hexene / LocalVPN

A packet interceptor for Android built on top of VpnService
Apache License 2.0
930 stars 367 forks source link

Original plain-text URL? #46

Closed Rich2020 closed 4 years ago

Rich2020 commented 4 years ago

Is it possible to get the plain-text URL submitted as part of a request? I'd like to be able to see (i.e. via Packet.java) not just the destination IP address and port, but the actual URL submitted (e.g. https://www.google.com).

hexene commented 4 years ago

The domain can be determined either from the HTTP Host header or from DNS packets.

Rich2020 commented 4 years ago

Thanks, but does that mean I can get this data using the LocalVPN library? Also, using the LocalVPN library, can I get the content sent and received?

hexene commented 4 years ago

LocalVPN operates at the transport layer (TCP/UDP), while what you're after is in the application layer (HTTP/DNS). You should be able to extract application layer data from backingBuffer in Packet.java. Of course an HTTP message can span multiple TCP packets, so you'll have to reassemble it yourself. There are tools that do this out of the box, like this one https://play.google.com/store/apps/details?id=app.greyshirts.sslcapture