#!/usr/bin/perl #-=-=-=-=-=-=-=-=[ sTs v0.5 ]=-=-=-# # slashdot trolling system :: sTs # Due to the attacks on kuro5hin all garbage options removed # sTs@zk65.com -=- http://zk65.com/ # Released under the GNU GPL v2 or later #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# my $version="sTs v0.5.1"; #-=-=-=-=-=-=-=-=-=-=[ ToDo ]=-=-=-# # Suggestions, anyone? #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# #=-=-=-=-=-=[ Configuration ]=-=-=-# # User-agent value to use my $user_agent = "Mozilla/4.".int(rand()*7)." [en-US]"; # Signature to append to comments my $sig="sTs"; # Username to use (leave blank for AC) #my $user="Slashdot Nick Here"; # Password (leave blank for AC) #my $password="zAKCrmpM"; # Repeat count (if -r is not specified) my $repeat=1; # Number of seconds to wait between repeat posts my $wait=71; # slashdot url (use other slash sites?) my $slashdot="slashdot.org"; #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# use IO::Socket; my $pid=0; # Parses command line options &options; # Gets latest SID and TITLE from main page &getmain if !$sid; # Sets referer sent to slashdot to avoid referer blocking $ref="http://$slashdot/comments.pl?sid=$sid&threshold=5&mode=nested&commentsort=0&op=Reply"; print "Startup Successful\n" if $verbose; # What to do &file # Reads comment from file sub file{ foreach $file(@file){ if(!-f "$file"){print "File doesn't exist\n";exit} open(IN, "$file"); $line=; if($line =~ s/^U//){ ($user,$password)=split(/:/,$line); $subject=; }else{ $subject=$line } chomp($subject); while(){ chomp; $comment.=$_."
"; } while($repeat--){&send_comment} } } sub send_comment{ print "Subject: $subject\n" if $verbose; print "Sending comment to '$sid'\n"; $comment_s=$comment.$sig; $submit="sid=$sid&formkey=".&get_formkey."&postersubj=".escape($subject)."&postercomment=".escape($comment_s)."&op=Submit&pid=$pid&mode=nested&threshold=-1&commentsort=0&rlogin=userlogin&posttype=html&unickname=$user&upasswd=$password"; my $result=post_url("http://$slashdot/comments.pl",$submit,$ref); if($result =~ /Comment Submitted/){ print "Comment Submitted\n" if $verbose; }else{ print "Problem Submitting Comment\n"; if($result=~/Lame(.*?)

(.*?)error.html");print E $result;close(E); } } if($repeat > 0){ print "Repeat... wait $wait seconds\n"; sleep($wait); } } sub options{ if(!@ARGV){ print </; $key=$1; if(!$key){ print "Error getting formkey!\n"; exit; }else{ print "Key: $key\n" if $verbose; } return($key); } sub get_url{ my $url=shift; my $ref=shift; $url =~ /^http:\/\/(.*?)\/(.*?)$/; my $host=$1; my $local="/".$2; if($host =~ /:(\d+)$/){$port=$1}else{$port=80} $http=IO::Socket::INET->new( PeerAddr => "$host", Proto => "tcp", PeerPort => "$port", Timeout => 30) or die "Unable to connect to $host"; print $http "GET $local HTTP/1.0\nUser-agent: $user_agent\nReferer: $ref\n\n"; my $out; while(<$http>){ chomp; $out.=$_; } return($out); } sub post_url{ my $url=shift; my $submit=shift; my $ref=shift; $url =~ /^http:\/\/(.*?)\/(.*?)$/; my $host=$1; my $local="/".$2; if($host =~ /:(\d+)$/){$port=$1}else{$port=80} my $http=IO::Socket::INET->new( PeerAddr => $host, Proto => "tcp", PeerPort => $port, Timeout => 30) or die "Unable to connect to $host"; print $http <){ chomp; $out.=$_; } return($out); } # URL-encode data (from CGI.pm) sub escape { my $toencode = shift; $toencode=~s/([^a-zA-Z0-9_.-])/uc sprintf("%%%02x",ord($1))/eg; return $toencode; }