You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: miscellaneous-reversing-forensics/get-injectedthread.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ description: >-
8
8
9
9
## Injecting Shellcode
10
10
11
-
Firstly, let's use an [injector](../offensive-security/t1055-process-injection/process-injection.md) program we wrote earlier to inject some shellcode into a process that will give us a reverse shell. In this case, we are injecting the shellcode into explorer.exe:
11
+
Firstly, let's use an [injector](../offensive-security/code-injection-process-injection/process-injection.md) program we wrote earlier to inject some shellcode into a process that will give us a reverse shell. In this case, we are injecting the shellcode into explorer.exe:
Copy file name to clipboardexpand all lines: offensive-security-experiments/active-directory-kerberos-abuse/from-dnsadmins-to-system-to-domain-compromise.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
In this lab I'm trying to get code execution with `SYSTEM` level privileges on a DC that runs a DNS service as originally researched by Shay Ber [here](https://medium.com/@esnesenon/feature-not-bug-dnsadmin-to-dc-compromise-in-one-line-a0f779b8dc83).
4
4
5
-
The attack relies on a [DLL injection](../../offensive-security/t1055-process-injection/dll-injection.md) into the dns service running as SYSTEM on the DNS server which most of the time is on a Domain Contoller.
5
+
The attack relies on a [DLL injection](../../offensive-security/code-injection-process-injection/dll-injection.md) into the dns service running as SYSTEM on the DNS server which most of the time is on a Domain Contoller.
However, if you have access to the system and enough privileges to change environment variables, the lock can be lifted by removing the variable `__PSLockdownPolicy` and re-spawning another powershell instance.
37
37
38
38
### Powershell Downgrade
39
39
40
40
If you have the ability to downgrade to Powershell 2.0, this can allow you to bypass the `ConstrainedLanguage`mode. Note how `$ExecutionContext.SessionState.LanguageMode` keeps returning `ConstrainedLangue` in powershell instances that were not launched with `-version Powershell 2` until it does not:
Copy file name to clipboardexpand all lines: offensive-security/code-execution/powershell-without-powershell.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ If you run into a situation where powershell.exe is blocked and no strict applic
10
10
rundll32.exe PowerShdll.dll,main
11
11
```
12
12
13
-

13
+

14
14
15
15
Note that the same could be achieved with a compiled .exe binary from the same project, but keep in mind that .exe is more likely to run into whitelisting issues.
16
16
@@ -22,9 +22,9 @@ Windows 10 comes with `SyncAppvPublishingServer.exe and` `SyncAppvPublishingServ

40
+

41
41
42
42
Note how regsvr32 process exits almost immediately. This means that just by looking at the list of processes on the victim machine, the evil process may not be immedialy evident... Not until you realise how it was invoked though. Sysmon commandline logging may help you detect this activity:

63
+

64
64
65
-

65
+

66
66
67
67
What is interesting is that I could not see an established network connection logged in sysmon logs, although I could see other network connections from the victim machine being logged.
A quick look at the dissasembly of the dll suggests that rundll32.exe will be spawned, a new thread will be created in suspended mode, which most likely will get injected with our shellcode and eventually resumed to execute that shellcode:
31
31
32
-

32
+

33
33
34
34
Invoking the shellcode via control.exe:
35
35
@@ -62,11 +62,11 @@ Copyright (c) 2009 Microsoft Corporation. All rights reserved.
62
62
63
63
Note how rundll32 spawns cmd.exe and establishes a connection back to the attacker - these are signs that should raise your suspicion when investingating a host for a compromise:
64
64
65
-

65
+

66
66
67
67
As always, sysmon logging can help in finding suspicious commandlines being executed in your environment:
@@ -36,7 +36,7 @@ Let's start calc.exe as our host / destination process - this is going to be the
36
36
37
37
### Destination ImageBaseAddress
38
38
39
-
Now, in order to hollow out the destination process, we need to know its `ImageBaseAddress`. We can get the location of image base address from the [PEB](../../memory-forensics/process-environment-block.md) structure of the host process via WinDBG - we know that the PEB is located at 0100e000:
39
+
Now, in order to hollow out the destination process, we need to know its `ImageBaseAddress`. We can get the location of image base address from the [PEB](../../miscellaneous-reversing-forensics/process-environment-block.md) structure of the host process via WinDBG - we know that the PEB is located at 0100e000:
Building an evil filter DLL based on a great [article](http://carnal0wnage.attackresearch.com/2013/09/stealing-passwords-every-time-they.html) by mubix. He has also kindly provided the code to use, which I modified slightly to make sure that the critical DLL functions were exported correctly in order for this technique to work, since mubix's code did not work for me out of the box. I also had to change the logging statements in order to rectify a couple of compiler issues:
0 commit comments