🐛 逻辑判断问题修复

This commit is contained in:
ronger 2024-01-11 15:55:49 +08:00
parent c85686e3db
commit 893de3f1a6

View File

@ -23,7 +23,7 @@ public class SSRFUtil {
// 获取域名并转为小写 // 获取域名并转为小写
String host = url.getHost().toLowerCase(); String host = url.getHost().toLowerCase();
// 禁止内网 IP // 禁止内网 IP
if (!internalIp(host)) { if (internalIp(host)) {
return false; return false;
} }
if (checkWhiteList) { if (checkWhiteList) {
@ -38,7 +38,7 @@ public class SSRFUtil {
} }
public static void main(String[] args) throws MalformedURLException { public static void main(String[] args) throws MalformedURLException {
URL url = new URL("http://192.168.0.1"); URL url = new URL("http://127.0.0.1:8080");
boolean b = checkUrl(url, false); boolean b = checkUrl(url, false);
System.out.println(b); System.out.println(b);
} }
@ -71,8 +71,7 @@ public class SSRFUtil {
return true; return true;
} }
case SECTION_5: case SECTION_5:
switch (b1) { if (b1 == SECTION_6) {
case SECTION_6:
return true; return true;
} }
default: default: