Commit Graph

55 Commits

Author SHA1 Message Date
emanuele-f
892731d2a2 Fix nDPI compilation warning 2023-12-10 12:44:57 +01:00
emanuele-f
6c8abf92c5 Use uid from the PCAPdroid trailer if available
When loading a PCAP file, if there is a PCAPdroid trailer available,
use its uid to associate the connections to the originating app.
Currently this assumes that the uid mapping has not changed, e.g. the
app for a specific uid has not been uninstalled.
2023-08-18 10:48:34 +02:00
emanuele-f
a947ebfc70 Fix ICMPv6 not working in VPN mode
ICMPv6 packets were dropped due to missing logic

Also affected #321
2023-05-19 12:37:20 +02:00
emanuele-f
2a22e89fef Add ability to configure port mapping
In VPN mode, it's now possible to redirect the traffic of specific
ports towards another host and port. This makes it possible to
integrate PCAPdroid with other apps, by forwarding the traffic to
a local server.

Closes #274
2022-12-12 23:48:56 +01:00
emanuele-f
3f6f32809a Fix paid features unlocking in beta builds
Paid features inherited from the official app were not properly
unlocked when the VPN was started by the Android system

Fixes #255
2022-09-09 22:10:10 +02:00
emanuele-f
88e65b5336 Fix Whatsapp video calls hang up
Fixes #254
2022-09-09 18:55:05 +02:00
emanuele-f
fd4a5a382d Fix ICMPv6 not captured with root and app filter 2022-07-23 10:29:05 +02:00
emanuele-f
fef9810118 Update submodule 2022-06-07 11:53:56 +02:00
emanuele-f
eedba8f180 Fix possible NullPointerException in sslkeyfileExportResult 2022-06-06 18:12:18 +02:00
emanuele-f
a010d5a327 Add missing union access check 2022-05-26 19:47:04 +02:00
emanuele-f
f9431746d8 Fix upload bandwidth bottleneck in VPN mode
This was caused by induced TCP retransmissions on buffer full
2022-05-26 16:16:18 +02:00
emanuele-f
528438e6de Fix export of invalid/unsupported pkts in root
This ensures that the PCAP file obtained with the root capture does not
excludes invalid/unsupported packets.

Fixes #209
2022-05-20 15:47:14 +02:00
emanuele-f
5dfe15c4d9 TLS decryption now uses SOCKS5 auth
This prevents other processes from using the proxy
2022-04-14 01:04:09 +02:00
emanuele-f
c4e23a8fb7 Fix UDP STUN compatibility
This makes p2p connections possible with some types of NAT
2022-03-26 18:06:07 +01:00
emanuele-f
8f5ed5fbb2 Fix GH worflow 2022-03-24 22:25:50 +01:00
emanuele-f
59288b583d Update to nDPI 4.2
Relevant changes:

- Reduced memory footprint
- Fix some memory issues
- Improved protocols dissection
2022-02-03 16:58:07 +01:00
emanuele-f
a59664415a Add DPI and malware detection tests 2022-01-20 20:07:13 +01:00
emanuele-f
44cda96718 Add -fPIC to zdtun 2022-01-20 14:56:57 +01:00
emanuele-f
e841cb6a52 Fix Cmake version warning 2021-12-14 22:50:26 +01:00
emanuele-f
a9b90d5ff2 Fix deprecation/warning messages
Closes #151
2021-12-14 15:13:16 +01:00
emanuele-f
a924ee5073 Remove symlinks and update dbip to 2021_12 2021-12-14 11:42:55 +01:00
emanuele-f
4855f7e4c4 Fix UAF of pd_conn_t
The UAF could be triggered with a on_connection_close followed by a
conns_clear and by a zdtun_lookup on the connection. Fixed in zdtun,
which now doesn't return closed connections.
2021-12-08 23:06:22 +01:00
emanuele-f
e3ecd253ea Fix crash after 28ff23e 2021-12-08 18:33:17 +01:00
emanuele-f
963b1072b1 Spoof DNS replies for blocked hosts
This prevents the DNS resolver from spamming multiple requests when no
reply is seen.
2021-12-08 17:17:13 +01:00
emanuele-f
28ff23e26e Host is now extracted and blocked immediately
This commit also introduces the pkt_context_t to remove the need to store a
temporary cur_pkt, reducing chance to introduce bugs in VPN mode.
2021-12-07 16:52:11 +01:00
emanuele-f
8cf67378f5 Fix crash in Android 7
The getParameterCount is only available since API level 26. Using a
patched MaxMind-DB-Reader-java to avoid crashing.

https://developer.android.com/reference/java/lang/reflect/Method#getParameterCount()

