Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // User configuration
- $Username = "";
- $Password = ""; // The MD5'd password
- // This is a payload of uknown value. Perhaps a protocol identifier
- $payload = "62:31:38:31:35:7c:31:31:7c:30:7c:34:34:65:30:38:38:66:35:62:38:66:33:34:33:64:36:64:39:65:63:66:65:36:36:63:31:62:66:35:65:64:66:3a:30:30:30:38:41:31:39:34:38:35:30:33:2e:30:30:31:35:46:32:35:37:34:42:45:31:2e:2e:30:30:30:30:30:30:30:30:30:30:30:30:30:30:45:30:2e:30:30:30:30:30:30:30:30:30:30:30:30:30:30:45:30:2e:3a:37:32:32:64:33:32:62:32:61:63:31:31:35:61:38:36:35:66:35:31:66:66:63:39:61:30:32:64:64:65:30:38:0d:0a";
- $payload = str_replace(':', '', $payload);
- $payload = pack("H*" , $payload);
- $fh = fsockopen('50.23.74.90', 13382);
- if ($fh) {
- // We're in!
- // Authenticate by sending first, the username\r\n
- echo "Sending Username...\r\n";
- fwrite($fh, "$Username\r\n");
- // Now the password
- echo "Sending Password...\r\n";
- fwrite($fh, "$Password\r\n");
- echo "Sending payload...\r\n";
- fwrite($fh, $payload);
- // A third call happens here, I have *no* idea what it is. Lets hope that we don't need it?
- // I suspect this is a call to bancho, some kind of "get me a list of users"
- // At this point, we should be 'connected'. Lets inspect the first packet
- // Read in some data to verify whether we authenticated properly
- $firstPacket = fread($fh, 9999);
- if ($firstPacket == pack("H*" , "05000004000000ffffffff")) {
- echo "Error. Authentication failed\r\n";
- die();
- } else {
- var_dump($firstPacket);
- }
- $olddata = false;
- $i = 0;
- while (true) {
- $data = fread($fh, 9999);
- if ($data != $olddata) {
- var_dump(bin2hex($data));
- // var_dump($data);
- $olddata = $data;
- $i++;
- } else {
- echo ".";
- var_dump($fh);
- usleep(100);
- }
- if ($i > 5) {
- die();
- }
- }
- } else {
- echo "Could not connect to osu :<";
- }
- var_dump($fh);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement