forked from Velocidex/velociraptor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Windows.Registry.PortProxy artifact (Velocidex#140)
- Loading branch information
Showing
7 changed files
with
136 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: Windows.Registry.PortProxy | ||
description: | | ||
**Description**: | ||
This artifact will return any items in the Windows PortProxy service | ||
registry path. The most common configuration of this service is via the | ||
lolbin netsh.exe; Metaspoit and other common attack tools also have | ||
configuration modules. | ||
**Reference**: [Port Proxy detection] | ||
(http://www.dfirnotes.net/portproxy_detection/) | ||
**ATT&CK**: [T1090 - Connection Proxy](https://attack.mitre.org/techniques/T1090/) | ||
Adversaries may use a connection proxy to direct network traffic between | ||
systems or act as an intermediary for network communications to a command | ||
and control server to avoid direct connections to their infrastructure. | ||
author: Matt Green - @mgreen27 | ||
|
||
precondition: SELECT OS From info() where OS = 'windows' | ||
|
||
parameters: | ||
- name: KeyGlob | ||
default: HKEY_LOCAL_MACHINE\SYSTEM\*ControlSet*\services\PortProxy\** | ||
|
||
sources: | ||
- name: PortProxy | ||
queries: | ||
- SELECT FullPath, | ||
basename(path=dirname(path=dirname(path=FullPath))) as ProxyType, | ||
basename(path=dirname(path=FullPath)) as Protocol, | ||
regex_replace(source=basename(path=FullPath),re="/",replace=":") as Listening, | ||
regex_replace(source=Data.value,re="/",replace=":") as Destination, | ||
timestamp(epoch=Mtime.sec) as ModifiedTime, | ||
Type | ||
FROM glob(globs=KeyGlob, accessor="reg") | ||
WHERE Type | ||
|
||
|
||
reports: | ||
- type: CLIENT | ||
template: | | ||
Port Forwarding: PortProxy | ||
========================== | ||
{{ .Description }} | ||
{{ define "report" }} | ||
LET report = SELECT Protocol, | ||
ProxyType, | ||
Listening, | ||
Destination, | ||
ModifiedTime, | ||
ProxyType + Protocol + Listening + Destination as ServiceKey | ||
FROM source(source='PortProxy') | ||
GROUP BY ServiceKey | ||
{{ end }} | ||
{{ Query "report" "SELECT ProxyType, Protocol, Listening, Destination, ModifiedTime FROM report" | Table }} | ||
- type: HUNT | ||
template: | | ||
Port Forwarding: PortProxy | ||
========================== | ||
{{ .Description }} | ||
{{ define "report" }} | ||
LET report = SELECT Fqdn, | ||
Protocol, | ||
ProxyType, | ||
Listening, | ||
Destination, | ||
ModifiedTime, | ||
ProxyType + Protocol + Listening + Destination as ServiceKey | ||
FROM source(source='PortProxy') | ||
GROUP BY ServiceKey | ||
{{ end }} | ||
{{ Query "report" "SELECT Fqdn, ProxyType, Protocol, Listening, Destination, ModifiedTime FROM report" | Table }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
mklink "c:\users\link" "c:\Windows" | ||
mklink "c:\users\link" "c:\Windows" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters