学逆向论坛

找回密码
立即注册

只需一步,快速开始

发新帖

2万

积分

41

好友

1171

主题

[Reverse] 沧海遗珠wp

发表于 2021-3-26 15:07:32 | 查看: 4199| 回复: 0

相关题目:

♦ 沧海遗珠


Hackover CTF: i-like-to-move-it


Challenge details

Contest Challenge Category Points
Hackover CTF i-like-to-move-it Reversing 350

Description

I like to move it, move it
I like to move it, move it
I like to move it, move it
You like to move it


Write-up

It's a mov-uscated binary:

Pintool go!

#!/usr/bin/python

import string
from subprocess import Popen, PIPE, STDOUT

pinpath = './pin'
countpath = './source/tools/ManualExamples/obj-ia32/inscount0.so'
apppath = './move_it'

key = ''

while True:
   maximum = 0,0
   for i in string.letters + string.digits + " _-!+":
      inputtry = key + i
      cmd = [pinpath, '-injection', 'child', '-t', countpath , '--' , apppath ]
      p = Popen(cmd, stdout=PIPE, stdin=PIPE, stderr=STDOUT)
      stdout = p.communicate(inputtry+'\n' ) 
      with open('inscount.out') as f:
          f.seek(6)
          nb_instructions = int(f.read())
          f.close()
      if nb_instructions > maximum[0]:
          maximum = nb_instructions, i
  key += maximum[1]
  print key

Running:

~/pin$ ./pin.py 
t
tH
tH1
tH1s
tH1sd
....

After a bit of fidgeting I found that the program expects a "_" to delimit words, but it does not increase the count. Therefor pintool won't find these characters. Add them manually after each word end to continue until:

$ ./pin.py 
tH1s_I5_FuN

Feeding the program this string changes the output of the program:

~/pin$ ./move_it 
tH1s_I5_FuN
Never Gonna Give You Up

After some franatic keyboard mashing:

~/pin$ ./move_it a
tH1s_I5_FuN
hackover15{I_L1k3_t0_m0V3_1t_M0v3_1T_Y0u_L1k3_t0_m0v3_1t}

The flag is:

hackover15{I_L1k3_t0_m0V3_1t_M0v3_1T_Y0u_L1k3_t0_m0v3_1t}
温馨提示:
1.如果您喜欢这篇帖子,请给作者点赞评分,点赞会增加帖子的热度,评分会给作者加学币。(评分不会扣掉您的积分,系统每天都会重置您的评分额度)。
2.回复帖子不仅是对作者的认可,还可以获得学币奖励,请尊重他人的劳动成果,拒绝做伸手党!
3.发广告、灌水回复等违规行为一经发现直接禁言,如果本帖内容涉嫌违规,请点击论坛底部的举报反馈按钮,也可以在【投诉建议】板块发帖举报。
论坛交流群:672619046

小黑屋|手机版|站务邮箱|学逆向论坛 ( 粤ICP备2021023307号 )|网站地图

GMT+8, 2024-12-26 13:50 , Processed in 0.151990 second(s), 36 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表