Covenant SC.exe Utility Query

Metadata

Author

Roberto Rodriguez @Cyb3rWard0g

Creation Date

2020/08/05

Modification Date

2020/08/05

Tactics

[‘TA0008’]

Techniques

[‘T1021.002’]

Tags

[‘RPC QueryServiceStatus’, ‘SMB Svcctl’]

Dataset Description

This dataset represents an adversary leveraging the sc.exe utility to query (RPC QueryServiceStatus method) for the statu of a service on a remote endpoint.

Notebooks

Notebooks created by the community leveraging the mordor datasets

Author

Name

Link

Simulation Plan

Environment

Tool Type

Module

Mordor shire

C2

SharpSC

Adversary View

sc.exe \\WORKSTATION6 query ikeext

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/lateral_movement/host/covenant_sc_query_dcerpc_smb_svcctl.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|10     |295  |
|WORKSTATION6.theshire.local|Microsoft-Windows-Sysmon/Operational|13     |70   |
|WORKSTATION5.theshire.local|Microsoft-Windows-Sysmon/Operational|7      |55   |
|WORKSTATION5.theshire.local|Security                            |5158   |20   |
|WORKSTATION5.theshire.local|Security                            |5156   |18   |
|WORKSTATION5.theshire.local|Microsoft-Windows-Sysmon/Operational|12     |13   |
|WORKSTATION6.theshire.local|Microsoft-Windows-Sysmon/Operational|10     |13   |
|WORKSTATION6.theshire.local|Security                            |5158   |13   |
|WORKSTATION6.theshire.local|Security                            |5156   |12   |
|MORDORDC.theshire.local    |Microsoft-Windows-Sysmon/Operational|7      |10   |
|MORDORDC.theshire.local    |Security                            |5156   |7    |
|MORDORDC.theshire.local    |Microsoft-Windows-Sysmon/Operational|3      |7    |
|WORKSTATION5.theshire.local|Microsoft-Windows-Sysmon/Operational|5      |5    |
|WORKSTATION6.theshire.local|Microsoft-Windows-Sysmon/Operational|12     |5    |
|MORDORDC.theshire.local    |Security                            |5157   |5    |
|WORKSTATION5.theshire.local|Security                            |4689   |5    |
|WORKSTATION5.theshire.local|Microsoft-Windows-Sysmon/Operational|3      |4    |
|WORKSTATION5.theshire.local|Microsoft-Windows-Sysmon/Operational|11     |4    |
|WORKSTATION6.theshire.local|Microsoft-Windows-Sysmon/Operational|11     |4    |
|MORDORDC.theshire.local    |Microsoft-Windows-Sysmon/Operational|9      |4    |
+---------------------------+------------------------------------+-------+-----+
only showing top 20 rows