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

TCP隧道+nginx反代时如何获取真实IP #38

Closed
UntaggedRui opened this issue Dec 18, 2022 · 2 comments
Closed

TCP隧道+nginx反代时如何获取真实IP #38

UntaggedRui opened this issue Dec 18, 2022 · 2 comments

Comments

@UntaggedRui
Copy link

原因:使用nps将公网服务器的9000端口转发到内网的远程桌面。但是运行一段时间后就会发现有一个IP再不断的爆破这个900端口,参考大量的非法url 攻击的方式,想尝试在nps外面加nginx,在nginx里面使用allow和deny来对IP进行处理。我的配置目前如下,

stream{
    upstream windows{
        hash $remote_addr consistent;
        server 	127.0.0.1:9000 max_fails=3 fail_timeout=10s;
    }
    server{
        listen 8000;
        proxy_connect_timeout 20s;
        proxy_timeout 5m;
        proxy_pass windows;
    }
}

但是这样在npc客户端中显示的访问ip永远都是127.0.0.1,假如再次有非法IP爆破端口我无法知道他的真实ip。
问题:如果使用nginx的反代方式,如何知道爆破方的真实IP?
或者nps有什么方法可以限制或者允许指定IP吗?(因为使用的人较复杂,所以只通过一个IP或者一个IP cidr无法满足要求,需要支持多个IP cidr的设置)

@yisier
Copy link
Owner

yisier commented Dec 19, 2022

v0.26.12.1

新增:在管理面板中新增客户端时,可以配置多个黑名单IP,用于防止被肉鸡扫描端口或被恶意攻击。

@UntaggedRui
Copy link
Author

感谢

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