Commit Graph

646 Commits

Author SHA1 Message Date
emanuele-f
e6906f3603 Remove the readme from the pcap dir
The readme must not be part of the fuzzing corpus
2022-01-30 01:13:52 +01:00
emanuele-f
8984ae6648 Boost fuzz_capture performance
Read packets without pcapd and only perform minimal DPI
2022-01-30 01:02:10 +01:00
emanuele-f
b4780b1246 Don't monitor Netlink without the @inet interface 2022-01-30 00:36:02 +01:00
emanuele-f
81cb73d70c Fix UAF in root capture with DNS replies
When a DNS reply is received, remove_connection frees the
connection data. However, a reference to the conn->tuple
was kept in the pkt_context_t, causing a use-after-free
2022-01-29 23:00:23 +01:00
emanuele-f
5d4eee8542 Add capture fuzz_capture target 2022-01-29 22:14:58 +01:00
emanuele-f
02b143aa42 Reorganize tests 2022-01-29 18:43:29 +01:00
emanuele-f
bdce2736f9 Fix possible OOB read in pcapd with invalid IPv6
Thank you fuzzer <3
2022-01-29 17:55:17 +01:00
emanuele-f
935f9218fe Only create pcapd PID in daemon mode 2022-01-29 17:34:56 +01:00
emanuele-f
c98b3b0cbe Add initial fuzzing of pcapd 2022-01-29 17:27:19 +01:00
emanuele-f
05faa403f5 Fix pcapd crash with no arguments 2022-01-29 17:24:28 +01:00
emanuele-f
4a859bee6a Tighten root parameters checks
This prevents possible injections from user provided parameters
2022-01-29 12:45:01 +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
a2d795152f Fix packets truncated with root and TSO/GRO
Packets were truncated on some devices employing offloading, in which
case the packet size was bigger than the MTU. A snaplen of 65535 fixes
this problem.

See #182
2022-01-27 14:26:59 +01:00
emanuele-f
e1bafef088 Revert "Disable TPACKET v3 to prevent packets reordering in root mode"
This reverts commit f715c06be1.

Further testing comparing the dumps produced by simultaneuosly running
PCAPdroid in non-immediate mode with tcpdump in immediate mode has
shown that packets reordering can also occur in immediate mode, so
it does not depend on TPACKET v3.
2022-01-27 11:59:54 +01:00
emanuele-f
f715c06be1 Disable TPACKET v3 to prevent packets reordering in root mode
It seems like TPACKET V3 causes packet reordering issues, where a packet
A sent before a packet B by the same host is actually seen after B in
the capture. This causes inexistent out-of-order and missing TCP segments
issues in Wireshark.

This has been verified by comparing the PCAP dump generated by PCAPdroid
in HTTP server mode with the traffic dump on the LAN, thus excluding
reordering occuring over the Internet.
2022-01-26 15:50:44 +01:00
emanuele-f
5e9be5cd8b Remove old strings 2022-01-26 10:03:47 +01:00
emanuele-f
a70f4e38f7 Implement functional tests for the new dump params 2022-01-25 22:46:08 +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
82831cae2d Provide recv stats when reading from file 2022-01-25 11:31:14 +01:00
emanuele-f
f2f765dca5 Fix root capture from "any" after 2ea1229 2022-01-25 11:28:01 +01:00
emanuele-f
59eda30056 Print total stats when pcapd terminates 2022-01-25 10:08:10 +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
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 Faranda
472b7f4a18
Update testing.md 2022-01-20 20:09:32 +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
ac9492a44b Remove install-llvm-action 2022-01-20 14:45:27 +01:00
emanuele-f
eb9e752198 Compile native tests with AddressSanitizer
This makes tests fail if memory errors or leaks are detected
2022-01-20 14:43:15 +01:00
emanuele-f
baaac465cb Possibly fix tests linker error 2022-01-20 12:52:49 +01:00
emanuele-f
8506923565 Fix tests directory 2022-01-20 12:35:16 +01:00
emanuele-f
b2e3e70e2d Add native-tests workflow 2022-01-20 12:15:43 +01:00
emanuele-f
2ea1229938 Add pcap_reader and blacklist tests
The pcap_reader can be used to test the native PCAPdroid implementation.
Native tests can be run with run_tests.sh
2022-01-20 12:05:31 +01:00
emanuele-f
32da035db9 Fix possible unaligned access 2022-01-17 19:44:57 +01:00
emanuele-f
1cc59d22f1 Decouple JNI from native code
It's now possible to build the native code without the Android
dependencies. This opens up new possibilities for debugging and testing.
2022-01-17 19:36:14 +01:00
emanuele-f
10c93d6d99 Merge branch 'dev' 2022-01-15 11:45:13 +01:00
Akihiro Nagai
d6645e74e2 Update Japanese strings 2022-01-15 11:39:31 +01:00
Emanuele Faranda
2ee36b863e
Drop support for PR-based translations
Supporting both Weblate-based and PR-based translations is a pain due to having to deal with merge conflicts, and conflicts cannot be solved in Weblate
2022-01-15 10:18:04 +00:00
Eric
443abecffd Update Chinese strings
Closes #181
2022-01-15 10:55:03 +01:00
emanuele-f
05982c52cf Add missign escapes 2022-01-15 00:59:18 +01:00
emanuele-f
0b0aa455e7 Add missing Italian strings 2022-01-15 00:55:17 +01:00
emanuele-f
9c5692b886 Update Italian strings
Use sentence-style caps and remove periods at the end of sentences
2022-01-14 23:45:52 +01:00
Allan Nordhøy
b690eaa79d Added translation using Weblate (Norwegian Bokmål)
Translation: PCAPdroid/App
Translate-URL: https://hosted.weblate.org/projects/pcapdroid/app/nb_NO/
2022-01-14 23:08:36 +01:00
Emanuele Faranda
c4de331fab
Update README.md 2022-01-14 20:10:40 +01:00
Emanuele Faranda
a78802219d
Update README.md 2022-01-14 20:09:55 +01:00
emanuele-f
fcd5f34355 Improve app strings
- Remove ending periods and exclamation marks (Material guidelines)
- Improve some apps strings (credits: @comradekingu)
- Improve labels of external projects

Closes #174
2022-01-14 19:52:10 +01:00
emanuele-f
25a1385f37 Use sentence-style caps
To follow the official Material guidelines: https://material.io/archive/guidelines/style/writing.html#writing-capitalization-punctuation
2022-01-14 19:09:30 +01:00
Emanuele Faranda
fa271ab10f
Update README.md 2022-01-14 17:38:00 +00:00