{"id":3093,"date":"2023-08-31T09:31:57","date_gmt":"2023-08-31T01:31:57","guid":{"rendered":"https:\/\/xinchewhd.com.cn\/?p=3093"},"modified":"2023-08-31T09:31:58","modified_gmt":"2023-08-31T01:31:58","slug":"java%e9%a1%b9%e7%9b%ae%e9%98%b2%e6%ad%a2sql%e6%b3%a8%e5%85%a5%e7%9a%84%e5%9b%9b%e7%a7%8d%e6%96%b9%e6%a1%88","status":"publish","type":"post","link":"https:\/\/xinchewhd.com.cn\/index.php\/mysql\/java%e9%a1%b9%e7%9b%ae%e9%98%b2%e6%ad%a2sql%e6%b3%a8%e5%85%a5%e7%9a%84%e5%9b%9b%e7%a7%8d%e6%96%b9%e6%a1%88\/","title":{"rendered":"Java\u9879\u76ee\u9632\u6b62SQL\u6ce8\u5165\u7684\u56db\u79cd\u65b9\u6848"},"content":{"rendered":"<section data-tool=\"mdnice\u7f16\u8f91\u5668\" data-website=\"https:\/\/www.mdnice.com\" data-mpa-powered-by=\"yiban.io\">\n<p style=\"outline: 0px; color: #3e3e3e; font-size: 15px; letter-spacing: 0.544px; white-space: normal; text-align: center; font-family: 'Helvetica Neue', Helvetica, 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; visibility: visible;\"><span style=\"outline: 0px; font-size: 13px; visibility: visible;\"><span style=\"outline: 0px; color: #888888; letter-spacing: 0.544px; visibility: visible;\">\u4e0a\u65b9\u84dd\u8272\u201c<\/span><span style=\"outline: 0px; letter-spacing: 0.544px; color: #0080ff; visibility: visible;\">\u7a0b\u5e8f\u5458\u8ffd\u98ce<\/span><span style=\"outline: 0px; color: #888888; letter-spacing: 0.544px; visibility: visible;\">\u201d\uff0c\u9009\u62e9\u201c\u8bbe\u4e3a\u661f\u6807\u201d<\/span><\/span><\/p>\n<p style=\"outline: 0px; color: #3e3e3e; font-size: 15px; letter-spacing: 0.544px; white-space: normal; text-align: center; font-family: 'Helvetica Neue', Helvetica, 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; visibility: visible;\"><span style=\"outline: 0px; font-size: 13px; letter-spacing: 0.544px; visibility: visible;\"><span style=\"outline: 0px; color: #888888; letter-spacing: 0.544px; word-spacing: 2px; font-size: 16px; visibility: visible;\">\u56de\u590d\u201c<\/span><span style=\"outline: 0px; letter-spacing: 0.544px; word-spacing: 2px; font-size: 16px; color: #ff4c41; visibility: visible;\"><strong style=\"outline: 0px; visibility: visible;\">\u8d44\u6599<\/strong><\/span><span style=\"outline: 0px; color: #888888; letter-spacing: 0.544px; word-spacing: 2px; font-size: 16px; visibility: visible;\">\u201d\u83b7\u53d6\u6574\u7406\u597d\u7684<\/span><strong style=\"outline: 0px; color: #3f3f3f; font-family: -apple-system-font, BlinkMacSystemFont, 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', Arial, sans-serif; letter-spacing: 0.544px; font-size: 15px; word-spacing: 2px; visibility: visible;\"><span style=\"outline: 0px; letter-spacing: 0.544px; font-size: 16px; color: #ff4c41; visibility: visible;\">\u9762\u8bd5\u8d44\u6599<\/span><\/strong><\/span><\/p>\n<p style=\"outline: 0px; letter-spacing: 0.544px; white-space: normal; visibility: visible;\"><br style=\"outline: 0px; visibility: visible;\" \/><span style=\"outline: 0px; font-family: 'Helvetica Neue', Helvetica, 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; color: #888888; font-size: 14px; letter-spacing: 0.544px; visibility: visible;\">\u539f\u6587\uff1a<\/span><span style=\"outline: 0px; text-align: right; word-spacing: 1.2px; color: #888888; letter-spacing: 0.544px; font-family: 'Helvetica Neue', Helvetica, 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; visibility: visible; font-size: 12px;\">www.jianshu.com\/p \/abf6fd4531e7<\/span><\/p>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong><span style=\"font-size: 20px;\">\u4e00\u3001\u4ec0\u4e48\u662fSQL\u6ce8\u5165\uff1f<\/span><\/strong><\/h2>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; margin-top: 10px; margin-bottom: 10px; font-size: 14px; word-spacing: 2px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 16px;\">SQL\u6ce8\u5165\u5373\u662f\u6307web\u5e94\u7528\u7a0b\u5e8f\u5bf9\u7528\u6237\u8f93\u5165\u6570\u636e\u7684\u5408\u6cd5\u6027\u6ca1\u6709\u5224\u65ad\u6216\u8fc7\u6ee4\u4e0d\u4e25\uff0c\u653b\u51fb\u8005\u53ef\u4ee5\u5728web\u5e94\u7528\u7a0b\u5e8f\u4e2d\u4e8b\u5148\u5b9a\u4e49\u597d\u7684\u67e5\u8be2\u8bed\u53e5\u7684\u7ed3\u5c3e\u4e0a\u6dfb\u52a0\u989d\u5916\u7684SQL\u8bed\u53e5\uff0c\u5728\u7ba1\u7406\u5458\u4e0d\u77e5\u60c5\u7684\u60c5\u51b5\u4e0b\u5b9e\u73b0\u975e\u6cd5\u64cd\u4f5c\uff0c\u4ee5\u6b64\u6765\u5b9e\u73b0\u6b3a\u9a97\u6570\u636e\u5e93\u670d\u52a1\u5668\u6267\u884c\u975e\u6388\u6743\u7684\u4efb\u610f\u67e5\u8be2\uff0c\u4ece\u800c\u8fdb\u4e00\u6b65\u5f97\u5230\u76f8\u5e94\u7684\u6570\u636e\u4fe1\u606f\u3002<\/span><\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; margin-top: 10px; margin-bottom: 10px; font-size: 14px; word-spacing: 2px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 16px;\">SQL\u6848\u5217<\/span><\/p>\n<pre style=\"margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; background: #282c34; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; border-radius: 0px; font-size: 12px; -webkit-overflow-scrolling: touch; letter-spacing: 0px;\">String\u00a0sql\u00a0=\u00a0<span style=\"color: #98c379; line-height: 26px;\">\"delete\u00a0from\u00a0table1\u00a0where\u00a0id\u00a0=\u00a0\"<\/span>\u00a0+\u00a0<span style=\"color: #98c379; line-height: 26px;\">\"id\"<\/span>;\n<\/code><\/pre>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; margin-top: 10px; margin-bottom: 10px; font-size: 14px; word-spacing: 2px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 16px;\">\u8fd9\u4e2aid\u4ece\u8bf7\u6c42\u53c2\u6570\u4e2d\u83b7\u53d6\uff0c\u82e5\u53c2\u6570\u88ab\u62fc\u63a5\u4e3a\uff1a<\/span><\/p>\n<blockquote style=\"font-size: 0.9em; overflow: auto; padding: 10px 10px 10px 20px; margin-bottom: 20px; margin-top: 20px; text-size-adjust: 100%; line-height: 1.55em; border-radius: 6px; color: #595959; box-sizing: inherit; border-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-color: rgba(64, 184, 250, 0.4); background: rgba(64, 184, 250, 0.1);\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><p><span style=\"color: rgba(64, 184, 250, .5); font-size: 34px; line-height: 1; font-weight: bold;\">\u275d<\/span><\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; font-size: 14px; word-spacing: 2px; line-height: 26px;\">1001 or \u00a01 = 1<\/p>\n<p><span style=\"float: right; color: rgba(64, 184, 250, .5);\">\u275e<\/span><\/p><\/blockquote>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; margin-top: 10px; margin-bottom: 10px; font-size: 14px; word-spacing: 2px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 16px;\">\u6700\u6267\u884c\u8bed\u53e5\u53d8\u4e3a\uff1a<\/span><\/p>\n<pre style=\"margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; background: #282c34; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; border-radius: 0px; font-size: 12px; -webkit-overflow-scrolling: touch; letter-spacing: 0px;\">String\u00a0sql\u00a0=\u00a0<span style=\"color: #98c379; line-height: 26px;\">\"delete\u00a0from\u00a0table1\u00a0where\u00a0id\u00a0=\u00a01001\u00a0or\u00a01\u00a0=\u00a01\"<\/span>;\n<\/code><\/pre>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; margin-top: 10px; margin-bottom: 10px; font-size: 14px; word-spacing: 2px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 16px;\">\u6b64\u65f6\uff0c\u6570\u636e\u5e93\u7684\u6570\u636e\u90fd\u4f1a\u88ab\u6e05\u7a7a\u6389\uff0c\u540e\u679c\u975e\u5e38\u4e25\u91cd<\/span><\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; margin-top: 10px; margin-bottom: 10px; font-size: 14px; word-spacing: 2px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong><span style=\"letter-spacing: 0.034em; font-size: 20px;\">\u4e8c\u3001Java\u9879\u76ee\u9632\u6b62SQL\u6ce8\u5165\u65b9\u5f0f<\/span><\/strong><\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; margin-top: 10px; margin-bottom: 10px; font-size: 14px; word-spacing: 2px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 16px;\">\u8fd9\u91cc\u603b\u7ed34\u79cd\uff1a<\/span><\/p>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px; font-size: 15px; color: #595959; list-style-type: circle;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li style=\"font-size: 16px;\">\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; font-size: 14px;\"><span style=\"font-size: 16px;\">PreparedStatement\u9632\u6b62SQL\u6ce8\u5165<\/span><\/section>\n<\/li>\n<li style=\"font-size: 16px;\">\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; font-size: 14px;\"><span style=\"font-size: 16px;\">mybatis\u4e2d#{}\u9632\u6b62SQL\u6ce8\u5165<\/span><\/section>\n<\/li>\n<li style=\"font-size: 16px;\">\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; font-size: 14px;\"><span style=\"font-size: 16px;\">\u5bf9\u8bf7\u6c42\u53c2\u6570\u7684\u654f\u611f\u8bcd\u6c47\u8fdb\u884c\u8fc7\u6ee4<\/span><\/section>\n<\/li>\n<li style=\"font-size: 16px;\">\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; font-size: 14px;\"><span style=\"font-size: 16px;\">nginx\u53cd\u5411\u4ee3\u7406\u9632\u6b62SQL\u6ce8\u5165<\/span><\/section>\n<\/li>\n<\/ul>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\"><\/h3>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong><span style=\"font-size: 18px;\">1\u3001PreparedStatement\u9632\u6b62SQL\u6ce8\u5165<\/span><\/strong><\/h3>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; margin-top: 10px; margin-bottom: 10px; font-size: 14px; word-spacing: 2px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 16px;\">PreparedStatement\u5177\u6709\u9884\u7f16\u8bd1\u529f\u80fd\uff0c\u4ee5\u4e0a\u8ff0SQL\u4e3a\u4f8b<\/span><\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; margin-top: 10px; margin-bottom: 10px; font-size: 14px; word-spacing: 2px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 16px;\">\u4f7f\u7528PreparedStatement\u9884\u7f16\u8bd1\u540e\u7684SQL\u4e3a\uff1a<\/span><\/p>\n<pre style=\"margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; background: #282c34; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; border-radius: 0px; font-size: 12px; -webkit-overflow-scrolling: touch; letter-spacing: 0px;\"><span style=\"color: #c678dd; line-height: 26px;\">delete<\/span>\u00a0<span style=\"color: #c678dd; line-height: 26px;\">from<\/span>\u00a0table1\u00a0<span style=\"color: #c678dd; line-height: 26px;\">where<\/span>\u00a0<span style=\"color: #c678dd; line-height: 26px;\">id<\/span>=\u00a0?\n<\/code><\/pre>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; margin-top: 10px; margin-bottom: 10px; font-size: 14px; word-spacing: 2px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 16px;\">\u6b64\u65f6SQL\u8bed\u53e5\u7ed3\u6784\u5df2\u56fa\u5b9a\uff0c\u65e0\u8bba\"?\"\u88ab\u66ff\u6362\u4e3a\u4efb\u4f55\u53c2\u6570\uff0cSQL\u8bed\u53e5\u53ea\u8ba4\u4e3awhere\u540e\u9762\u53ea\u6709\u4e00\u4e2a\u6761\u4ef6\uff0c\u5f53\u518d\u4f20\u5165 1001 or \u00a01 = 1\u65f6\uff0c\u8bed\u53e5\u4f1a\u62a5\u9519\uff0c\u4ece\u800c\u8fbe\u5230\u9632\u6b62SQL\u6ce8\u5165\u6548\u679c<\/span><\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; margin-top: 10px; margin-bottom: 10px; font-size: 14px; word-spacing: 2px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong><span style=\"letter-spacing: 0.034em; font-size: 18px;\">2\u3001mybatis\u4e2d#{}\u9632\u6b62SQL\u6ce8\u5165<\/span><\/strong><\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; margin-top: 10px; margin-bottom: 10px; font-size: 14px; word-spacing: 2px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 16px;\">mybatis\u4e2d#{}\u8868\u8fbe\u5f0f\u9632\u6b62SQL\u6ce8\u5165\u4e0ePreparedStatement\u7c7b\u4f3c\uff0c\u90fd\u662f\u5bf9SQL\u8bed\u53e5\u8fdb\u884c\u9884\u7f16\u8bd1\u5904\u7406<\/span><\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; margin-top: 10px; margin-bottom: 10px; font-size: 14px; word-spacing: 2px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"color: #3594f7; font-weight: bold; font-size: 16px;\">\u6ce8\u610f\uff1a<\/span><\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; margin-top: 10px; margin-bottom: 10px; font-size: 14px; word-spacing: 2px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 16px;\">#{} \uff1a\u53c2\u6570\u5360\u4f4d\u7b26<\/span><\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; margin-top: 10px; margin-bottom: 10px; font-size: 14px; word-spacing: 2px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 16px;\">${} \uff1a\u62fc\u63a5\u66ff\u6362\u7b26\uff0c\u4e0d\u80fd\u9632\u6b62SQL\u6ce8\u5165\uff0c\u4e00\u822c\u7528\u4e8e<\/span><\/p>\n<ul class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px; font-size: 15px; color: #595959; list-style-type: circle;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li style=\"font-size: 16px;\">\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; font-size: 14px;\"><span style=\"font-size: 16px;\">\u4f20\u5165\u6570\u636e\u5e93\u5bf9\u8c61\uff08\u5982\uff1a\u6570\u636e\u5e93\u540d\u79f0\u3001\u8868\u540d\uff09<\/span><\/section>\n<\/li>\n<li style=\"font-size: 16px;\">\n<section style=\"margin-top: 5px; margin-bottom: 5px; line-height: 26px; font-size: 14px;\"><span style=\"font-size: 16px;\">order by \u00a0\u540e\u7684\u6761\u4ef6<\/span><\/section>\n<\/li>\n<\/ul>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\"><\/h3>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong><span style=\"font-size: 18px;\">3\u3001\u5bf9\u8bf7\u6c42\u53c2\u6570\u7684\u654f\u611f\u8bcd\u6c47\u8fdb\u884c\u8fc7\u6ee4<\/span><\/strong><\/h3>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; margin-top: 10px; margin-bottom: 10px; font-size: 14px; word-spacing: 2px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 16px;\">\u8fd9\u91cc\u662fspringboot\u7684\u5199\u6cd5\uff0c\u5982\u4e0b\uff1a<\/span><\/p>\n<pre style=\"margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; background: #282c34; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; border-radius: 0px; font-size: 12px; -webkit-overflow-scrolling: touch; letter-spacing: 0px;\"><span style=\"color: #c678dd; line-height: 26px;\">import<\/span>\u00a0org.springframework.context.annotation.Configuration;\n<span style=\"color: #c678dd; line-height: 26px;\">import<\/span>\u00a0javax.servlet.*;\n<span style=\"color: #c678dd; line-height: 26px;\">import<\/span>\u00a0javax.servlet.annotation.WebFilter;\n<span style=\"color: #c678dd; line-height: 26px;\">import<\/span>\u00a0java.io.IOException;\n<span style=\"color: #c678dd; line-height: 26px;\">import<\/span>\u00a0java.util.Enumeration;\n\u00a0\n<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">\/**\n\u00a0*\u00a0<span style=\"color: #c678dd; line-height: 26px;\">@Auther<\/span>:\u00a0\u7761\u7af9\n\u00a0*\u00a0<span style=\"color: #c678dd; line-height: 26px;\">@Date<\/span>:\u00a02023\/03\/07\n\u00a0*\u00a0<span style=\"color: #c678dd; line-height: 26px;\">@Description<\/span>:\u00a0sql\u9632\u6ce8\u5165\u8fc7\u6ee4\u5668\n\u00a0*\/<\/span>\n<span style=\"color: #61aeee; line-height: 26px;\">@WebFilter<\/span>(urlPatterns\u00a0=\u00a0<span style=\"color: #98c379; line-height: 26px;\">\"\/*\"<\/span>,filterName\u00a0=\u00a0<span style=\"color: #98c379; line-height: 26px;\">\"sqlFilter\"<\/span>)\n<span style=\"color: #61aeee; line-height: 26px;\">@Configuration<\/span>\n<span style=\"color: #c678dd; line-height: 26px;\">public<\/span>\u00a0<span style=\"line-height: 26px;\"><span style=\"color: #c678dd; line-height: 26px;\">class<\/span>\u00a0<span style=\"color: #e6c07b; line-height: 26px;\">SqlFilter<\/span>\u00a0<span style=\"color: #c678dd; line-height: 26px;\">implements<\/span>\u00a0<span style=\"color: #e6c07b; line-height: 26px;\">Filter<\/span>\u00a0<\/span>{\n\u00a0\n\u00a0\u00a0\u00a0\u00a0<span style=\"color: #61aeee; line-height: 26px;\">@Override<\/span>\n\u00a0\u00a0\u00a0\u00a0<span style=\"line-height: 26px;\"><span style=\"color: #c678dd; line-height: 26px;\">public<\/span>\u00a0<span style=\"color: #c678dd; line-height: 26px;\">void<\/span>\u00a0<span style=\"color: #61aeee; line-height: 26px;\">init<\/span><span style=\"line-height: 26px;\">(FilterConfig\u00a0filterConfig)<\/span>\u00a0<span style=\"color: #c678dd; line-height: 26px;\">throws<\/span>\u00a0ServletException\u00a0<\/span>{}\n\u00a0\n\u00a0\u00a0\u00a0\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">\/**\n\u00a0\u00a0\u00a0\u00a0\u00a0*\u00a0<span style=\"color: #c678dd; line-height: 26px;\">@description<\/span>\u00a0sql\u6ce8\u5165\u8fc7\u6ee4\n\u00a0\u00a0\u00a0\u00a0\u00a0*\/<\/span>\n\u00a0\u00a0\u00a0\u00a0<span style=\"color: #61aeee; line-height: 26px;\">@Override<\/span>\n\u00a0\u00a0\u00a0\u00a0<span style=\"line-height: 26px;\"><span style=\"color: #c678dd; line-height: 26px;\">public<\/span>\u00a0<span style=\"color: #c678dd; line-height: 26px;\">void<\/span>\u00a0<span style=\"color: #61aeee; line-height: 26px;\">doFilter<\/span><span style=\"line-height: 26px;\">(ServletRequest\u00a0servletRequest,\u00a0ServletResponse\u00a0servletResponse,\u00a0FilterChain\u00a0filterChain)<\/span>\u00a0<span style=\"color: #c678dd; line-height: 26px;\">throws<\/span>\u00a0IOException,\u00a0ServletException\u00a0<\/span>{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ServletRequest\u00a0request\u00a0=\u00a0servletRequest;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ServletResponse\u00a0response\u00a0=\u00a0servletResponse;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">\/\/\u00a0\u83b7\u5f97\u6240\u6709\u8bf7\u6c42\u53c2\u6570\u540d<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Enumeration&lt;String&gt;\u00a0names\u00a0=\u00a0request.getParameterNames();\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0String\u00a0sql\u00a0=\u00a0<span style=\"color: #98c379; line-height: 26px;\">\"\"<\/span>;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #c678dd; line-height: 26px;\">while<\/span>\u00a0(names.hasMoreElements()){\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">\/\/\u00a0\u5f97\u5230\u53c2\u6570\u540d<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0String\u00a0name\u00a0=\u00a0names.nextElement().toString();\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">\/\/\u00a0\u5f97\u5230\u53c2\u6570\u5bf9\u5e94\u503c<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0String[]\u00a0values\u00a0=\u00a0request.getParameterValues(name);\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #c678dd; line-height: 26px;\">for<\/span>\u00a0(<span style=\"color: #c678dd; line-height: 26px;\">int<\/span>\u00a0i\u00a0=\u00a0<span style=\"color: #d19a66; line-height: 26px;\">0<\/span>;\u00a0i\u00a0&lt;\u00a0values.length;\u00a0i++)\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0sql\u00a0+=\u00a0values[i];\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #c678dd; line-height: 26px;\">if<\/span>\u00a0(sqlValidate(sql))\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">\/\/TODO\u00a0\u8fd9\u91cc\u76f4\u63a5\u629b\u5f02\u5e38\u5904\u7406\uff0c\u524d\u540e\u7aef\u4ea4\u4e92\u9879\u76ee\u4e2d\uff0c\u8bf7\u628a\u9519\u8bef\u4fe1\u606f\u6309\u524d\u540e\u7aef\"\u6570\u636e\u8fd4\u56de\u7684VO\"\u5bf9\u8c61\u8fdb\u884c\u5c01\u88c5<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #c678dd; line-height: 26px;\">throw<\/span>\u00a0<span style=\"color: #c678dd; line-height: 26px;\">new<\/span>\u00a0IOException(<span style=\"color: #98c379; line-height: 26px;\">\"\u60a8\u53d1\u9001\u8bf7\u6c42\u4e2d\u7684\u53c2\u6570\u4e2d\u542b\u6709\u975e\u6cd5\u5b57\u7b26\"<\/span>);\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\u00a0<span style=\"color: #c678dd; line-height: 26px;\">else<\/span>\u00a0{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0filterChain.doFilter(request,response);\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}\n\u00a0\u00a0\u00a0\u00a0}\n\u00a0\n\u00a0\u00a0\u00a0\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">\/**\n\u00a0\u00a0\u00a0\u00a0\u00a0*\u00a0<span style=\"color: #c678dd; line-height: 26px;\">@description<\/span>\u00a0\u5339\u914d\u6548\u9a8c\n\u00a0\u00a0\u00a0\u00a0\u00a0*\/<\/span>\n\u00a0\u00a0\u00a0\u00a0<span style=\"line-height: 26px;\"><span style=\"color: #c678dd; line-height: 26px;\">protected<\/span>\u00a0<span style=\"color: #c678dd; line-height: 26px;\">static<\/span>\u00a0<span style=\"color: #c678dd; line-height: 26px;\">boolean<\/span>\u00a0<span style=\"color: #61aeee; line-height: 26px;\">sqlValidate<\/span><span style=\"line-height: 26px;\">(String\u00a0str)<\/span><\/span>{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">\/\/\u00a0\u7edf\u4e00\u8f6c\u4e3a\u5c0f\u5199<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0String\u00a0s\u00a0=\u00a0str.toLowerCase();\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">\/\/\u00a0\u8fc7\u6ee4\u6389\u7684sql\u5173\u952e\u5b57\uff0c\u7279\u6b8a\u5b57\u7b26\u524d\u9762\u9700\u8981\u52a0\\\\\u8fdb\u884c\u8f6c\u4e49<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0String\u00a0badStr\u00a0=\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #98c379; line-height: 26px;\">\"select|update|and|or|delete|insert|truncate|char|into|substr|ascii|declare|exec|count|master|into|drop|execute|table|\"<\/span>+\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #98c379; line-height: 26px;\">\"char|declare|sitename|xp_cmdshell|like|from|grant|use|group_concat|column_name|\"<\/span>\u00a0+\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #98c379; line-height: 26px;\">\"information_schema.columns|table_schema|union|where|order|by|\"<\/span>\u00a0+\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #98c379; line-height: 26px;\">\"'\\\\*|\\\\;|\\\\-|\\\\--|\\\\+|\\\\,|\\\\\/\/|\\\\\/|\\\\%|\\\\#\"<\/span>;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">\/\/\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u8fdb\u884c\u5339\u914d<\/span>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #c678dd; line-height: 26px;\">boolean<\/span>\u00a0matches\u00a0=\u00a0s.matches(badStr);\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<span style=\"color: #c678dd; line-height: 26px;\">return<\/span>\u00a0matches;\n\u00a0\u00a0\u00a0\u00a0}\n\u00a0\n\u00a0\u00a0\u00a0\u00a0<span style=\"color: #61aeee; line-height: 26px;\">@Override<\/span>\n\u00a0\u00a0\u00a0\u00a0<span style=\"line-height: 26px;\"><span style=\"color: #c678dd; line-height: 26px;\">public<\/span>\u00a0<span style=\"color: #c678dd; line-height: 26px;\">void<\/span>\u00a0<span style=\"color: #61aeee; line-height: 26px;\">destroy<\/span><span style=\"line-height: 26px;\">()<\/span>\u00a0<\/span>{}\n}\n<\/code><\/pre>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\"><\/h3>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong><span style=\"font-size: 18px;\">4\u3001nginx\u53cd\u5411\u4ee3\u7406\u9632\u6b62SQL\u6ce8\u5165<\/span><\/strong><\/h3>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; margin-top: 10px; margin-bottom: 10px; font-size: 14px; word-spacing: 2px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 16px;\">\u8d8a\u6765\u8d8a\u591a\u7f51\u7ad9\u4f7f\u7528nginx\u8fdb\u884c\u53cd\u5411\u4ee3\u7406\uff0c\u8be5\u5c42\u6211\u4eec\u4e5f\u53ef\u4ee5\u8fdb\u884c\u9632\u6b62SQL\u6ce8\u5165\u914d\u7f6e\u3002<\/span><\/p>\n<p style=\"padding-top: 8px; padding-bottom: 8px; line-height: 26px; margin-top: 10px; margin-bottom: 10px; font-size: 14px; word-spacing: 2px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 16px;\">\u5c06\u4e0b\u9762\u7684Nginx\u914d\u7f6e\u6587\u4ef6\u4ee3\u7801\u653e\u5165\u5230server\u5757\u4e2d\uff0c\u7136\u540e\u91cd\u542fNginx\u5373\u53ef<\/span><\/p>\n<pre style=\"margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; background: #282c34; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; border-radius: 0px; font-size: 12px; -webkit-overflow-scrolling: touch; letter-spacing: 0px;\">\u00a0<span style=\"color: #c678dd; line-height: 26px;\">if<\/span>\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$request_method<\/span>\u00a0!~*\u00a0GET|POST)\u00a0{\u00a0<span style=\"color: #e6c07b; line-height: 26px;\">return<\/span>\u00a0444;\u00a0}\n\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u4f7f\u7528444\u9519\u8bef\u4ee3\u7801\u53ef\u4ee5\u66f4\u52a0\u51cf\u8f7b\u670d\u52a1\u5668\u8d1f\u8f7d\u538b\u529b\u3002<\/span>\n\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u9632\u6b62SQL\u6ce8\u5165<\/span>\n\u00a0<span style=\"color: #c678dd; line-height: 26px;\">if<\/span>\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$query_string<\/span>\u00a0~*\u00a0(\\$|<span style=\"color: #98c379; line-height: 26px;\">'|--|[+|(%20)]union[+|(%20)]|[+|(%20)]insert[+|(%20)]|[+|(%20)]drop[+|(%20)]|[+|(%20)]truncate[+|(%20)]|[+|(%20)]update[+|(%20)]|[+|(%20)]from[+|(%20)]|[+|(%20)]grant[+|(%20)]|[+|(%20)]exec[+|(%20)]|[+|(%20)]where[+|(%20)]|[+|(%20)]select[+|(%20)]|[+|(%20)]and[+|(%20)]|[+|(%20)]or[+|(%20)]|[+|(%20)]count[+|(%20)]|[+|(%20)]exec[+|(%20)]|[+|(%20)]chr[+|(%20)]|[+|(%20)]mid[+|(%20)]|[+|(%20)]like[+|(%20)]|[+|(%20)]iframe[+|(%20)]|[\\&lt;|%3c]script[\\&gt;|%3e]|javascript|alert|webscan|dbappsecurity|style|confirm\\(|innerhtml|innertext)(.*)$)\u00a0{\u00a0return\u00a0555;\u00a0}\n\u00a0if\u00a0($uri\u00a0~*\u00a0(\/~).*)\u00a0{\u00a0return\u00a0501;\u00a0}\n\u00a0if\u00a0($uri\u00a0~*\u00a0(\\\\x.))\u00a0{\u00a0return\u00a0501;\u00a0}\n\u00a0#\u9632\u6b62SQL\u6ce8\u5165\u00a0\n\u00a0if\u00a0($query_string\u00a0~*\u00a0\"[;'<\/span>&lt;&gt;].*<span style=\"color: #98c379; line-height: 26px;\">\")\u00a0{\u00a0return\u00a0509;\u00a0}\n\u00a0if\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$request_uri<\/span>\u00a0~\u00a0\"<\/span>\u00a0<span style=\"color: #98c379; line-height: 26px;\">\")\u00a0{\u00a0return\u00a0509;\u00a0}\n\u00a0if\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$request_uri<\/span>\u00a0~\u00a0(\\\/\\.+))\u00a0{\u00a0return\u00a0509;\u00a0}\n\u00a0if\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$request_uri<\/span>\u00a0~\u00a0(\\.+\\\/))\u00a0{\u00a0return\u00a0509;\u00a0}\n\u00a0#if\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$uri<\/span>\u00a0~*\u00a0(insert|select|delete|update|count|master|truncate|declare|exec|\\*|\\')(.*)<\/span><\/code><\/pre>\n<pre><\/pre>\n<pre style=\"margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; padding: 16px; color: #abb2bf; background: #282c34; display: -webkit-box; font-family: Operator Mono, Consolas, Monaco, Menlo, monospace; border-radius: 0px; font-size: 12px; -webkit-overflow-scrolling: touch; letter-spacing: 0px;\"><span style=\"color: #98c379; line-height: 26px;\">nbsp;)\u00a0{\u00a0return\u00a0503;\u00a0}\n\u00a0#\u9632\u6b62SQL\u6ce8\u5165\n\u00a0if\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$request_uri<\/span>\u00a0~*\u00a0\"<\/span>(cost\\()|(concat\\()<span style=\"color: #98c379; line-height: 26px;\">\")\u00a0{\u00a0return\u00a0504;\u00a0}\n\u00a0if\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$request_uri<\/span>\u00a0~*\u00a0\"<\/span>[+|(%20)]union[+|(%20)]<span style=\"color: #98c379; line-height: 26px;\">\")\u00a0{\u00a0return\u00a0504;\u00a0}\n\u00a0if\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$request_uri<\/span>\u00a0~*\u00a0\"<\/span>[+|(%20)]and[+|(%20)]<span style=\"color: #98c379; line-height: 26px;\">\")\u00a0{\u00a0return\u00a0504;\u00a0}\n\u00a0if\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$request_uri<\/span>\u00a0~*\u00a0\"<\/span>[+|(%20)]select[+|(%20)]<span style=\"color: #98c379; line-height: 26px;\">\")\u00a0{\u00a0return\u00a0504;\u00a0}\n\u00a0if\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$request_uri<\/span>\u00a0~*\u00a0\"<\/span>[+|(%20)]or[+|(%20)]<span style=\"color: #98c379; line-height: 26px;\">\")\u00a0{\u00a0return\u00a0504;\u00a0}\n\u00a0if\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$request_uri<\/span>\u00a0~*\u00a0\"<\/span>[+|(%20)]delete[+|(%20)]<span style=\"color: #98c379; line-height: 26px;\">\")\u00a0{\u00a0return\u00a0504;\u00a0}\n\u00a0if\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$request_uri<\/span>\u00a0~*\u00a0\"<\/span>[+|(%20)]update[+|(%20)]<span style=\"color: #98c379; line-height: 26px;\">\")\u00a0{\u00a0return\u00a0504;\u00a0}\n\u00a0if\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$request_uri<\/span>\u00a0~*\u00a0\"<\/span>[+|(%20)]insert[+|(%20)]<span style=\"color: #98c379; line-height: 26px;\">\")\u00a0{\u00a0return\u00a0504;\u00a0}\n\u00a0if\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$query_string<\/span>\u00a0~\u00a0\"<\/span>(&lt;|%3C).*script.*(&gt;|%3E)<span style=\"color: #98c379; line-height: 26px;\">\")\u00a0{\u00a0return\u00a0505;\u00a0}\n\u00a0if\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$query_string<\/span>\u00a0~\u00a0\"<\/span>GLOBALS(=|\\[|\\%[0-9A-Z]{0,2})<span style=\"color: #98c379; line-height: 26px;\">\")\u00a0{\u00a0return\u00a0505;\u00a0}\n\u00a0if\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$query_string<\/span>\u00a0~\u00a0\"<\/span>_REQUEST(=|\\[|\\%[0-9A-Z]{0,2})<span style=\"color: #98c379; line-height: 26px;\">\")\u00a0{\u00a0return\u00a0505;\u00a0}\n\u00a0if\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$query_string<\/span>\u00a0~\u00a0\"<\/span>proc\/self\/environ<span style=\"color: #98c379; line-height: 26px;\">\")\u00a0{\u00a0return\u00a0505;\u00a0}\n\u00a0if\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$query_string<\/span>\u00a0~\u00a0\"<\/span>mosConfig_[a-zA-Z_]{1,21}(=|\\%3D)<span style=\"color: #98c379; line-height: 26px;\">\")\u00a0{\u00a0return\u00a0505;\u00a0}\n\u00a0if\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$query_string<\/span>\u00a0~\u00a0\"<\/span>base64_(en|de)code\\(.*\\)<span style=\"color: #98c379; line-height: 26px;\">\")\u00a0{\u00a0return\u00a0505;\u00a0}\n\u00a0if\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$query_string<\/span>\u00a0~\u00a0\"<\/span>[a-zA-Z0-9_]=http:\/\/<span style=\"color: #98c379; line-height: 26px;\">\")\u00a0{\u00a0return\u00a0506;\u00a0}\n\u00a0if\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$query_string<\/span>\u00a0~\u00a0\"<\/span>[a-zA-Z0-9_]=(\\.\\.\/\/?)+<span style=\"color: #98c379; line-height: 26px;\">\")\u00a0{\u00a0return\u00a0506;\u00a0}\n\u00a0if\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$query_string<\/span>\u00a0~\u00a0\"<\/span>[a-zA-Z0-9_]=\/([a-z0-9_.]\/\/?)+<span style=\"color: #98c379; line-height: 26px;\">\")\u00a0{\u00a0return\u00a0506;\u00a0}\n\u00a0if\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$query_string<\/span>\u00a0~\u00a0\"<\/span>b(ultram|unicauca|valium|viagra|vicodin|xanax|ypxaieo)b<span style=\"color: #98c379; line-height: 26px;\">\")\u00a0{\u00a0return\u00a0507;\u00a0}\n\u00a0if\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$query_string<\/span>\u00a0~\u00a0\"<\/span>b(erections|hoodia|huronriveracres|impotence|levitra|libido)b<span style=\"color: #98c379; line-height: 26px;\">\")\u00a0{return\u00a0507;\u00a0}\n\u00a0if\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$query_string<\/span>\u00a0~\u00a0\"<\/span>b(ambien|bluespill|cialis|cocaine|ejaculation|erectile)b<span style=\"color: #98c379; line-height: 26px;\">\")\u00a0{\u00a0return\u00a0507;\u00a0}\n\u00a0if\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$query_string<\/span>\u00a0~\u00a0\"<\/span>b(lipitor|phentermin|pro[sz]ac|sandyauer|tramadol|troyhamby)b<span style=\"color: #98c379; line-height: 26px;\">\")\u00a0{\u00a0return\u00a0507;\u00a0}\n\u00a0#\u8fd9\u91cc\u5927\u5bb6\u6839\u636e\u81ea\u5df1\u60c5\u51b5\u6dfb\u52a0\u5220\u51cf\u4e0a\u8ff0\u5224\u65ad\u53c2\u6570\uff0ccURL\u3001wget\u8fd9\u7c7b\u7684\u5c4f\u853d\u6709\u70b9\u513f\u6781\u7aef\u4e86\uff0c\u4f46\u8981\u201c\u5b81\u53ef\u9519\u6740\u4e00\u5343\uff0c\u4e0d\u53ef\u653e\u8fc7\u4e00\u4e2a\u201d\u3002\n\u00a0if\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$http_user_agent<\/span>\u00a0~*\u00a0YisouSpider|ApacheBench|WebBench|Jmeter|JoeDog|Havij|GetRight|TurnitinBot|GrabNet|masscan|mail2000|github|wget|curl|Java|python)\u00a0{\u00a0return\u00a0508;\u00a0}\n\u00a0#\u540c\u4e0a\uff0c\u5927\u5bb6\u6839\u636e\u81ea\u5df1\u7ad9\u70b9\u5b9e\u9645\u60c5\u51b5\u6765\u6dfb\u52a0\u5220\u51cf\u4e0b\u9762\u7684\u5c4f\u853d\u62e6\u622a\u53c2\u6570\u3002\n\u00a0if\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$http_user_agent<\/span>\u00a0~*\u00a0\"<\/span>Go-Ahead-Got-It<span style=\"color: #98c379; line-height: 26px;\">\")\u00a0{\u00a0return\u00a0508;\u00a0}\n\u00a0if\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$http_user_agent<\/span>\u00a0~*\u00a0\"<\/span>GetWeb!<span style=\"color: #98c379; line-height: 26px;\">\")\u00a0{\u00a0return\u00a0508;\u00a0}\n\u00a0if\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$http_user_agent<\/span>\u00a0~*\u00a0\"<\/span>Go!Zilla<span style=\"color: #98c379; line-height: 26px;\">\")\u00a0{\u00a0return\u00a0508;\u00a0}\n\u00a0if\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$http_user_agent<\/span>\u00a0~*\u00a0\"<\/span>Download\u00a0Demon<span style=\"color: #98c379; line-height: 26px;\">\")\u00a0{\u00a0return\u00a0508;\u00a0}\n\u00a0if\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$http_user_agent<\/span>\u00a0~*\u00a0\"<\/span>Indy\u00a0Library<span style=\"color: #98c379; line-height: 26px;\">\")\u00a0{\u00a0return\u00a0508;\u00a0}\n\u00a0if\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$http_user_agent<\/span>\u00a0~*\u00a0\"<\/span>libwww-perl<span style=\"color: #98c379; line-height: 26px;\">\")\u00a0{\u00a0return\u00a0508;\u00a0}\n\u00a0if\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$http_user_agent<\/span>\u00a0~*\u00a0\"<\/span>Nmap\u00a0Scripting\u00a0Engine<span style=\"color: #98c379; line-height: 26px;\">\")\u00a0{\u00a0return\u00a0508;\u00a0}\n\u00a0if\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$http_user_agent<\/span>\u00a0~*\u00a0\"<\/span>~17ce.com<span style=\"color: #98c379; line-height: 26px;\">\")\u00a0{\u00a0return\u00a0508;\u00a0}\n\u00a0if\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$http_user_agent<\/span>\u00a0~*\u00a0\"<\/span>WebBench*<span style=\"color: #98c379; line-height: 26px;\">\")\u00a0{\u00a0return\u00a0508;\u00a0}\n\u00a0if\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$http_user_agent<\/span>\u00a0~*\u00a0\"<\/span>spider<span style=\"color: #98c379; line-height: 26px;\">\")\u00a0{ return 508;\u00a0}\u00a0#\u8fd9\u4e2a\u4f1a\u5f71\u54cd\u56fd\u5185\u67d0\u4e9b\u641c\u7d22\u5f15\u64ce\u722c\u866b\uff0c\u6bd4\u5982\uff1a\u641c\u72d7\n\u00a0#\u62e6\u622a\u5404\u6076\u610f\u8bf7\u6c42\u7684UA\uff0c\u53ef\u4ee5\u901a\u8fc7\u5206\u6790\u7ad9\u70b9\u65e5\u5fd7\u6587\u4ef6\u6216\u8005waf\u65e5\u5fd7\u4f5c\u4e3a\u53c2\u8003\u914d\u7f6e\u3002\n\u00a0if\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$http_referer<\/span>\u00a0~*\u00a017ce.com)\u00a0{\u00a0return\u00a0509;\u00a0}\n\u00a0#\u62e6\u622a17ce.com\u7ad9\u70b9\u6d4b\u901f\u8282\u70b9\u7684\u8bf7\u6c42\uff0c\u6240\u4ee5\u660e\u6708\u4e00\u76f4\u90fd\u8bf4\u8fd9\u4e9b\u6d4b\u901f\u7f51\u7ad9\u7684\u6570\u636e\u4ec5\u4f9b\u53c2\u8003\u4e0d\u80fd\u5f53\u771f\u7684\u3002\n\u00a0if\u00a0(<span style=\"color: #d19a66; line-height: 26px;\">$http_referer<\/span>\u00a0~*\u00a0WebBench*\"<\/span>)\u00a0{\u00a0<span style=\"color: #e6c07b; line-height: 26px;\">return<\/span>\u00a0509;\u00a0}\n\u00a0<span style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u62e6\u622aWebBench\u6216\u8005\u7c7b\u4f3c\u538b\u529b\u6d4b\u8bd5\u5de5\u5177\uff0c\u5176\u4ed6\u5de5\u5177\u53ea\u9700\u8981\u66f4\u6362\u540d\u79f0\u5373\u53ef\u3002<\/span>\n<\/code><\/pre>\n<\/section>\n<section style=\"text-align: right;\"><\/section>\n<p style=\"display: none;\">\n<p>\u672c\u7bc7\u6587\u7ae0\u6765\u6e90\u4e8e\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4f5c\u8005\uff1a\u7a0b\u5e8f\u5458\u8ffd\u98ce \u7a0b\u5e8f\u5458\u8ffd\u98ce \u5fae\u4fe1\u53f7 gh_431f6fdffcb1 \u529f\u80fd\u4ecb\u7ecd \u4e13\u6ce8\u4e8e\u5206\u4eabJava\u5404\u7c7b\u5b66\u4e60\u7b14\u8bb0\u3001\u9762\u8bd5\u9898\u4ee5\u53caIT\u7c7b\u8d44\u8baf\u3002 \u53d1\u8868\u4e8e<br \/>\n\u8f6c\u8f7d\u5730\u5740\uff1ahttps:\/\/mp.weixin.qq.com\/s\/9AOOZeRxXG6_LICUpzfbig<\/p>\n","raw":"","protected":false},"excerpt":{"rendered":"<p>\u4e0a\u65b9\u84dd\u8272\u201c\u7a0b\u5e8f\u5458\u8ffd\u98ce\u201d\uff0c\u9009\u62e9\u201c\u8bbe\u4e3a\u661f\u6807\u201d \u56de\u590d\u201c\u8d44\u6599\u201d\u83b7\u53d6\u6574\u7406\u597d\u7684\u9762\u8bd5\u8d44\u6599 \u539f\u6587\uff1awww.jianshu.com\/p \/abf6f &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[3,7],"tags":[],"class_list":["post-3093","post","type-post","status-publish","format-standard","hentry","category-mysql","category-spring-boot"],"post_thumbnail_image":"","content_first_image":null,"post_medium_image_300":"","post_thumbnail_image_624":"","post_frist_image":null,"post_medium_image":"","post_large_image":"","post_full_image":"","post_all_images":[],"videoAdId":"","listAd":"0","listAdId":"","listAdEvery":6,"total_comments":0,"category_name":"MySQL","post_date":"2023-08-31","like_count":"0","praiseWord":"\u9f13\u52b1","copyright_state":"","excitationAd":"0","rewardedVideoAdId":"","detailAdId":"","detailAd":"0","enterpriseMinapp":"0","audios":[],"postImageUrl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230519082947553.jpg","avatarurls":[],"related_posts":null,"pageviews":335,"next_post_id":3087,"next_post_title":"\u4e0d\u60f3\u5f15\u5165MQ\uff1f\u4e0d\u59a8\u8bd5\u8bd5 Debezium","previous_post_id":3095,"previous_post_title":"Spring Boot \u591a\u7ebf\u7a0b\u4e8b\u52a1\u56de\u6eda\uff0c\u4e00\u4e2a\u6ce8\u89e3\u8f7b\u677e\u641e\u5b9a","_links":{"self":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/3093","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/comments?post=3093"}],"version-history":[{"count":1,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/3093\/revisions"}],"predecessor-version":[{"id":3106,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/3093\/revisions\/3106"}],"wp:attachment":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media?parent=3093"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/categories?post=3093"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/tags?post=3093"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}