Communitygithub.com

bg-szy/TOP-SKILLS

Configura y ejecuta Ruzzy, el fuzzer de Ruby guiado por cobertura de Trail of Bits y el único listo para producción en el lenguaje. Cubre la estructura de harness, fuzzing de Ruby puro y extensiones nativas C en gemas, y compilaciones con sanitizadores. Úsalo al fuzzing de una biblioteca o gema de Ruby, al probar una extensión C de Ruby para seguridad de memoria, o al preguntar cómo hacer fuzzing en Ruby.

¿Qué es TOP-SKILLS?

Esta habilidad proporciona una guía completa para instalar, configurar y usar Ruzzy, el fuzzer de Ruby guiado por cobertura desarrollado por Trail of Bits, que es actualmente la única herramienta lista para producción para fuzzing en Ruby. Su principal utilidad radica en la detección de vulnerabilidades de memoria y comportamiento indefinido tanto en código Ruby puro como en extensiones C de gemas, gracias a la integración con sanitizadores como AddressSanitizer y UndefinedBehaviorSanitizer. La habilidad explica paso a paso cómo escribir harnesses de fuzzing, ya sea para código Ruby puro (que requiere un script tracer adicional) o para extensiones C (con un único archivo), y detalla la compilación de gemas con flags de sanitización. Además, cubre la ejecución de campañas de fuzzing, la interpretación de resultados y la resolución de problemas comunes, apoyándose en recursos externos clave como el repositorio oficial de Ruzzy y la documentación de libFuzzer.

Compatible con~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/bg-szy/TOP-SKILLS/tree/HEAD/skills/skills/ruzzy

Preguntar en tu IA favorita

Abre un nuevo chat con esta habilidad de agente ya precargada.

Documentación

Ruzzy

Ruzzy es un fuzzer guiado por cobertura para Ruby construido sobre libFuzzer. Permite fuzzing tanto de código Ruby puro como de extensiones C de Ruby con soporte de sanitizadores para detectar corrupción de memoria y comportamiento indefinido.

Cuándo usar

Ruzzy es actualmente el único fuzzer guiado por cobertura listo para producción para Ruby.

Elige Ruzzy cuando:

  • Realices fuzzing de aplicaciones o bibliotecas Ruby
  • Pruebes extensiones C de Ruby para problemas de seguridad de memoria
  • Necesites fuzzing guiado por cobertura para código Ruby
  • Trabajes con gemas Ruby que tengan extensiones nativas

Inicio rápido

Configura el entorno:

export ASAN_OPTIONS="allocator_may_return_null=1:detect_leaks=0:use_sigaltstack=0"

Prueba con el ejemplo incluido:

LD_PRELOAD=$(ruby -e 'require "ruzzy"; print Ruzzy::ASAN_PATH') \
    ruby -e 'require "ruzzy"; Ruzzy.dummy'

Esto debería encontrar rápidamente un fallo que demuestre que Ruzzy funciona correctamente.

Instalación

Soporte de plataforma

Ruzzy soporta Linux x86-64 y AArch64/ARM64. Para macOS o Windows, usa el Dockerfile o el entorno de desarrollo.

Prerrequisitos

  • Linux x86-64 o AArch64/ARM64
  • Versión reciente de clang (probado desde 14.0.0, se recomienda la última versión)
  • Ruby con gem instalado

Comando de instalación

Instala Ruzzy con las banderas del compilador clang:

MAKE="make --environment-overrides V=1" \
CC="/ruta/a/clang" \
CXX="/ruta/a/clang++" \
LDSHARED="/ruta/a/clang -shared" \
LDSHAREDXX="/ruta/a/clang++ -shared" \
    gem install ruzzy

Variables de entorno explicadas:

  • MAKE: Sobrescribe make para respetar las variables de entorno subsiguientes
  • CC, CXX, LDSHARED, LDSHAREDXX: Aseguran que se usen los binarios clang adecuados para las últimas características

Solución de problemas de instalación

Si la instalación falla, habilita la salida de depuración:

RUZZY_DEBUG=1 gem install --verbose ruzzy

Verificación

Verifica la instalación ejecutando el ejemplo de juguete (ver sección de Inicio rápido).

Escribiendo un harness

Fuzzing de código Ruby puro

El fuzzing de Ruby puro requiere dos scripts debido a detalles de implementación del intérprete Ruby.

Script tracer (test_tracer.rb):

# frozen_string_literal: true

require 'ruzzy'

Ruzzy.trace('test_harness.rb')

Script harness (test_harness.rb):

# frozen_string_literal: true

require 'ruzzy'

