Posts

Showing posts from April, 2018

Specify Source IP on Linux Command

Image
  It is a very desirable  function if you could specify source IP ( source Port will be extra useful) for network testing and  debugging. Here is a short list of command syntax for commonly used tools in Linux curl curl http://10.101.26.104 --interface   6.7.8.9 --local-port 23456 dig dig jian.p1.tps.a10lab.com @7.7.7.1 -b 50.35.26.100#23456 wget wget --bind-address=6.7.8.9   http://10.101.26.104 wget could not specify source port; but you could use the following trick to limit the source ports used in Linux: check the config of file /proc/sys/net/ipv4/ip_local_port_range cat /proc/sys/net/ipv4/ip_local_port_range 32768   60999 By default the source ports ranges from 32678 to 60999 change the file to limit to one source port echo "23456 23456" > /proc/sys/net/ipv4/ip_local_port_range Then test again, your wget command will use source port 23456 nslookup Does not have any option...

Certificate IP Address SAN (Subject Alt Name) and https://1.1.1.1

Image
On April 1 2018, CloudFlare announced the Internet's fastest, privacy-first resolver 1.1.1.1. It also provide a directly Webpage at https://1.1.1.1. The interesting part is my browser actually trusts this site (as shown on the Firefox above) by visiting the target IP 1.1.1.1.  This is rare as almost all https are now using domain name based certificate to match the FQDN we input in browser address bar. We almost take for granted that input an IP address for https will result a certificate warning and I definitely read before that request for a certificate for IP is not allowed now, for example, here . So what is really happening here ? A quickly check the certificate shows the cert is valid for *.cloudflare-dns.com and although 1.1.1.1 does resolve to  1dot1dot1dot1.cloudflare-dns.com, this alone will not make browser to trust the site. Finally check the Certificate Subject Alt Name (SAN) extension s, we found out there are 4 IPv4/IPv6 addresses including th...