📋 요청 사항
너는 보안점검 전문가로, 블랙박스 테스트를 진행하는 '화이트해커' 전문
claude code 용 agent(s)를 만들고 싶어. 외부에서 테스트 하는 화이트
해커이기 때문에, DB내부나 인프라적인 것들을 제외하고 순수하게
'모의해킹'을 통해 취약점을 검출하고 그 결과 및 권장처리 방법을 문서화
해줘야해. 첨부된 문서를 참고하여, 어떤 agent(s) 혹은 skill(s)가
필요할지 정리해줘
🤖 Agent 아키텍처 설계
전체 구조도
┌─────────────────────────────────────────────────────────────┐ │ Main
Orchestrator Agent │ │ (전체 테스트 계획 및 조율, 리포트 생성) │
└─────────────────────────┬───────────────────────────────────┘ │
┌─────────────────────┼─────────────────────┐ │ │ │ ▼ ▼ ▼ ┌─────────┐
┌─────────┐ ┌─────────┐ │ Recon │ │ Scanner │ │ Reporter│ │ Agent │ │
Agents │ │ Agent │ └────┬────┘ └────┬────┘ └────┬────┘ │ │ │ ▼ ▼ ▼
┌─────────┐ ┌─────────────────┐ ┌─────────────┐ │정보수집 │ │취약점
스캔/검증 │ │ 보고서 생성 │ │Skills │ │ Skills │ │ Skills │
└─────────┘ └─────────────────┘ └─────────────┘
Agent 정의
1. Orchestrator Agent (총괄)
| 역할 |
전체 테스트 워크플로우 조율 |
| 기능 |
대상 URL 검증, 에이전트 호출, 취약점 우선순위 결정, 상태 관리
|
2. Reconnaissance Agent (정보수집)
| 역할 |
대상 시스템 정보 수집 |
| Skills |
tech_stack_fingerprint, directory_enumeration,
input_point_mapping, api_endpoint_discovery, error_page_analysis
|
3. Scanner Agents (취약점 스캔) - 4개
| Agent |
대상 |
주요 테스트 항목 |
| Input Validation Scanner |
입력데이터 검증 (17개) |
SQL Injection, XSS, Command Injection, File Upload, CSRF, SSRF
등
|
| Security Function Scanner |
보안기능 (16개) |
인증 우회, 접근제어, 암호화 강도, 세션 토큰 분석 등 |
| Error Handling Scanner |
에러처리 (3개) |
에러 메시지 노출, 스택 트레이스, 디버그 정보 |
| Session Management Scanner |
세션통제 |
세션 예측, 세션 고정, 세션 만료 |
4. Reporter Agent (리포팅)
| 역할 |
취약점 결과 종합 및 보고서 생성 |
| 출력 |
경영진 요약, 기술 상세 보고서, 권장 조치사항, CVSS 점수 |
🔧 핵심 Skills 정의
Skill 1: SQL Injection Test
skill_name:
sql_injection_test
category:
입력데이터 검증 및 표현
reference:
SR1-1 DBMS 조회 및 결과 검증
test_vectors:
- "' OR '1'='1" -
"1; DROP TABLE--" -
"' UNION SELECT NULL--" -
"1' AND SLEEP(5)--"
detection_methods:
- error_based:
"SQL 에러 메시지 탐지" -
blind_boolean:
"참/거짓 응답 차이 분석" -
blind_time:
"응답 시간 차이 분석" -
union_based:
"UNION 쿼리 응답 분석"
remediation:
-
"PreparedStatement 또는 파라미터화된 쿼리 사용"
- "입력값 검증 및 이스케이프 처리" -
"최소 권한 DB 계정 사용"
Skill 2: XSS Test
skill_name:
xss_test
category:
입력데이터 검증 및 표현
reference:
SR1-5 웹 서비스 요청 및 결과 검증
test_vectors:
-
"<script>alert('XSS')</script>"
-
"<img src=x onerror=alert('XSS')>" -
"javascript:alert('XSS')" -
"<svg onload=alert('XSS')>"
detection_methods:
- reflected:
"입력값이 응답에 그대로 반영" -
stored:
"저장된 데이터가 실행" -
dom_based:
"DOM 조작 스크립트 실행"
remediation:
- "HTML 인코딩/이스케이프 처리" -
"Content-Security-Policy 헤더 설정" -
"입력값 화이트리스트 검증"
Skill 3: Authentication Bypass Test
skill_name:
authentication_bypass_test
category:
보안기능
reference:
SR2-1 인증 대상 및 방식
test_methods:
- direct_url_access:
"인증 없이 URL 직접 접근" -
parameter_manipulation:
"인증 파라미터 조작" -
cookie_manipulation:
"쿠키 값 조작" -
jwt_token_attack:
"JWT 토큰 취약점"
remediation:
- "모든 중요 페이지에 서버측 인증 확인" -
"세션 기반 인증 상태 검증" -
"안전한 토큰 검증 메커니즘"
Skill 4: File Upload Test
skill_name:
file_upload_test
category:
입력데이터 검증 및 표현
reference:
SR1-10 업로드·다운로드 파일 검증
test_methods:
- extension_bypass:
"test.php.jpg, test.pHp" -
content_type_bypass:
"Content-Type 헤더 조작" -
magic_byte_bypass:
"매직 바이트 조작" -
null_byte:
"test.php%00.jpg"
dangerous_extensions:
- ".php, .jsp, .asp, .aspx" -
".exe, .sh, .bat" -
".htaccess"
remediation:
- "화이트리스트 기반 확장자 검증" -
"파일 내용(매직 바이트) 검증" -
"업로드 디렉토리 실행 권한 제거" -
"파일명 랜덤화"
Skill 5: CSRF Test
skill_name:
csrf_test
category:
입력데이터 검증 및 표현
reference:
SR1-6 웹 기반 중요 기능 수행 요청 유효성 검증
test_methods:
- token_absence:
"CSRF 토큰 존재 여부" -
token_validation:
"토큰 검증 로직" -
referer_check:
"Referer 헤더 검증"
remediation:
- "CSRF 토큰 구현" -
"SameSite 쿠키 속성 설정" -
"중요 기능에 재인증 요구"
Skill 6: Session Security Test
skill_name:
session_security_test
category:
세션통제
reference:
SR4-1 세션통제
test_methods:
- session_prediction:
"세션 ID 예측 가능성" -
session_fixation:
"세션 고정 공격" -
session_timeout:
"세션 만료 시간" -
concurrent_sessions:
"동시 세션 허용"
remediation:
- "로그인 시 세션 ID 재생성" -
"안전한 세션 ID 생성 알고리즘" -
"세션 타임아웃 설정" -
"HttpOnly, Secure 쿠키 속성"
Skill 7: Error Disclosure Test
skill_name:
error_disclosure_test
category:
에러처리
reference:
SR3-1 예외처리
test_methods:
- invalid_input:
"비정상 입력으로 에러 유발" -
missing_parameter:
"필수 파라미터 제거" -
sql_error_trigger:
"SQL 문법 오류 유발"
check_items:
- "스택 트레이스 노출" -
"DB 정보 노출" -
"서버 경로 노출" -
"프레임워크/버전 정보 노출"
remediation:
- "사용자 정의 에러 페이지 구현" -
"상세 에러 로깅은 서버측에서만" -
"일반적인 에러 메시지만 클라이언트에 전달"
🗂️ 권장 파일 구조
/mnt/skills/user/whitehacker/ ├──
SKILL.md
├──
agents/ │ ├──
orchestrator.md
│ ├──
reconnaissance.md
│ ├──
input_validation_scanner.md
│ ├──
security_function_scanner.md
│ ├──
error_handling_scanner.md
│ ├──
session_scanner.md
│ └──
reporter.md
├──
payloads/ │ ├──
sql_injection.txt
│ ├──
xss.txt
│ ├──
command_injection.txt
│ ├──
path_traversal.txt
│ └──
file_upload_bypass.txt
├──
templates/ │ ├──
report_template.md
│ ├──
vulnerability_template.md
│ └──
remediation_template.md
├──
reference/ │ ├──
kisa_security_guide.md
│ ├──
owasp_mapping.md
│ └──
cvss_scoring.md
└──
utils/ ├──
http_client.py
├──
response_analyzer.py
└──
evidence_collector.py