The following nmap script can be used to detect proxy servers on a network. Typically proxy servers work on TCP port 8080. nmap can be used to scan a network for TCP port 8080. The following command shows the appropriate
script to be used with nmap.
nmap -p T:8080 192.168.1.0/24
The above command scans the network 192.168.1.0/24 for TCP port 8080 and displays the IP addresses which have the port open.
Learn to make custom tools and scripts with Python – Python Network programming