🐛 逻辑判断问题修复
🐛 逻辑判断问题修复
This commit is contained in:
commit
7735280f71
@ -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,9 +71,8 @@ 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:
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user