This set of scripts aims to extract from auth attempts or device scanning IPs and users used for those auth attempts.
The top 10 IPs are:
The top 10 users are:
If you didn't use the fetch script to get you
users.log, you can put your
secure files in
import/sources/ (those files are ignored by git, so it won't be uploaded) - then you have to import them - refer to importing section
If you used the fetch script, put your
users.log files in
import/ and prefix them to distinguish them from other users' files and devices (please only use letters, numbers, dash and underscore in the prefix - I use a githubusername_devicename pattern)
How and what
fetch/fetch.sh script get from
/var/log/auth.log the IPs and users of the previous day lines of the log. Hence it has to be run only once a day to get everything and to not duplicate data.
Moreover, for it to work, the cron has to be able to read
If you're fetching IPs and Users on several devices and want to centralize everything on one, you can put your
secure files in
Please prefix your auth.log or secure files per device in order to distinguish them, I use a githubusername_devicename pattern (only use letters, numbers, dash and underscore in the prefix, or it won't work).
Counting and sorting
Once enough data gathered, and the
users.log are created in
IAA.sh will create unique IPs and users lists, as well as lists with count of their occurences in the original logs, sorted descendingly.
/var/log/auth.log(or the fetch script will have to be adaptated to your auth logging)
- Python 3
You can run this script on your public facing devices to collect the IPs and users too, and if you want to contribute, please refer to Import section.
Once you're done, run
./import.sh if needed, and
./IAA.sh - commit and then create a pull request.
Note that you will need git lfs for