def fuzzing_target(input)
  # Tu código a fuzzear aquí
  if input.length == 4
    if input[0] == 'F'
      if input[1] == 'U'
        if input[2] == 'Z'
          if input[3] == 'Z'
            raise
          end
        end
      end
    end
  end
end

test_one_input = lambda do |data|
  fuzzing_target(data)
  return 0
end

Ruzzy.fuzz(test_one_input)

Ejecuta con:

LD_PRELOAD=$(ruby -e 'require "ruzzy"; print Ruzzy::ASAN_PATH') \
    ruby test_tracer.rb

Fuzzing de extensiones C de Ruby

Las extensiones C se pueden fuzzear con un solo archivo harness, sin necesidad de tracer.

Ejemplo de harness para msgpack (fuzz_msgpack.rb):

# frozen_string_literal: true

require 'msgpack'
require 'ruzzy'

test_one_input = lambda do |data|
  begin
    MessagePack.unpack(data)
  rescue Exception
    # Buscamos corrupción de memoria, no excepciones Ruby
  end
  return 0
end

Ruzzy.fuzz(test_one_input)

Ejecuta con:

LD_PRELOAD=$(ruby -e 'require "ruzzy"; print Ruzzy::ASAN_PATH') \
    ruby fuzz_msgpack.rb

Reglas del harness

HazNo hagas
Captura excepciones Ruby si pruebas extensiones CDejes que excepciones Ruby fallen el fuzzer
Devuelve 0 de la lambda test_one_inputDevuelvas otros valores
Mantén el harness deterministaUses aleatoriedad o lógica basada en tiempo
Usa el script tracer para Ruby puroOmitas el tracer para código Ruby puro

Ver también: Para técnicas detalladas de escritura de harnesses, patrones para manejar entradas complejas y estrategias avanzadas, consulta la habilidad técnica fuzz-harness-writing.

Compilación

Instalando gemas con sanitizadores

Al instalar gemas Ruby con extensiones C para fuzzing, compila con banderas de sanitización:

MAKE="make --environment-overrides V=1" \
CC="/ruta/a/clang" \
CXX="/ruta/a/clang++" \
LDSHARED="/ruta/a/clang -shared" \
LDSHAREDXX="/ruta/a/clang++ -shared" \
CFLAGS="-fsanitize=address,fuzzer-no-link -fno-omit-frame-pointer -fno-common -fPIC -g" \
CXXFLAGS="-fsanitize=address,fuzzer-no-link -fno-omit-frame-pointer -fno-common -fPIC -g" \
    gem install <nombre-de-la-gema>

Banderas de compilación

BanderaPropósito
-fsanitize=address,fuzzer-no-linkHabilita AddressSanitizer e instrumentación del fuzzer
-fno-omit-frame-pointerMejora la calidad de los stack traces
-fno-commonMejor compatibilidad con sanitizadores
-fPICCódigo independiente de posición para bibliotecas compartidas
-gIncluye símbolos de depuración

Ejecutando campañas

Configuración del entorno

Antes de ejecutar cualquier campaña de fuzzing, configura ASAN_OPTIONS:

export ASAN_OPTIONS="allocator_may_return_null=1:detect_leaks=0:use_sigaltstack=0"

Opciones explicadas:

  1. allocator_may_return_null=1: Omite fallos de asignación comunes de bajo impacto (DoS)
  2. detect_leaks=0: El intérprete Ruby filtra datos, ignora esto por ahora
  3. use_sigaltstack=0: Ruby recomienda deshabilitar sigaltstack con ASan

Ejecución básica

LD_PRELOAD=$(ruby -e 'require "ruzzy"; print Ruzzy::ASAN_PATH') \
    ruby harness.rb

Nota: LD_PRELOAD es necesario para la inyección del sanitizador. A diferencia de ASAN_OPTIONS, no lo exportes ya que podría interferir con otros programas.

Con corpus

LD_PRELOAD=$(ruby -e 'require "ruzzy"; print Ruzzy::ASAN_PATH') \
    ruby harness.rb /ruta/al/corpus

Pasando opciones de libFuzzer

Todas las opciones de libFuzzer se pueden pasar como argumentos:

LD_PRELOAD=$(ruby -e 'require "ruzzy"; print Ruzzy::ASAN_PATH') \
    ruby harness.rb /ruta/al/corpus -max_len=1024 -timeout=10

Consulta opciones de libFuzzer para la referencia completa.

Reproduciendo fallos

Vuelve a ejecutar un caso de fallo pasando el archivo:

