Commit Graph

108 Commits

Author SHA1 Message Date
emanuele-f
6f42015873 Initial support for built-in TLS decryption
PCAPdroid can now decrypt TLS connections and show the decrypted data
with the help of a separate mitm addon
2022-02-13 00:00:07 +01:00
emanuele-f
b4b172e540 Fix possible NULL pointer access in isRootCapture 2022-02-10 10:11:37 +01:00
emanuele-f
a9653054ef Avoid ANR when stopping the capture
The threads are now joinined in the background, avoiding to delay the main
thread. This fixes ANR while stopping the capture.

Fixes #186
2022-02-09 22:36:48 +01:00
emanuele-f
e0ccce12c9 Fix CaptureService not stopped properly
When stopping the service, only stopForeground was called, but not
stopSelf. If the process was destroyed (e.g. by swiping the app
from the recent apps), in some cases it would be restarted due to
START_STICKY, causing ForegroundServiceStartNotAllowedException in
Android 12.

Fixes #175
2022-02-09 16:26:38 +01:00
emanuele-f
c2ad297005 Initial mitmproxy plugin implementation
The pcapdroid_mitm.py plugin allows PCAPdroid to receive the decrypted data from
mitmproxy and display it into the GUI (currently limited to the HTTP request)
2022-02-06 00:27:09 +01:00
emanuele-f
7a1a0e6981 Reaching max_dump_size does not stop the capture
Now only the PCAP dump is stopped when max_dump_size is reached
2022-02-03 11:59:40 +01:00
emanuele-f
987839858d Fix crash on stop with no dump after 672e810 2022-01-29 11:55:21 +01:00
emanuele-f
672e810bec Improve capture performance with PCAP dump
PCAP dump is now performed into a separate thread. This greatly reduces
the chance for packet loss in root mode as well as preventing latency
spikes in VPN mode.
2022-01-28 18:08:37 +01:00
emanuele-f
e00870b23e New dump parameters for the Intent-based API
- snaplen: limit the size of a every packet
- max_pkts_per_flow
- max_dump_size: stop the capture when the size limit is reached
2022-01-25 15:57:38 +01:00
emanuele-f
e76499d02a Add proper support for always-on VPN
The VPN can now be started by the system when the always-on VPN is
enabled. In this case, the stop button is hidden and the previous
configuration is used.

Closes #165

Null intents (e.g. due to START_STICKY) are now handled, which prevents
ForegroundServiceStartNotAllowedException in Android 12.

Fixes #175
2022-01-20 23:12:00 +01:00
emanuele-f
9dc0e1ec83 Add redeem string 2022-01-05 17:01:38 +01:00
emanuele-f
52af258a02 Fix bad ordering of pending updates
Swapping two pending updates with new connections could cause a crash
due to non incremental connection IDs. Also fix crash in case of full
queue.
2022-01-02 22:25:34 +01:00
emanuele-f
148bfbf617 Add tests for the ConnectionsAdapter 2021-12-25 11:26:37 +01:00
emanuele-f
3fc333647b Fix whitelisted connections being blocked
The whitelist logic is now moved to the native side
2021-12-20 17:14:32 +01:00
emanuele-f
49361d05a2 Rework blocklist loading
The new ListDescriptor class now encapsulates the lists
2021-12-20 12:37:32 +01:00
emanuele-f
9140e0b236 Add ability to filter by interface in root mode
When the capture interface is set to "All Interfaces", it is now
possible to filter connections by interface. The interface is also shown
into the connection details.

Closes #163
2021-12-14 22:33:24 +01:00
emanuele-f
c079474917 Rename vpnproxy to pcapdroid 2021-12-06 16:29:37 +01:00
emanuele-f
62c84f9663 Initial firewall implementation (no-root mode)
- Block connections by IP, domain or app
- Add filter to show blocked connections
- Migrate IP matching to ndpi_ptree_t API
- IPv6 addresses now supported in blacklists
- Duplicate IP address rules now only counted once
2021-11-29 22:40:35 +01:00
emanuele-f
6c084e6d81 Add ability to receive Intent on capture stopped 2021-11-22 19:04:07 +01:00
emanuele-f
a61d8af4c1 Add malware detection warning with private DNS on 2021-11-22 16:15:23 +01:00
emanuele-f
3e522a1786 Properly handle private DNS
PCAPdroid now tracks the private DNS state. Secure DNS queries are now
only blocked when set in opportunistic mode. A notice is now shown when
PCAPdroid has no visibility on the DNS query.

