Postando mensagem no Facebook com Perl
Publicado por Perfil removido (última atualização em 11/08/2014)
[ Hits: 6.842 ]
Caso ocorra algum problema, tente logar no Facebook para celular, e desative a mensagem que pede para colocar número de celular. Se mesmo assim continuar dando problema, aí já não sei o que fazer, haha.
Usando o script:
$ perl fb.pl [email] [senha]
#!/usr/bin/perl -w
# Coder: MMxM
# hc0der.blogspot.com
# Post facebook message with perl
use strict;
use LWP;
use HTTP::Cookies;
use URI::Escape;
die("\n[+] $0 <fb-email> <fb-password>\n\n") if(@ARGV!=2);
my($email,$pw) = @ARGV;
print "[*] Logging... (Wait)\n";
my $browser = LWP::UserAgent->new;
$browser->cookie_jar( {} );
$browser->agent('Mozilla/5.0 (Windows NT 6.2; rv:31.0) Gecko/20100101 Firefox/31.0');
my $body = $browser->get('https://m.facebook.com/')->content;
my %attr;
my @elements = ($body =~ /(?<=<input type="hidden" name=").*?(?<=" value=").*?(?=["])/g);
my $uri_login;
($body =~ /<form method="post" class="v w" id="login_form" novalidate="1" action="(.*?)">/)
&&($uri_login=$1) || die("Error to get login URL\n");
foreach my $hidden(@elements){
my @tmp = split(/" value="/,$hidden);
$attr{$tmp[0]} = uri_escape($tmp[1]);
}
$attr{'email'} = $email;
$attr{'pass'} = $pw;
my $header = $browser->post( $uri_login , \%attr )->as_string;
my $location;
if($header =~ /Location: (.*)/){
$location = $1;
} else {
die("[-] Unexpected Error\n");
}
if($location =~ /^https:\/\/m.facebook.com\/login.php/){
die("[-] Failed to login\n");
}
print "[+] Sucessfull Login\n";
print "[*] GETing URL to post message... (Wait)\n";
$browser->get($location);
$browser->get('https://m.facebook.com/phoneacqwrite/?s=1&source=m_mobile_mirror_interstitial');
$body = $browser->get('https://m.facebook.com/home.php?_rdr')->content;
my %attr2;
my @ele2 = ($body =~ /(?<=<input type="hidden" name=").*?(?<=" value=").*?(?=["])/g);
($body =~ /<form method="post" action="\/composer\/(.*?)">/)
&& ($location = 'https://m.facebook.com/composer/'.$1) || die("Error to get URL\n");
$location =~ s/&/&/g;
for(0..12){
my @tmp = split (/" value="/ ,$ele2[$_]);
next if($tmp[0] eq 'search' || $tmp[0] eq 'search_source');
$attr2{$tmp[0]} = uri_escape($tmp[1]);
}
$attr2{'xc_message'} = '';
$attr2{'rst_icv'} = '';
$header = $browser->post($location, \%attr2)->as_string;
if($header =~ /Location: (.*)/){
$location = $1;
} else {
die("Error to get URL\n");
}
($location !~ /$attr2{'csid'}/) && die("Unexpected Error\n");
print "[+] OK\n";
print "[*] Acessing url ...(Wait)\n";
$body = $browser->get($location)->content;
my %attr3;
my @h = ($body =~ /(?<=<input type="hidden" name=").*?(?<=" value=").*?(?=["])/g);
if($body =~ /<form method="post" action="\/composer\/mbasic\/(.*?)" enctype="multipart\/form-data">/){
$location='https://m.facebook.com/composer/mbasic/'.$1;
}
for(0..scalar(@h)-1){
my @tmp = split(/" value="/,$h[$_]);
if($_ == 6){
$attr3{'target'} = $tmp[1];
next;
}
if($_ == 12){
$attr3{'waterfall_source'} = $tmp[1];
next;
}
$attr3{$tmp[0]} = $tmp[1];
}
print "[*] Write your message:\n\n";
my $xms = <stdin>;
$attr3{'xc_message'} = $xms;
$attr3{'users_with'} = '';
$attr3{'album_id'} = '';
$attr3{'view_post'} = '';
$attr3{'file1'} = '';
$attr3{'file2'} = '';
$attr3{'file3'} = '';
my $x = $browser->post($location, Content_Type => 'multipart/form-data',
Content => [ %attr3 ]);
if($x->as_string =~ /Location: https:\/\/m.facebook.com\/home.php/){
print "\n[+] Message posted successfully\n";
} else {
print "\n[-] Possible error\n";
}
#__EOF__
Avisar por e-mail se o IP da conexão ADSL mudar
Gmail::SendMail - Enviando emails usando gmail
Obtendo a temperatura com Perl
PDF completo com todas as páginas do Diário Oficial do Estado de Goiás
Nenhum comentário foi encontrado.
IA Turbina o Desktop Linux enquanto distros renovam forças
Como extrair chaves TOTP 2FA a partir de QRCODE (Google Authenticator)
Linux em 2025: Segurança prática para o usuário
Desktop Linux em alta: novos apps, distros e privacidade marcam o sábado
Atualizando o Fedora 42 para 43
Como saber se o seu e-mail já teve a senha vazada?
Como descobrir se a sua senha já foi vazada na internet?
E aí? O Warsaw já está funcionando no Debian 13? [RESOLVIDO] (15)
Secure boot, artigo interessante, nada técnico. (4)
copiar library para diretorio /usr/share/..... su com Falha na a... (1)









