Commit Graph

123 Commits

Author SHA1 Message Date
emanuele-f
f3bf5e282c Fix VPN marked as metered on newer Android 2022-05-18 12:30:22 +02:00
emanuele-f
51224accb6 Implement firewall status
- Ability to enable/disable the firewall at runtime
- Blocked connections stats: num blocked, last block, jump to
  connections
- In the app details, show traffic and total/blocked connections
2022-05-17 15:58:09 +02:00
emanuele-f
f456ef0365 Show message for blocked connections in the details 2022-05-01 18:33:48 +02:00
emanuele-f
ede31c61d7 Improve mitm addon control and status reporting
This fixes the addon not being stopped when a start request is
followed by a stop request in a short interval
2022-04-26 19:01:34 +02:00
emanuele-f
6854284db0 Fix export of SSLKEYLOG
The keylog export dialog now appears automatically when the capture is
stopped and PCAP dump is enabled
2022-04-26 16:32:11 +02:00
emanuele-f
f22a07f989 Catch possible SecurityException with apps filter 2022-04-19 23:36:43 +02:00
emanuele-f
da34a5529d Fix crash with TLS decryption and app filter set 2022-04-19 22:59:23 +02:00
emanuele-f
58b2da09e5 Avoid capturing the mitm-addon own traffic
This allows TLS decryption to be enabled system-wide
2022-04-19 22:38:18 +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
f8ccd99980 Simplify the payload mode preference
Turn it into a toggle which enables/disables the full payload
2022-04-12 22:54:07 +02:00
emanuele-f
d3a1ef2b05 Always show full payload with TLS decryption 2022-04-12 22:23:58 +02:00
emanuele-f
35e13d5e26 Allow inspecting connections after the capture is stopped 2022-03-26 18:39:41 +01:00
emanuele-f
35cdd7086b Add ability to display the full packet payload
- 3 modes: no payload, minimal payload (save memory), full payload
- Display payload as hexdump
- Display HTTP requests and responses as string
- Show decrypted HTTPS (requires mitm addon)
- Decode chunked encoding and gzip body
- Show websockets messages (only with TLS decryption enabled)
- An icon indicates the connections decryption status
- Easily copy the HTTP request/response from the context menu

See #107
2022-03-21 18:00:43 +01:00
emanuele-f
12727bdb24 Add ability to export the SSL/TLS master secrets
When the TLS decryption is enabled, it's now possible to export the
SSLKEYLOGFILE to decrypt the PCAP file in Wireshark. The export only
works when the capture is running.
2022-03-08 23:47:57 +01:00
emanuele-f
1c0ea6e696 Fix TLS payload sometimes missing with mitm addon
Also report the TLS errors in the connection details
2022-02-16 22:57:00 +01:00
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