Introduction
This is a small Python script that reads an AWStats URL (typically, the hosts URL) and outputs a new HTML file with IP addresses resolved via reverse lookup.
The script requires Python 3 or higher, Beautiful
Soup and Requests. To use the script, fill out the variables url,
user and pw:
url: the URL to the AWStats hosts page (open AWStats, find the hosts table, right-click "Last visit")user: the username for logging into AWstatspw: the password for logging into AWStats
The script outputs a file called
awstats_resolved.html. It may take a while for the script
to complete as an individual reverse lookup may hang for up to ten seconds.
Source code
resolve_awstats.py (change
the extension from .txt to .py)
License
The code is open source and licensed under the MIT license. The license is included in the source code files above. Among other things, it allows commercial and non-commercial use of the code free of charge.