Commit Graph

335 Commits

Author SHA1 Message Date
emanuele-f
06a98d3486 Add decryption status filter 2022-04-14 11:37:38 +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
ab697a186f Pass mitm args as object 2022-04-13 21:55:36 +02:00
emanuele-f
bc80a5fb44 Read timestamp from the mitm plugin, fix warnings 2022-04-13 18:49:54 +02:00
emanuele-f
64900d5f59 Improve payload visualization
- The "jump to reply" button is only shown for non-consecutive items
- Removed extra space when paginated
2022-04-13 18:01:28 +02:00
emanuele-f
710cd7b471 Fix content-length header not used 2022-04-12 23:16:47 +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
cfb3e5aac3 Fix pcap dialog not appearing when started on boot 2022-04-12 19:07:33 +02:00
emanuele-f
507b9861e0 Fix corrupt PCAP file on Android 10+ with overwrite
Due to a subtle change in Android 10, the ContentResolver default mode
does not truncate files anymore, which causes corrupt PCAP files to be
generated when overwriting an existing file with greater size.

Issue: https://issuetracker.google.com/issues/180526528
2022-04-11 17:50:07 +02:00
emanuele-f
00c4d08deb Add HTTP scroll to request/reply button 2022-04-11 12:58:28 +02:00
emanuele-f
64721ea64c Join HTTP request and reponse tabs 2022-04-11 11:52:49 +02:00
emanuele-f
1895b0198b Split long payload into pages to avoid UI freezes
Rendering long text in TextViews makes the UI freeze. The payload is now
paginated so that only the currently shown portion is shown in
TextViews.
2022-03-30 12:31:58 +02:00
emanuele-f
7c6798d52e Fix wrong connection ID returned on rollover
ON rollover, an invalid connection ID was returned, causing the
connection details of another connection to be shown.
2022-03-29 14:31:25 +02:00
emanuele-f
4f969c9e13 Fix possible null dereference 2022-03-26 23:29:26 +01:00
emanuele-f
32b71fef6f Add support for deflate and brotli content encodings 2022-03-26 23:20:33 +01:00
emanuele-f
ab4ac8f272 Make payload items collapsible
Showing long payloads can make the UI freeze
2022-03-26 22:26:58 +01:00
emanuele-f
f4e8e3b62f Show status message if decryption/proxy is enabled 2022-03-26 19:05:32 +01:00
emanuele-f
caca592999 Disable PCAP dump by default
This is a safer setting for non technical people
2022-03-26 18:49:52 +01:00
emanuele-f
35e13d5e26 Allow inspecting connections after the capture is stopped 2022-03-26 18:39:41 +01:00
emanuele-f
771ffbe6f3 Allow capture start by tapping "Ready" 2022-03-26 18:38:42 +01:00
emanuele-f
fd4516f717 Disable upstream cert verification with TLS decryption 2022-03-26 12:47:26 +01:00
emanuele-f
fd5330786e Fix bad orange open lock icon 2022-03-24 22:03:46 +01:00
emanuele-f
fe26eccf19 Fix crash with TLS decryption when viewing a connection
The connection was serialized before starting the ConnectionDetailsActivity,
which sometimes caused a ConcurrentModificationException. Serialization
was not necessary and has been removed.
2022-03-24 21:57:44 +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
0482b066f4 Use the stop command before starting the mitm addon 2022-02-17 12:33:58 +01:00
emanuele-f
0ea7574b41 Add mitm addon version check 2022-02-16 23:51:04 +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
bfa8a1243d Fix capture termination with the mitm addon 2022-02-16 15:18:30 +01:00
emanuele-f
61330c4fb4 Ability to install the CA certificate via Intent
This works before Android 11. If the installation fails, fall back to
export
2022-02-16 15:10:13 +01:00
emanuele-f
9d5660f2f9 Add mitm addon install link 2022-02-15 19:56:53 +01:00
emanuele-f
00984fc224 Certificate export now uses the MitmService API 2022-02-15 19:02:54 +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
695af4889e Merge branch 'master' into dev 2022-02-09 22:42:49 +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
955f36b881 Fix start/stop icons appearance when disabled 2022-02-09 22:07:02 +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
558e20aef0 Remove the CSV header from translated strings 2022-02-06 11:53: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
f5e0fbd417 Improve HTTP server termination
This prevents synchronization issues on clients not ReadyForData
2022-02-03 11:56:33 +01:00
emanuele-f
18ffc2c374 Fix memory leak in HTTP server mode
When a client stopped the PCAP download, the isCloseConnection did not
detect the close. As a result, the PCAP dump would still be enqueued to
the ChunkedInputStream, causing the memory allocation to raise and never
be free.

Since NanoHTTPD does not seem to provide a way to detect connection close
and since it is not actively maintained, the HTTP server has been
replaced with an ad-hoc implementation which provides the minimal
features PCAPdroid needs to export the PCAP over HTTP.
2022-02-01 17:40:23 +01:00
emanuele-f
987839858d Fix crash on stop with no dump after 672e810 2022-01-29 11:55:21 +01:00
emanuele-f
9052bd8f5f Return the PCAPdroid version in get_status 2022-01-28 18:29:37 +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
41f76486b4 Add requirePreference 2022-01-21 11:36:50 +01:00
emanuele-f
3364a4946e Fix SecurityException with PCAP file dump on Android TV
When no file manager was available, takePersistableUriPermission
was called without an Intent (and the corresponding
FLAG_GRANT_PERSISTABLE_URI_PERMISSION flag), causing a
SecurityException.

Fixes #176
2022-01-21 00:17:14 +01:00