rev245 points  Solved 86 times  Reversing  Arun Dunna

Little bit harder?

The answer will not be in the typical sctf{flag} format, so when you do get it, you must put it into the format by doing sctf{flag_you_found}

ダウンロードしたファイルのファイルタイプをfileコマンドで確認します。Linuxの64bitバイナリです。

$ file rev2

rev2: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=3c07a67e1a790d75ac819159d8c7d824704b0fc6, not stripped

objdumpコマンドで逆アセンブルして動作を解析します。

$ objdump -s -D rev2 > aaa.txt

rev1と同様、入力されたデータを数値として読み込み、0x30dda83=51239555と比較して分岐しています。

  40067d:    bf c0 07 40 00           mov    $0x4007c0,%edi            #%d
  400682:    b8 00 00 00 00           mov    $0x0,%eax
  400687:    e8 c4 fe ff ff           callq  400550 <scanf@plt>
  40068c:    8b 45 f8                 mov    -0x8(%rbp),%eax
  40068f:    3d 83 da 0d 03           cmp    $0x30dda83,%eax            #51239555
  400694:    75 7b                    jne    400711 <main+0xbb>

rev2を実行し、パスワードに51239555を入力します。フラグが表示されました。

$ ./rev2
What is the magic password?
51239555
Correct! Your flag is: 51196695

フラグは、

sctf{51196695}

です。