Skip to main content

Parses binary cookies from a given .binarycookies file

Project description

Github Actions Status

Binary Cookies Reader

This project provides a CLI tool to read and interpret binary cookie files. The project is based on the cookie reader written by Satishb3

Requirements

  • Python 3.8 or higher

Installation

pip install binary-cookies-parser

If you want to use the parser as CLI, it's recommended to use pipx to install the package in an isolated environment.

Usage

After installation, you can use the command-line interface to read a binary cookies file:

bcparser <path_to_binary_cookies_file>

Replace <path_to_binary_cookies_file> with the path to the binary cookie file you want to read.

Or use it in Python:

from binary_cookies_parser import load 

cookies = load("path/to/cookies.binarycookies")

Output Types

The bcparser CLI supports two output types: json (default) and ascii.

JSON Output

The json output type formats the cookies as a JSON array, making it easy to parse and manipulate programmatically.

Example usage:

bcparser path/to/cookies.binarycookies --output json

example output:

[
  {
    "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"
  }
]

ASCII Output

The ascii output type formats the cookies in a simple, line-by-line text format, making it easy to read and pipe to other command-line tools.

Example usage:

bcparser path/to/cookies.binarycookies --output ascii

Example output:

Name: session_id
Value: abc123
URL: https://example.com
Path: /
Created: 2023-10-01T12:34:56+00:00
Expires: 2023-12-31T23:59:59+00:00
Flag: Secure
----------------------------------------
Name: user_token
Value: xyz789
URL: https://example.com
Path: /account
Created: 2023-10-01T12:34:56+00:00
Expires: 2023-12-31T23:59:59+00:00
Flag: HttpOnly
----------------------------------------

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

binary_cookies_parser-1.1.1.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

binary_cookies_parser-1.1.1-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file binary_cookies_parser-1.1.1.tar.gz.

File metadata

  • Download URL: binary_cookies_parser-1.1.1.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.12.9 Linux/6.8.0-1021-azure

File hashes

Hashes for binary_cookies_parser-1.1.1.tar.gz
Algorithm Hash digest
SHA256 e0fea8acdc9f3c189ff20a70fdb4fd71df0ba527b93afa74691d7062bc178b4b
MD5 2d906d9634b6d5de7fae393634a9c395
BLAKE2b-256 93b66cdc2568dd816266a2b67fad713d2aadd5ca0d09ce23d9fa1f22022b3ebd

See more details on using hashes here.

File details

Details for the file binary_cookies_parser-1.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for binary_cookies_parser-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4dc4aa0bd2fd2adc14b2a731bf39db301bac9e4bf6163516f9dd0450940186c1
MD5 bad578a10379615bd4a32f1f76f2a9dd
BLAKE2b-256 d4b569f3fae5211b845afcafa57fcd23f5e68ebeaf04371b9401e49ec871d33f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page