{"id":1073,"date":"2023-12-25T15:13:48","date_gmt":"2023-12-25T07:13:48","guid":{"rendered":"https:\/\/systw.net\/note\/?p=1073"},"modified":"2024-03-16T00:52:45","modified_gmt":"2024-03-15T16:52:45","slug":"htb-diogenes-rage","status":"publish","type":"post","link":"https:\/\/systw.net\/note\/archives\/1073","title":{"rendered":"HTB diogenes rage"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">\u76ee\u6a19\u8aaa\u660e<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">hackthebox\u4e0a\u7684web\u9776\u6a5f\uff0c\u540d\u7a31\u70ba<code>diogenes rage<\/code>\uff0c\u60c5\u5883\u662f\u8ca9\u8ce3\u6a5f<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b89\u5168\u98a8\u96aa<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b64\u76ee\u6a19\u767c\u73fe1\u500b\u5b89\u5168\u98a8\u96aa<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u8cfc\u8cb7\u512a\u60e0\u5238\u7684API\u6709\u689d\u4ef6\u7af6\u722d\u554f\u984c<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5b89\u5168\u512a\u5316\u5efa\u8b70\u00a0<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5b89\u6392\u4ee3\u78bc\u6aa2\u67e5\uff0c\u78ba\u4fdd\u5728\u4e0d\u5141\u8a31\u4e26\u767c\u7684\u6d41\u7a0b\u4e2d\u4f7f\u7528<code>async<\/code>\u800c\u5f15\u767c\u689d\u4ef6\u7af6\u722d\u554f\u984c<\/li>\n\n\n\n<li>\u91dd\u5c0d\u512a\u60e0\u5238\u7b49\u76f8\u95dc\u529f\u80fd\u9032\u884c\u4e26\u767c\u6e2c\u8a66\uff0c\u78ba\u4fdd\u7121\u5176\u4ed6\u689d\u4ef6\u7af6\u722d\u554f\u984c<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u653b\u64ca\u624b\u6cd5<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><code>flag<\/code>\u8981\u82b1\u9322\u624d\u80fd\u53d6\u5f97\uff0c\u6240\u4ee5\u8981\u60f3\u8fa6\u6cd5\u628a\u624b\u4e0a\u7684\u9322\u8b8a\u591a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5206\u6790<code>outer\/index.js<\/code>\u4ee3\u78bc\u767c\u73fe\u689d\u4ef6\u7af6\u722d\u554f\u984c\uff0c<code>async<\/code>\u5141\u8a31\u4e26\u767c\u57f7\u884c\uff0c\u9019\u610f\u8b02\u8457\u6211\u53ef\u4ee5\u540c\u4e00\u6642\u9593\u4e00\u6b21\u8cfc\u8cb7\u591a\u500b\u512a\u60e0\u5238<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>router.post('\/api\/coupons\/apply', AuthMiddleware, async (req, res) => {\r\n...omit...\r\nif (coupon_code) {\r\n\tif (user.coupons.includes(coupon_code)) {\r\n\t\treturn res.status(401).send(response(\"This coupon is already redeemed!\"));\r\n\t}\r\n\treturn db.getCouponValue(coupon_code)\r\n\t\t.then(coupon => {\r\n\t\tif (coupon) {\r\n\t\t\treturn db.addBalance(user.username, coupon.value)\r\n\t\t\t.then(() => {\r\n\t\t\t\tdb.setCoupon(user.username, coupon_code)\r\n\t\t\t\t.then(() => res.send(response(`$${coupon.value} coupon redeemed successfully! Please select an item for order.`)))\r\n\t\t\t})\r\n\t\t\t.catch(() => res.send(response(\"Failed to redeem the coupon!\")));\r\n\t\t}\r\n\tres.send(response(\"No such coupon exists!\"));\r\n\t})\r\n}\r\n...omit...<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u6b63\u5e38\u6d41\u7a0b\u4e2d\u4e00\u6b21\u53ea\u80fd\u8cb7\u4e00\u5f35\u50f9\u503c1\u5143\u9762\u984d\u7684\u512a\u60e0\u5238\uff0c\u4f46\u56e0\u70ba\u6709\u689d\u4ef6\u7af6\u722d\u6f0f\u6d1e\uff0c\u6211\u5011\u53ef\u4ee5\u7528\u4e26\u767c\u7684\u65b9\u5f0f\uff0c\u5728\u540c\u4e00\u6642\u9593\u7533\u8acb\u591a\u5f35\u512a\u60e0\u5238<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>flag<\/code>\u50f9\u683c\u70ba13.37\u5143\uff0c\u6240\u4ee5\u6211\u5011\u81f3\u5c11\u8981\u5c0d<code>\/api\/coupons\/apply<\/code>\u4e26\u767c14\u6b21\u4ee5\u4e0a\u8acb\u6c42\uff0c\u6210\u529f\u5f8c\u5c31\u80fd\u5229\u7528\u9019\u4e9b\u9322\u53bb\u8cb7flag<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"> <\/p>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u88dc\u5145\u8aaa\u660e<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">nodejs\u7684async<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u4f7f\u7528 <code>async<\/code> \u6642\uff0c\u5982\u679c\u5b58\u5728\u591a\u500b\u975e\u540c\u6b65\u64cd\u4f5c\u5171\u4eab\u540c\u4e00\u500b\u8cc7\u6599\u6216\u72c0\u614b\uff0c\u800c\u9019\u4e9b\u975e\u540c\u6b65\u64cd\u4f5c\u53ef\u80fd\u6703\u540c\u6642\u9032\u884c\u8b80\u5beb\u64cd\u4f5c\uff0c\u90a3\u9ebc\u5c31\u6709\u53ef\u80fd\u51fa\u73fe\u689d\u4ef6\u7af6\u722d\u6f0f\u6d1e\u3002 \u9019\u7a2e\u60c5\u6cc1\u4e26\u975e <code>async<\/code> \u672c\u8eab\u5f15\u767c\u7684\u554f\u984c\uff0c\u800c\u662f\u7531\u65bc\u4e26\u767c\u64cd\u4f5c\u5171\u4eab\u8cc7\u6e90\u800c\u5c0e\u81f4\u7684\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u5982\uff0c\u5047\u8a2d\u6709\u5169\u500b\u975e\u540c\u6b65\u51fd\u6578 A \u548c B\uff0c\u5b83\u5011\u90fd\u6703\u5c0d\u540c\u4e00\u500b\u8b8a\u6578\u9032\u884c\u8b80\u5beb\u904b\u7b97\u3002 \u7531\u65bc\u975e\u540c\u6b65\u51fd\u6578\u7684\u57f7\u884c\u9806\u5e8f\u662f\u4e0d\u78ba\u5b9a\u7684\uff0cA \u548c B \u53ef\u80fd\u6703\u540c\u6642\u8b80\u53d6\u548c\u4fee\u6539\u9019\u500b\u8b8a\u91cf\uff0c\u5f9e\u800c\u7522\u751f\u7af6\u722d\u689d\u4ef6\u3002 \u9019\u6a23\u7684\u60c5\u6cc1\u4e0b\uff0c\u5982\u679c\u6c92\u6709\u6b63\u78ba\u5730\u8655\u7406\u5171\u4eab\u8cc7\u6e90\u7684\u8a2a\u554f\uff0c\u5c31\u53ef\u80fd\u5c0e\u81f4\u8cc7\u6599\u4e0d\u4e00\u81f4\u6216\u932f\u8aa4\u7684\u884c\u70ba\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u53c3\u8003\u6587\u737b<br><a href=\"https:\/\/domdom.tistory.com\/293\" target=\"_blank\" rel=\"noopener\">https:\/\/domdom.tistory.com\/293<\/a><br><a href=\"https:\/\/b3cl4ssy.tistory.com\/481\" target=\"_blank\" rel=\"noopener\">https:\/\/b3cl4ssy.tistory.com\/481<\/a><br><a href=\"https:\/\/www.freebuf.com\/articles\/web\/340879.html\" target=\"_blank\" rel=\"noopener\">https:\/\/www.freebuf.com\/articles\/web\/340879.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f7f\u7528\u689d\u4ef6\u7af6\u722d\u6f0f\u6d1e\u4e00\u6b21\u8cfc\u8cb7\u591a\u5f35\u512a\u60e0\u5238<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"","fifu_image_alt":"","_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[27],"tags":[47],"class_list":["post-1073","post","type-post","status-publish","format-standard","hentry","category-hackerskill","tag-logic-vulnerabilities"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":2377,"url":"https:\/\/systw.net\/note\/archives\/2377","url_meta":{"origin":1073,"position":0},"title":"Vulnerability Assessment","author":"raymond","date":"2025 \u5e74 4 \u6708 1 \u65e5","format":false,"excerpt":"\u5f31\u9ede\u6383\u63cf\u670d\u52d9\u662f\u4e00\u7a2e\u8cc7\u8a0a\u5b89\u5168\u8a55\u4f30\u65b9\u6cd5\uff0c\u65e8\u5728\u8b58\u5225\u3001\u5206\u985e\u548c\u8a55\u4f30\u8cc7\u8a0a\u7cfb\u7d71\u3001\u61c9\u7528\u7a0b\u5f0f\u6216\u7db2\u8def\u4e2d\u7684\u5b89\u5168\u6f0f\u6d1e","rel":"","context":"\u5728\u300c\u5b89\u5168\u89e3\u6c7a\u65b9\u6848\u300d\u4e2d","block_context":{"text":"\u5b89\u5168\u89e3\u6c7a\u65b9\u6848","link":"https:\/\/systw.net\/note\/archives\/category\/securitysloution"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2380,"url":"https:\/\/systw.net\/note\/archives\/2380","url_meta":{"origin":1073,"position":1},"title":"Penetration Testing","author":"raymond","date":"2025 \u5e74 5 \u6708 1 \u65e5","format":false,"excerpt":"\u6ef2\u900f\u6e2c\u8a66\u662f\u4e00\u7a2e\u4e3b\u52d5\u7684\u8cc7\u8a0a\u5b89\u5168\u8a55\u4f30\u65b9\u6cd5\uff0c\u901a\u904e\u6a21\u64ec\u771f\u5be6\u4e16\u754c\u4e2d\u99ed\u5ba2\u7684\u653b\u64ca\u884c\u70ba\uff0c\u4f86\u6e2c\u8a66\u548c\u8a55\u4f30\u7cfb\u7d71\u7684\u5b89\u5168\u6027\u3002","rel":"","context":"\u5728\u300c\u5b89\u5168\u89e3\u6c7a\u65b9\u6848\u300d\u4e2d","block_context":{"text":"\u5b89\u5168\u89e3\u6c7a\u65b9\u6848","link":"https:\/\/systw.net\/note\/archives\/category\/securitysloution"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2495,"url":"https:\/\/systw.net\/note\/archives\/2495","url_meta":{"origin":1073,"position":2},"title":"\u5171\u8b58\u6a5f\u5236","author":"raymond","date":"2024 \u5e74 8 \u6708 5 \u65e5","format":false,"excerpt":"\u5171\u8b58\u6a5f\u5236Consensus\u662f\u5340\u584a\u93c8\u6280\u8853\u7684\u6838\u5fc3\u7d44\u6210\u90e8\u5206\uff0c\u7528\u65bc\u78ba\u4fdd\u53bb\u4e2d\u5fc3\u5316\u7db2\u7d61\u4e2d\u7684\u6240\u6709\u7bc0\u9ede\u5c0d\u5340\u584a\u93c8\u4e0a\u7684\u6578\u2026","rel":"","context":"\u5728\u300cBlockChain\u300d\u4e2d","block_context":{"text":"BlockChain","link":"https:\/\/systw.net\/note\/archives\/category\/%e5%8d%80%e5%a1%8a%e9%8f%88\/blockchain"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2923,"url":"https:\/\/systw.net\/note\/archives\/2923","url_meta":{"origin":1073,"position":3},"title":"Web\u6ef2\u900f\u6e2c\u8a66\u5be6\u52d9","author":"raymond","date":"2025 \u5e74 12 \u6708 20 \u65e5","format":false,"excerpt":"\u672c\u8ab2\u7a0b\u5c08\u70ba\u8cc7\u5b89\u521d\u5b78\u8005\u8207\u60f3\u8f49\u8077\u6ef2\u900f\u6e2c\u8a66\u7684\u6280\u8853\u4eba\u54e1\u8a2d\u8a08\u3002\u900f\u904e \u300c\u7406\u8ad6\u5c0e\u5f15\u3001\u5de5\u5177\u719f\u7df4\u3001\u6f0f\u6d1e\u5be6\u8e10\u3001\u9776\u5834\u5be6\u6230\u300d\u2026","rel":"","context":"\u5728\u300c\u5b89\u5168\u89e3\u6c7a\u65b9\u6848\u300d\u4e2d","block_context":{"text":"\u5b89\u5168\u89e3\u6c7a\u65b9\u6848","link":"https:\/\/systw.net\/note\/archives\/category\/securitysloution"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1080,"url":"https:\/\/systw.net\/note\/archives\/1080","url_meta":{"origin":1073,"position":4},"title":"HTB petpet rcbee","author":"raymond","date":"2023 \u5e74 12 \u6708 26 \u65e5","format":false,"excerpt":"\u5206\u6790\u4f9d\u8cf4\u5305\u767c\u73feRCE\u6f0f\u6d1e,\u4e26\u4f7f\u7528\u8a72\u6f0f\u6d1e\u53d6\u5f97flag","rel":"","context":"\u5728\u300c\u653b\u64ca\u624b\u6cd5\u300d\u4e2d","block_context":{"text":"\u653b\u64ca\u624b\u6cd5","link":"https:\/\/systw.net\/note\/archives\/category\/hackerskill"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/i.imgur.com\/TVxlXUy.jpg?fit=1024%2C1024&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/i.imgur.com\/TVxlXUy.jpg?fit=1024%2C1024&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/i.imgur.com\/TVxlXUy.jpg?fit=1024%2C1024&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/i.imgur.com\/TVxlXUy.jpg?fit=1024%2C1024&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":1054,"url":"https:\/\/systw.net\/note\/archives\/1054","url_meta":{"origin":1073,"position":5},"title":"HTB easter-bunny","author":"raymond","date":"2023 \u5e74 12 \u6708 23 \u65e5","format":false,"excerpt":"\u7528X-Forwarded-host\u6539\u8b8a\u8b80\u53d6js\u7684\u4f86\u6e90,\u5728\u8b93\u76ee\u6a19\u7de9\u5b58\u4e2d\u6bd2,\u4f7f\u5f97\u4ee3\u78bc\u88ab\u60e1\u610f\u7de9\u5b58\u5f71\u97ff\u800c\u57f7\u884c\u2026","rel":"","context":"\u5728\u300c\u653b\u64ca\u624b\u6cd5\u300d\u4e2d","block_context":{"text":"\u653b\u64ca\u624b\u6cd5","link":"https:\/\/systw.net\/note\/archives\/category\/hackerskill"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts\/1073","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/comments?post=1073"}],"version-history":[{"count":0,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts\/1073\/revisions"}],"wp:attachment":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/media?parent=1073"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/categories?post=1073"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/tags?post=1073"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}