Skip to main content

AIGC: ContentProducer: Minimax Agent AI ContentPropagator: Minimax Agent AI Label: AIGC ProduceID: "00000000000000000000000000000000" PropagateID: "00000000000000000000000000000000" ReservedCode1: 3046022100d8fb03d49d8e140463d02bdb2868a07042019b5763856eab2ec45d3a938aaadf022100dae825f35c40395a84c126ece91eeb231eccf541aa37e69835147b20a35e942c ReservedCode2: 30440220794e4825772a93181d23db0dd5c7e399586ba254a0d10f7b8c8efbdac244802c02204ee574050f659f1c9a558ce1494a4b1cb3dd390337b77f45e18d17071796e37a

rlo-detector

Detect RLO/bidi-control Unicode character abuse in filenames.

Overview

rlo-detector is a security tool that detects filenames containing Unicode bidirectional control characters. These characters can be used to create deceptive filenames that appear legitimate but contain malicious extensions or content.

For example, a file named invoice\u202Efdp.exe may appear as invoice.pdf in some user interfaces, tricking users into thinking it's a safe document.

Installation

pip install rlo-detector

Or install from source:

pip install .

Usage

Command Line

# Scan current directory
rlo-detect

# Scan specific directory
rlo-detect /path/to/scan

# Recursive scan
rlo-detect -r /path/to/scan

# Follow symlinks
rlo-detect -r --follow-symlinks /path/to/scan

# Exclude patterns
rlo-detect -r --exclude '*/.git/*' --exclude '*/node_modules/*' /path/to/scan

# JSON output
rlo-detect --json /path/to/scan

# Exit with code 1 if suspicious files found
rlo-detect --fail-on-detect /path/to/scan

Python API

from pathlib import Path
from rlo_detector import analyze_path, Finding

# Analyze a single path
finding = analyze_path(Path("invoice\u202Efdp.exe"))
if finding:
    print(f"Warning: {finding.reason}")
    print(f"Severity: {finding.severity}")
    print(f"Real extension: {finding.real_extension}")
    print(f"Apparent extension: {finding.apparent_extension}")

# Iterate over paths
from rlo_detector import iter_paths

for path in iter_paths(["/path/to/scan"], recursive=True, follow_symlinks=False, exclude=[]):
    finding = analyze_path(path)
    if finding:
        print(f"Found: {path}")

Exit Codes

  • 0: No suspicious paths found
  • 1: Suspicious paths found (only when --fail-on-detect is set)
  • 2: Runtime error

Detected Characters

The tool detects the following Unicode bidirectional control characters:

Character Name Description
\u202A LRE Left-to-Right Embedding
\u202B RLE Right-to-Left Embedding
\u202C PDF Pop Directional Formatting
\u202D LRO Left-to-Right Override
\u202E RLO Right-to-Left Override
\u2066 LRI Left-to-Right Isolate
\u2067 RLI Right-to-Left Isolate
\u2068 FSI First Strong Isolate
\u2069 PDI Pop Directional Isolate
\u200E LRM Left-to-Right Mark
\u200F RLM Right-to-Left Mark

Severity Levels

  • HIGH: The file's apparent extension differs from its real extension (definite spoofing)
  • MEDIUM: The file contains bidi control characters (potential spoofing attempt)

License

MIT License - see LICENSE file for details.

Metadata

Release files for rlo-detector 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rlo-detector 1.0.0
File Size Uploaded
rlo_detector-1.0.0.tar.gz 10.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rlo-detector 1.0.0
File Interpreter ABI Platform
rlo_detector-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.1 kB

Release files / rlo_detector-1.0.0.tar.gz

Download URL rlo_detector-1.0.0.tar.gz
Size 10.4 kB
Tags Source
SHA-256 checksum
How to use checksums
118ba74ae929e066921c1f3ca55426ff3b6ae0b4df80b22bd38e398c514a037c
BLAKE2b-256 checksum
How to use checksums
9b18132fea0e8bcb74b1f1f6607960fa91e0bd75f87831889b0c0d9580796f12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.8

Release files / rlo_detector-1.0.0-py3-none-any.whl

Download URL rlo_detector-1.0.0-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7e76434aed1f98da4dd94655758e3e01dc4bdfee20aadda0661c7696ff4b784f
BLAKE2b-256 checksum
How to use checksums
56a8c2e3db7ae05abcdfa7d4d2abcd40cfd5c76e5d3c246b75d7feed208508b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.8

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page