Fixes #130
2021-11-22 15:38:56 +01:00
emanuele-f
ebfcea7217 Ability to manually update the blacklists
The update status is now also shown
2021-11-19 18:21:44 +01:00
emanuele-f
3366a778c6 Improve malware detection overview
- Refresh malware status and blacklists views
- Serialize blacklists info
- Improve layout
2021-11-19 18:21:44 +01:00
emanuele-f
e7b8811f23 Initial malware detection overview (wip)
- Overall status of malware detection
- Show the blacklists used, check their status
- Whitelist moved to this activity
2021-11-19 18:21:44 +01:00
emanuele-f
61a3d24993 Offload connection updates processing
Connection updates are now processed into a separate thread, reducing
the packet processing delay.
2021-11-19 18:21:44 +01:00
emanuele-f
586b26b0b6 Initial geolocation support
Needed for #106
2021-11-19 18:21:36 +01:00
emanuele-f
c54c5e06fd Add osint.digitalside.it IP blacklist 2021-10-25 11:49:12 +02:00
emanuele-f
bd18c5e195 Add ability to whitelist malicious connections
Needed for #105
2021-10-21 14:49:23 +02:00
emanuele-f
c20b56a4ac Remove apply from EditFilterActivity, add reset 2021-10-21 11:01:17 +02:00
emanuele-f
82850d5680 Implement blacklists reloading from URLs
The blacklists state is shown in the Stats activity.

Needed for #105
2021-10-20 22:02:00 +02:00
emanuele-f
cb4bbc454d Implement blacklist-based malware detection
A notification is generated when a connection matches known malicious
domains or IP addresses. The connections view reports malicious
connections with a skull icon. A filter can be set to only show them.

Needed for #105
2021-10-20 15:32:29 +02:00
emanuele-f
9c3c4ba121 Catch SecurityException to prevent crash with URI
A SecurityException occurs when the app does not have the permissions to
write the specified URI
2021-09-15 11:46:27 +02:00
emanuele-f
ca3889fab9 Improve control via Intent
- Fix app state not refreshed
- Fix VPNService.prepare not called
- Add missing pcap_uri parameter
2021-09-11 15:45:31 +02:00
emanuele-f
8181575f82 Fix wrong app filter shown when started via intents 2021-09-11 12:44:28 +02:00
emanuele-f
25f495335a Add ability to select interface in root mode
Closes #110
2021-08-25 21:48:48 +02:00
emanuele-f
1c5995e01e Implement start via intent
User permission is asked every time the intent is fired. Stopping capure
is allowed to the same app which started it without asking permission.

See #33
2021-08-20 00:58:22 +02:00
emanuele-f
4846a0b546 Add preference to toggle the PCAPdroid trailer
Closes #36
2021-07-04 15:08:08 +02:00
emanuele-f
0a935be6e4 Initial export of app info in PCAP
Initial work for #36
2021-07-02 00:45:19 +02:00
emanuele-f
9d427461cb Fix UDP exporter and HTTP dump modes with root
When exporting traffic over the network, we must exclude this traffic
from the monitoring, otherwise the traffic will be captured in a loop
2021-07-01 14:30:37 +02:00
emanuele-f
91cc995eff Refactor PCAP dump
PCAP dump now always occurs in Java
2021-07-01 11:01:15 +02:00
emanuele-f
5b50e3e8a1 Optimize JNI calls on connections updates
Connections data is now split into three groups:

- The connection identifier (e.g. 5 tuple)
- The connection statistics
- The connection L7 information (e.g. HTTP URL and request data)

With this optimization, most updates will only pass the connection
statistics throught the JNI interface. The connection identifier will
only be passed for new connections and the L7 information will only be
passed when needed (e.g. after extracting the URL).

Closes #82
2021-06-29 15:31:30 +02:00
emanuele-f
bfb1390499 Implement app details
Show information about an app, including its target SDK version,
install/update date and its requested permissions. Also add a button to
quickly open the app info/settings in android.

Closes #45
2021-06-25 14:50:38 +02:00
emanuele-f
f49c34ddec Rework whitelist
The whitelist editor is now a separate activity. Whitelist removed from
the ConnectionRegister.
2021-06-14 15:21:57 +02:00
emanuele-f
9b7675d6e2 Rename "exclusions" to "whitelist" 2021-06-14 11:15:36 +02:00
emanuele-f
a642ddbd0d Optimize connections matching 2021-06-11 21:01:17 +02:00
emanuele-f
2983be8ecf Optimize adapter ops with connections filters 2021-06-11 18:22:25 +02:00
emanuele-f
4a4886b0ed Make exclusions persistent 2021-06-09 16:52:46 +02:00
emanuele-f
0d48c1f141 Fix deprecations 2021-06-05 13:06:02 +02:00
emanuele-f
78d2e12233 Add ads placeholders 2021-06-03 11:36:06 +02:00
emanuele-f
e65ff93972 Add ability to read the root daemon log 2021-06-02 00:01:10 +02:00