Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!perl
- # MPGH User Information Grabber by Mike Rohsoft
- # C:\Users\Scriptkiddy\Desktop>perl mpgh.pl
- # My Rank is: member1
- # My Mail is: xxxxxx@xxxxxxxxxxxxxxxxxxxx.de
- use strict;
- use LWP::UserAgent;
- #======= User Login =========
- my $username = 'MikeRohsoft'; # You should edit this
- my $password = 'XXXXXXXXXXX'; # And this
- #============================
- #======= Client Config ======
- my $user_agent = 'Mozilla/5.0 (Ubuntu; X11; Linux i686; rv:8.0) Gecko/20100101 Firefox/8.0';
- my $cookie_file = 'mpgh.cookie';
- #============================
- #======= Site Config ========
- my $protocol = 'http';
- my $url = 'www.mpgh.net';
- my $index_uri = 'forum/index.php';
- my $login_uri = 'forum/login.php?do=login';
- my $login_params =
- {
- do => 'login',
- vb_login_md5password => '',
- vb_login_md5password_utf => '',
- s => '',
- securitytoken => 'guest',
- vb_login_username => $username,
- vb_login_password => $password,
- vb_login_password_hint => 'Password',
- };
- #=============================
- # Create our global HTTP Object
- my $ua = LWP::UserAgent->new
- (
- agent => $user_agent,
- cookie_jar =>
- {
- autosave => 1,
- ignore_discard => 1,
- file => $cookie_file,
- },
- max_redirect => 4,
- timeout => 90
- );
- #====== Pattern Routine ======
- sub onLogin
- {
- my $content = shift;
- my $usrid = 0;
- my $rank = my $email = '';
- ($usrid) = $1 if $content =~ m!<a href="member\.php\?u=(\d+)">$username</a>!s; # Extract our Userid
- if($usrid)
- {
- my $res = $ua->get(sprintf '%s://%s/forum/member.php?u=%d', $protocol, $url, $usrid)->decoded_content; # Browse to our Profile
- ($rank) = $res =~ m!<img src="$protocol://$url/ranks/([^\.]*?)\.png".*?/>!s; # Extract Rank by Picture
- $res = $ua->get(sprintf '%s://%s/forum/profile.php?do=editpassword', $protocol, $url)->decoded_content; # Browse to our email address
- ($email) = $res =~ /input.*?name="email".*?value="(.*?)"/s; # Extract our Email Address
- }
- print "My Rank is: $rank\n";
- print "My Mail is: $email\n";
- }
- #=============================
- #=============================
- #=============================
- my $index_url = sprintf '%s://%s/%s', $protocol, $url, $index_uri; # Build Index URL
- my $res = $ua->get($index_url);
- my $content = $res->decoded_content;
- if($content =~ /www\.cloudflare\.com/) # Bypass Cloudflare
- {
- my ($jscript) = $content =~ /setTimeout.*?function.*?(var.*?)f\.submit/s; # Extract the JScript we need
- my @MicrosoftJScript = ();
- my $keyname = '';
- $jscript =~ s/\n//g;
- for(split /;/s, $jscript)
- {
- next unless /^([a-zA-Z]+\.[a-zA-Z]+)/ or /^\s*var /; # We only need the declaration of the object and the object lines
- if ($keyname eq '')
- {
- ($keyname) = $_ =~ /^([a-zA-Z]+\.[a-zA-Z]+)/; # get our Object.KeyName if we don't got already
- }
- s/a\.value(.*)/WScript.Echo(parseInt($keyname, 10))/s; # Replace a.value* with WScript.Echo(parseInt($keyname, 10)) for Console output
- push @MicrosoftJScript, "$_;\n";
- }
- # We are lazy, we can decrypt what happen, or load a blowed JavaScript Interpreter, or we just use the build in MS Interpreter
- open my $fh, '>', 'sumscript.js';
- print $fh @MicrosoftJScript";
- close $fh;
- my $buffer = `cscript //E:jscript sumscript.js`;
- unlink 'sumscript.js'; # clean up
- my $sum = 0;
- for(split /\n/, $buffer) # We only need the Integer output, so we should extract it from callback
- {
- if(/^(\d+)$/)
- {
- $sum = $1;
- last; # stop loop if we found it
- }
- }
- if($sum)
- {
- my $cloudflare_sum = $sum + length($url);
- my %formvalues = ( jschl_answer => $cloudflare_sum ); # We got already the first value
- # Gather uri and Formular Objects
- my ($cloudflareuri, $values) = $content =~ m!<form id="challenge-form" action="(.*?)" method="get">(.*?)</form>!s;
- for(split /\n/, $values)
- {
- $formvalues{$1} = $2 if m!<input type="hidden" name="(.*?)" value="(.*?)"/>!; # Gather name and value fields
- }
- my $cloudflare_request = sprintf '%s://%s%s?', $protocol, $url, $cloudflareuri; # Create our callback url
- $cloudflare_request .= "$_=$formvalues{$_}&" for keys %formvalues; # Append the Values to url
- chop $cloudflare_request; # Remove the last &
- sleep 4; # Wait 4 seconds like the Browser
- $res = $ua->get($cloudflare_request);
- }
- else
- {
- die "can't calcute cloudflare sum";
- }
- }
- my $login_url = sprintf '%s://%s/%s', $protocol, $url, $login_uri; # Built Login URL
- $res = $ua->post($login_url, $login_params); # Request our Login Parameters declared in the Head
- $res = $ua->get($index_url);
- # We should Loged in now
- $content = $res->decoded_content;
- &onLogin($content);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement