Create a Simple PHP Shell Command Terminal
In this thread I (TechLab) will show you how to make a Super simple php command line shell.
This is similar to my X-Small shell which is under 200 bytes.
All credits go to Me TechLab!!!
To Begin
You need:
!# Basic html knowledge
!# A PHP host (in my case I am using a localhost)
!# And a brain (im my case I am using....)
First, create a php file and call it something such as shell.php.
Open it in a text editor.
Now, start the php with the opening and closing brakets:
In the php brackets we will create a php function and call it exec_cmd and add a if isset function to check to see if we have submitted any command:
Now, in the if statement let us add the actual functions to execute the command.
Your code should look something like this:
![[Image: code1j.png]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_voYq_JeyMEJcoa0YiRgQMuFCo50-91LLw22kKuGlLOr6dTaLM-n-P2E3Y_atvdfEy3ZmAHcYIxHJyLM9y3Ql-ANr_wyCG2qIjQo3Io0fx8GYJxzuI3=s0-d)
The php is almost done! :)
Now for the HTML!
Below the closing php tag (it MUST be out of the <?php ?> tags!) we will add the post form.
To begin, create a simple form and add a php post to self:
Note: the $_SERVER["PHP_SELF"] should only be used on tools like this, and not on pages accessed by other people because of a XSS vuln.
All the html is Done!!!
Your code should look like this:
![[Image: code2g.png]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_vuEnFnPM8vnlUtJ0v8Dxq_-3KpUnY5g7OTivi3uWZ3CiJaIzH0fUG3JsZJspEk6szCHw1fSQ9wbmGAq-vMwnT172xybW8P5JL5111nUGAPR4ZC53Y=s0-d)
All we need to add is the last bit of PHP!
Under the closing </form> tag, add this php code to Call the function:
You are finished!
The complete code looks like this:
![[Image: code3.png]](https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_snPk9-bmJWsYHP4FXDQX_CsKQkyQ4DsNnk-hFLcLkz93Yi7Ir2_bJrORcZNDgUsUm-uxg_SnZ-GODeXzAljThOIDX2f3F5vpabVtTu4WV61SD5QZ8=s0-d)
I hoped you liked it!
Please say thanks if you thought it was useful! :)
And, Do Not leach!
facebook
In this thread I (TechLab) will show you how to make a Super simple php command line shell.
This is similar to my X-Small shell which is under 200 bytes.
All credits go to Me TechLab!!!
To Begin
You need:
!# Basic html knowledge
!# A PHP host (in my case I am using a localhost)
!# And a brain (im my case I am using....)
First, create a php file and call it something such as shell.php.
Open it in a text editor.
Now, start the php with the opening and closing brakets:
PHP Code:
<?php // code will go in here except for the html and calling the php function.?>In the php brackets we will create a php function and call it exec_cmd and add a if isset function to check to see if we have submitted any command:
Now, in the if statement let us add the actual functions to execute the command.
PHP Code:
$exc = $_POST['command']; echo shell_exec($exc); Your code should look something like this:
The php is almost done! :)
Now for the HTML!
Below the closing php tag (it MUST be out of the <?php ?> tags!) we will add the post form.
To begin, create a simple form and add a php post to self:
Note: the $_SERVER["PHP_SELF"] should only be used on tools like this, and not on pages accessed by other people because of a XSS vuln.
PHP Code:
<form action='<?php echo $_SERVER["PHP_SELF"]?>' method='post'>
<input type= 'text' name='command' />
<input type='submit' />
</form> All the html is Done!!!
Your code should look like this:
All we need to add is the last bit of PHP!
Under the closing </form> tag, add this php code to Call the function:
PHP Code:
<?php exec_cmd();?>You are finished!
The complete code looks like this:
I hoped you liked it!
Please say thanks if you thought it was useful! :)
And, Do Not leach!
No comments:
Post a Comment