In this lecture, we will create a database for our control panel. To do so, we will be using MySQL
database service.
If you are new to these concepts, please learn more about MySQL and its data types before keeping
continue.
So let's start.
Open a terminal inside your attacker machine.
To start MySQL service, you can use sudo service mysql start and in order to connect
to your MySQL service, use sudo mysql -u root
sudo mysql -u root
It's the root of the MySQL service, not the local root user
And -p parameter for password and -h parameter for host
We will be using localhost and press enter key for your password.
Here we are inside the MySQL database service.
In order to create a database, we will be using create database command.
I will call it ControlPanel.
You can list the databases using show databases command, as you can see, the ControlPanel database is
here use the control panel database by using the "use".
command.
And inside the database, we will create two tables.
A user table for storing the Web users and also victims table for storing information about victims
and also sending commands to victims and getting results from the victims.
Let's start with creating users table
to create a table.
We will be using create table command
users table will have three columns.
The first column will be id.
And it's data type will be integer
and it will be incremented automatically.
And also, it will be the primary key.
So it will be unique in every role.
And we need another column for storing the username.
I will call it username and state type will be varchar(255) it is just about the size.
I want to make sure that you can use any kind of username and serious and long usernames.
And also the last column will be for storing the password.
And it's data type will also be varchar(255)
Two hundred fifty five.
And it's time for creating the victims table use create table commend again, victims table will have.
Eight columns, the first column will be the id column.
And the second column will be the hostname, and it's datatype will be varchar(255) and ipaddress column
for storing the IP address.
And also another column called
operatingsystem for storing operating system information
and a command, a command column for storing commands.
And it will be text data type. Text data type is much more bigger than varchar, so I want to make sure
that you can send seriously long commands to the victims.
And also commandresults column for.
Studying the results of commands, and it will be long text.
It's way, way, way more bigger than text and text is way more bigger than varchar, etc..
So we are done here.
You can list the tables using show tables command.
As you can see, we have our users and victims tables.
So that's it for this lecture.
See you in the next one.