Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ radare2 secure_shell.elf
- Warning: Cannot initialize dynamic strings
- -- Here be dragons.
- [0x08048d0a]> aaa
- [x] Analyze all flags starting with sym. and entry0 (aa)
- [x] Analyze len bytes of instructions for references (aar)
- [x] Analyze function calls (aac)
- [ ] [*] Use -AA or aaaa to perform additional experimental analysis.
- [x] Constructing a function name for fcn.* and sym.func.* functions (aan))
- [0x08048d0a]> iz~Access
- vaddr=0x080becfe paddr=0x00076cfe ordinal=005 sz=15 len=14 section=.rodata type=ascii string=Access denied.
- vaddr=0x080d9c40 paddr=0x00091c40 ordinal=1238 sz=37 len=36 section=.rodata type=ascii string=Accessing a corrupted shared library
- [0x08048d0a]> axt 0x080becfe
- data 0x8048f3e mov dword [esp], str.Access_denied. in fcn.08048f09
- [0x08048d0a]> pdf @ fcn.08048f09
- - (fcn) fcn.08048f09 233
- | fcn.08048f09 ();
- | ; var int local_210h @ ebp-0x210
- | ; var int local_110h @ ebp-0x110
- | ; var int local_10h @ ebp-0x10
- | ; var int local_ch @ ebp-0xc
- | ; var int local_0h @ ebp-0x0
- | ; CALL XREF from 0x08049059 (fcn.08048ff2)
- | 0x08048f09 55 push ebp
- | 0x08048f0a 89e5 mov ebp, esp
- | 0x08048f0c 81ec28020000 sub esp, 0x228
- | 0x08048f12 c70424ebec0b. mov dword [esp], str._nEnter_file_name: ; [0x80beceb:4]=0x746e450a LEA str._nEnter_file_name: ; str._nEnter_file_name:
- | 0x08048f19 e822650000 call fcn.0804f440
- | 0x08048f1e 8d85f0feffff lea eax, [ebp - local_110h]
- | 0x08048f24 890424 mov dword [esp], eax
- | 0x08048f27 e814710000 call fcn.08050040
- | 0x08048f2c 8d85f0feffff lea eax, [ebp - local_110h]
- | 0x08048f32 890424 mov dword [esp], eax
- | 0x08048f35 e868ffffff call fcn.08048ea2
- | 0x08048f3a 85c0 test eax, eax
- | ,=< 0x08048f3c 7511 jne 0x8048f4f
- | | 0x08048f3e c70424feec0b. mov dword [esp], str.Access_denied. ; [0x80becfe:4]=0x65636341 LEA str.Access_denied. ; "Access denied." @ 0x80becfe
- | | 0x08048f45 e886720000 call fcn.080501d0
- | ,==< 0x08048f4a e9a1000000 jmp 0x8048ff0
- | || ; JMP XREF from 0x08048f3c (fcn.08048f09)
- | |`-> 0x08048f4f c74424040ded. mov dword [esp + 4], 0x80bed0d ; [0x80bed0d:4]=0x6f430072 ; "rCould not open file.Content of file:\x0a1. List directory2. Print file3. Log out> %i\x0aLog out...\x0aError! Try again...Username: Password: admingod\x0aWelcome!\x0aRestricted area! Keep off!libc-start.cFATAL: kernel too old\x0a/dev/urandom__libc_start_main"
- | | 0x08048f57 8d85f0feffff lea eax, [ebp - local_110h]
- | | 0x08048f5d 890424 mov dword [esp], eax
- | | 0x08048f60 e87b6c0000 call fcn.0804fbe0
- | | 0x08048f65 8945f4 mov dword [ebp - local_ch], eax
- | | 0x08048f68 837df400 cmp dword [ebp - local_ch], 0
- | |,=< 0x08048f6c 750e jne 0x8048f7c
- | || 0x08048f6e c704240fed0b. mov dword [esp], str.Could_not_open_file. ; [0x80bed0f:4]=0x6c756f43 LEA str.Could_not_open_file. ; "Could not open file." @ 0x80bed0f
- | || 0x08048f75 e856720000 call fcn.080501d0
- | ,===< 0x08048f7a eb74 jmp 0x8048ff0
- | ||| ; JMP XREF from 0x08048f6c (fcn.08048f09)
- | ||`-> 0x08048f7c c7042424ed0b. mov dword [esp], str.Content_of_file: ; [0x80bed24:4]=0x746e6f43 LEA str.Content_of_file: ; "Content of file:" @ 0x80bed24
- | || 0x08048f83 e848720000 call fcn.080501d0
- | || ; JMP XREF from 0x08048fe3 (fcn.08048f09)
- | ||.-> 0x08048f88 8b45f4 mov eax, dword [ebp - local_ch]
- | ||| 0x08048f8b 8944240c mov dword [esp + 0xc], eax
- | ||| 0x08048f8f c74424080001. mov dword [esp + 8], 0x100 ; [0x100:4]=0x554e47
- | ||| 0x08048f97 c74424040100. mov dword [esp + 4], 1
- | ||| 0x08048f9f 8d85f0fdffff lea eax, [ebp - local_210h]
- | ||| 0x08048fa5 890424 mov dword [esp], eax
- | ||| 0x08048fa8 e8636c0000 call fcn.0804fc10
- | ||| 0x08048fad 8945f0 mov dword [ebp - local_10h], eax
- | ||| 0x08048fb0 a1c0b40e08 mov eax, dword [0x80eb4c0] ; [0x80eb4c0:4]=0x80eb200
- | ||| 0x08048fb5 8944240c mov dword [esp + 0xc], eax
- | ||| 0x08048fb9 8b45f0 mov eax, dword [ebp - local_10h]
- | ||| 0x08048fbc 89442408 mov dword [esp + 8], eax
- | ||| 0x08048fc0 c74424040100. mov dword [esp + 4], 1
- | ||| 0x08048fc8 8d85f0fdffff lea eax, [ebp - local_210h]
- | ||| 0x08048fce 890424 mov dword [esp], eax
- | ||| 0x08048fd1 e85a6d0000 call fcn.0804fd30
- | ||| 0x08048fd6 8b45f4 mov eax, dword [ebp - local_ch]
- | ||| 0x08048fd9 890424 mov dword [esp], eax
- | ||| 0x08048fdc e80f750000 call fcn.080504f0
- | ||| 0x08048fe1 85c0 test eax, eax
- | ||`=< 0x08048fe3 74a3 je 0x8048f88
- | || 0x08048fe5 8b45f4 mov eax, dword [ebp - local_ch]
- | || 0x08048fe8 890424 mov dword [esp], eax
- | || 0x08048feb e880660000 call fcn.0804f670
- | || ; JMP XREF from 0x08048f4a (fcn.08048f09)
- | || ; JMP XREF from 0x08048f7a (fcn.08048f09)
- | ``--> 0x08048ff0 c9 leave
- =< 0x08048ff1 c3 ret
- [0x08048d0a]> pdf @ fcn.08048ea2
- - (fcn) fcn.08048ea2 103
- | fcn.08048ea2 (int arg_8h);
- | ; arg int arg_8h @ ebp+0x8
- | ; CALL XREF from 0x08048f35 (fcn.08048f09)
- | 0x08048ea2 55 push ebp
- | 0x08048ea3 89e5 mov ebp, esp
- | 0x08048ea5 83ec18 sub esp, 0x18
- | 0x08048ea8 c7442404dfec. mov dword [esp + 4], str.flag.txt ; [0x80becdf:4]=0x67616c66 LEA str.flag.txt ; "flag.txt" @ 0x80becdf
- | 0x08048eb0 8b4508 mov eax, dword [ebp + arg_8h] ; [0x8:4]=0
- | 0x08048eb3 890424 mov dword [esp], eax
- | 0x08048eb6 e8953b0100 call fcn.0805ca50
- | 0x08048ebb 85c0 test eax, eax
- | ,=< 0x08048ebd 7407 je 0x8048ec6
- | | 0x08048ebf b800000000 mov eax, 0
- | ,==< 0x08048ec4 eb41 jmp 0x8048f07
- | || ; JMP XREF from 0x08048ebd (fcn.08048ea2)
- | |`-> 0x08048ec6 c7442404e8ec. mov dword [esp + 4], 0x80bece8 ; [0x80bece8:4]=0xa002e2e ; ".."
- | | 0x08048ece 8b4508 mov eax, dword [ebp + arg_8h] ; [0x8:4]=0
- | | 0x08048ed1 890424 mov dword [esp], eax
- | | 0x08048ed4 e8773b0100 call fcn.0805ca50
- | | 0x08048ed9 85c0 test eax, eax
- | |,=< 0x08048edb 7407 je 0x8048ee4
- | || 0x08048edd b800000000 mov eax, 0
- | ,===< 0x08048ee2 eb23 jmp 0x8048f07
- | ||| ; JMP XREF from 0x08048edb (fcn.08048ea2)
- | ||`-> 0x08048ee4 c74424042f00. mov dword [esp + 4], 0x2f ; '/' ; [0x2f:4]=0x1c001d00 ; '/'
- | || 0x08048eec 8b4508 mov eax, dword [ebp + arg_8h] ; [0x8:4]=0
- | || 0x08048eef 890424 mov dword [esp], eax
- | || 0x08048ef2 e8a9f3ffff call fcn.080482a0
- | || 0x08048ef7 85c0 test eax, eax
- | ||,=< 0x08048ef9 7407 je 0x8048f02
- | ||| 0x08048efb b800000000 mov eax, 0
- | ,====< 0x08048f00 eb05 jmp 0x8048f07
- | |||| ; JMP XREF from 0x08048ef9 (fcn.08048ea2)
- | |||`-> 0x08048f02 b801000000 mov eax, 1
- | ||| ; JMP XREF from 0x08048ec4 (fcn.08048ea2)
- | ||| ; JMP XREF from 0x08048ee2 (fcn.08048ea2)
- | ||| ; JMP XREF from 0x08048f00 (fcn.08048ea2)
- | ```--> 0x08048f07 c9 leave
- =< 0x08048f08 c3 ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement