Skip to content

Instantly share code, notes, and snippets.

@scottstamp
Created August 24, 2020 19:10
Show Gist options
  • Save scottstamp/58f3c1c19dd8f8c0b25dae76ab7ddfef to your computer and use it in GitHub Desktop.
Save scottstamp/58f3c1c19dd8f8c0b25dae76ab7ddfef to your computer and use it in GitHub Desktop.
Arcturus Emulator RCON PHP shell
<?php
// replace $key with something secret or face peril!
error_reporting(E_ALL);
$key = 'secret';
$sec = $_GET['sec'];
$payload = $_POST['payload'];
if (isset($payload) && $sec == $key) {
$sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
$res = socket_connect($sock, "127.0.0.1", 3001);
if ($res === false) {
echo "socket_connect() failed.<br />Reason: ($result) " . socket_strerror(socket_last_error($sock)) . "<br />";
}
$res = socket_write($sock, $payload, strlen($payload));
if ($res === false) {
echo socket_strerror(socket_last_error($sock)) . "<br />";
}
$out = socket_read($sock, 2048);
echo "<textarea rows='2' cols='30' disabled>$out</textarea><br /><br />";
} else {
$payload = '{
"key": "action",
"data": {
"message": "-",
"username": "-"
}
}';
}
if (isset($sec) && $sec == $key) {
?>
<form method="post">
<input type="hidden" value="<?php echo $key; ?>" />
<textarea rows="20" cols="90" name="payload"><?php echo $payload; ?></textarea><br />
<button type="submit">Submit</button>
</form>
<?php
}
else
{
echo "lol";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment