1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[CODE] Linux blog commenter

Discussion in 'Black Hat SEO' started by Lumen, Sep 4, 2011.

  1. Lumen

    Lumen Newbie

    Joined:
    Jan 31, 2008
    Messages:
    8
    Likes Received:
    2
    It's still buggy; I was debating on sharing but hey it's free.

    You have to replace commentregex.

    edit: after running it I take goodlinks to pingfarm or something of the sorts

    Code:
    #!/usr/bin/perl
    use WWW::Mechanize;
    use LWP::UserAgent;
    use URI::URL;
    
    
    
    my $url = $ARGV[0];
    $author = '';
    $email = '';
    $url_comment = '';
    $comment = '';
    
    my $mech = WWW::Mechanize->new(
        autocheck => 0,
        quiet => 1,
        agent => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6'
    );
    
    
    
    $mech->timeout(30);
    $mech->cookie_jar(HTTP::Cookies->new());
    $mech->get($url);
    die "[-] Can't even get the page: ", $mech->response->status_line unless $mech->success;
    
    print " [i] URL: " . $url . " \n";
    
    
    
    #-Wordpress ---------------------------------------------
    
    if ($mech->content =~ /wp-comments/) {
    	print "[+] Found Wordpress\n";
    
    	my %fields = (
            	author=>$author,
                    email=>$email,
    		url=>$url_comment,
    		comment=>$comment,
                    );
    
    	$mech->form_id('commentform');
    	$mech->set_fields(%fields);
           	$mech->submit_form(button => 'submit');
    die "[-] Can't post: ", $mech->response->status_line unless $mech->success;
    	if ($mech->content =~ /commentregex/) {
    		print "[+] Found Backlink\n";
    
    		open FILE, ">>goodlinks" or die $!;
    		print FILE $url . "\n"; 
    		close FILE;
    		}
    	else {
    		print "[-] No Backlink\n";
    	}
    
    }	
    
    #-Movable Type ------------------------------------------
    
    elsif ($mech->content =~ /mt-comments/) {
    	print "[+] Found Movable Type\n";
    
    	my %fields = (
            	comment-author=>$author,
                    comment-email=>$email,
    		comment-url=>$url_comment,
    		comment-comment=>$comment,
                    );
    
    if ($mech->content =~ /comments closed/) {
    	print "[-] Found comments closed\n";
    	exit;
    }
    	$mech->form_name('comments_form');
    	$mech->set_fields(%fields);
    	$mech->submit_form();
    
    die "[-] Can't post: ", $mech->response->status_line unless $mech->success;
    	if ($mech->content =~ /commentregex/) {
    		print "[+] Found Backlink\n";
    
    		open FILE, ">>goodlinks" or die $!;
    		print FILE $url . "\n"; 
    		close FILE;
    		}
    	else {
    		print "[-] No Backlink\n";
    	}
    #	system("perl ./rpcping.pl \"" . $mech->title . "\" " .$url ." ");
    	}
    
    
     
    Last edited: Sep 4, 2011