Sketch- has asked for the wisdom of the Perl Monks concerning the following question:
Hey perlmonks, I finally brought myself to make an account on here as I use it every day. I'm pretty new to perl so please excuse how fail my code is :)
Well anyway I'm working on a tool for my pentests, just to quickly scan url's for cross site scripting vulnerabilities.
It just grabs a list of urls and uses LWP to load it with the XSS payload attached. If the payload is returned on the page without any encoding or filtering it will print out "site is vulnerable".
But I'm getting this wierd error when I run it.Can anyone help me? Here's the codeUnsuccessful open on filename containing newline at
#!/usr/bin/perl -w use LWP::UserAgent; my $ua = LWP::UserAgent->new(); my $payload = "\"/><h1>XSS</h1>"; my $html; print "list --> "; my $list = <>; open(URLS, $list); my @list = <URLS>; close(URLS); foreach $url(@list) { $html = $ua->get($url.$payload); $html = $html->decoded_content; if($html =~ m/\<h1\>XSS\<\/h1\>/i) { print "$url is vulnerable\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Pentesting tool
by johngg (Canon) on Jul 04, 2011 at 13:13 UTC | |
|
Re: Pentesting tool
by JavaFan (Canon) on Jul 04, 2011 at 12:41 UTC | |
by Sketch- (Initiate) on Jul 04, 2011 at 13:10 UTC | |
by AnomalousMonk (Archbishop) on Jul 04, 2011 at 16:08 UTC | |
|
Re: Pentesting tool
by GrandFather (Saint) on Jul 04, 2011 at 20:31 UTC | |
by Sketch- (Initiate) on Jul 05, 2011 at 02:49 UTC | |
by GrandFather (Saint) on Jul 05, 2011 at 07:26 UTC | |
by AnomalousMonk (Archbishop) on Jul 05, 2011 at 20:00 UTC | |
|
Re: Pentesting tool
by Anonymous Monk on Jul 04, 2011 at 19:47 UTC |