Created
February 27, 2015 10:11
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
telegram-cli is here: https://github.com/vysheng/tg