fritap
Simplifying SSL/TLS traffic analysis for researchers by making SSL decryption effortless.
Science Score: 67.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 5 DOI reference(s) in README -
○Academic publication links
-
✓Committers with academic emails
6 of 14 committers (42.9%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.3%) to scientific vocabulary
Keywords
Repository
Simplifying SSL/TLS traffic analysis for researchers by making SSL decryption effortless.
Basic Info
- Host: GitHub
- Owner: fkie-cad
- License: gpl-3.0
- Language: JavaScript
- Default Branch: main
- Homepage: https://fkie-cad.github.io/friTap/
- Size: 32.4 MB
Statistics
- Stars: 385
- Watchers: 11
- Forks: 37
- Open Issues: 6
- Releases: 31
Topics
Metadata Files
README.md
Real-time key extraction and traffic decryption for security researchfriTap
friTap is a powerful tool designed to assist researchers in analyzing network traffic encapsulated in SSL/TLS. With its ability to automate key extraction, friTap is especially valuable when dealing with malware analysis or investigating privacy issues in applications. By simplifying the process of decrypting and inspecting encrypted traffic, friTap empowers researchers to uncover critical insights with ease.
Key features include seamless support for automated SSL/TLS key extraction, making it an ideal choice for scenarios requiring rapid and accurate traffic analysis. Whether you’re dissecting malicious network behavior or assessing data privacy compliance, friTap streamlines your workflow.
For more details, explore the OSDFCon webinar slides or check out our blog post.
This project was inspired by SSL_Logger and currently supports all major operating systems (Linux, Windows, Android). More platforms and libraries will be added in future releases.
Key Features
The main features of friTap are:
- TLS key extraction in real time (
-k key.log) - Decryption of TLS payload as PCAP in real time (
-p plaintext.pcap) - Library analysis and debugging (
--list-libraries) - Integration with Python. Learn more
- Support for custom Frida scripts. Details
- Support of most common SSL libraries (OpenSSL, BoringSSL, NSS, GnuTLS, etc.)
Installation
Installation is simply a matter of pip3 install fritap. This will give you the fritap command. You can update an existing fritap installation with pip3 install --upgrade fritap.
Usage
On Linux/Windows/MacOS we can easily attach to a process by entering its name or its PID:
bash
$ sudo fritap --pcap mycapture.pcap thunderbird
For mobile applications we just have to add the -m parameter to indicate that we are now attaching (or spawning) an Android or iOS app:
bash
$ fritap -m -k keys.log com.example.app
Further ensure that the frida-server is running on the Android/iOS device.
Remember when working with the pip installation you have to invoke the fritap command with sudo a little bit different. Either as module:
bash
$ sudo -E python3 -m friTap.friTap --pcap mycapture.pcap thunderbird
or directly invoking the script:
```bash
$ which friTap
/home/daniel/.local/bin/friTap
$ sudo -E /home/daniel/.local/bin/friTap ```
friTap can also be used as a Python library within your project:
python
from friTap import SSL_Logger
For more details on integrating friTap into your Python project, check out the INTEGRATION.md guide.
friTap allows you to enhance its functionality by providing a custom Frida script during your session. This custom script will be invoked just before friTap applies its own hooks. To do so, use the -c parameter (more).
More examples on using friTap can be found in the USAGE.md. A detailed introduction using friTap on Android is under EXAMPLE.md as well.
Hooking Libraries Without Symbols
In certain scenarios, the library we want to hook offers no symbols or is statically linked with other libraries, making it challenging to directly hook functions. For example Cronet (libcronet.so) and Flutter (libflutter.so) are often statically linked with BoringSSL.
Despite the absence of symbols, we can still use friTap for parsing and hooking.
Hooking by Byte Patterns
To solve this, we can use friTap with byte patterns to hook the desired functions. You can provide friTap with a JSON file that contains byte patterns for hooking specific functions, based on architecture and platform using the --patterns <byte-pattern-file.json> option.
In order to apply the apprioate hooks for the various byte patterns we distinguish between different hooking categories.
These categories include:
- Dump-Keys
- Install-Key-Log-Callback
- KeyLogCallback-Function
- SSL_Read
- SSL_Write
Each category has a primary and fallback byte pattern, allowing flexibility when the primary pattern fails. For libraries like BoringSSL, where TLS functionality is often statically linked into other binaries, we developed a tool called BoringSecretHunter. This tool automatically identifies the necessary byte patterns to hook BoringSSL by byte-pattern matching. BoringSecretHunter is available as a Docker container with pre-configured Ghidra environment:
```bash
Create directories and copy target libraries
mkdir -p binary results cp /path/to/libflutter.so binary/
Run BoringSecretHunter
docker run --rm -v "$(pwd)/binary":/usr/local/src/binaries -v "$(pwd)/results":/host_output boringsecrethunter
Use generated patterns with friTap
fritap --patterns results/libflutter.sopatterns.json -k keys.log targetapp ```
More about the different hooking categories can be found in usage of byte-patterns in friTap.
Hooking by Offsets
Alternatively, you can use the --offsets <offset-file.json> option to hook functions using known offsets. friTap allows you to specify user-defined offsets (relative to the base address of the targeting SSL/socket library) or absolute virtual addresses for function resolution. This is done through a JSON file, which is passed using the --offsets parameter.
If the --offsets parameter is used, friTap will only overwrite the function addresses specified in the JSON file. For functions that are not specified, friTap will attempt to detect the addresses automatically (using symbols).
Problems
The absence of traffic or incomplete traffic capture in the resulting pcap file (-p
Default Socket Information
There might be instances where friTap fails to retrieve socket information. In such scenarios, running friTap with default socket information (--enable_default_fd) could resolve the issue. This approach utilizes default socket information (127.0.0.1:1234 to 127.0.0.1:2345) for all traffic when the file descriptor (FD) cannot be used to obtain socket details:
bash
fritap -m --enable_default_fd -p plaintext.pcap com.example.app
Handling Subprocess Traffic
Traffic originating from a subprocess could be another contributing factor. To capture this traffic, friTap can leverage Frida's spawn gating feature, which intercepts newly spawned processes using the --enable_spawn_gating parameter:
bash
fritap -m -p log.pcap --enable_spawn_gating com.example.app
Library Support exist only for Key Extraction
In cases where the target library solely supports key extraction (cf. the table below), you can utilize the -k <key.log> parameter alongside full packet capture:
bash
fritap -m -p log.pcap --full_capture -k keys.log com.example.app
Seeking Further Assistance
If these approaches do not address your issue, please create a detailed issue report to aid in troubleshooting. To facilitate a more effective diagnosis, include the following information in your report:
- The operating system and its version
- The specific application encountering the issue or a comparable application that exhibits similar problems
- The output from executing friTap with the specified parameters, augmented with friTap's debug output:
bash fritap -do -v com.example.app
Supported SSL/TLS implementations and corresponding logging capabilities
markdown
| Library | Linux | Windows | MacOSX | Android | iOS |
|---------------------------|---------------|---------------|----------|----------|--------------|
| OpenSSL | Full | R/W-Hook only | TBI | Full | TBI |
| BoringSSL | Full | R/W-Hook only | KeyEo | Full | KeyEo |
| NSS | Full | R/W-Hook only | TBI | TBA | TBI |
| GnuTLS | R/W-Hook only | R/W-Hook only | TBI | Full | TBI |
| WolfSSL | R/W-Hook only | R/W-Hook only | TBI | Full | TBI |
| MbedTLS | R/W-Hook only | R/W-Hook only | TBI | Full | TBI |
| Bouncycastle/Spongycastle | TBA | TBA | TBA | Full | TBA |
| Conscrypt | TBA | TBA | TBA | Full | TBA |
| S2n-tls | Full | LibNO | TBA | Full | LibNO |
| RusTLS | KeyEo | TBI | TBI | KeyEo | TBI |
R/W-Hook only = Logging data sent and received by process
KeyEo = Only the keying material can be extracted
Full = Logging data send and received by process + Logging keys used for secure connection
TBA = To be answered
TBI = To be implemented
LibNO = This library is not supported for this plattform
We verified the Windows implementations only for Windows 10
Dependencies
- frida (
>= 17) >= python3.7- click (
python3 -m pip install click) - hexdump (
python3 -m pip install hexdump) - scapy (
python3 -m pip install scapy) - watchdog (
python3 -m pip install watchdog) - importlib.resources (
python3 -m pip install importlib-resources) - AndroidFridaManager (
python3 -m pip install AndroidFridaManager) - for hooking on Android ensure that the
adb-command is in your PATH
Planned features
- [ ] add the capability to alter the decrypted payload
- integration with https://github.com/mitmproxy/mitmproxy
- integration with http://portswigger.net/burp/
- [ ] add wine support
- [x]
add Flutter support - [ ] add further libraries (have a look at this Wikipedia entry):
- Botan (BSD license, Jack Lloyd)
- LibreSSL (OpenBSD)
- Cryptlib (Peter Gutmann)
- JSSE (Java Secure Socket Extension, Oracle)
- MatrixSSL
- ...
- [x]
Working with static linked libraries - [x]
Add feature to prototype TLS-Read/Write/SSLKEY functions - [ ] improve iOS/MacOS support (currently under development)
Development
Quick Development Setup
For developers who want to contribute to friTap, we provide an automated setup:
```bash
Clone and setup development environment
git clone https://github.com/fkie-cad/friTap.git cd friTap
Automated setup (recommended)
python setup_dev.py
Manual setup
pip install -r requirements-dev.txt pip install -e . npm install # For TypeScript agent compilation ```
Testing
friTap includes a comprehensive testing framework:
```bash
Run all fast tests
python run_tests.py --fast
Run specific test categories
python runtests.py unit # Unit tests
python runtests.py agent # Agent compilation tests
python run_tests.py integration # Mock integration tests
Generate coverage report
python run_tests.py coverage ```
Development Dependencies
- Python 3.7+ with development dependencies (
requirements-dev.txt) - Node.js 16+ for TypeScript agent compilation
- Testing framework: pytest with comprehensive mocking
- Code quality: black, flake8, mypy, pre-commit hooks
See DEVELOPMENT.md for detailed development setup and testing guide.
Contribute
Contributions are always welcome. Just fork it and open a pull request! More details can be found in the CONTRIBUTION.md.
Changelog
See the wiki for release notes.
How to Cite friTap
If you use friTap in your research, please cite the following paper:
Daniel Baier, Alexander Basse, Jan-Niclas Hilgert, Martin Lambertz
TLS key material identification and extraction in memory: current state and future challenges
Forensic Science International: Digital Investigation, Volume 49, 2024, 301766.
https://doi.org/10.1016/j.fsidi.2024.301766
📄 BibTeX
bibtex
@article{baier2024tls,
title={TLS key material identification and extraction in memory: current state and future challenges},
author={Baier, Daniel and Basse, Alexander and Hilgert, Jan-Niclas and Lambertz, Martin},
journal={Forensic Science International: Digital Investigation},
volume={49},
pages={301766},
year={2024},
publisher={Elsevier},
doi={10.1016/j.fsidi.2024.301766}
}
Alternatively, you can find a citation file in CITATION.cff or use the “Cite this repository” button on GitHub.
Support
If you have any suggestions, or bug reports, please create an issue in the Issue Tracker.
In case you have any questions or other problems, feel free to send an email to:
Owner
- Name: FKIE-CAD
- Login: fkie-cad
- Kind: organization
- Repositories: 114
- Profile: https://github.com/fkie-cad
Citation (CITATION.cff)
cff-version: 1.2.0
message: "If you use friTap, please cite the following:"
authors:
- family-names: Baier
given-names: Daniel
- family-names: Lengersdorff
given-names: Julian
- family-names: Ufer
given-names: Max Jens
title: "friTap: Real-time key extraction and traffic decryption for security research"
version: "1.3.5.4"
date-released: "2020-06-26"
url: "https://github.com/fkie-cad/friTap"
preferred-citation:
type: software
authors:
- family-names: Baier
given-names: Daniel
- family-names: Lengersdorff
given-names: Julian
- family-names: Ufer
given-names: Max Jens
title: "friTap: Real-time key extraction and traffic decryption for security research"
version: "1.3.5.4"
url: "https://github.com/fkie-cad/friTap"
date-released: "2020-06-26"
GitHub Events
Total
- Create event: 19
- Issues event: 28
- Release event: 13
- Watch event: 98
- Delete event: 2
- Member event: 2
- Issue comment event: 76
- Push event: 93
- Pull request event: 9
- Fork event: 8
Last Year
- Create event: 19
- Issues event: 28
- Release event: 13
- Watch event: 98
- Delete event: 2
- Member event: 2
- Issue comment event: 76
- Push event: 93
- Pull request event: 9
- Fork event: 8
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Max Ufer | m****r@l****e | 185 |
| Daniel Baier | a****n@r****m | 156 |
| Francois Egner | f****r@f****e | 58 |
| daniel baier | b****d@c****e | 47 |
| lengersdorffj0 | s****g@u****e | 44 |
| Francois Egner | m****l@f****e | 24 |
| baierd | d****r@f****e | 13 |
| lengersdorffj0 | s****g@u****e | 8 |
| Julian Lengersdorff | j****f@F****e | 2 |
| 0xhakeem | 0****m@g****m | 1 |
| Raphael Tomé Santana | r****3@g****m | 1 |
| THouriezPEReN | 7****N | 1 |
| eyJhb | e****b@g****m | 1 |
| Mathis Hesse | m****e@b****i | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 4 months ago
All Time
- Total issues: 40
- Total pull requests: 13
- Average time to close issues: 4 months
- Average time to close pull requests: 7 days
- Total issue authors: 32
- Total pull request authors: 7
- Average comments per issue: 3.65
- Average comments per pull request: 0.15
- Merged pull requests: 11
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 15
- Pull requests: 8
- Average time to close issues: 8 days
- Average time to close pull requests: about 12 hours
- Issue authors: 12
- Pull request authors: 2
- Average comments per issue: 3.47
- Average comments per pull request: 0.0
- Merged pull requests: 6
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- lilili87222 (3)
- yoshimo (3)
- SinghSek (2)
- Aniketh01 (2)
- thecoder8324 (2)
- techware01 (2)
- josemariafr-upm (1)
- dreyes15 (1)
- AlreadyNobody (1)
- freako89 (1)
- milahu (1)
- tomy1989 (1)
- Burkino (1)
- guixxx (1)
- Hamz-a (1)
Pull Request Authors
- Julian-Lengersdorff (7)
- 0xhakeem (2)
- raphaelts3 (2)
- feedthedogs (2)
- daMatz (1)
- THouriezPEReN (1)
- eyJhb (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 3
-
Total downloads:
- pypi 1,187 last-month
-
Total dependent packages: 0
(may contain duplicates) -
Total dependent repositories: 0
(may contain duplicates) - Total versions: 115
- Total maintainers: 1
proxy.golang.org: github.com/fkie-cad/fritap
- Documentation: https://pkg.go.dev/github.com/fkie-cad/fritap#section-documentation
- License: gpl-3.0
-
Latest release: v1.1.0
published over 2 years ago
Rankings
proxy.golang.org: github.com/fkie-cad/friTap
- Documentation: https://pkg.go.dev/github.com/fkie-cad/friTap#section-documentation
- License: gpl-3.0
-
Latest release: v1.1.0
published over 2 years ago
Rankings
pypi.org: fritap
Simplifying SSL/TLS traffic analysis for researchers by making SSL/TLS decryption effortless. Decrypts and logs a process's SSL/TLS traffic on all major platforms. Further it allows the SSL/TLS key extraction.
- Homepage: https://github.com/fkie-cad/friTap
- Documentation: https://fritap.readthedocs.io/
- License: GPL v3
-
Latest release: 1.0.4
published about 3 years ago
Rankings
Maintainers (1)
Dependencies
- androidx.appcompat:appcompat 1.1.0 implementation
- androidx.constraintlayout:constraintlayout 1.1.3 implementation
- androidx.core:core-ktx 1.1.0 implementation
- androidx.lifecycle:lifecycle-viewmodel-ktx 2.2.0 implementation
- com.google.android.gms:play-services-safetynet 17.0.0 implementation
- com.madgag.spongycastle:bctls-jdk15on 1.58.0.0 implementation
- com.madgag.spongycastle:core 1.58.0.0 implementation
- com.madgag.spongycastle:pg 1.54.0.0 implementation
- com.madgag.spongycastle:pkix 1.54.0.0 implementation
- com.madgag.spongycastle:prov 1.58.0.0 implementation
- org.jetbrains.kotlin:kotlin-stdlib $kotlin_version implementation
- junit:junit 4.12 testImplementation
- org.junit.jupiter:junit-jupiter-api 5.3.1 testImplementation
- org.junit.jupiter:junit-jupiter-engine 5.3.1 testRuntimeOnly
- org.jetbrains.kotlin:kotlin-stdlib-jdk7 $kotlin_version implementation
- async 2.5.0
- boolean_selector 2.1.0
- characters 1.1.0
- charcode 1.2.0
- clock 1.1.0
- collection 1.15.0
- cupertino_icons 1.0.2
- english_words 3.1.5
- fake_async 1.2.0
- flutter 0.0.0
- flutter_test 0.0.0
- http 0.12.2
- http_parser 3.1.4
- matcher 0.12.10
- meta 1.3.0
- path 1.8.0
- pedantic 1.11.0
- sky_engine 0.0.99
- source_span 1.8.0
- stack_trace 1.10.0
- stream_channel 2.1.0
- string_scanner 1.1.0
- term_glyph 1.2.0
- test_api 0.2.19
- typed_data 1.3.0
- vector_math 2.1.0
- flutter_test --- !ruby/hash:ActiveSupport::HashWithIndifferentAccess sdk: flutter development
- cupertino_icons ^1.0.2
- english_words ^3.1.5
- flutter --- !ruby/hash:ActiveSupport::HashWithIndifferentAccess sdk: flutter
- http ^0.12.0+2
- ubuntu 20.04 build
- ubuntu latest build
- @types/frida-gum ^18 development
- @types/node ^18 development
- frida-compile ^10.2.4 development
- frida-fs ^5.2.1
- util ^0.12.4
- @frida/assert 3.0.2 development
- @frida/base64-js 2.0.3 development
- @frida/buffer 7.0.4 development
- @frida/crosspath 3.0.0 development
- @frida/diagnostics_channel 1.0.0 development
- @frida/events 4.0.4 development
- @frida/http 4.0.2 development
- @frida/http-parser-js 1.0.0 development
- @frida/https 1.0.0 development
- @frida/ieee754 2.0.2 development
- @frida/net 4.0.1 development
- @frida/os 1.0.2 development
- @frida/path 2.0.3 development
- @frida/process 1.2.1 development
- @frida/punycode 3.0.0 development
- @frida/querystring 1.0.0 development
- @frida/readable-stream 4.1.3 development
- @frida/reserved-words 1.0.0 development
- @frida/stream 1.0.2 development
- @frida/string_decoder 2.0.0 development
- @frida/terser 1.0.0 development
- @frida/timers 3.0.0 development
- @frida/tty 1.0.0 development
- @frida/url 1.0.2 development
- @frida/util 1.0.3 development
- @frida/vm 2.0.0 development
- @jridgewell/gen-mapping 0.3.2 development
- @jridgewell/resolve-uri 3.1.0 development
- @jridgewell/set-array 1.1.2 development
- @jridgewell/source-map 0.3.2 development
- @jridgewell/sourcemap-codec 1.4.14 development
- @jridgewell/trace-mapping 0.3.16 development
- @types/frida-gum 18.2.0 development
- @types/node 17.0.45 development
- @types/node 18.8.4 development
- acorn 8.8.0 development
- base64-js 1.5.1 development
- buffer-from 1.1.2 development
- commander 2.20.3 development
- commander 9.4.1 development
- frida-compile 16.1.3 development
- http-parser-js 0.5.8 development
- ieee754 1.2.1 development
- rxjs 7.5.7 development
- source-map 0.6.1 development
- source-map-support 0.5.21 development
- tslib 2.4.0 development
- typed-emitter 2.1.0 development
- available-typed-arrays 1.0.5
- call-bind 1.0.2
- define-properties 1.1.4
- es-abstract 1.20.4
- es-to-primitive 1.2.1
- for-each 0.3.3
- frida-fs 5.2.1
- function-bind 1.1.1
- function.prototype.name 1.1.5
- functions-have-names 1.2.3
- get-intrinsic 1.1.3
- get-symbol-description 1.0.0
- has 1.0.3
- has-bigints 1.0.2
- has-property-descriptors 1.0.0
- has-symbols 1.0.3
- has-tostringtag 1.0.0
- inherits 2.0.4
- internal-slot 1.0.3
- is-arguments 1.1.1
- is-bigint 1.0.4
- is-boolean-object 1.1.2
- is-callable 1.2.7
- is-date-object 1.0.5
- is-generator-function 1.0.10
- is-negative-zero 2.0.2
- is-number-object 1.0.7
- is-regex 1.1.4
- is-shared-array-buffer 1.0.2
- is-string 1.0.7
- is-symbol 1.0.4
- is-typed-array 1.1.9
- is-weakref 1.0.2
- object-inspect 1.12.2
- object-keys 1.1.1
- object.assign 4.1.4
- regexp.prototype.flags 1.4.3
- safe-buffer 5.2.1
- safe-regex-test 1.0.0
- side-channel 1.0.4
- string.prototype.trimend 1.0.5
- string.prototype.trimstart 1.0.5
- unbox-primitive 1.0.2
- util 0.12.4
- which-boxed-primitive 1.0.2
- which-typed-array 1.1.8
- @types/frida-gum ^18 development
- @types/node ^18 development
- frida-compile ^16 development
- frida-fs ^5.2.1
- util ^0.12.4
- frida >=15.0.0
- frida-tools >=10.0.0
- hexdump *
- scapy *