This Python script is designed to analyze log files generated by the 3proxy software, a proxy server solution widely used for internet connection sharing and anonymity. The script extracts IP addresses from the log entries, determines how frequently each IP connects to the proxy, and identifies the country associated with each IP address using the GeoLite2 Country database.
- Python 3.x
- geoip2 Python library (can be installed via pip3)
Install the required package (if not already installed):
pip3 install geoip2
To run the script, use the following command in your terminal:
python3 3proxy_log_parser.py <path_to_log_file>
For example:
python3 3proxy_log_parser.py ./3proxy_example.log
This command will process the log file, count the frequency of each IP address, and print each IP with its corresponding country and count to the console.
The output will be formatted as follows:
IP: 1.2.3.4, Country: United States, Count: 340
IP: 2.3.4.5, Country: Canada, Count: 120
IP: 3.4.5.6, Country: United Kingdom, Count: 80
This format helps easily identify where the connections to the proxy server are coming from and how frequent they are, which can be essential for network security and management purposes.
Contributions to the 3proxy Log Parser are welcome! Please feel free to fork the repository, make changes, and submit pull requests.