Skip to main content

Multilingual OSINT analysis in a single call: language detection, IOC extraction, entity recognition, and risk scoring.

Project description

osintlens

Multilingual OSINT analysis in a single call. Point it at a block of text — a forum post, a paste, a scraped page — and get back the language, the indicators of compromise, the named entities, and an explainable risk verdict.

import osintlens as ol

result = ol.analyze("Leaked db_pass for admin@corp.example, C2 at 45.13.2.11")

result.risk.label          # 'CRITICAL'
result.risk.confidence     # 95
result.language.code       # 'en'
result.iocs["email"]       # ['admin@corp.example']
result.iocs["ipv4"]        # ['45.13.2.11']
result.matched_keywords    # {'critical': ['db_pass', ...], 'high': ['c2'], ...}

Most OSINT tooling on PyPI does one of these things — iocextract pulls indicators, a separate library detects language, another scores risk. osintlens runs the whole triage pipeline in one call, and it does it across English, Russian, Chinese, and German text, not just English.

Install

The base install is pure Python with zero dependencies — rule-based risk scoring and IOC extraction work out of the box:

pip install osintlens

Add optional backends only when you need them:

pip install "osintlens[multilingual]"   # fine-grained langdetect + spaCy NER
pip install "osintlens[ml]"             # scikit-learn risk model
pip install "osintlens[all]"            # everything

Everything degrades gracefully. Without [multilingual], language detection falls back to a Unicode-script heuristic (still distinguishes ru/zh from Latin) and entity extraction returns an empty list — IOCs act as a dependency-free entity floor. Without [ml], risk scoring uses the rule engine. Nothing crashes because an extra is missing.

For spaCy NER you also need the language models, e.g.:

python -m spacy download en_core_web_sm

What you get back

analyze() returns an AnalysisResult:

Field Description
language code, name, confidence, supported
risk label (LOW/MEDIUM/HIGH/CRITICAL), score, confidence, backend
iocs dict of ipv4, email, url, md5, sha1, sha256, cve, btc
entities list of {text, type, start, end, language} (needs [multilingual])
matched_keywords risk keywords found, grouped by tier
text_sha256 content hash for dedup / provenance

result.to_json() serializes the whole thing.

Build a knowledge graph

Every result can emit graph-ready nodes and edges, so you can knit many documents into a shared Neo4j (or any property-graph) view — the same entity seen in two documents becomes one shared node:

graph = result.graph(document_id="post-42")
# {"nodes": [{"id": "Document"...}, {"id": "email:admin@corp.example"...}],
#  "edges": [{"from": "post-42", "to": "email:...", "type": "CONTAINS"}]}

Command line

osintlens scan report.txt                 # analyze a file, print JSON
cat paste.txt | osintlens scan -           # read stdin
osintlens scan report.txt --graph post-42  # emit graph nodes/edges
osintlens scan report.txt --ml-model risk_model.joblib

Train your own risk model

from osintlens.ml import train

train(labeled_cases, output_path="risk_model.joblib")
# labeled_cases: [{"text": ..., "entities": [...], "expected_label": "HIGH"}, ...]

The model learns over the 12-element feature vector from osintlens.featurize, so it's a drop-in replacement for the rule engine via Analyzer(ml_model_path="risk_model.joblib").

Responsible use

osintlens analyzes text you already have. It does not fetch, scrape, or route traffic, and it is intended for defensive threat intelligence, security research, and authorized OSINT. Respect the terms of service and applicable law for any source you collect from, and don't use it to profile or target private individuals.

Author

Created and maintained by muhammed shazin sadhik kunhi parambath.

License

MIT

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

osintlens-0.1.0.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

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

osintlens-0.1.0-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file osintlens-0.1.0.tar.gz.

File metadata

  • Download URL: osintlens-0.1.0.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for osintlens-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1d6ea04de60b6e5fb7c60f13b5c0b910f097931e328ed45fae1ec1e327b22d27
MD5 dae3f4fa91458ca1dbfd2bb524c9d5bf
BLAKE2b-256 78c88f2aeb541abaa79d88d82b3cb04ad027ce2cf16bfad3078a5882050d27dd

See more details on using hashes here.

File details

Details for the file osintlens-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: osintlens-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for osintlens-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e5a60c9cd76a176e6a704cbc3d719f0308b3361304bc1fe4c6cfad89fc07e8c4
MD5 59edcbcb7f4bfb201a93a47112362da6
BLAKE2b-256 f1727b57694ee8540fdfa94c6e0db2745e218c55815e2c15076958a2f4e58899

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