java.lang.NoSuchMethodError: No virtual method getParameterCount()I in class Ljava/lang/reflect/Constructor; or its super classes (declaration of 'java.lang.reflect.Constructor' appears in /system/framework/core-oj.jar)
 at com.maxmind.db.Decoder.decodeMapIntoObject(Decoder.java:397)
 at com.maxmind.db.Decoder.decodeMap(Decoder.java:342)
 at com.maxmind.db.Decoder.decodeByType(Decoder.java:162)
 at com.maxmind.db.Decoder.decode(Decoder.java:151)
 at com.maxmind.db.Decoder.decode(Decoder.java:76)
 at com.maxmind.db.Reader.<init>(Reader.java:133)
 at com.maxmind.db.Reader.<init>(Reader.java:90)
 at com.emanuelef.remote_capture.Geolocation.openDb(Geolocation.java:67)
2021-11-23 22:42:08 +01:00
emanuele-f
1a8522126d Update dependencies 2021-11-23 11:11:54 +01:00
emanuele-f
f29637bbe8 Add raw resources submodule 2021-11-19 18:31:04 +01:00
emanuele-f
4d0681f4d7 Revert library changes 2021-10-29 11:44:54 +02:00
emanuele-f
49117d1ecf Fix string 2021-10-29 11:16:22 +02:00
emanuele-f
1809a3d88c Update dependencies
- libpcap 1.10.1
- nDPI 4.0
- gradle, ndk, build tools
2021-10-14 19:48:16 +02:00
emanuele-f
69178a8910 Remove dependency on autotools 2021-07-28 11:19:56 +02:00
emanuele-f
bc28244e21 Rework time handling
Periodic tasks are now based on a monotonic timer. The timestamp in
the exported PCAP now corresponds to the original timestamp when using
root. Moreover, in-app first/last seen time now displays the milliseconds.

Closes #89
2021-07-06 15:54:26 +02:00
emanuele-f
51dc0dde7e Fix bogus connections with root due to fragments
Connections with random ports sometimes appeared while capturing packets
as root, in particular while exporting data via the UDP exporter. These
were actually IP fragments, whose data was misinterpreted due to the
lack of L4 headers.
2021-07-01 18:27:28 +02:00
emanuele-f
258930d110 Fix multiple issues with ICMP connections
- Fix ping to known DNS servers being blocked
- Hide port number for ICMP connections
- Fix monodirectional ICMP connnections in root mode
2021-06-30 17:31:41 +02:00
emanuele-f
50bc81e575 Show request plaintext regardless of the protocol 2021-06-03 12:27:28 +02:00
emanuele-f
e7c5227bfe Fix missing HTTP request in some cases 2021-06-02 15:34:40 +02:00
emanuele-f
c73620dc59 Rename functions 2021-06-02 12:11:18 +02:00
emanuele-f
2ff3fec947 Fix URL when an HTTP proxy is used
Also show the proxy URL in the connection details
2021-05-01 16:42:53 +02:00
emanuele-f
c2df8436ab Implement ability to capture packets as root
This requires a rooted device. It allows PCAPdroid to run with other VPN
apps.
2021-05-01 12:02:48 +02:00
emanuele-f
72949b0284 Update zdtun 2021-04-14 12:32:42 +02:00
emanuele-f
d8f153ecef Reduce MTU to avoid fragmentation 2021-04-11 17:14:02 +02:00
emanuele-f
c31c9065ec Improve TCP connections handling
- The client MSS option is now honored
- srv->cli MSS is now calculated and reported based on the IP version
- TCP window scaling is now supported
- Slow downs due to blocking TCP sends in big uploads are now fixed
2021-04-11 16:43:23 +02:00
emanuele-f
b02989598f Implement SOCKS5 proxy support
When enabled, all the TCP connections will be redirected to a SOCKS5
proxy. This also removes the need to use a customized mitmproxy to
perform the TLS decryption.
2021-04-09 10:52:25 +02:00
emanuele-f
1bb6ae3165 Fix UDP broadcast connections 2021-03-29 12:01:51 +02:00
emanuele-f
c4cc662a32 Update zdtun 2021-03-23 16:02:35 +01:00
emanuele-f
47e1d88aab Add IPv6 support
IPv6 must be manually enabled from the preferences. However, when an IPv6 gateway
is not available, the connections will fail with network unreachable.

Closes #2
2021-03-18 19:25:25 +01:00
emanuele-f
9668a1f455 Improve TCP connections handling 2021-03-11 22:42:29 +01:00
emanuele-f
5e43340002 Add ICMP support
Closes #3
2021-03-09 16:19:47 +01:00
emanuele-f
3460e27703 Unify sendCaptureStats and sendVPNStats 2021-03-01 22:11:55 +01:00