↓ Skip to main content
  1. Writeups/
  2. CyberDefenders/

PsExec Hunt

Tools: Wireshark
Table of Contents

Description
#

An alert from the Intrusion Detection System (IDS) flagged suspicious lateral movement activity involving PsExec. This indicates potential unauthorized access and movement across the network. As a SOC Analyst, your task is to investigate the provided PCAP file to trace the attacker’s activities. Identify their entry point, the machines targeted, the extent of the breach, and any critical indicators that reveal their tactics and objectives within the compromised environment.

Check the challenge here.

Solution
#

We get a zip file (143-psexec-hunt.zip) that gives us a .pcapng file to analyze for this challenge (psexec-hunt.pcapng).


Q1: To effectively trace the attacker’s activities within our network, can you identify the IP address of the machine from which the attacker initially gained access?

We can open the file in wireshark and start analyzing it. The challenge mentions PsExec a utility that abuses SMB to execute commands on a Windows machine. So we can check for SMB traffick in the file and see where the PsExec file was uploaded:

Wireshark first look

The traffic is pretty easy to find by just scrolling through the file. There we can assume that the source address that uploads the file is our attacker.

Flag: 10.0.0.130


Q2: To fully understand the extent of the breach, can you determine the hostname of the machine to which the attacker first pivoted?

To get information about the machine targeted by the attacker, we can try to dig into the SMB packets and try to get the hostname from them. The host name is tagged in a packet’s property as Target Name.

Getting Hostname

Flag: SALES-PC


Q3: Knowing the username of the account the attacker used for authentication will provide insight into the extent of the breach. What username did the attacker use to authenticate?

In the Session Setup Request packet we can find details about the authentication process. In the NTLM Secure Service Provider section of the packet we can see the username used to establish the connection.

Getting Username

Flag: ssales


Q4: After determining how the attacker moved through the network, we need to understand what they did on the target machine. What is the name of the service executable the attacker installed on the target?

We can also see in the previous screenshots that the attacker made a Create Request File for the file PSEXESVC.EXE which is the executable used to compromise the machine.

Flag: psexesvc.exe


Q5: Understanding how the attacker installed the service can help identify other systems affected by the same lateral movement technique. Which network share did PsExec use to install the service on the target machine?

This challenge can easily be solved with the general knowledge that PsExec uses the Admin$ share to upload executables on the target machine.

But we can also see in the screenshots above that the attacker made a Tree Connect Request Tree to the Admin$ share before making the Create Request File.

Flag: Admin$


Q6: Which network share did PsExec use to communicate between the two machines?

PsExec communicates over named pipes stored in the IPC$ share. In our caputre the pipes are named something like this: PSEXESVC-HR-PC-7980-stidin, and other names as well. An we can see in the packet capture that these files are requested from IPC$.

Communication Share

Flag: IPC$


Q7: What is the hostname of the second machine the attacker targeted while moving through the network?

We found the first machine by checking the Session Setup Response SMB packet that contain the computer hostname. We can filter for those packets and the SMB protocol in wireshark and see which packets do not have the same hostname.

Lateral Movement

Flag: MARKETING-PC

Vlad Șteopoaie
Author
Vlad Șteopoaie
A.K.A. h3pha