#!/usr/bin/perl
# phpBB Mass PM sender
use LWP::UserAgent;
use HTTP::Cookies;
$host = @ARGV[0];
# Replace 1 2 3 or 4 with user id numbers you don't want the message sent to.
# Add or delete numbers as you please. You should understand the pattern...
@badID = (1,2,3,4,5); #leave as just (); if you just want everyone to get the pm
$arrSize = @badID;
$i = 2;
if (@ARGV < 1)
{
print "\n\n [-] Specify a host";
print "\n\n [!] Example: perl massphpbb.pl http://www.phpbbforum.com/path/\n\n";
exit(0);
}
loginPrompt();
sub login($$)
{
$browser = LWP::UserAgent->new(agent =>
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; T312461)' ,
);
$cookie_jar = HTTP::Cookies->new();
$browser->cookie_jar($cookie_jar);
$response = $browser->post( $host.'login.php',
[ 'username' =>$_[0],
'password'=>$_[1],
'redirect'=>'',
'login'=>'Log in',Referer => $host ]
);
$content = $response->content;
if ($content =~ /<head>/gmi)
{print "\n[-] INCORRECT LOGIN\n"; loginPrompt()}
else{msgInfo()}
}
sub spam()
{
for ($j = 0; $j <= $arrSize + 1; $j++)
{
if ($i > $uid){ print "\n\n [+] Spamming Completed\n"; exit(0) }
if ($badID[$j] eq $i) { $i++; spam() }
}
sleep(15); #delay (seconds) between sending eah pm. Pretty much required to work, change accordingly..
$res = $browser->get("$host/privmsg.php?mode=post&u=$i");
$results = $res->content;
if ($results =~ /value="([a-f0-9]{32})"(.*)/){$SID = $1;}
if ($results =~ /name="username"(.*)tabindex="1" value="(.*?)"(.*)/gmi){$name = $2;}
$resp = $browser->post( "$host/privmsg.php",
[ 'username'=> $name,
'subject'=> $subj,
'addbbcode18'=>'%23444444&addbbcode20=12',
'helpbox'=>'Italic+text%3A+%5Bi%5Dtext%5B%2Fi%5D++%28alt%2Bi%29',
'message'=> $msg,
'folder'=>'inbox',
'mode'=>'post',
'sid'=> $SID,
'post'=>'Submit', Referer => $host ]
);
print "\n [!] Message Sent to: $name with SID $SID";
if ($i > $uid){print "\n\n [+] Spamming Completed\n"; exit(0)}
else{$i++;spam()}
}
sub loginPrompt()
{
print "\nEnter your login name: ";
chomp($id = <STDIN>);
print "\nEnter your password: ";
chomp($pass = <STDIN>);
login($id, $pass);
}
sub msgInfo()
{
print "\nEnter message subject: ";
chomp($subj = <STDIN>);
print "\nEnter your message: ";
chomp($msg = <STDIN>);
print "\nEnter highest uid: ";
chomp($uid = <STDIN>);
spam();
}