mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-31 10:41:08 +00:00
add more bad p2p ports
This commit is contained in:
parent
cdc32994fe
commit
6967e8e8ab
@ -87,10 +87,14 @@ incoming connections.
|
|||||||
1720: h323hostcall
|
1720: h323hostcall
|
||||||
1723: pptp
|
1723: pptp
|
||||||
2049: nfs
|
2049: nfs
|
||||||
|
3306: MySQL
|
||||||
|
3389: RDP / Windows Remote Desktop
|
||||||
3659: apple-sasl / PasswordServer
|
3659: apple-sasl / PasswordServer
|
||||||
4045: lockd
|
4045: lockd
|
||||||
5060: sip
|
5060: sip
|
||||||
5061: sips
|
5061: sips
|
||||||
|
5432: PostgreSQL
|
||||||
|
5900: VNC
|
||||||
6000: X11
|
6000: X11
|
||||||
6566: sane-port
|
6566: sane-port
|
||||||
6665: Alternate IRC
|
6665: Alternate IRC
|
||||||
@ -100,6 +104,7 @@ incoming connections.
|
|||||||
6669: Alternate IRC
|
6669: Alternate IRC
|
||||||
6697: IRC + TLS
|
6697: IRC + TLS
|
||||||
10080: Amanda
|
10080: Amanda
|
||||||
|
27017: MongoDB
|
||||||
|
|
||||||
For further information see:
|
For further information see:
|
||||||
|
|
||||||
|
|||||||
@ -921,10 +921,14 @@ bool IsBadPort(uint16_t port)
|
|||||||
case 1720: // h323hostcall
|
case 1720: // h323hostcall
|
||||||
case 1723: // pptp
|
case 1723: // pptp
|
||||||
case 2049: // nfs
|
case 2049: // nfs
|
||||||
|
case 3306: // MySQL
|
||||||
|
case 3389: // RDP / Windows Remote Desktop
|
||||||
case 3659: // apple-sasl / PasswordServer
|
case 3659: // apple-sasl / PasswordServer
|
||||||
case 4045: // lockd
|
case 4045: // lockd
|
||||||
case 5060: // sip
|
case 5060: // sip
|
||||||
case 5061: // sips
|
case 5061: // sips
|
||||||
|
case 5432: // PostgreSQL
|
||||||
|
case 5900: // VNC
|
||||||
case 6000: // X11
|
case 6000: // X11
|
||||||
case 6566: // sane-port
|
case 6566: // sane-port
|
||||||
case 6665: // Alternate IRC
|
case 6665: // Alternate IRC
|
||||||
@ -934,6 +938,7 @@ bool IsBadPort(uint16_t port)
|
|||||||
case 6669: // Alternate IRC
|
case 6669: // Alternate IRC
|
||||||
case 6697: // IRC + TLS
|
case 6697: // IRC + TLS
|
||||||
case 10080: // Amanda
|
case 10080: // Amanda
|
||||||
|
case 27017: // MongoDB
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -14,6 +14,7 @@
|
|||||||
#include <util/translation.h>
|
#include <util/translation.h>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <numeric>
|
||||||
|
|
||||||
#include <boost/test/unit_test.hpp>
|
#include <boost/test/unit_test.hpp>
|
||||||
|
|
||||||
@ -603,14 +604,10 @@ BOOST_AUTO_TEST_CASE(isbadport)
|
|||||||
BOOST_CHECK(!IsBadPort(443));
|
BOOST_CHECK(!IsBadPort(443));
|
||||||
BOOST_CHECK(!IsBadPort(8333));
|
BOOST_CHECK(!IsBadPort(8333));
|
||||||
|
|
||||||
// Check all ports, there must be 80 bad ports in total.
|
// Check all possible ports and ensure we only flag the expected amount as bad
|
||||||
size_t total_bad_ports{0};
|
std::list<int> ports(std::numeric_limits<uint16_t>::max());
|
||||||
for (uint16_t port = std::numeric_limits<uint16_t>::max(); port > 0; --port) {
|
std::iota(ports.begin(), ports.end(), 1);
|
||||||
if (IsBadPort(port)) {
|
BOOST_CHECK_EQUAL(std::ranges::count_if(ports, IsBadPort), 85);
|
||||||
++total_bad_ports;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
BOOST_CHECK_EQUAL(total_bad_ports, 80);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_SUITE_END()
|
BOOST_AUTO_TEST_SUITE_END()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user