s-rah / onionscan

OnionScan is a free and open source tool for investigating the Dark Web.
https://twitter.com/OnionScan
Other
2.89k stars 599 forks source link

Parametrize bitcoin scan to be able to scan for other coins #64

Closed laanwj closed 8 years ago

laanwj commented 8 years ago

This pull request parametrizes the bitcoin scanner and so adds support for scanning other bitcoin-derived protocols.

Report changes

To be able to store the dynamic information I created a per-service report map BitcoinService. This contains the bitcoin fields that used to be on the report directly, but per scan.

For example, after scanning a bitcoin testnet node:

$ ./onionscan -jsonReport -scans bitcoin_test -verbose aaiilnwzuqpx5o6j.onion
        "bitcoinServices": {
            "bitcoin_test": {
                "detected": true,
                "userAgent": "/Satoshi:0.13.0(aaiilnwzuqpx5o6j)/",
                "prototocolVersion": 70014,
                "onionPeers": [
                    "aaiilnwzuqpx5o6j.onion:18333",
                    "nec4kn4ghql7p7an.onion:18333",
                    "gl3wjwdsxa62uxln.onion:18333",
                    "6vu4juq6hhomxrel.onion:18333",
                    "cjz4w57h2zasljw3.onion:18333",
                    "bbgw7gpjpko5yvuh.onion:18333",
                    "attdhwktlpnfaluw.onion:18333",
                    "l24shdlfjbmr3txf.onion:18333",
                    "nkf5e6b7pl4jfd4a.onion:18333"
                ]
            }
        },

Please let me know if this is the right approach or if you'd prefer something else.

Coins

To get started I added dogecoin and litecoin, as well as the respective testnets of bitcoin, dogecoin and litecoin.

There are tons of bitcoin testnet nodes to be found on Tor. I haven't actually managed to find any onion nodes for litecoin and dogecoin though. Maybe you have more luck :)

I did not enable the scans for litecoin and dogecoin testnets by default. As their mainnet nodes are already so hard to find on tor, looking for these is probably a waste of time.

Adding new coins

There are literally hundreds of different altcoins derived from the bitcoin source, although most have no user base to speak of.

Assuming a coin's protocol (the subset for version negotiation and address exchange) is close enough to that of bitcoin for this to work, adding support for a new coin is trivial:

s-rah commented 8 years ago

Again awesome :) - I'm currently running a big scan with this latest patch and all looks good, and we will see if we can discover any other endpoints!