|
| 1 | +When Bitcoin Core automatically opens outgoing P2P connections it chooses |
| 2 | +a peer (address and port) from its list of potential peers. This list is |
| 3 | +populated with unchecked data, gossiped over the P2P network by other peers. |
| 4 | + |
| 5 | +It may happen that a malicious actor gossips an address:port where no Bitcoin |
| 6 | +node is listening. Or even where another service is listening which is not |
| 7 | +related to the Bitcoin network. As a result, this service may occasionally |
| 8 | +get connection attempts from Bitcoin nodes. |
| 9 | + |
| 10 | +"Bad" ports are ones that are used by services which usually are not opened to |
| 11 | +the public and usually require authentication. A connection attempt (by Bitcoin |
| 12 | +Core, trying to connect because it thinks there is a Bitcoin node on that |
| 13 | +address:port) to such service may be considered a malicious action by an |
| 14 | +ultra-paranoid administrator. An example for such a port is 22 (ssh). On the |
| 15 | +other hand, connection attempts to public services that usually do not require |
| 16 | +authentication are unlikely to be considered a malicious action, |
| 17 | +e.g. port 80 (http). |
| 18 | + |
| 19 | +Following is a list of "bad" ports which Bitcoin Core avoids when choosing a |
| 20 | +peer to connect to. If a node is listening on such a port, it will likely get |
| 21 | +less incoming connections. |
| 22 | + |
| 23 | + 1: tcpmux |
| 24 | + 7: echo |
| 25 | + 9: discard |
| 26 | + 11: systat |
| 27 | + 13: daytime |
| 28 | + 15: netstat |
| 29 | + 17: qotd |
| 30 | + 19: chargen |
| 31 | + 20: ftp data |
| 32 | + 21: ftp access |
| 33 | + 22: ssh |
| 34 | + 23: telnet |
| 35 | + 25: smtp |
| 36 | + 37: time |
| 37 | + 42: name |
| 38 | + 43: nicname |
| 39 | + 53: domain |
| 40 | + 69: tftp |
| 41 | + 77: priv-rjs |
| 42 | + 79: finger |
| 43 | + 87: ttylink |
| 44 | + 95: supdup |
| 45 | + 101: hostname |
| 46 | + 102: iso-tsap |
| 47 | + 103: gppitnp |
| 48 | + 104: acr-nema |
| 49 | + 109: pop2 |
| 50 | + 110: pop3 |
| 51 | + 111: sunrpc |
| 52 | + 113: auth |
| 53 | + 115: sftp |
| 54 | + 117: uucp-path |
| 55 | + 119: nntp |
| 56 | + 123: NTP |
| 57 | + 135: loc-srv /epmap |
| 58 | + 137: netbios |
| 59 | + 139: netbios |
| 60 | + 143: imap2 |
| 61 | + 161: snmp |
| 62 | + 179: BGP |
| 63 | + 389: ldap |
| 64 | + 427: SLP (Also used by Apple Filing Protocol) |
| 65 | + 465: smtp+ssl |
| 66 | + 512: print / exec |
| 67 | + 513: login |
| 68 | + 514: shell |
| 69 | + 515: printer |
| 70 | + 526: tempo |
| 71 | + 530: courier |
| 72 | + 531: chat |
| 73 | + 532: netnews |
| 74 | + 540: uucp |
| 75 | + 548: AFP (Apple Filing Protocol) |
| 76 | + 554: rtsp |
| 77 | + 556: remotefs |
| 78 | + 563: nntp+ssl |
| 79 | + 587: smtp (rfc6409) |
| 80 | + 601: syslog-conn (rfc3195) |
| 81 | + 636: ldap+ssl |
| 82 | + 989: ftps-data |
| 83 | + 990: ftps |
| 84 | + 993: ldap+ssl |
| 85 | + 995: pop3+ssl |
| 86 | + 1719: h323gatestat |
| 87 | + 1720: h323hostcall |
| 88 | + 1723: pptp |
| 89 | + 2049: nfs |
| 90 | + 3659: apple-sasl / PasswordServer |
| 91 | + 4045: lockd |
| 92 | + 5060: sip |
| 93 | + 5061: sips |
| 94 | + 6000: X11 |
| 95 | + 6566: sane-port |
| 96 | + 6665: Alternate IRC |
| 97 | + 6666: Alternate IRC |
| 98 | + 6667: Standard IRC |
| 99 | + 6668: Alternate IRC |
| 100 | + 6669: Alternate IRC |
| 101 | + 6697: IRC + TLS |
| 102 | + 10080: Amanda |
| 103 | + |
| 104 | +For further information see: |
| 105 | + |
| 106 | +[pull/23306](https://github.com/bitcoin/bitcoin/pull/23306#issuecomment-947516736) |
| 107 | + |
| 108 | +[pull/23542](https://github.com/bitcoin/bitcoin/pull/23542) |
| 109 | + |
| 110 | +[fetch.spec.whatwg.org](https://fetch.spec.whatwg.org/#port-blocking) |
| 111 | + |
| 112 | +[chromium.googlesource.com](https://chromium.googlesource.com/chromium/src.git/+/refs/heads/main/net/base/port_util.cc) |
| 113 | + |
| 114 | +[hg.mozilla.org](https://hg.mozilla.org/mozilla-central/file/tip/netwerk/base/nsIOService.cpp) |
0 commit comments