https://github.com/dan1elt0m/binarycookies
Binary Cookies CLI and Python library
https://github.com/dan1elt0m/binarycookies
binary binary-cookie binary-cookies binarycookies cli cookies parser python reader
Last synced: 11 days ago
JSON representation
Binary Cookies CLI and Python library
- Host: GitHub
- URL: https://github.com/dan1elt0m/binarycookies
- Owner: dan1elt0m
- License: mit-0
- Created: 2024-07-12T11:01:42.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-11-02T17:09:44.000Z (3 months ago)
- Last Synced: 2025-11-02T19:07:36.062Z (3 months ago)
- Topics: binary, binary-cookie, binary-cookies, binarycookies, cli, cookies, parser, python, reader
- Language: Python
- Homepage: https://dan1elt0m.github.io/binarycookies/
- Size: 938 KB
- Stars: 21
- Watchers: 1
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/dan1elt0m/binary-cookies-reader/actions/workflows/test.yml)
Binary Cookies
CLI tool and Python library for reading and writing Binary Cookies.
### Documentation
For detailed documentation, please visit the [Binary Cookies Documentation](https://dan1elt0m.github.io/binarycookies/)
### Requirements
- Python >= 3.9
### Installation
```bash
pip install binarycookies
```
### CLI example:
```sh
bcparser path/to/cookies.binarycookies
```
Output:
```json
[
{
"name": "session_id",
"value": "abc123",
"url": "https://example.com",
"path": "/",
"create_datetime": "2023-10-01T12:34:56+00:00",
"expiry_datetime": "2023-12-31T23:59:59+00:00",
"flag": "Secure"
},
{
"name": "user_token",
"value": "xyz789",
"url": "https://example.com",
"path": "/account",
"create_datetime": "2023-10-01T12:34:56+00:00",
"expiry_datetime": "2023-12-31T23:59:59+00:00",
"flag": "HttpOnly"
}
]
```
#### Output formats
The CLI supports multiple output formats using the --output flag.
- `json` (default): Outputs cookies in JSON format.
- `ascii`: Outputs cookies in a human-readable ASCII format with each cookie property on a separate line.
- `netscape`: Outputs cookies in the Netscape cookie file format.
### Basic Usage Python
#### Deserialization
```python
import binarycookies
with open("path/to/cookies.binarycookies", "rb") as f:
cookies = binarycookies.load(f)
```
#### Serialization
```python
import binarycookies
cookie = {
"name": "session_id",
"value": "abc123",
"url": "https://example.com",
"path": "/",
"create_datetime": "2023-10-01T12:34:56+00:00",
"expiry_datetime": "2023-12-31T23:59:59+00:00",
"flag": "Secure"
}
with open("path/to/cookies.binarycookies", "wb") as f:
binarycookies.dump(cookie, f)
```
### Ethical Use & Responsible Handling
This project is intended for lawful, ethical use only. Typical, appropriate uses include:
- Inspecting Binary Cookies from your own devices or data you are authorized to access
- DFIR, QA, and security testing performed with explicit, written permission
- Educational/research work on datasets that are owned by you, anonymized, or publicly released for that purpose
You must not use this tool to:
- Access, extract, modify, or distribute cookies from systems or accounts you do not own or have permission to analyze
- Bypass authentication, session management, DRM, or other technical controls
- Enable tracking, stalking, doxxing, fraud, or other privacy-invasive or harmful activities
### License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
### Contributing
Contributions are welcome! If you find a bug or have a feature request, please open an issue on GitHub. Pull requests are also welcome.