Skip to content

Passive TCP fingerprinting #36

@clouedoc

Description

@clouedoc

Hello,

Do you think it would be technically feasible to integrate TCP fingerprinting into fingerproxy?

I naively thought I could layer P0f on top of it, but I would need to edit P0f to save the info about the IP somewhere, then retrieve it in my application code, and that would be ugly and also could be innacurate if multiple clients have the same IP.

I think it would be cleaner if everything was stored inside the headers, in a single simple-to-hack Go program...

(btw, thank you for writing Fingerproxy! It's been really easy to use and customize. I made my own flavour here: https://github.com/clouedoc/fingerproxy-full)

I just want to open the discussion about TCP fingerprinting, I'd be open to contributing such a feature.

Implementation idea

This just some incomplete idea of how to implement this.

  1. We receive a TCP connection on the Go side
  2. Somehow, this connection might have an unique identifier? Maybe we can just use the timestamp of establishment + the remote IP?
  3. Another goroutine looks at all the available network interfaces, parses packets where a TCP connection opened, and sends the info (where? to the "main goroutine"?)
  4. When building the header, we can just look at the data we saved in memory somehow? Maybe we can just use a hashmap and garbage-collect old values?

As you can see, I'm a bit fuzzy on the concept.

Unless there is a way to access low-level info about the TCP connection from the Go side, I think we'll need to have another goroutine parsing the networking interface somehow.

Reference

Here are some references to help for a potential implementation

Name Description
passivetcp-rs A P0f rewrite in Rust
P0f Apparently, one of the historical TCP fingerprinting tools?
Wikipedia page

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions