This Python script checks if the SMTP port 25 is open on a list of IP addresses. It reads IP addresses from a text file and reports whether each IP can be connected to on port 25.
- Python 3.x
smtplib
andsocket
libraries (both are included in the Python standard library)
-
Clone the repository or download the script file.
-
Ensure you have Python 3.x installed on your system.
-
Create a text file containing the list of IP addresses you want to check, with one IP address per line. For example:
192.168.1.1 10.0.0.1 172.16.0.1
-
Run the script from the command line, passing the path to your text file as an argument:
python smtpbeacon.py path/to/ip_list.txt
Replace
path/to/ip_list.txt
with the actual path to your text file.
Given a text file ips.txt
with the following content:
192.168.1.1
10.0.0.1
172.16.0.1
Run the script:
python smtpbeacon.py ips.txt
Output:
192.168.1.1: Open
10.0.0.1: Closed
172.16.0.1: Open