Skip to content

Instantly share code, notes, and snippets.

@timhughes
Created June 18, 2020 18:13
Show Gist options
  • Save timhughes/96f5145a35898a52e41db6ff73ebfc4e to your computer and use it in GitHub Desktop.
Save timhughes/96f5145a35898a52e41db6ff73ebfc4e to your computer and use it in GitHub Desktop.
oneliner python netcat style listening socket server for when nc is not available
python -uc "import sys, socket;from functools import partial; a = socket.create_server(('0.0.0.0', 8888)).accept(); [sys.stdout.buffer.write(bytes(i)) for i in iter(partial(a[0].recv, 1024), b'')]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment