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

Issues/considerations w/ running on Android on Chromebooks #78

Open
fat-tire opened this issue Jul 10, 2017 · 14 comments
Open

Issues/considerations w/ running on Android on Chromebooks #78

fat-tire opened this issue Jul 10, 2017 · 14 comments
Assignees

Comments

@fat-tire
Copy link
Contributor

On Chromebooks, Android can have its own bridged network interface with an IP not assigned by the router. For example, on the Chromebook Pro, Android uses br0 set at 100.115.92.1 -- and when you try to portscan behind a NAT, you see this, which unless this is ipv6 seems like way too many hosts, no?

screenshot

It does correctly detect the WAN IP and the LAN IP is correct too. I tried manually scanning 192.168.1.1 but though it said there 1024 hosts, it seemed to freeze when scanning.

Thoughts?

@ghost
Copy link

ghost commented Jul 10, 2017

@fat-tire "Chromebook Pro, Android uses br0 set at 100.115.92.1", what subnet size is this?

You said you are scanning behind NAT, can you detail that a bit more the networking setup?

What is your phone's IPv4 address and in what subnet? What subnet are you trying to scan (br0?), and what size is it? What is being NAT'd from and to here?

Also that's a "/1" since there are 2^32 (4,294,967,296) possible IPv4 addresses.

@aaronjwood
Copy link
Owner

This might be a bug but I need to get on implementing #59 for cases where automatic detection may not work (NAT).

@aaronjwood
Copy link
Owner

Yup, sounds like there'll need to be some extra work for the Chrome OS scenario https://developer.android.com/topic/arc/index.html#network

@fat-tire
Copy link
Contributor Author

So as mentioned this is a Chromebook Pro using wifi behind NAT:

wlan0 is 192.168.0.223 in this case, but br0 is 100.115.92.1, which is apparently set into the Android layer of ChromeOS. As for the subnet I'm trying scan, ideally it would be the 192.168.0.x local network-- all I've done is hit the "discover hosts" button at the bottom.

FWIW the Lan IP is listed as 192.168.0/223/0, the SSID is the correct router name. I am seeing what looks like a IPv6 WAN IP address. Hope this answers your question...

@Bartoloni
Copy link

what is the way .. (on this cases.. or when the hosts are 65500+ ) to force scanning to... max 4096 hosts for example? (just to end the scan function in a reasonable time)

@aaronjwood
Copy link
Owner

That'd have to be an extra option built in as part of #59.

@aaronjwood aaronjwood self-assigned this Nov 21, 2017
@markpitop
Copy link

I'm interested in running port authority to scan a physical network attached to the Chromebook where the wifi switched off.
When I try that I get an error "wifi not enabled" and the physical network is not scanned.
I've had a quick look and it appears this may be coded in MainActivty:getNetworkInfo.
I'd be interested in changing this behaviour (assuming I am correct). Could you help me with the initial steps or let me know what I'm doing wrong?

@aaronjwood
Copy link
Owner

aaronjwood commented Nov 7, 2018

I haven't been very active on this project for a bit, my life is a little busy right now but I'm hoping I'll have some of my extra time back next year. I started this to support ethernet but I don't have any devices with ethernet to test it. Once that's working and #59 is taken care of scanning networks over ethernet on Chromebooks should work. If you're interested you could build the code on the branch in my ethernet MR and try it out. I was looking for someone to test the ethernet stuff a while back.

@markpitop
Copy link

markpitop commented Nov 7, 2018 via email

@markpitop
Copy link

markpitop commented Nov 8, 2018 via email

@aaronjwood
Copy link
Owner

Thanks for testing this! It's a huge help. Your results are good so far, if you look in the link I posted a while back in here you'll see that Chromebooks do some natting which makes it look like you're on a /1 subnet. The fact that you're able to start a scan when on Ethernet but not wireless means the logic for detecting the network connection type is working.

@aaronjwood
Copy link
Owner

aaronjwood commented Nov 9, 2018

Chromebooks run the entire Android OS in a container, similar to Docker or LXC. This means that Android will not have direct access to the system's LAN interface. Instead, IPv4 traffic will pass through an internal layer of network address translation (NAT), and IPv6 unicast traffic will be routed through an extra hop. Outbound unicast connections from an Android app to the internet should mostly work as-is; but in general, inbound connections are blocked. Multicast or broadcast packets from Android will not be forwarded to the LAN through the firewall.

This is why my auto subnet detection breaks on Chromebooks. I'll see if I can squeeze in some work on this over the next few weeks!

@markpitop
Copy link

markpitop commented Nov 9, 2018 via email

@aaronjwood
Copy link
Owner

The external (WAN) IP should still be retrievable. If ChromeOS really runs Android inside a fully isolated container then I don't think I can get the internal (LAN) IP outside of the container. Seems like it'd be a big security hole if you could work around the network namespace that the kernel isolates you to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants