Skip to content

Instantly share code, notes, and snippets.

@hiway
Created February 27, 2015 10:11
Show Gist options
  • Save hiway/551b57e2aa4126e91971 to your computer and use it in GitHub Desktop.
Save hiway/551b57e2aa4126e91971 to your computer and use it in GitHub Desktop.
Here's a script to punch a big hole thru your VPS's security and access your shell over Telegram chat… don't try this on production.
-- To use: telegram-cli -k tg-server.pub -s ohgodno.lua
--
-- Remember to watch for your telegram ID in telegram-cli, update it below.
-- This script will let you message yourself, and will ignore messages from others.
telegram_id = 1234567
message_echo = ""
function on_msg_receive (msg)
if msg.to.id == telegram_id and msg.from.id == telegram_id and msg.text ~= message_echo then
text = execute_command(msg.text)
message_echo = text
send_msg (msg.from.print_name, text, ok_callback, false)
end
end
function execute_command (command)
local execute = io.popen(command..' 2>&1')
local result = execute:read("*a")
execute:close()
return result
end
function ok_callback ()
end
@hiway
Copy link
Author

hiway commented Feb 27, 2015

telegram-cli is here: https://github.com/vysheng/tg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment