🐛 逻辑判断问题修复

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();
// 禁止内网 IP
if (!internalIp(host)) {
if (internalIp(host)) {
return false;
}
if (checkWhiteList) {
@ -38,7 +38,7 @@ public class SSRFUtil {
}
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);
System.out.println(b);
}
@ -71,8 +71,7 @@ public class SSRFUtil {
return true;
}
case SECTION_5:
switch (b1) {
case SECTION_6:
if (b1 == SECTION_6) {
return true;
}
default: