sniffnet/resources/scripts/services.sh

14 lines
614 B
Bash
Executable file

#!/bin/bash
# Script used to generate the file ./services.txt
# The source for port-to-service mappings is provided by nmap
# Available at: https://raw.githubusercontent.com/nmap/nmap/master/nmap-services
OUT=./services.txt
echo -e "# This file is automatically generated from the port-to-service mappings provided by nmap\n# Available at: https://raw.githubusercontent.com/nmap/nmap/master/nmap-services\n# Don't edit this file manually\n" > $OUT
curl https://raw.githubusercontent.com/nmap/nmap/master/nmap-services \
| grep -E '/tcp|/udp' \
| grep -E -v '^#|^unknown\t' \
| cut -d$'\t' -f 1,2 >> $OUT