All Projects → ojarva → P0f3 Api Py

ojarva / P0f3 Api Py

Python client for p0f3 API

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to P0f3 Api Py

Bmon
bandwidth monitor and rate estimator
Stars: ✭ 787 (+6458.33%)
Mutual labels:  network-analysis
Slack Gitlab Notifier
Gitlab-Slack Notifier - Integration between Gitlab Webhook Events and Slack Bot notifications
Stars: ✭ 17 (+41.67%)
Mutual labels:  integration
Osinysuhomework
🚪Own experiments operating systems🚪
Stars: ✭ 8 (-33.33%)
Mutual labels:  os
Pgrouting
Repository contains pgRouting library. Development branch is "develop", stable branch is "master"
Stars: ✭ 804 (+6600%)
Mutual labels:  network-analysis
Yii2 Yml Catalog
Компонент выгрузки каталога товаров в Яндекс.Маркет
Stars: ✭ 16 (+33.33%)
Mutual labels:  integration
R4ds
📖 R for data import/export , clean, wrangling, exploration, visualization, & analysis with R https://xiangyunhuang.github.io/r4ds/
Stars: ✭ 19 (+58.33%)
Mutual labels:  network-analysis
Webhook
webhook is a lightweight incoming webhook server to run shell commands
Stars: ✭ 7,201 (+59908.33%)
Mutual labels:  integration
Walkoff
A flexible, easy to use, automation framework allowing users to integrate their capabilities and devices to cut through the repetitive, tedious tasks slowing them down. #nsacyber
Stars: ✭ 855 (+7025%)
Mutual labels:  integration
Os X Yosemite
GTK theme based on the flat appearance of OS X 10.10 Yosemite
Stars: ✭ 17 (+41.67%)
Mutual labels:  os
Os2
x86_64 OS kernel with completely async userspace and single address space [WIP; but basic kernel functionality implemented]
Stars: ✭ 25 (+108.33%)
Mutual labels:  os
Rnn Rbm In Theano
An implementation of RNN-RBM & GBRBM.
Stars: ✭ 6 (-50%)
Mutual labels:  network-analysis
Sparkling Water
Sparkling Water provides H2O functionality inside Spark cluster
Stars: ✭ 887 (+7291.67%)
Mutual labels:  integration
Intellij jahia plugin
Jahia's definitions.cnd files syntax highlighting, code completion, and other amazing stuff
Stars: ✭ 19 (+58.33%)
Mutual labels:  integration
Github
GitHub 漫游指南- a Chinese ebook on how to build a good project on Github. Explore the users' behavior. Find some thing interest.
Stars: ✭ 7,168 (+59633.33%)
Mutual labels:  os
Pulse
Network Inspector for Apple Platforms
Stars: ✭ 841 (+6908.33%)
Mutual labels:  network-analysis
Sitewhere
SiteWhere is an industrial strength open-source application enablement platform for the Internet of Things (IoT). It provides a multi-tenant microservice-based infrastructure that includes device/asset management, data ingestion, big-data storage, and integration through a modern, scalable architecture. SiteWhere provides REST APIs for all system functionality. SiteWhere provides SDKs for many common device platforms including Android, iOS, Arduino, and any Java-capable platform such as Raspberry Pi rapidly accelerating the speed of innovation.
Stars: ✭ 788 (+6466.67%)
Mutual labels:  integration
Snow Grafana Proxy
Connector for grafana simple-json data source and ServiceNow incidents retieved over ServiceNow API
Stars: ✭ 18 (+50%)
Mutual labels:  integration
Osmnx Examples
Usage examples, demos, and tutorials for OSMnx.
Stars: ✭ 863 (+7091.67%)
Mutual labels:  network-analysis
Netgraph
A cross platform http sniffer with a web UI
Stars: ✭ 852 (+7000%)
Mutual labels:  network-analysis
Figmiro Plugin
Figma Integration with Miro (Plugin)
Stars: ✭ 23 (+91.67%)
Mutual labels:  integration

p0f Python API client

This is a simple API client for p0f3, available at http://lcamtuf.coredump.cx/p0f3/ . It is not compatible with version 2.x or 1.x. Start p0f with -s path/to/unix_socket option.

Basic usage:

::

from p0f import P0f, P0fException

data = None p0f = P0f("p0f.sock") # point this to socket defined with "-s" argument. try: data = p0f.get_info("192.168.0.1") except P0fException, e: # Invalid query was sent to p0f. Maybe the API has changed? print e except KeyError, e: # No data is available for this IP address. print e except ValueError, e: # p0f returned invalid constant values. Maybe the API has changed? print e

if data: print "First seen:", data["first_seen"] print "Last seen:", data["last_seen"]

Django integration

See examples/django_models.py for complete Django model of the data returned by p0f.

Django middleware is available in p0f.django.middleware.

To use, add P0FSOCKET = "path/to/p0f_unix_socket" to your project's settings.py, and p0f.django.middleware.P0fMiddleware to MIDDLEWARE_CLASSES.

The middleware adds p0f attribute to all incoming requests. request.p0f is None if connection to p0f failed or p0f did not return data for remote IP address.

Data fields

Parts of these descriptions are shamelessly copied from http://lcamtuf.coredump.cx/p0f3/README :

By default, following fields are parsed:

  • datetime: first_seen
  • datetime: last_seen
  • timedelta: uptime
  • int: uptime_sec
  • timedelta: up_mod_days
  • datetime: last_nat
  • datetime: last_chg

Additionally, bad_sw and os_match_q are validated. "ValueError" is raised, if incorrect value is encountered. For all empty fields, None is used instead of empty strings or constants:

  • uptime_min
  • uptime_sec
  • uptime
  • up_mod_days
  • last_nat
  • last_chg
  • distance
  • bad_sw
  • os_name
  • os_flavor
  • http_flavor
  • link_type
  • language

This parsing and validation can be disabled with

::

p0f.get_info("192.168.0.1", True)

Full descriptions of the fields:

  • int: first_seen - unix time (seconds) of first observation of the host.
  • int: last_seen - unix time (seconds) of most recent traffic.
  • int: total_conn - total number of connections seen.
  • int: uptime_min - calculated system uptime, in minutes. Zero if not known.
  • int: up_mod_days - uptime wrap-around interval, in days.
  • int: last_nat - time of the most recent detection of IP sharing (NAT, load balancing, proxying). Zero if never detected.
  • int: last_chg - time of the most recent individual OS mismatch (e.g., due to multiboot or IP reuse).
  • int: distance - system distance (derived from TTL; -1 if no data).
  • int: bad_sw - p0f thinks the User-Agent or Server strings aren't accurate. The value of 1 means OS difference (possibly due to proxying), while 2 means an outright mismatch. NOTE: If User-Agent is not present at all, this value stays at 0.
  • int: os_match_q - OS match quality: 0 for a normal match; 1 for fuzzy (e.g., TTL or DF difference); 2 for a generic signature; and 3 for both.
  • string: os_name - Name of the most recent positively matched OS. If OS not known, os_name is empty string. NOTE: If the host is first seen using an known system and then switches to an unknown one, this field is not reset.
  • string: os_flavor - OS version. May be empty if no data.
  • string: http_name - most recent positively identified HTTP application (e.g. 'Firefox').
  • string: http_flavor - version of the HTTP application, if any.
  • string: link_type - network link type, if recognized.
  • string: language - system language, if recognized.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].