Some quick and dirty Kali / linux tricks….

bash-script

1 – Serving a HTTPServer quickly

SimpleHTTPServer is a python module which allows you to instantly create a web server with file access.  Use the command below to start the webserver on a pre-defined ip and port number. 

				
					python3 -m http.server --bind 192.168.1.100 9980

				
			

You should now have access to this webserver on: http://192.168.1.100:9980 or use the hosts ip with the default port 8000

				
					python3 -m http.server
...Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
				
			

Now the webserver is accessible on: http://x.x.x.x:8000

2 – Spawn  a new bash shell in meterpreter with Python

Trying to use a command such as su – root in a Meterpreter session results in an error message:

				
					su: must be run from a terminal

				
			


You could try to create an python “wrapper” to perform the bash command(s).

				
					python -c 'import pty;pty.spawn("/bin/bash")'
				
			


Now it is possible to run the command!

Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post

CPU 100% in taskmanager not in processes

Next Post
bash-script

Use Autopwn plugin in Metasploit for automatic exploitation

Related Posts
fix-mbr

Backup MBR (Master Boot Record)

[title size=”2″ content_align=”center” style_type=”default” sep_color=”” margin_top=”” margin_bottom=”” class=”” id=””]Backup the MBR (Master Boot Record)[/title][separator style_type=”none” top_margin=”5″ bottom_margin=”” sep_color=””…
Read More