[crazy][crazy] finding a few cert prints of electrum nodes for different currencies
$ pwd /home/ubuntu/src/electrumx/electrumx/lib $ less coins.py # in less, I type '/_class' to find the lookup_coin_class function that has code to enumerate all the coins # then in another pane, I open python3, import electrumx, and plan to copy the code
turns out i have the kyuupichan code. trying to switch to spesmilo using git remotes.
having some inhibition spasmy stuff. the part of me that supported this wanted it done faster than i knew how to do given my issues.
okay, here: i can enumerate the coins without cloning spesmilo by using the e-x library i already have cached by pip. my parts are trying to move toward being more anonymous and secure, so less network activity supports that.
it takes me a few tries to get e-x installed. it uses the same package name as electrumx so there are path conflicts pip doesn't expect. $ pip3 uninstall electrumx $ pip3 uninstall e-x $ pip3 install e-x
import electrumx for coin in electrumx.lib.coins.util.subclasses(electrumx.lib.coins.Coin): ... print(coin.NAME) ... print(coin.PEERS) ...
many of the coins don't have any hardcoded peers, so I filter them out
for coin in electrumx.lib.coins.util.subclasses(electrumx.lib.coins.Coin): ... if len(coin.PEERS) == 0: ... continue ... print(coin.NAME, *coin.PEERS) ...
ellcoin bell.electrumx.japanesecoin-pool.work s t bell.streetcrypto7.com s t Bitcoin electrum.vom-stausee.de s t electrum.hsmiths.com s t helicarrier.bauerj.eu s t hsmiths4fyqlw5xw.onion s t ozahtqwp25chjdjd.onion s t elect rum.hodlister.co s electrum3.hodlister.co s btc.usebsv.com s50006 fortress.qtornado.com s443 t ecdsa.net s110 t e2.keff.org s t currentlane.lovebi tco.in s t electrum.jochen-hoenicke.de s50005 t50003 vps5.hsmiths.com s electrum.emzy.de s BitcoinCashABC bch.imaginary.cash s t electroncash.dk s t wallet.satoshiscoffeehouse.com s t BitcoinCashABC bch0.kister.net t s testnet.imaginary.cash t50001 s50002 blackie.c3-soft.com t60001 s60002 BitcoinGold electrumx-eu.bitcoingold.org s50002 t50001 electrumx-us.bitcoingold.org s50002 t50001 BitcoinGold test-node1.bitcoingold.org s50002 test-node2.bitcoingold.org s50002 test-node3.bitcoingold.org s50002 BitcoinSV electrumx.bitcoinsv.io s satoshi.vision.cash s sv.usebsv.com s t sv.jochen-hoenicke.de s t sv.satoshi.io s t BitcoinSV stn-server.electrumsv.io t51001 s51002 BitcoinSV electrontest.cascharia.com t51001 s51002 BitcoinSegwit electrum.vom-stausee.de s t electrum.hsmiths.com s t helicarrier.bauerj.eu s t hsmiths4fyqlw5xw.onion s t ozahtqwp25chjdjd.onion s t electrum.hodlister.co s electrum3.hodlister.co s btc.usebsv.com s50006 fortress.qtornado.com s443 t ecdsa.net s110 t e2.keff.org s t currentlane. lovebitco.in s t electrum.jochen-hoenicke.de s50005 t50003 vps5.hsmiths.com s electrum.emzy.de s BitcoinSegwit testnet.hsmiths.com t53011 s53012 hsmithsxurybd7uh.onion t53011 s53012 testnet.qtornado.com s t testnet1.bauerj.eu t50001 s50002 tn. not.fyi t55001 s55002 bitcoin.cluelessperson.com s t Bitcoin testnet.hsmiths.com t53011 s53012 hsmithsxurybd7uh.onion t53011 s53012 testnet.qtornado.com s t testnet1.bauerj.eu t50001 s50002 tn.not.fy i t55001 s55002 bitcoin.cluelessperson.com s t Bitcore ele1.bitcore.cc s t ele2.bitcore.cc s t ele3.bitcore.cc s t ele4.bitcore.cc s t Bitsend ele1.bitsend.cc s t 51.15.121.233 s t CPUchain electrumx.cpuchain.org s t ColossusXT electrum.polispay.com Crown sgp-crwseed.crowndns.info s t blr-crwseed.crowndns.info s t sfo-crwseed.crowndns.info s t nyc-crwseed.crowndns.info s t ams-crwseed.crowndns .info s t tor-crwseed.crowndns.info s t lon-crwseed.crowndns.info s t fra-crwseed.crowndns.info s t Dash electrum.dash.org s t electrum.masternode.io s t electrum-drk.club s t dashcrypto.space s t electrum.dash.siampm.com s t wl4sfwq2hwxn[11/443] on s t Dash electrum.dash.siampm.com s t dasht.random.re s54002 t54001 FairCoin electrum.faircoin.world s electrumfair.punto0.org s Feathercoin electrumx-gb-1.feathercoin.network s t electrumx-gb-2.feathercoin.network s t electrumx-de-1.feathercoin.network s t Groestlcoin electrum1.groestlcoin.org s t electrum2.groestlcoin.org s t 6brsrbiinpc32tfc.onion t xkj42efxrcy6vbfw.onion t Groestlcoin electrum-test1.groestlcoin.org s t electrum-test2.groestlcoin.org s t 7frvhgofuf522b5i.onion t aocojvqcybdoxekv.onion t Koto fr.kotocoin.info s t electrum.kotocoin.info s t Koto testnet.kotocoin.info s t Litecoin ex.lug.gs s444 electrum-ltc.bysh.me s t electrum-ltc.ddns.net s t electrum-ltc.wilv.in s t electrum.cryptomachine.com p1000 s t electrum. ltc.xurious.com s t eywr5eubdbbe2laq.onion s50008 t50007 Litecoin electrum-ltc.bysh.me s t electrum.ltc.xurious.com s t ipv6-only.electrum.random.re s t MNPCoin electrum.polispay.com Minexcoin electrumx.xpresit.net s t elex01-ams.turinex.eu s t eu.minexpool.nl s t Monacoin electrumx.tamami-foundation.org s t electrumx3.monacoin.nl s t electrumx1.monacoin.ninja s t electrumx2.movsign.info s t electrum-mona.bi tbank.cc s t ri7rzlmdaf4eqbza.onion s t Monacoin electrumx1.testnet.monacoin.ninja s t electrumx1.testnet.monacoin.nl s t Namecoin electrum-nmc.le-space.de s50002 ex.lug.gs s446 luggscoqbymhvnkp.onion t82 nmc.bitcoins.sk s50002 ulrichard.ch s50006 t50005 Namecoin electrum-nmc.le-space.de s50002 ex.lug.gs s446 luggscoqbymhvnkp.onion t82 nmc.bitcoins.sk s50002 ulrichard.ch s50006 t50005 PAC electrum.paccoin.io s t electro-pac.paccoin.io s t PAC electrum.paccoin.io s t electro-pac.paccoin.io s t Peercoin electrum.peercoinexplorer.net s PeercoinTestnet electrum.peercoinexplorer.net s Polis electrum.polispay.com Primecoin electrumx.primecoin.org s t PrimecoinTestnet electrumx.testnet.primecoin.org t Ritocoin electrum-rito.minermore.com s t TokenPay electrum-us.tpay.ai s electrum-eu.tpay.ai s Trezarcoin electrumx1.trezarcoin.com s t UniformFiscalObject electrumx1.ufobject.com s t Unitus electrumx.unituscurrency.com s t Viacoin vialectrum.bitops.me s t server.vialectrum.org s t vialectrum.viacoin.net s t viax1.bitops.me s t Viacoin vialectrum.bysh.me s t Viacoin vialectrum.bysh.me s t Xaya seeder.xaya.io s50002 xaya.domob.eu s50002 Zcoin electrum.polispay.com Zcoin electrum.polispay.com now i get to connect to each one !
basically i'll be copying electrumx's connection code i think it can parse the address format in lib.peer.Peer, uncertain
relating to internal outer process: this is clearly a slower way to do this. karl's original approach would have included this. prioritising this for speed makes no sense and derails the task. [for attempting to learn]. still attempting to do thi
atm we are displaying all the hostnames for a mitm to produce fake ssl certs for them. that's unlikely to be something that i can influence if it exists. but it still makes sense to, at this point, get all the fingerprints.
i made a source file that makes peer objects. some of the peer objects threw an exception, maybe they need coin-specific code, dunno. it just skips those. next, connection. import electrumx coin_peers = { coin.NAME: coin.PEERS for coin in electrumx.lib.coins.util.subclasses(electrumx.lib.coins.Coin) if len(coin.PEERS) > 0 } for name, peers in coin_peers.items(): try: for peer in peers: peer = electrumx.lib.peer.Peer.from_real_name(peer, '') print(name, peer.real_name()) except: continue
i'm not seeing the print extraction code on my system so i plan to navigate to the other thread to copy it. here's the sourcefile i made so far. import aiorpcx async def main(): coin_peers = { coin.NAME: coin.PEERS for coin in electrumx.lib.coins.util.subclasses(electrumx.lib.coins.Coin) if len(coin.PEERS) > 0 } for name, peers in coin_peers.items(): try: for peer in peers: peer = electrumx.lib.peer.Peer.from_real_name(peer, '') async with aiorpcx.connect_rs(peer.host, pper.ssl_port) as session: print('connected to', name, peer.real_name(), session) except: continue import asyncio asyncio.run(main())
here's the code I drafted from the other thread: ssl_obj = session.transport._asyncio_transport.get_extra_info('ssl_object') der_cert = ssl_obj.getpeercert(True) pem_cert = ssl.DER_cert_to_PEM_cert(der_cert) cert_print = hashlib.sha256(der_cert).hexdigest() it looks like i'm hashing the der cert instead of the pem cert, so i'll want to fix that, i think
This is present code. It has no output, likely because of an error-to-investigate throwing an exception each iteration that then gets caught: import electrumx import aiorpcx async def main(): coin_peers = { coin.NAME: coin.PEERS for coin in electrumx.lib.coins.util.subclasses(electrumx.lib.coins.Coin) if len(coin.PEERS) > 0 } for name, peers in coin_peers.items(): try: for peer in peers: peer = electrumx.lib.peer.Peer.from_real_name(peer, '') async with aiorpcx.connect_rs(peer.host, pper.ssl_port) as session: print('connected to', name, peer.real_name(), session) ssl_obj = session.transport._asyncio_transport.get_extra_info('ssl_object') der_cert = ssl_obj.getpeercert(True) pem_cert = ssl.DER_cert_to_PEM_cert(der_cert) for alg in 'md5 sha1 sha256 blake2b'.split(' '): cert_print = getattr(hashlib, alg)(pem_cert).hexdigest() print(peer.real_name(), alg, cert_print) except: continue import asyncio asyncio.run(main())
The biggest issue appears to be that I am not telling it to form an SSL connection. can copy that in from the existing code
with stuff like this ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1129) y'gotta remember although this should never happen, this could be a bunch of hobbyists just setting things up
(Pdb) p err.reason, err.verify_message ('CERTIFICATE_VERIFY_FAILED', 'self signed certificate') (Pdb) p peer.real_name() 'testnet.hsmiths.com v0.0 s53012 t53011' It's testnet. It's self-signed because it's testnet. paranoia is intense.
current source. throwing encoding error from hashlib. import electrumx import aiorpcx import asyncio import hashlib import ssl async def main(): coin_peers = { coin.NAME: coin.PEERS for coin in electrumx.lib.coins.util.subclasses(electrumx.lib.coins.Coin) if len(coin.PEERS) > 0 } nonverifying_ssl = ssl.SSLContext(ssl.PROTOCOL_TLS) for name, peers in coin_peers.items(): try: for peer in peers: peer = electrumx.lib.peer.Peer.from_real_name(peer, '') cert_msg = '' client = aiorpcx.connect_rs(peer.host, peer.ssl_port, ssl=True) try: transport, protocol = await client.create_connection() except ssl.SSLCertVerificationError as err: if err.reason != 'CERTIFICATE_VERIFY_FAILED': raise else: cert_msg = err.verify_message client = aiorpcx.connect_rs(peer.host, peer.ssl_port, ssl=nonverifying_ssl) transport, protocol = await client.create_connection() try: print('connected to', name, peer.real_name(), protocol.session) ssl_obj = protocol.session.transport._asyncio_transport.get_extra_info('ssl_object') der_cert = ssl_obj.getpeercert(True) pem_cert = ssl.DER_cert_to_PEM_cert(der_cert) for alg in 'md5 sha1 sha256 blake2b'.split(' '): cert_print = getattr(hashlib, alg)(pem_cert).hexdigest() print(peer.real_name(), alg, cert_print) finally: protocol.session.close() except KeyError: continue asyncio.run(main())
participants (1)
-
Undiscussed Horrific Abuse, One Victim of Many