Flask app that reads apache logs line by line and returns the following information and exposes REST API:
-
list of unique IP addresses
-
list of unique IP addresses with country and number of hits
-
list of all activity per IP address
-
detect SQLi with found entries
-
detect remote file inclusion with found entries
-
detect web shells with found entries
Packages Used:
pygeoip: returns the geolocation of target IP address
How to use:
- Configure the path outputs in "app.py"
- Put the log file in the input folder
- Run the flask app "app.py"
API ENDPoints:
- Fetch unique IP addresses-GET http://SERVER:5000/getuniqueaddress
- Fetch activity per IP addresses -GET http://SERVER:5000/getactivitiesperip
- Detect SQLI attack Entries-GET http://SERVER:5000/getsqliattacks
- Detect Remote File Inclusion Entries -GET http://SERVER:5000/getfileinclusionattacks
- Detect Web shells in the Entries - GET http://SERVER:5000/getwebshellattacks