Context
I check open ports on my server with a scheduled batch file:
nmap.exe server1 server2 server3 etc >> log.txt
Usually 21, 22, 80, 443 and 3389 are opened.
Now I want to send an email if only other ports are opened.
I saw there is Nmap Script Engine but I didn't find examples to understand... Also I would like to use batch if possible because I have already developed email mailings with this language (Blat).
Questions
- How to filter "all ports except 21, 22, 80, 443, 3389"?
- How to develop "for server x, if one port are opened, send email"?