Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSRF的isIntranet好像有点问题 #9

Closed
u21h2 opened this issue Nov 23, 2022 · 2 comments
Closed

SSRF的isIntranet好像有点问题 #9

u21h2 opened this issue Nov 23, 2022 · 2 comments

Comments

@u21h2
Copy link

u21h2 commented Nov 23, 2022

public static boolean isIntranet(String url) {
        Pattern reg = Pattern.compile("^(127\\.0\\.0\\.1)|(localhost)|(10\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})|(172\\.((1[6-9])|(2\\d)|(3[01]))\\.\\d{1,3}\\.\\d{1,3})|(192\\.168\\.\\d{1,3}\\.\\d{1,3})$");
        Matcher match = reg.matcher(url);
        boolean a = match.find();
        return a;
    }

127.0.0.1匹配不到?
同时也可以ip地址转换绕过 比如127.1 或者十进制 十六进制

@j3ers3
Copy link
Owner

j3ers3 commented Nov 23, 2022

isIntranet方法只作判断内网ip,关于进制绕过下版本会更新

@u21h2
Copy link
Author

u21h2 commented Nov 23, 2022

好的 辛苦

@u21h2 u21h2 closed this as completed Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants