#!/usr/local/bin/perl -- -*-fundamental-*- ## Showpath.pl ## Written by Greg Mullane ## Please see http://www.turnstep.com/Spambot/ ## ## This program displays the path a certain user takes ## through a site ## Use at your own risk ## Usage: showpath.pl ip [access_log] ## Default access log filename is "access_log" ## Notes: This program assumes the following: ## 1. You have enough memory to run this. Access logs get BIG ## 2. The access log is in a "standard" format $user = $ARGV[0] || die "Usage: showpath ip [access_log]\n"; $accessfile = $ARGV[1] || "access_log"; open(KILLSPAM, $accessfile) || die "Could not find $accessfile!\n"; while() { $lines++; if (m#(.*) - - \[.*\"GET ([^ ]*)#) { $ip = $1; $path = $2; if ($user eq $ip) { print "$path\n"; } } } close(KILLSPAM); exit;