Skip to content
KitploitKITPLOIT
도구블로그
제출
도구블로그
제출

해킹, 침투 테스트 및 사이버 보안 도구를 당신의 보안 무기고에!

Kitploit은 해킹, 사이버 보안 및 침투 테스트 도구 디렉토리입니다. 최신 프로젝트 업데이트를 발견하여 취약점을 찾고, 시스템을 분석하고, 테스트를 자동화하고, 보안을 강화하세요.

··피드·문의·개인정보·© 2026 Kitploit

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
KidnapRAG — 블랙박스 공격 프레임워크로, 에이전트 기반 검색 증강 생성(RAG) 시스템에서 추론을 탈취하기 위해 오염된 문서를 주입하며, 여러 공격 방법과 데이터셋을 지원합니다. | Kitploit
도구/GitHubGitHub/chanwoochoi316/kidnaprag
Machine LearningAI SecurityAdversarial Attack
GitHubchanwoochoi316/kidnaprag

KidnapRAG

블랙박스 공격 프레임워크로, 에이전트 기반 검색 증강 생성(RAG) 시스템에서 추론을 탈취하기 위해 오염된 문서를 주입하며, 여러 공격 방법과 데이터셋을 지원합니다.

저장소 보기
2132개월 전아직 검토되지 않음

인기

모두 보기 →

커뮤니티에서 가장 많이 사용되는 도구를 찾아보세요.

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유

KidnapRAG: 에이전트 기반 RAG 시스템의 추론을 탈취하는 블랙박스 공격

🎓 논문 | 📄 데이터셋 | 🚀 빠른 시작

빠른 시작

클론한 KidnapRAG 저장소의 상위 디렉터리에서 다음 명령어를 실행하세요.

root@kitploit:~
cd KidnapRAG
conda create -n KidnapRAG python=3.10
conda activate KidnapRAG
pip install -r requirements.txt

그런 다음, 말뭉치 데이터셋 📄을 다운로드하고 ReAct 데이터셋을 /KidnapRAG/ReAct로, WebThinker 데이터셋을 /KidnapRAG/WebThinker로 이동하세요.

ReAct

Llama 모델을 사용한 HotpotQA 예시입니다.

  1. 공격 없이 ReAct 응답 생성하기.
root@kitploit:~
cd ReAct/ReAct
CUDA_VISIBLE_DEVICES=0,1,2,3 python attack_react.py --attack_method clean --model_path meta-llama/Llama-3.3-70B-Instruct --seed 1 --dataset hotpotqa

--model_path는 Llama-3.3-70B-Instruct와 Qwen/Qwen2.5-32B-Instruct를 지원합니다.

--dataset은 hotpotqa, musique, 2wikimultihopqa를 지원합니다.

  1. 미끼 문서 생성하기.
root@kitploit:~
CUDA_VISIBLE_DEVICES=0,1 python generate_attack_doc_kill.py --input_path /KidnapRAG/ReAct/results/adv_targeted_results/hotpotqa_seed1_clean_llama70b.json --gpu_num 2 --dataset hotpotqa --type ours

--type은 다음 공격 방법을 추가로 지원합니다: Naive Attack용 naive, Ignore Attack용 ignore, Fake Completion Attack용 completion_real, Combined Attack용 completion_realcmb, TopicAttack용 topicattack, PoisonedRAG용 poisonedRAG, RAG Paradox용 paradox.

  1. 다섯 가지 체인 드래깅 시나리오 생성하기. (BM, BCM, BCCM, BCCCM, BCCCCM)
root@kitploit:~
cd ..
python concat.py --dataset hotpotqa --gen_model llama70b

--gen_model은 Llama-3.3-70B-Instruct용 llama70b와 Qwen/Qwen2.5-32B-Instruct용 qwen25를 지원합니다.

  1. 생성된 문서 인덱싱하기.
root@kitploit:~
CUDA_VISIBLE_DEVICES=0 python scripts/build_index.py \
    --corpus_path /KidnapRAG/ReAct/datasets/hotpotqa/REACT_BM_llama70b.jsonl \
    --output_dir /KidnapRAG/ReAct/datasets/hotpotqa/REACT_BM_llama70b \
    --model_name intfloat/e5-large-v2
  1. 공격 실행하기.
root@kitploit:~
cd ReAct
CUDA_VISIBLE_DEVICES=0,1,2,3 python attack_react.py --attack_method BM --model_path meta-llama/Llama-3.3-70B-Instruct --seed 1 --dataset hotpotqa

Webthinker

QwQ 모델을 사용한 HotpotQA 예시입니다.

이 섹션은 KidnapRAG 저장소 루트에서 실행하세요.

  1. 공격 없이 Webthinker 응답 생성하기.
root@kitploit:~
cd Webthinker

bash scripts/webthinker/qwq_clean.sh \
  ./datasets/hotpotqa/hotpotqa_promptinject_select.json \
  ./datasets/hotpotqa_corpus/hotpotqa_corpus.jsonl \
  ./results/hotpotqa/clean_qwq.json

인자:

  • ./datasets/hotpotqa/hotpotqa_promptinject_select.json: 쿼리 경로
  • ./datasets/hotpotqa_corpus/hotpotqa_corpus.jsonl: 말뭉치 경로
  • ./results/hotpotqa/clean_qwq.json: 결과 경로
  1. 미끼 문서 생성하기.
root@kitploit:~
cd scripts
CUDA_VISIBLE_DEVICES=0,1 python generate_attack_doc_kill.py --input_path /KidnapRAG/Webthinker/results/hotpotqa/clean_qwq.json --gpu_num 2 --dataset hotpotqa --type ours
  1. 다섯 가지 체인 드래깅 시나리오 생성하기. (BM, BCM, BCCM, BCCCM, BCCCCM)
root@kitploit:~
cd ..
python concat.py --dataset hotpotqa --gen_model qwq

--gen_model은 lixiaoxi45/WebThinker-R1-32B용 deepseek_32b와 Qwen/QwQ-32B용 qwq를 지원합니다.

  1. 공격 실행하기.
root@kitploit:~
bash scripts/webthinker/qwq_attack.sh \
  ./datasets/hotpotqa/hotpotqa_promptinject_select.json \
  ./datasets/hotpotqa_corpus/hotpotqa_corpus.jsonl \
  ./datasets/hotpotqa_poisoned_corpus/WEBTHINKER_BM_qwq.jsonl \
  ./results/hotpotqa/BM.json

인자:

  • ./datasets/hotpotqa/hotpotqa_promptinject_select.json: 쿼리 경로
  • ./datasets/hotpotqa_corpus/hotpotqa_corpus.jsonl: 말뭉치 경로
  • ./datasets/hotpotqa_poisoned_corpus/WEBTHINKER_BM_qwq.jsonl: 오염된 말뭉치 경로
  • ./results/hotpotqa/BM.json: 결과 경로

인용

root@kitploit:~
@misc{
}
도구 다운로드