Hello everyone I coded a script to search a string on a webpage but the request doesn't works I don't know why ...
website : http://www.matrixx.com/ string to search : solutions
code :
#!/usr/bin/perl
use strict;
use IO::Socket;
use Term::ANSIColor;
use HTML::Parser;
use LWP::UserAgent;
use LWP::Simple;
use vars qw( $PROG );
$SIG{'INT'} = sub {exit;};
my $stringsearch = "solutions";
my $url = "http://www.matrixx.com/";
my $ua = LWP::UserAgent->new;
print "\e[96m[!]Searching \e[31m$url\n\e[0m";
my $response = $ua->post($url);
if ( !$response->is_success )
{
print "error\n";
}
my $parser = HTML::Parser->new( 'text_h' => [ \&text_handler, 'dtext' ] );
$parser->parse( $response->decoded_content );
sub text_handler
{
chomp( my $text = shift );
if ( $text =~ /$stringsearch/i )
{
print "\e[96m[+]Found: \e[32m$url\e[0m\n";
}
else
{
print "Not Found \n";
}
}