Running SQL Injection Exploits With K2HackBot
Run Sample SQL Injection Exploits with K2HackBot.
Overview
This script runs SQL Injection top vulnerabilities and it gets detected by K2 Platform seamlessly. This script will install K2HackBot and run SQL Injection exploits.
Working
The run_mysql.sh performs the following operations:
1. Start the application Docker container
Firstly, the script will run the Docker container of the application. The application Docker image used is k2cyber/ic-test-application:sql-injection. This is a Java based application that includes SQL-Injection vulnerabilities.
If the k2agent is already present on the machine, the application will be attached STATICALLY. On the other hand, if the k2agent is not present on the machine, the application will be attached DYNAMICALLY.
2. Install K2HackBot
Once the application is started successfully, the script will try to install the latest K2HackBot on the same machine. The installation directory for K2HackBot is /tmp.
If the K2HackBot package is already present inside the /tmp directory, then the script will skip the installation and use the existing K2HackBot.
3. Trigger K2HackBot
The script will create the K2HackBot config file dynamically and trigger the K2HackBot.
The K2HackBot is started in the scan-web-application mode. Once the scanning is over, all the exploits will be reported by the K2HackBot.
Ideally, it should report 5 Vulnerabilities.
Mysql Exploits Script
Copy the following run_mysql.sh file anywhere on the Linux machine or you can find script in demo_exploits folder of your installation.
Options
--k2email
Provide the registered K2 email. The default value is set to installer@k2io.com.
--k2password
Provide the password corresponding to the registered K2 email.
--k2hackbot-bundle-url
Provide the K2HackBot Bundle URL.
--k2collector-path
The directory path where you want all the K2 related stuff to be downloaded.
Commands
Note: Before running the below commands, make sure that you are present inside the directory where the run_mysql.sh script is present.
Command to display the help page:
Run the script when k2agent is NOT present on the machine:
Run the script when k2agent is present on the machine:
In this case, make sure to pass the k2-email and the k2-password options. Use the same k2-email which was used while installing the k2agent on the machine.
Upgrade/Downgrade the K2HackBot Bundle:
The script provides the support to install a specific version of the K2HackBot if required. For this purpose, use the k2hackbot-bundle-url option.
View Exploits
Detected Exploits will be shown on K2 Portal's Exploits Page.
Alternatively go to Exploits | K2 Portal
Last updated
Was this helpful?