shadowsocks / shadowsocks-android

A shadowsocks client for Android
Other
35.19k stars 11.57k forks source link

NetBIOS scan on connection startup #1051

Closed felixonmars closed 7 years ago

felixonmars commented 7 years ago

Environment

Configuration

Put an x inside the [ ] that applies.

What did you do?

Click to start connection.

What did you see instead?

One or more random /24 subnet(s) inside 10.0.0.0/8 was scanned at UDP port 137 (NetBIOS). See attached screenshots for more details:

2017-01-03-143758-01f3ef

This is considered malicious activity by my server ISP: 2017-01-03-164248-54b9d5

madeye commented 7 years ago

In your settings, you didn't enable UDP forwarding. Also, the route is set to bypass LAN address. So, I don't think it's related to shadowsocks-android.

My suggestion is double checking your server, make sure no malicious software installed.

felixonmars commented 7 years ago

The screenshot was on my local subnet, and the timing of the netbios requests is highly consistent with shadowsocks-android's startup. I didn't enable UDP forwarding and set route to bypass LAN, so these requests were "leaked" to my local subnet, which is then captured.

Besides the netbios requests, there are also connections to 26.26.26.x, which is present in shadowsocks-android's source code. Since these addresses should be bound to a tun2socks interface, the leaking of the requests indicates some race conditions in place, IMHO.

madeye commented 7 years ago

Shadowsocks didn't and won't do the scanning. However, some apps would do it. For example, if you have installed any video play, file sharing or download manager apps on your Android device, they could perform port scanning like NetBIOS scanning for service discovery, e.g. scanning service of Samba/CIFS or DLNA.

When shadowsocks is connected, a new subnetwork 26.26.26.0/24 is also created. Then, a network changing broadcast will be sent to all the receivers on your Android OS. The app performing the NetBIOS scanning also received the broadcast and tries to scan services again on your private network (10.0.0.0/8 and 26.26.26.0/24), which actually causes the logs you saw.

So, if you want to keep using these apps, just make sure "bypass LAN" is enabled.

felixonmars commented 7 years ago

I see, thanks for the detailed info. I will try harder to find the real source then. Sorry for the trouble, and happy new year!