tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

request-bad-port.any.js (2097B)


      1 // META: global=window,worker
      2 
      3 // list of bad ports according to
      4 // https://fetch.spec.whatwg.org/#port-blocking
      5 var BLOCKED_PORTS_LIST = [
      6    0,
      7    1,    // tcpmux
      8    7,    // echo
      9    9,    // discard
     10    11,   // systat
     11    13,   // daytime
     12    15,   // netstat
     13    17,   // qotd
     14    19,   // chargen
     15    20,   // ftp-data
     16    21,   // ftp
     17    22,   // ssh
     18    23,   // telnet
     19    25,   // smtp
     20    37,   // time
     21    42,   // name
     22    43,   // nicname
     23    53,   // domain
     24    69,   // tftp
     25    77,   // priv-rjs
     26    79,   // finger
     27    87,   // ttylink
     28    95,   // supdup
     29    101,  // hostriame
     30    102,  // iso-tsap
     31    103,  // gppitnp
     32    104,  // acr-nema
     33    109,  // pop2
     34    110,  // pop3
     35    111,  // sunrpc
     36    113,  // auth
     37    115,  // sftp
     38    117,  // uucp-path
     39    119,  // nntp
     40    123,  // ntp
     41    135,  // loc-srv / epmap
     42    137,  // netbios-ns
     43    139,  // netbios-ssn
     44    143,  // imap2
     45    161,  // snmp
     46    179,  // bgp
     47    389,  // ldap
     48    427,  // afp (alternate)
     49    465,  // smtp (alternate)
     50    512,  // print / exec
     51    513,  // login
     52    514,  // shell
     53    515,  // printer
     54    526,  // tempo
     55    530,  // courier
     56    531,  // chat
     57    532,  // netnews
     58    540,  // uucp
     59    548,  // afp
     60    554,  // rtsp
     61    556,  // remotefs
     62    563,  // nntp+ssl
     63    587,  // smtp (outgoing)
     64    601,  // syslog-conn
     65    636,  // ldap+ssl
     66    989,  // ftps-data
     67    990,  // ftps
     68    993,  // ldap+ssl
     69    995,  // pop3+ssl
     70    1719, // h323gatestat
     71    1720, // h323hostcall
     72    1723, // pptp
     73    2049, // nfs
     74    3659, // apple-sasl
     75    4045, // lockd
     76    4190, // sieve
     77    5060, // sip
     78    5061, // sips
     79    6000, // x11
     80    6566, // sane-port
     81    6665, // irc (alternate)
     82    6666, // irc (alternate)
     83    6667, // irc (default)
     84    6668, // irc (alternate)
     85    6669, // irc (alternate)
     86    6679, // osaut
     87    6697, // irc+tls
     88    10080, // amanda
     89 ];
     90 
     91 BLOCKED_PORTS_LIST.map(function(a){
     92    promise_test(function(t){
     93        return promise_rejects_js(t, TypeError, fetch(`${location.origin}:${a}`))
     94    }, 'Request on bad port ' + a + ' should throw TypeError.');
     95 });