|
| 1 | +--- |
| 2 | +title: "PowerShell Exploiter" |
| 3 | +draft: false |
| 4 | +description: "Exploits PowerShell Remoting" |
| 5 | +tags: ["exploiter", "powershell", "brute force"] |
| 6 | +pre: "<i class='fa fa-terminal'></i> " |
| 7 | +--- |
| 8 | + |
| 9 | +## PowerShell Remoting |
| 10 | + |
| 11 | +[PowerShell Remoting]( |
| 12 | +https://docs.microsoft.com/en-us/powershell/scripting/learn/remoting/winrmsecurity) |
| 13 | +is a PowerShell feature that enables connecting to Windows machines remotely in |
| 14 | +order to execute PowerShell commands on them. It is commonly used by |
| 15 | +administrators to manage multiple systems in a network. |
| 16 | + |
| 17 | +## Exploitation |
| 18 | + |
| 19 | +Attackers that can successfully authenticate via PowerShell Remoting are able |
| 20 | +to execute arbitrary commands on the victim machine. Infection Monkey's |
| 21 | +PowerShell exploiter uses brute-force to attempt to propagate to a victim |
| 22 | +via PowerShell Remoting. |
| 23 | + |
| 24 | + |
| 27 | + |
| 28 | +### Credentials used |
| 29 | + |
| 30 | +The PowerShell exploiter can be run from both Linux and Windows attackers. On |
| 31 | +Windows attackers, the exploiter has the ability to use the cached username |
| 32 | +and/or password from the current user. When attacking from Linux or Windows, |
| 33 | +the exploiter uses all combinations of [user-configured credentials]( |
| 34 | +/usage/configuration/credentials), as well as credentials collected from other |
| 35 | +victims. Different combinations of credentials are attempted in the following |
| 36 | +order: |
| 37 | + |
| 38 | +1. **Cached username and password (Windows attacker only)** - The exploiter |
| 39 | + uses the stored credentials of the current user to attempt to log into |
| 40 | + the victim machine. |
| 41 | + |
| 42 | +1. **Brute force usernames with blank passwords** - Windows allows you to |
| 43 | + configure a user with a blank/empty password. The exploiter attempts to |
| 44 | + log into the victim machine using usernames set in the |
| 45 | + [configuration](/usage/configuration/credentials) or stolen from other |
| 46 | + victims, and a blank password. |
| 47 | + |
| 48 | + In order for the attacker to connect with a blank password, the victim must |
| 49 | + have enabled basic authentication, http and no encryption. |
| 50 | + |
| 51 | +1. **Brute force usernames with cached password (Windows attacker only)** - The |
| 52 | + exploiter attempts to log into the victim machine using usernames |
| 53 | + set in the [configuration](/usage/configuration/credentials) or stolen from |
| 54 | + other victims, and the current user's cached password. |
| 55 | + |
| 56 | +1. **Brute force usernames and passwords** - The exploiter attempts to use |
| 57 | + all combinations of usernames and passwords that were set in the |
| 58 | + [configuration](/usage/configuration/credentials) or stolen from other |
| 59 | + victims. |
| 60 | + |
| 61 | +1. **Brute force usernames and LM hashes** - The exploiter attempts to use |
| 62 | + all combinations of usernames and LM hashes that were set in the |
| 63 | + [configuration](/usage/configuration/credentials) or stolen from other |
| 64 | + victims. |
| 65 | + |
| 66 | +1. **Brute force usernames and NT hashes** - The exploiter attempts to use |
| 67 | + all combinations of usernames and NT hashes that were set in the |
| 68 | + [configuration](/usage/configuration/credentials) or stolen from other |
| 69 | + victims. |
| 70 | + |
| 71 | +Note that techniques that use cached credentials, are only possible from |
| 72 | +Windows attackers. |
| 73 | + |
| 74 | +## Mitigation |
| 75 | + |
| 76 | +1. Restrict PowerShell remote command execution. |
| 77 | +1. Harden the credentials of relevant users by enforcing strong password |
| 78 | + policies. |
| 79 | +1. Enable multi-factor authentication. |
| 80 | + |
| 81 | +More information about how to remediate security concerns related to PowerShell |
| 82 | +Remoting can be found [here]( |
| 83 | +https://docs.microsoft.com/en-us/powershell/scripting/learn/remoting/winrmsecurity). |
| 84 | + |
| 85 | +## See also |
| 86 | +- [PowerShell exploiter reference documentation](/reference/exploiters/powershell) |
0 commit comments