1 00:00:00,520 --> 00:00:08,440 In this lecture, we will create a database for our control panel. To do so, we will be using MySQL 2 00:00:08,440 --> 00:00:09,580 database service. 3 00:00:10,700 --> 00:00:17,850 If you are new to these concepts, please learn more about MySQL and its data types before keeping 4 00:00:17,890 --> 00:00:18,410 continue. 5 00:00:18,890 --> 00:00:20,770 So let's start. 6 00:00:22,600 --> 00:00:25,750 Open a terminal inside your attacker machine. 7 00:00:28,440 --> 00:00:37,970 To start MySQL service, you can use sudo service mysql start and in order to connect 8 00:00:37,980 --> 00:00:44,970 to your MySQL service, use sudo mysql -u root 9 00:00:45,240 --> 00:00:46,320 sudo mysql -u root 10 00:00:47,230 --> 00:00:51,280 It's the root of the MySQL service, not the local root user 11 00:00:52,660 --> 00:00:59,320 And -p parameter for password and -h parameter for host 12 00:00:59,740 --> 00:01:04,810 We will be using localhost and press enter key for your password. 13 00:01:06,930 --> 00:01:09,690 Here we are inside the MySQL database service. 14 00:01:10,730 --> 00:01:16,850 In order to create a database, we will be using create database command. 15 00:01:18,180 --> 00:01:20,220 I will call it ControlPanel. 16 00:01:24,940 --> 00:01:33,850 You can list the databases using show databases command, as you can see, the ControlPanel database is 17 00:01:33,850 --> 00:01:39,110 here use the control panel database by using the "use". 18 00:01:39,460 --> 00:01:40,120 command. 19 00:01:42,660 --> 00:01:47,820 And inside the database, we will create two tables. 20 00:01:48,690 --> 00:01:58,110 A user table for storing the Web users and also victims table for storing information about victims 21 00:01:58,110 --> 00:02:01,860 and also sending commands to victims and getting results from the victims. 22 00:02:04,640 --> 00:02:07,220 Let's start with creating users table 23 00:02:10,880 --> 00:02:11,930 to create a table. 24 00:02:12,140 --> 00:02:14,570 We will be using create table command 25 00:02:17,270 --> 00:02:20,180 users table will have three columns. 26 00:02:20,660 --> 00:02:22,490 The first column will be id. 27 00:02:23,410 --> 00:02:25,270 And it's data type will be integer 28 00:02:28,000 --> 00:02:30,610 and it will be incremented automatically. 29 00:02:32,510 --> 00:02:34,430 And also, it will be the primary key. 30 00:02:34,470 --> 00:02:36,890 So it will be unique in every role. 31 00:02:38,960 --> 00:02:43,370 And we need another column for storing the username. 32 00:02:44,710 --> 00:02:55,120 I will call it username and state type will be varchar(255) it is just about the size. 33 00:02:55,810 --> 00:03:02,200 I want to make sure that you can use any kind of username and serious and long usernames. 34 00:03:04,060 --> 00:03:07,840 And also the last column will be for storing the password. 35 00:03:10,830 --> 00:03:14,790 And it's data type will also be varchar(255) 36 00:03:17,500 --> 00:03:18,940 Two hundred fifty five. 37 00:03:22,910 --> 00:03:32,390 And it's time for creating the victims table use create table commend again, victims table will have. 38 00:03:33,620 --> 00:03:37,190 Eight columns, the first column will be the id column. 39 00:03:44,460 --> 00:03:56,880 And the second column will be the hostname, and it's datatype will be varchar(255) and ipaddress column 40 00:03:56,880 --> 00:03:59,580 for storing the IP address. 41 00:04:02,740 --> 00:04:05,830 And also another column called 42 00:04:08,440 --> 00:04:11,860 operatingsystem for storing operating system information 43 00:04:14,320 --> 00:04:21,880 and a command, a command column for storing commands. 44 00:04:23,230 --> 00:04:32,620 And it will be text data type. Text data type is much more bigger than varchar, so I want to make sure 45 00:04:32,620 --> 00:04:37,390 that you can send seriously long commands to the victims. 46 00:04:39,890 --> 00:04:44,720 And also commandresults column for. 47 00:04:45,580 --> 00:04:49,060 Studying the results of commands, and it will be long text. 48 00:04:50,410 --> 00:04:56,850 It's way, way, way more bigger than text and text is way more bigger than varchar, etc.. 49 00:04:58,300 --> 00:04:59,970 So we are done here. 50 00:05:01,330 --> 00:05:04,960 You can list the tables using show tables command. 51 00:05:06,190 --> 00:05:09,640 As you can see, we have our users and victims tables. 52 00:05:10,690 --> 00:05:12,430 So that's it for this lecture. 53 00:05:12,580 --> 00:05:13,630 See you in the next one.