[FREE] PHP Sniper

Status
This thread has been locked.

MattBenson1

Premium
Feedback score
1
Posts
159
Reactions
89
Resources
0
Pretty basic code, not really efficient was made awhile back.

http://hastebin.com/ajetacupew.php

Code:
<?php

/****************************************************************************************************************************/

//Change the following information to fit your needs
date_default_timezone_set(''); //Set your timezone. You can find a list of supported timezones at http://php.net/manual/en/timezones.php
$accountLoginName = ''; //Current login username/email for Mojang.com
$accountUsername = ''; //Current in-game Minecraft username
$accountPassword = ''; //Current account password
$newName = ''; //Desired new username
$time = ''; //Set the time that the account name should change. YYYY-MM-DD HH:MM:SS format.

/****************************************************************************************************************************/


/*****************************************************PROGRAM START. DO NOT TOUCH*****************************************************/

set_time_limit(0);
$accountUrl = 'https://account.mojang.com/login';
$cookiePath = $_SERVER['DOCUMENT_ROOT'] . "/cookie.txt";
$isItTime = false;
$strToTime = strtotime($time);


$uuid = file_get_contents('https://api.mojang.com/users/profiles/minecraft/' . $accountUsername);
if (!empty($uuid)) {
    $uuid = explode(':', $uuid);
    $uuid = explode(',', $uuid[1]);
    $uuid = str_replace('"', '', $uuid[0]);
}
else {
    die("Invalid username");
}

$fields = array(
            'username' => $accountLoginName,
            'password' => $accountPassword,
            'remember' => 'true'
            );
$fields_string = '';
foreach($fields as $key => $value) {
    $fields_string .= $key . '=' . $value . '&';
}
rtrim($fields_string, '&');

$ch = curl_init($accountUrl);
curl_setopt($ch, CURLOPT_POST, count($fields));
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiePath);
$result = curl_exec($ch);

if ($result == false) {
    die("Curl error: " . curl_error($ch));
}
else {
    curl_setopt($ch, CURLOPT_URL, 'https://account.mojang.com/me/renameProfile/' . $uuid);
    curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiePath);
    $result2 = curl_exec($ch);
    if ($result2 == false) {
        die("Curl error: " . curl_error($ch));
    }
    else {
        $authToken = explode('name="authenticityToken" value="', $result2);
        $authToken = explode('">', $authToken[1]);
        $authToken = $authToken[0];
        $fields = array(
                    'newName' => $newName,
                    'password' => $accountPassword,
                    'authenticityToken' => $authToken);
        $fields_string = '';
        foreach($fields as $key => $value) {
            $fields_string .= $key . '=' . $value . '&';
        }
        rtrim($fields_string, '&');
        curl_setopt($ch, CURLOPT_POST, count($fields));
        curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);
        while ($isItTime == false) {

            if ($strToTime <= time()) {
                $result3 = curl_exec($ch);
                if (stripos($result3, 'errors') !== false || stripos($result3, 'error') !== false || stripos($result3, 'not found') !== false) {
                    echo "An error occured:<br /><br />" . $result3;
                }
                else {
                    echo "Username changed successfully.<br /><br />Old Username: " . $accountUsername . "<br />New username:" . $newName;
                }
                $isItTime = true;
            }
            else {
                continue;
            }
        }
    }
}

curl_close($ch);

Pretty much run a cron job 1 minute before and obviously edit the information at the top. If you require a tutorial you probably shouldn't use. Has many factors in terms of sniping at an accurate time.

Yes pretty much basic, and can (has) been done a better way, but guess this is all you get for leaching.
 
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

Sly Cooper

Where's my cane?!
Premium
Feedback score
0
Posts
327
Reactions
120
Resources
0
And then what is what makes a sniper faster?
Connection speed to the moment servers. Using an Ethernet cable while having very good upload speed would get very well results(google fiber for example). Services such as MCSniper probably had a server hosted somewhat near the mojang servers.
 

MattBenson1

Premium
Feedback score
1
Posts
159
Reactions
89
Resources
0
Connection speed to the moment servers. Using an Ethernet cable while having very good upload speed would get very well results(google fiber for example). Services such as MCSniper probably had a server hosted somewhat near the mojang servers.

Servers are a factor, not so much "upload speed" more in the terms of ping.

Or at least a consistent ping/response to/from mojang servers.
 

Sly Cooper

Where's my cane?!
Premium
Feedback score
0
Posts
327
Reactions
120
Resources
0
not so much "upload speed" more in the terms of ping.
More or less :p[DOUBLEPOST=1446144004,1446143873][/DOUBLEPOST]
More or less :p
Actually, I just thought about this after I posted that. Ping is how many milliseconds it takes for your data to upload to a server. Minecraft, for example, if you have 100 Ping to a server then it will take 100 milliseconds(ping=ms) for all the data you input(in this case breaking blocks or placing blocks) to be received.[DOUBLEPOST=1446144131][/DOUBLEPOST]
More or less :p[DOUBLEPOST=1446144004,1446143873][/DOUBLEPOST]
Actually, I just thought about this after I posted that. Ping is how many milliseconds it takes for your data to upload to a server. Minecraft, for example, if you have 100 Ping to a server then it will take 100 milliseconds(ping=ms) for all the data you input(in this case breaking blocks or placing blocks) to be received.
So if you had a better upload speed then you would have less ping. Even servers hosted somewhere need good upload speed , otherwise they won't be doing their job efficiently. Ya know what I mean?
 

MattBenson1

Premium
Feedback score
1
Posts
159
Reactions
89
Resources
0
More or less :p[DOUBLEPOST=1446144004,1446143873][/DOUBLEPOST]
Actually, I just thought about this after I posted that. Ping is how many milliseconds it takes for your data to upload to a server. Minecraft, for example, if you have 100 Ping to a server then it will take 100 milliseconds(ping=ms) for all the data you input(in this case breaking blocks or placing blocks) to be received.[DOUBLEPOST=1446144131][/DOUBLEPOST]
So if you had a better upload speed then you would have less ping. Even servers hosted somewhere need good upload speed , otherwise they won't be doing their job efficiently. Ya know what I mean?

There is a difference in having 1GB upload in africa, and 1GB upload next door.
 

MattBenson1

Premium
Feedback score
1
Posts
159
Reactions
89
Resources
0
Yeah of course there is. Africa can't have 1gb upload if it doesn't have internet!! (joke)

If you're gonna improve the sniper multi-thread it with a ton of proxies with average response time to mojang servers. Magic.
 

Jake4

Premium
Feedback score
5
Posts
851
Reactions
287
Resources
0
So load it in CMD with PHP installed?
Eg: php run.php
 

Spirit

Vorex Services
Supreme
Feedback score
17
Posts
1,120
Reactions
895
Resources
0
Thanks, works like a charm. (setup wise)
I'll pick up a VPS or a small dedicated server near the Mojang servers and will snipe names.
 
Status
This thread has been locked.
Top