Scan IIS log for SQL injection, file inclusion and webshell attack.
To run this application you need docker
and docker-compose
.
- docker installation
- docker-compose installation
- Clone this repository
- Run with docker-compose:
- CD into cloned repository (defaults to
log-scanner
)
cd log-scanner
- Activate container:
docker-compose up -d
wait a bit for the container to be fully up
- Get IP address
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' log-scanner
- Access the application using browser to IP address from last step on port 5000, e.g.
http://<log-scanner-ip>:5000
Access the web on http://:5000.
You can upload log file to scan from here. If the log size is big, please wait until the scanning process end (it can be a while, depends on your log file size).
You find unique IP list found in the log file. You can click the IP to view the activities of that IP.
Orange background signifies possible attack has been detected.
You find unique IP with the registered country of that IP and number of hits. You can click the IP to view the activities of that IP.
You will find all the attack detected on the log file. You can click the IP to view the activities of that IP.
This application currently detects three types of attack:
- SQL Inject (
sqli
) - File inclusion (
fileinc
) - Web shell (
webshell
)
To start development on host machine, you will need to install:
virtualenv
postgresql
for database
Use virtualenv
to ease development environment.
- Start new virtualenv:
mkvirtualenv log-scanner
or activate existing virtualenv. 2. Install the dependency packages:
pip install -r requirements.txt
- Set environment variables:
export LOG_SCANNER_CONFIG=app.config.Development
export LOG_SCANNER_SECRET_KEY=secret
export LOG_SCANNER_UPLOAD=/tmp
export LOG_SCANNER_DB_URI=postgres://postgres:postgres@localhost:5432/logscanner
or adjust to yourpostgresql
configurationexport FLASK_APP=manage.py
- Create tables on database, from code root path:
flask db upgrade
- Run the application:
flask run
- Access the application using browser on
http://localhost:5000
or you can using docker environment:
- Edit the code like usual.
- Run
docker-compose up -d --build
to build new image and activate the containers. You need to do this everytime you make changes to the source code.