Skip to content

Commit

Permalink
Create README.mdx
Browse files Browse the repository at this point in the history
  • Loading branch information
nuoxoxo authored Nov 18, 2024
1 parent 7fee261 commit 90d38b9
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions level11/README.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# 11

Login

```b
> ssh level11@$(ifconfig|grep 'inet '|awk 'NR==2 {print $2}') -p 4242
> Password: s5cAJpM8ev6XHw998pRWG728z
```

A lua script

```b
> ls -l
-rwsr-sr-x 1 flag11 level11 668 level11.lua
> file level11.lua
level11.lua: setuid setgid a lua script, ASCII text executable
```
```b
> strings level11.lua
#!/usr/bin/env lua
local socket = require("socket")
local server = assert(socket.bind("127.0.0.1", 5151))
function hash(pass)
prog = io.popen("echo "..pass.." | sha1sum", "r")
data = prog:read("*all")
prog:close()
data = string.sub(data, 1, 40)
return data
while 1 do
local client = server:accept()
client:send("Password: ")
client:settimeout(60)
local l, err = client:receive()
if not err then
print("trying " .. l)
local h = hash(l)
if h ~= "f05d1d066fb246efe0c6f7d095f909a7a0cf34a0" then
client:send("Erf nope..\n");
else
client:send("Gz you dumb*\n")
end
end
client:close()
```
```b
> ltrace ./level11.lua
ltrace: Can't open ELF file "./level11.lua"
> ./level11.lua
lua: ./level11.lua:3: address already in use
stack traceback:
[C]: in function 'assert'
./level11.lua:3: in main chunk
[C]: ?
```

0 comments on commit 90d38b9

Please sign in to comment.