博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
【pwnable.kr】flag
阅读量:4206 次
发布时间:2019-05-26

本文共 2166 字,大约阅读时间需要 7 分钟。

IDA 分析源程序,发现字符串中有upx,upx -d解压后IDA可以继续分析。

程序malloc一块内存,调用strcpy拷贝了flag。

$ file flagflag: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, stripped$ upx -d ./flag                       Ultimate Packer for eXecutables                          Copyright (C) 1996 - 2013UPX 3.91        Markus Oberhumer, Laszlo Molnar & John Reiser   Sep 30th 2013        File size         Ratio      Format      Name   --------------------   ------   -----------   -----------    887219 <-    335288   37.79%  linux/ElfAMD   flagUnpacked 1 file.$ file flagflag: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, for GNU/Linux 2.6.24, BuildID[sha1]=96ec4cc272aeb383bd9ed26c0d4ac0eb5db41b16, not stripped
IDA disassemble
.text:0000000000401164 ; __unwind {.text:0000000000401164                 push    rbp.text:0000000000401165                 mov     rbp, rsp.text:0000000000401168                 sub     rsp, 10h.text:000000000040116C                 mov     edi, offset aIWillMallocAnd ; "I will malloc() and strcpy the flag the"....text:0000000000401171                 call    puts.text:0000000000401176                 mov     edi, 64h.text:000000000040117B                 call    malloc.text:0000000000401180                 mov     [rbp+dest], rax.text:0000000000401184                 mov     rdx, cs:flag.text:000000000040118B                 mov     rax, [rbp+dest].text:000000000040118F                 mov     rsi, rdx        ; src.text:0000000000401192                 mov     rdi, rax        ; dest.text:0000000000401195                 call    _strcpy.text:000000000040119A                 mov     eax, 0.text:000000000040119F                 leave.text:00000000004011A0                 retn.text:00000000004011A0 ; } // starts at 401164.text:00000000004011A0 main            endp.data:00000000006C2070 flag            dq offset aUpxSoundsLikeA.data:00000000006C2070                                         ; DATA XREF: main+20↑r.data:00000000006C2070                                         ; "UPX...? sounds like a delivery service "...

PS: 这题gdb动态调试也可以。

flag见IDA反汇编结果:"UPX...? sounds like a delivery service "...

你可能感兴趣的文章
POJ 1101 解题报告
查看>>
ACM POJ catalogues[转载]
查看>>
ACM经历总结[转载]
查看>>
C/C++文件操作[转载]
查看>>
专业计划
查看>>
小米笔试:最大子数组乘积
查看>>
常见的排序算法
查看>>
5.PyTorch实现逻辑回归(二分类)
查看>>
6.PyTorch实现逻辑回归(多分类)
查看>>
8.Pytorch实现5层全连接结构的MNIST(手写数字识别)
查看>>
9.PyTorch实现MNIST(手写数字识别)(2卷积1全连接)
查看>>
hdu 3460 Ancient Printer(trie tree)
查看>>
中间数
查看>>
KMP求前缀函数(next数组)
查看>>
KMP
查看>>
poj 3863Business Center
查看>>
Android编译系统简要介绍和学习计划
查看>>
Android编译系统环境初始化过程分析
查看>>
user2eng 笔记
查看>>
DRM in Android
查看>>