Q: How do I parse relevant IP addresses from netstat and redirect it to NSlookup in a batch script? : How do you parse the ip addresses in the foreign address column and redirect it to nslookup whilst ignoring everything else?
 
  `
  Proto  Local Address          Foreign Address        State           PID
  TCP    127.0.0.1:5354         0.0.0.0:0              LISTENING       2076
  TCP    127.0.0.1:5354         127.0.0.1:49671        ESTABLISHED     2076
  TCP    127.0.0.1:5354         127.0.0.1:49672        ESTABLISHED     2076
  TCP    127.0.0.1:27015        0.0.0.0:0              LISTENING       1360
  TCP    127.0.0.1:27015        127.0.0.1:51666        ESTABLISHED     1360
  TCP    127.0.0.1:49671        127.0.0.1:5354         ESTABLISHED     1360
  TCP    127.0.0.1:49672        127.0.0.1:5354         ESTABLISHED     1360
  TCP    127.0.0.1:49769        127.0.0.1:49770        ESTABLISHED     7916
  TCP    127.0.0.1:49770        127.0.0.1:49769        ESTABLISHED     7916
  TCP    127.0.0.1:49773        127.0.0.1:49774        ESTABLISHED     6952
  TCP    127.0.0.1:49774        127.0.0.1:49773        ESTABLISHED     6952
  TCP    127.0.0.1:51666        127.0.0.1:27015        ESTABLISHED     7944
  TCP    192.168.1.4:139        0.0.0.0:0              LISTENING       4
  TCP    192.168.1.4:50031      40.77.229.23:443       ESTABLISHED     3268
  TCP    192.168.1.4:50047      17.252.60.32:5223      ESTABLISHED     8684
  TCP    192.168.1.4:50197      104.82.252.232:443     CLOSE_WAIT      12640
  TCP    192.168.1.4:50198      104.82.252.232:443     CLOSE_WAIT      12640`