Thứ Hai, 3 tháng 10, 2016

[showup][H4ck1t] Blabla

Giải xài platform của facebook ctf nên rất lag. Pwn cũng chả mấy bài nên toàn làm for, misc này nọ thôi.
1 vài bài mình làm
https://drive.google.com/drive/folders/0B-QPcxnExPUcbDNmUC1OdTJDa0E?usp=sharing
Bài nào có có code thì show code thôi chứ cũng k khó lắm. Mấy bài pcap thì khá dễ nên không bàn...

100 PPC
Bài này thì giải nén mấy file đó ra. Trong đó có khoảng 100 file nén lại với nhau thì phải (?). File cuối cùng là flag.
code :
import os
filename=98
#thay duong dan 
path = "/home/z22/ctf/h4ck1t/100_00edb54bed7e46bd5cdb7c06059881c2.1/work_folder/99.1/work_folder/"
while (1):
 try:
  os.system('dtrx -f --no-directory *')
  path = path + "work_folder/"
  os.chdir(path)
 except:
  os.system("cat flag")
  break
#flag 0W_MY_G0D_Y0U_M4D3_1T


CryptoPixels:
Đọc code, hiểu, sau đó code decrypt.
code :
from PIL import Image
img1=Image.open('encrypted.png')
flag=''
l_flag=img1.getpixel((0,0))[0]
x=img1.getpixel((0,0))[1]
y=img1.getpixel((0,0))[2]
for i in range(l_flag):
  x1=img1.getpixel((x,y))[1]
  y1=img1.getpixel((x,y))[2]
  flag+=chr(img1.getpixel((x,y))[0])
  x=x1
  y=y1
print 'h4ck1t{'+flag+'}'
Planet :
Nhìn kĩ có mấy pixels khác màu. Get từng pixel ra xong ghép lại ra flag
code:
from PIL import Image

data=[]
im=Image.open('planet.png')
im1=Image.open('flag.png')
pix=im.load()
it=0
for i in range(0,1512,24):
 for j in range(0,1512,24):
  data.append(pix[i,j]);
 it=it+1
print it

t=0

for i in range(63):
 for j in range(63):
  im1.putpixel((i,j),data[t])
  t=t+1

im1.save('flag.png')
Test :
đọc đoạn đầu " \'00\'89\'50\'4e\'47\ "
là đoán đây là mã hex file signature của file png (code dễ lắm nên tự code nha ).
Sau khi lấy được hình. dùng binwalk xem thì thấy có file zip.
Trong file zip có chưa flag.txt.
Lấy đoạn đó ra. unzip ra được flag.

Không có nhận xét nào:

Đăng nhận xét