LD_PRELOAD=$(ruby -e 'require "ruzzy"; print Ruzzy::ASAN_PATH') \
    ruby harness.rb ./fallo-253420c1158bc6382093d409ce2e9cff5806e980

Interpretando la salida

SalidaSignificado
INFO: Running with entropic power scheduleCampaña de fuzzing iniciada
ERROR: AddressSanitizer: heap-use-after-freeCorrupción de memoria detectada
SUMMARY: libFuzzer: fuzz target exitedOcurrió una excepción Ruby
artifact_prefix='./'; Test unit written to ./fallo-*Entrada de fallo guardada
Base64: ...Codificación Base64 de la entrada de fallo

Integración de sanitizadores

AddressSanitizer (ASan)

Ruzzy incluye una biblioteca AddressSanitizer precompilada:

LD_PRELOAD=$(ruby -e 'require "ruzzy"; print Ruzzy::ASAN_PATH') \
    ruby harness.rb

Usa ASan para detectar:

  • Desbordamientos de búfer en heap
  • Desbordamientos de búfer en pila
  • Use-after-free
  • Double-free
  • Fugas de memoria (deshabilitadas por defecto en Ruzzy)

UndefinedBehaviorSanitizer (UBSan)

Ruzzy también incluye UBSan:

LD_PRELOAD=$(ruby -e 'require "ruzzy"; print Ruzzy::UBSAN_PATH') \
    ruby harness.rb

Usa UBSan para detectar:

  • Desbordamiento de enteros con signo
  • Desreferencias de puntero nulo
  • Acceso a memoria desalineada
  • División por cero

Problemas comunes con sanitizadores

ProblemaSolución
Advertencias de fuga del intérprete RubyUsa ASAN_OPTIONS=detect_leaks=0
Conflictos de sigaltstackUsa ASAN_OPTIONS=use_sigaltstack=0
Spam de fallos de asignaciónUsa ASAN_OPTIONS=allocator_may_return_null=1
LD_PRELOAD interfiere con herramientasNo lo exportes; configúralo en línea con el comando ruby

Ver también: Para configuración detallada de sanitizadores, problemas comunes y banderas avanzadas, consulta las habilidades técnicas address-sanitizer y undefined-behavior-sanitizer.

Ejemplos del mundo real

Ejemplo: msgpack-ruby

Fuzzing del analizador MessagePack msgpack para corrupción de memoria.

Instalación con sanitizadores:

MAKE="make --environment-overrides V=1" \
CC="/ruta/a/clang" \
CXX="/ruta/a/clang++" \
LDSHARED="/ruta/a/clang -shared" \
LDSHAREDXX="/ruta/a/clang++ -shared" \
CFLAGS="-fsanitize=address,fuzzer-no-link -fno-omit-frame-pointer -fno-common -fPIC -g" \
CXXFLAGS="-fsanitize=address,fuzzer-no-link -fno-omit-frame-pointer -fno-common -fPIC -g" \
    gem install msgpack

Harness (fuzz_msgpack.rb):

# frozen_string_literal: true

require 'msgpack'
require 'ruzzy'

test_one_input = lambda do |data|
  begin
    MessagePack.unpack(data)
  rescue Exception
    # Buscamos corrupción de memoria, no excepciones Ruby
  end
  return 0
end

Ruzzy.fuzz(test_one_input)

Ejecución:

export ASAN_OPTIONS="allocator_may_return_null=1:detect_leaks=0:use_sigaltstack=0"
LD_PRELOAD=$(ruby -e 'require "ruzzy"; print Ruzzy::ASAN_PATH') \
    ruby fuzz_msgpack.rb

Ejemplo: Objetivo Ruby puro

Fuzzing de código Ruby puro con un analizador personalizado.

Tracer (test_tracer.rb):

# frozen_string_literal: true

require 'ruzzy'

Ruzzy.trace('test_harness.rb')

Harness (test_harness.rb):

# frozen_string_literal: true

require 'ruzzy'
require_relative 'my_parser'

test_one_input = lambda do |data|
  begin
    MyParser.parse(data)
  rescue StandardError
    # Excepciones esperadas de entrada malformada
  end
  return 0
end

Ruzzy.fuzz(test_one_input)

Ejecución:

export ASAN_OPTIONS="allocator_may_return_null=1:detect_leaks=0:use_sigaltstack=0"
LD_PRELOAD=$(ruby -e 'require "ruzzy"; print Ruzzy::ASAN_PATH') \
    ruby test_tracer.rb

Solución de problemas

ProblemaCausaSolución
La instalación fallaVersión o ruta de clang incorrectaVerifica la ruta de clang, usa clang 14.0.0+
cannot open shared object fileLD_PRELOAD no configuradoConfigura LD_PRELOAD en línea con el comando ruby
El fuzzer sale inmediatamenteFalta el directorio del corpusCrea el directorio del corpus o pásalo como argumento
Sin progreso de coberturaRuby puro necesita tracerUsa el script tracer para código Ruby puro
Spam de detección de fugasFugas del intérprete RubyConfigura ASAN_OPTIONS=detect_leaks=0
Depuración de instalación necesariaErrores de compilaciónUsa RUZZY_DEBUG=1 gem install --verbose ruzzy

Habilidades relacionadas

Habilidades técnicas

HabilidadCaso de uso
fuzz-harness-writingGuía detallada para escribir harnesses efectivos
address-sanitizerDetección de errores de memoria durante el fuzzing
undefined-behavior-sanitizerDetección de comportamiento indefinido en extensiones C
libfuzzerComprensión de opciones de libFuzzer (Ruzzy está construido sobre libFuzzer)

Fuzzers relacionados

HabilidadCuándo considerar
libfuzzerAl fuzzear código de extensión C de Ruby directamente en C/C++
aflppEnfoque alternativo para fuzzear Ruby instrumentando el intérprete Ruby

Recursos

Recursos externos clave

Presentando Ruzzy, un fuzzer Ruby guiado por cobertura Publicación oficial del blog de Trail of Bits anunciando Ruzzy, cubriendo motivación, arquitectura y resultados iniciales.

Repositorio GitHub de Ruzzy Código fuente, ejemplos adicionales e instrucciones de desarrollo.

Documentación de libFuzzer Dado que Ruzzy está construido sobre libFuzzer, comprender las opciones y el comportamiento de libFuzzer es valioso.

Fuzzing de extensiones C de Ruby Guía detallada sobre fuzzing de extensiones C con banderas de compilación y ejemplos.

Fuzzing de código Ruby puro Guía detallada sobre el patrón de tracer requerido para fuzzing de Ruby puro.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

bg-szy/TOP-SKILLS

Brand-first landing page designer — runs a brand-identity interview (colors, typography, shape language), then generates and iterates on a polished landing page via Stitch with deployment-ready HTML. Use when the user asks to create, design, or build a landing page, homepage, or marketing page and has no established visual direction. Skip when they have a design mockup, need a dashboard or app UI, are working at component level, building a multi-page app, or restyling with known design tokens — use frontend-design instead.

bg-szy/TOP-SKILLS

Fill out Microsoft Azure Landing Zone (ALZ) Accelerator checklists by interviewing the user, mapping their Azure subscriptions, integrating IP addressing documentation, and applying Microsoft Cloud Adoption Framework best practices. Produces a completed Excel checklist (.xlsx) ready for ALZ deployment. Use this skill whenever the user mentions Azure Landing Zone, ALZ checklist, landing zone accelerator, platform landing zone configuration, ALZ bootstrap, hub-and-spoke setup, Azure network topology planning, or wants to fill out any ALZ-related checklist or configuration file. Also trigger when the user uploads an Excel file that contains tabs like "Accelerator - Bootstrap", "Accelerator - Bicep", or "Accelerator - Terraform".

bg-szy/TOP-SKILLS

Compose a premium, animated landing page section by section in Next.js + Tailwind + Motion (Framer Motion) — built on a real design system, with editorial copy and motion that feels human-crafted, not template-generated. Use when building or rebuilding a landing page, marketing site, or hero/feature/pricing/CTA sections that need to look production-ready and bespoke from day one.

bg-szy/TOP-SKILLS

Write high-converting landing page copy using proven frameworks like PAS (Problem-Agitate-Solution), AIDA, and StoryBrand. Creates headlines, value propositions, CTAs, and full page sections optimized for conversion. Use when users need landing page copy, sales page content, or marketing website text.

bg-szy/TOP-SKILLS

Optimize landing pages for conversions, performance, and SEO. Use when improving landing pages, increasing conversions, or optimizing page performance.

bg-szy/TOP-SKILLS

Review investment portfolios for risk, diversification, fees. Asset allocation recommendations, tax-loss harvesting, rebalancing.

bg-szy/TOP-SKILLS

Beads Viewer - Graph-aware triage engine for Beads projects. Computes PageRank, betweenness, critical path, and cycles. Use --robot-* flags for AI agents.

bg-szy/TOP-SKILLS

CI red? Call us. Pipeline fire brigade deploys. Use when user mentions CI failures, build errors, test failures, or pipeline issues. Do NOT load for: local builds, standard implementation work, reviews, or setup.

