Skip to content

Instantly share code, notes, and snippets.

@icheernoom
Created December 24, 2013 15:51
Show Gist options
  • Save icheernoom/8115003 to your computer and use it in GitHub Desktop.
Save icheernoom/8115003 to your computer and use it in GitHub Desktop.
Get image link from picpost.mthai.com and auto post into SMF Forum.
use LWP::UserAgent;
use HTTP::Cookies;
$user='admin';
$password='1234';
$target = 'http://localhost/smf2/';
$ua = LWP::UserAgent->new() or die;
$cookie_jarr = HTTP::Cookies->new();
$ua->cookie_jar( $cookie_jarr );
$resr = $ua->post($target.'index.php?action=login2',
Content => ["user"=>"$user","passwrd"=>"$password","cookielength"=>"60",],)->status_line;
if($resr =~ /302/){
print "\nConnect to SMF success...\n\n";
print "Page : ";
chomp($page=<STDIN>);
$pagect=LWP::UserAgent->new->get($page)->content;
while($pagect=~m/<a href="\/view\/(.*?)\" title="(.*?)\" class=/ig){$id=$1;$url='http://picpost.mthai.com/view/'.$id;print $url."\n";
$message="";
$content=LWP::UserAgent->new->get($url)->content;
if($content=~m/<title>(.*?)\<\/title>/ig){$title=$1;$title=~s/ \| picpost\.mthai\.com//g;}
if($content!~/error_msg/){
print $title."\n";
$content=LWP::UserAgent->new->get($url)->content;
while($content=~m/class="fullsize" rel="gallery"><img src="(.*?)\" alt="/ig)
{
$pic=$1;
$getpicture='http://picpost.mthai.com'.$pic;
$message.='[img]'.$getpicture.'[/img][br][br]';
}
$message.='Ref : http://picpost.mthai.com';
$url='http://localhost/smf2/index.php?action=post;board=2.0';
$dynamiz=$ua->get($url)->content;
$dynamiz=~s/\r|\n//ig;$dynamiz=~s/\s+/ /ig;$dynamiz=~s/\>\s+\</\>\</ig;
if($dynamiz=~/sSessionId: '(.*?)'(.*?)sSessionVar: '(.*?)'(.*?)"seqnum" value="(.*?)"/i){$ba062f6=$3;$session=$1;$seqnum=$5;print '[+] sSessionVar: '.$ba062f6."\n";print '[+] sSessionId: '.$session."\n";print '[+] seqnum: '.$seqnum."\n";}
$url='http://localhost/smf2/index.php?action=post2;start=0;board=2';
$ua->default_header('Referer' =>$url);
$resr = $ua->post($url,Content => [
"topic"=>"",
"subject" => '[ Sexy Picpost ] '.$title,
"icon"=>"xx",
"sel_face"=>"",
"sel_size"=>"",
"sel_color"=>"",
"message" => $message,
"message_mode"=>"0",
"notify"=>"0",
"lock"=>"0",
"sticky"=>"0",
"move"=>"0",
"attachment[]"=>"",
"additional_options"=> "0",
$ba062f6 => $session,
"seqnum"=>$seqnum])->content;
print "\n[+$i] ".'Topic Complete...'."\n\n";
}
sleep(2);
}
}
else{
print "\n[-] Username or Password are Wrong..!!!\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment