Communitygithub.com

Caido Mode

Caido API용 전체 CLI 도구. HTTP 기록 검색, 요청 수정 및 재전송, 세션 관리, 스코프 설정 등 보안 테스트 워크플로우를 CLI에서 직접 수행합니다.

Caido Mode란 무엇인가요?

Caido Mode는 Caido 웹 보안 테스트 플랫폼의 API를 커버하는 종합 CLI 도구입니다. 이 스킬을 통해 사용자는 HTTP 기록(HTTPQL 검색, 요청 ID 조회), 요청 편집/재전송(쿠키/인증 헤더 유지), 세션/컬렉션 관리, 퍼징, 스코프(허용/차단 목록) 생성, 필터 프리셋 저장, 환경 변수 관리(취약점 테스트용 변수 저장), 보안 발견(Findings) 생성/업데이트, 프로젝트 전환, 호스트 파일 관리, 인터셉트 제어, 플러그인 조회, 상태 확인 등을 지원합니다. 이 스킬은 Caido의 공식 `@caido/sdk-client` 패키지를 기반으로 하며, 모든 트래픽은 Caido를 통해 전달되어 UI에서 추가 분석이 가능합니다. 특히 유기적인 요청을 찾아 쿠키나 인증 토큰을 수동으로 복사하지 않고 헤더를 유지한 채 경로, 메서드, 본문만 수정하여 재전송할 수 있는 `edit` 명령어가 핵심 기능입니다. 인증은 PAT(Personal Access Token) 기반으로 한 번 설정하면 토큰이 `~/.agents/config/secrets.json`에 캐시되어 CLI 호출 간에 재사용됩니다.

지원 대상✓Claude Code~Codex CLI✓Cursor✓OpenCode
npx skills add Aceproulx/claude-skills

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

Caido Mode Skill

개요

Caido API를 위한 전체 CLI 도구입니다. 공식 @caido/sdk-client 패키지를 기반으로 하며 다음 기능을 지원합니다:

  • HTTP 기록 - HTTPQL을 사용한 검색, 조회, 재전송, 요청 수정
  • 재전송 및 세션 - 세션, 컬렉션, 엔트리, 퍼징
  • 스코프 - 테스트 스코프 생성 및 관리 (허용/차단 목록 패턴)
  • 필터 프리셋 - HTTPQL 필터 프리셋 저장 및 재사용
  • 환경 변수 - 테스트 변수 저장 (취약점 대상 ID, 토큰 등)
  • 발견 항목 - 보안 발견 항목 생성, 목록 조회, 업데이트
  • 작업 - 백그라운드 작업 모니터링 및 취소
  • 프로젝트 - 테스트 프로젝트 간 전환
  • 호스트 파일 - Caido가 제공하는 파일 관리
  • 인터셉트 - 프로그래밍 방식으로 요청 인터셉트 활성화/비활성화
  • 플러그인 - 설치된 플러그인 목록 조회
  • 내보내기 - 요청을 PoC용 curl 명령어로 변환
  • 상태 확인 - Caido 인스턴스 상태 확인

모든 트래픽은 Caido를 통해 전달되므로 UI에서 추가 분석이 가능합니다.

이 모델을 사용하는 이유?

쿠키와 인증 토큰이 매우 클 수 있습니다 - 세션 쿠키, JWT, CSRF 토큰은 쉽게 1-2KB가 될 수 있습니다. 수동으로 복사/붙여넣기 대신:

  1. Caido의 HTTP 기록에서 유효한 인증이 있는 유기적인 요청을 찾습니다
  2. edit 명령어로 필요한 부분만 수정 (경로, 메서드, 본문)하면서 모든 인증 헤더는 그대로 유지합니다
  3. 전송합니다 - 응답이 전체 컨텍스트와 함께 반환됩니다

인증 설정

초기 설정 (한 번만)

  1. 대시보드 → 개발자 → 개인 액세스 토큰을 열어주세요
  2. 새 토큰을 생성합니다
  3. 다음 명령어를 실행합니다:
npx tsx ~/.agents/skills/caido-mode/caido-client.ts setup <your-pat>

# 기본이 아닌 Caido 인스턴스
npx tsx ~/.agents/skills/caido-mode/caido-client.ts setup <pat> http://192.168.1.100:8080

# 또는 환경 변수로 설정
export CAIDO_PAT=caido_xxxxx

setup 명령어는 SDK를 통해 PAT를 검증하고(액세스 토큰으로 교환), PAT와 캐시된 액세스 토큰을 ~/.agents/config/secrets.json에 저장합니다. 이후 실행 시 캐시된 토큰을 직접 로드하며, 유효한 캐시 토큰이 있으면 PAT가 없어도 사용할 수 있습니다.

상태 확인

npx tsx ~/.agents/skills/caido-mode/caido-client.ts auth-status

인증 작동 방식

SDK는 내부적으로 디바이스 코드 플로우를 사용하며, PAT가 이를 자동 승인하고 액세스 토큰과 리프레시 토큰을 받습니다. 커스텀 SecretsTokenCache(SDK의 TokenCache 인터페이스 구현)가 이러한 토큰을 secrets.json에 저장하여 CLI 호출 간에 유지되도록 합니다.

인증 우선순위: CAIDO_PAT 환경 변수 → ~/.agents/config/secrets.json의 PAT → 유효한 캐시된 액세스 토큰 → 설정 안내와 함께 오류

CLI 도구

위치: ~/.agents/skills/caido-mode/caido-client.ts. 모든 명령어는 JSON을 출력합니다.


HTTP 기록 및 테스트 명령어

search - HTTP 기록을 HTTPQL로 검색

npx tsx caido-client.ts search 'req.method.eq:"POST" AND resp.code.eq:200'
npx tsx caido-client.ts search 'req.host.cont:"api"' --limit 50
npx tsx caido-client.ts search 'req.host.cont:"api"' --desc --limit 10
npx tsx caido-client.ts search 'req.path.cont:"/admin"' --ids-only
npx tsx caido-client.ts search 'resp.raw.cont:"password"' --after <cursor>

recent - 최근 요청 조회

npx tsx caido-client.ts recent
npx tsx caido-client.ts recent --limit 50

get / get-response - 전체 세부 정보 조회

npx tsx caido-client.ts get <request-id>
npx tsx caido-client.ts get <request-id> --headers-only
npx tsx caido-client.ts get-response <request-id>
npx tsx caido-client.ts get-response <request-id> --compact

edit - 수정 및 재전송 (핵심 기능)

기존 요청을 수정하면서 모든 쿠키/인증 헤더를 보존합니다:

# 경로 변경 (IDOR 테스트)
npx tsx caido-client.ts edit <id> --path /api/user/999

# 메서드 변경 및 본문 추가
npx tsx caido-client.ts edit <id> --method POST --body '{"admin":true}'

# 헤더 추가/제거
npx tsx caido-client.ts edit <id> --set-header "X-Forwarded-For: 127.0.0.1"
npx tsx caido-client.ts edit <id> --remove-header "X-CSRF-Token"

# 요청 내 텍스트 찾기/바꾸기
npx tsx caido-client.ts edit <id> --replace "user123:::user456"

# 여러 수정 사항 결합
npx tsx caido-client.ts edit <id> --method PUT --path /api/admin --body '{"role":"admin"}' --compact

# 기존 재전송 탭/세션 재사용 (반복 탐색용)
npx tsx caido-client.ts edit <id> --path /api/user/1001 --session <session-id> --compact
옵션설명
--method <METHOD>HTTP 메서드 변경
--path <path>요청 경로 변경
--set-header <Name: Value>헤더 추가 또는 교체 (반복 가능)
--remove-header <Name>헤더 제거 (반복 가능)
--body <content>요청 본문 설정 (Content-Length 자동 업데이트)
--replace <from>:::<to>요청 내 텍스트 찾기/바꾸기 (반복 가능)
--session <id>새 탭 대신 기존 재전송 세션 재사용
--collection <id>새로 생성된 재전송 세션을 컬렉션에 저장
--sni <host>TLS SNI 재정의
--connect-host <host>HTTP 요청은 유지하면서 다른 호스트에 연결
--connect-port <port>다른 포트에 연결
--connect-tls / --connect-no-tls연결에 TLS/평문 강제 적용

replay / send-raw - 요청 전송

# 원본 그대로 재전송
npx tsx caido-client.ts replay <request-id>

# 사용자 정의 raw로 재전송
npx tsx caido-client.ts replay <id> --raw "GET /modified HTTP/1.1\r\nHost: example.com\r\n\r\n"

# 완전히 사용자 정의 요청 전송
npx tsx caido-client.ts send-raw --host example.com --port 443 --tls --raw "GET / HTTP/1.1\r\nHost: example.com\r\n\r\n"
npx tsx caido-client.ts send-raw --host example.com --raw @request.txt --name "G /"
cat request.txt | npx tsx caido-client.ts send-raw --host example.com --raw -

# 요청의 Host/SNI는 유지하면서 다른 곳에 연결
npx tsx caido-client.ts replay <id> --connect-host 10.0.0.5 --connect-port 8443 --sni example.com

--raw는 \r\n 이스케이프 문자열, 디스크에서 읽을 @file, stdin에서 읽을 -을 지원합니다.

export-curl - PoC용 curl로 변환

npx tsx caido-client.ts export-curl <request-id>

모든 헤더와 본문이 포함된 바로 사용 가능한 curl 명령어를 출력합니다.


재전송 탭 조회

Caido 재전송 탭이 이미 열려 있고 해당 활성 엔트리에서 직접 작업하려는 경우에 사용합니다.

npx tsx caido-client.ts get-session <session-id-or-name> --compact
npx tsx caido-client.ts replay-entries <session-id-or-name> --limit 20
npx tsx caido-client.ts replay-entries <session-id-or-name> --raw --compact
npx tsx caido-client.ts edit-session <session-id-or-name> --body '{"test":true}' --compact

session-entries는 replay-entries의 별칭으로 허용됩니다.


재전송 세션 및 컬렉션

세션

# 기존 요청에서 재전송 세션 생성
npx tsx caido-client.ts create-session <request-id>
npx tsx caido-client.ts create-session <request-id> --collection <collection-id>

# Caido UI에서 쉽게 식별할 수 있도록 세션 이름을 항상 변경하세요
npx tsx caido-client.ts rename-session <session-id> "idor-user-profile"

# 모든 재전송 세션 목록 조회
npx tsx caido-client.ts replay-sessions
npx tsx caido-client.ts replay-sessions --limit 50

# 세션을 컬렉션 간 이동
npx tsx caido-client.ts move-session <session-id> <collection-id>

# 재전송 세션 삭제
npx tsx caido-client.ts delete-sessions <session-id-1>,<session-id-2>

컬렉션

재전송 세션을 컬렉션으로 구성:

# 재전송 컬렉션 목록 조회
npx tsx caido-client.ts replay-collections
npx tsx caido-client.ts replay-collections --limit 50

# 컬렉션 생성
npx tsx caido-client.ts create-collection "IDOR Testing"

# 컬렉션 이름 변경
npx tsx caido-client.ts rename-collection <collection-id> "Auth Bypass Tests"

# 컬렉션 삭제
npx tsx caido-client.ts delete-collection <collection-id>

퍼징

# 퍼징용 자동화 세션 생성
npx tsx caido-client.ts create-automate-session <request-id>

# 퍼징 시작 (먼저 Caido UI에서 페이로드와 마커 구성)
npx tsx caido-client.ts fuzz <session-id>

스코프 관리

테스트 스코프를 정의합니다. 글로브 패턴을 사용합니다.

# 모든 스코프 목록 조회
npx tsx caido-client.ts scopes

# 허용 목록과 차단 목록으로 스코프 생성
npx tsx caido-client.ts create-scope "Target Corp" --allow "*.target.com,*.target.io" --deny "*.cdn.target.com"

# 스코프 업데이트
npx tsx caido-client.ts update-scope <scope-id> --allow "*.target.com,*.api.target.com"

# 스코프 삭제
npx tsx caido-client.ts delete-scope <scope-id>

글로브 패턴: *.example.com은 example.com의 모든 하위 도메인과 일치합니다.


필터 프리셋

자주 사용하는 HTTPQL 쿼리를 명명된 프리셋으로 저장합니다.

# 저장된 필터 목록 조회
npx tsx caido-client.ts filters

# 필터 프리셋 생성
npx tsx caido-client.ts create-filter "API Errors" --query 'req.path.cont:"/api/" AND resp.code.gte:400'
npx tsx caido-client.ts create-filter "Auth Endpoints" --query 'req.path.regex:"/(login|auth|oauth)/"' --alias "auth"

# 필터 업데이트
npx tsx caido-client.ts update-filter <filter-id> --query 'req.path.cont:"/api/" AND resp.code.gte:500'

# 필터 삭제
npx tsx caido-client.ts delete-filter <filter-id>

환경 변수

세션 간에 유지되는 테스트 변수를 저장합니다. 여러 사용자 ID로 IDOR 테스트할 때 유용합니다.

# 환경 목록 조회
npx tsx caido-client.ts envs

# 환경 생성
npx tsx caido-client.ts create-env "IDOR-Test"

# 변수 설정
npx tsx caido-client.ts env-set <env-id> victim_user_id "user_456"
npx tsx caido-client.ts env-set <env-id> attacker_token "eyJhbG..."

# 활성 환경 선택
npx tsx caido-client.ts select-env <env-id>

# 환경 선택 해제
npx tsx caido-client.ts select-env

# 환경 삭제
npx tsx caido-client.ts delete-env <env-id>

발견 항목

보안 발견 항목을 생성, 목록 조회, 업데이트합니다. Caido의 발견 항목 탭에 표시됩니다.

# 모든 발견 항목 목록 조회
npx tsx caido-client.ts findings
npx tsx caido-client.ts findings --limit 50

# 특정 발견 항목 조회
npx tsx caido-client.ts get-finding <finding-id>

# 요청에 연결된 발견 항목 생성
npx tsx caido-client.ts create-finding <request-id> \
  --title "사용자 프로필 엔드포인트의 IDOR" \
  --description "ID 매개변수를 변경하여 다른 사용자의 프로필에 접근 가능" \
  --reporter "rez0"

# 중복 제거 키 포함 (중복 방지)
npx tsx caido-client.ts create-finding <request-id> \
  --title "/admin의 인증 우회" \
  --dedupe-key "admin-auth-bypass"

# 발견 항목 업데이트
npx tsx caido-client.ts update-finding <finding-id> \
  --title "업데이트된 제목" \
  --description "업데이트된 설명"

작업

백그라운드 작업(가져오기, 내보내기 등)을 모니터링하고 취소합니다.

# 모든 작업 목록 조회
npx tsx caido-client.ts tasks

# 실행 중인 작업 취소
npx tsx caido-client.ts cancel-task <task-id>

프로젝트 관리

# 모든 프로젝트 목록 조회
npx tsx caido-client.ts projects

# 활성 프로젝트 전환
npx tsx caido-client.ts select-project <project-id>

호스트 파일

# 호스트 파일 목록 조회
npx tsx caido-client.ts hosted-files

# 호스트 파일 삭제
npx tsx caido-client.ts delete-hosted-file <file-id>

인터셉트 제어

# 인터셉트 상태 확인
npx tsx caido-client.ts intercept-status

# 인터셉트 활성화/비활성화
npx tsx caido-client.ts intercept-enable
npx tsx caido-client.ts intercept-disable

정보, 상태 및 플러그인

# 현재 사용자 정보
npx tsx caido-client.ts viewer

# 설치된 플러그인 목록 조회
npx tsx caido-client.ts plugins

# Caido 인스턴스 상태 확인 (버전, 준비 상태)
npx tsx caido-client.ts health

출력 제어

get, get-response, replay, edit, send-raw 명령어와 함께 사용합니다:

플래그설명
--max-body <n>최대 응답 본문 라인 수 (기본값: 200, 0=무제한)
--max-body-chars <n>최대 본문 문자 수 (기본값: 5000, 0=무제한)
--no-request출력에서 요청 raw 생략
--headers-onlyHTTP 헤더만, 본문 없음
--compact단축 표기: --no-request --max-body 50 --max-body-chars 5000

HTTPQL 참조

HTTP 기록 검색을 위한 Caido의 쿼리 언어입니다.

중요: 문자열 값은 반드시 따옴표로 묶어야 합니다. 정수 값은 따옴표로 묶지 않습니다.

중요: HTTPQL에는 NOT 연산자가 없습니다. NOT expr을 작성하지 마세요. 대신 부정된 연산자 변형을 사용하세요:

  • ncont (포함하지 않음), nlike (같지 않음), nregex (정규식 일치하지 않음), ne (같지 않음)
  • 잘못된 예: NOT req.path.cont:"/admin"
  • 올바른 예: req.path.ncont:"/admin"

네임스페이스 및 필드

네임스페이스필드유형설명
reqextstring파일 확장자 (. 포함)
reqhoststring호스트명
reqmethodstringHTTP 메서드 (대문자)
reqpathstringURL 경로
reqquerystring쿼리 문자열
reqrawstring전체 raw 요청
reqportint포트 번호
reqlenint요청 본문 길이
reqcreated_atdate생성 타임스탬프
reqtlsboolHTTPS 여부
resprawstring전체 raw 응답
respcodeint상태 코드
resplenint응답 본문 길이
resproundtripint왕복 시간 (ms)
rowidint요청 ID
source-특수"intercept", "replay", "automate", "workflow"
preset-특수필터 프리셋 참조

연산자

문자열: eq, ne, cont, ncont, like, nlike, regex, nregex 정수: eq, ne, gt, gte, lt, lte 불리언: eq, ne 논리: AND, OR, 그룹화용 괄호

쿼리 예제

# 200 응답의 POST 요청
req.method.eq:"POST" AND resp.code.eq:200

# API 요청
req.host.cont:"api" OR req.path.cont:"/api"

# 오류 응답 (상태 코드 >= 400)
resp.code.gte:400

# JavaScript 파일
req.ext.eq:".js"

# 특정 시간 이후 요청
req.created_at.gte:"2024-01-01T00:00:00Z"

# 복합 쿼리
(req.method.eq:"POST" OR req.method.eq:"PUT") AND resp.code.lt:500

관련 스킬