bg-szy/TOP-SKILLS

CASS Memory System - procedural memory for AI coding agents. Three-layer cognitive architecture with confidence decay, anti-pattern learning, cross-agent knowledge transfer, trauma guard safety system. Bun/TypeScript CLI.

bg-szy/TOP-SKILLS

Mandatory entry point: read this first for any request to make, create, edit, animate, or render a video, animation, or motion graphic, including a promo, explainer, captioned clip, title card, overlay, slideshow or interactive deck, Remotion port, or any HyperFrames HTML composition. Also use it to inspect, diagnose, validate, preview, publish, or batch-render an existing HyperFrames project. Inputs may be a website URL, GitHub PR, Figma design or URL, text or brief, existing footage, or music. It resumes project state, captures intent when applicable, selects and installs the owning workflow, and routes domain capabilities. HyperFrames is the default output framework unless the user explicitly chooses another framework for the deliverable or asks only to record a browser session.

bg-szy/TOP-SKILLS

Expert in building portfolios that actually land jobs and clients - not just showing work, but creating memorable experiences. Covers developer portfolios, designer portfolios, creative portfolios, and portfolios that convert visitors into opportunities.

bg-szy/TOP-SKILLS

Use when the user asks to "pre-launch check the landing page", "run a Quality-Score preflight", or "verify ad-to-page message match before launch"; produces an ad↔page continuity report — message-match gaps, above-the-fold check, page-speed read, form-friction count, mobile-render flags — as a pass/fix punch list. Not for redesigning or rewriting the page — use landing-optimizer; not for scoring the account or the RQS — use ad-account-auditor. 落地页体验预检/广告落地页一致性检查

bg-szy/TOP-SKILLS

Use when the user asks to "optimize our landing page for influencer traffic", "fix our promo-code landing page", or "improve conversion from a creator campaign"; produces a message-match audit, page-structure and social-proof recommendations, a promo-code/CTA conversion plan, and an A/B test roadmap. Not for measuring campaign results after launch — use performance-analyzer.

bg-szy/TOP-SKILLS

Audit a landing page, sales page or checkout page for conversion leaks and return a fix list ordered by expected revenue impact. Use when asked to review, critique or improve a landing page, sales page, opt-in page, product page or checkout flow, when conversion rate is low, when paid traffic is not converting, or when someone asks "why isn't this page converting" or wants a CRO / landing page review.

bg-szy/TOP-SKILLS

Landing page conversion optimization with layout rules, hero section design, and CTA psychology. Covers above-the-fold formula, social proof placement, mobile design, and F-pattern reading. Use for: startup landing pages, product pages, SaaS marketing, conversion optimization. Triggers: landing page, hero section, above the fold, conversion optimization, landing page design, cta button, hero image, landing page layout, saas landing page, product page design, conversion rate, landing page best practices

bg-szy/TOP-SKILLS

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

bg-szy/TOP-SKILLS

Landing page conversion optimization with layout rules, hero section design, and CTA psychology. Covers above-the-fold formula, social proof placement, mobile design, and F-pattern reading. Use for: startup landing pages, product pages, SaaS marketing, conversion optimization. Triggers: landing page, hero section, above the fold, conversion optimization, landing page design, cta button, hero image, landing page layout, saas landing page, product page design, conversion rate, landing page best practices

bg-szy/TOP-SKILLS

Account assets, equity and fund positions, P&L, cash flow records, account statements, margin ratios, buy-power estimates, order management, and DCA recurring investments via Longbridge (most require Trade permission). Frameworks: portfolio diagnosis, rebalancing, asset allocation, risk analysis (VaR/CVaR), performance attribution, and tax-loss harvesting. Triggers: "持仓", "账户", "盈亏", "资产", "对账单", "下单", "买入", "卖出", "撤单", "定投", "组合诊断", "再平衡", "资产配置", "风险分析", "绩效归因", "税损收割", "持倉", "賬戶", "盈虧", "對賬單", "下單", "買入", "賣出", "組合診斷", "再平衡", "稅損收割", "positions", "portfolio", "P&L", "order", "buy", "sell", "DCA", "statement", "risk analysis", "rebalancing", "tax harvesting", "我的风险", "持仓风险", "风险敞口", "資產", "資產配置", "風險分析", "績效歸因", "撤單

bg-szy/TOP-SKILLS

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

bg-szy/TOP-SKILLS

Process video files with audio extraction, format conversion (mp4, webm), and Whisper transcription. Use when user mentions video conversion, audio extraction, transcription, mp4, webm, ffmpeg, or whisper transcription.

Skills relacionados