Skip to content
KitploitKITPLOIT
ツールブログ
提出
ツールブログ
提出

ハッキング、侵入テスト、サイバーセキュリティツールをあなたのセキュリティアーセナルに!

Kitploitはハッキング、サイバーセキュリティ、ペネトレーションテストのツールディレクトリです。最新のプロジェクトアップデートを見つけて、脆弱性の発見、システム分析、テストの自動化、セキュリティの強化を行いましょう。

··フィード·お問い合わせ·プライバシー·© 2026 Kitploit

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
LOAD — Lord Of Active Directory - AWS上に脆弱なActive Directoryを自動構築 | Kitploit
ツール/GitHubGitHub/0xballpoint/load
クラウドインフラストラクチャセキュリティセキュリティ仮想化ペネトレーションテスト学習と教育レッドチーミングラボと実践
GitHub0xballpoint/load

LOAD

Lord Of Active Directory - AWS上に脆弱なActive Directoryを自動構築

リポジトリを見る
156132年前Kitploit レビュー済み

人気

すべて見る →

コミュニティで最も使われているツールを見つけましょう。

すべてのツールを探索

ツールコレクションを閲覧

すべてのツールを見る →
共有
ウェブサイト

load.jpg

はじめに

AWS-Redteam-Lab と OCD GOAD に基づいています。

このラボを1ヶ月に125時間稼働させた場合の費用は、約14ドルです。 Free Tier では、EC2 を月750時間利用できます。マシンが6台あるため、125時間になります。ただし、ストレージは30Gbしかありません。そのため、残り5台分の VM 用ストレージが必要です : 30Gb * 5 = 150Gb = 月額14ドル

インストール

GOAD プロジェクトと同様に、インストールは2つの部分で構成されています :

  • providing : Terraform を使用して作成され、AWS VPC、ネットワーク、EC2(仮想マシン)を設定します。
  • provisioning : Ansible を使用して作成され、Active Directory ネットワークのようにラボを稼働させるために必要なものをすべてインストールします。

プロビジョニング

要件

これまでのところ、このラボは Linux マシンでのみテストされていますが、macOS でも動作するはずです。Ansible は Windows ホストでいくつか問題があるため、そちらについてはわかりません。

セットアップを正しく動作させるには、以下をインストールする必要があります:

Ansible

Docker での Ansible

docker コンテナからプロビジョニングを行いたい場合は、次のコマンドを実行してコンテナを準備できます。

root@kitploit:~
sudo docker build -t loadansible .

ホスト上の Ansible

ホスト上で Ansible を実行したい場合は、次のコマンドを実行してください :

  1. Python >= 3.8 の仮想環境を作成します
root@kitploit:~
sudo apt install git
git clone [email protected]:0xBallpoint/LOAD.git
cd LOAD/ansible
sudo apt install python3.8-venv
python3.8 -m virtualenv .venv
source .venv/bin/activate
  1. .venv に ansible と pywinrm をインストールします
    • ansible は、公式サイトの詳細なガイドに従ってインストールします ansible。
    • ansible-core (2.12) でテスト済み
    • pywinrm パッケージがインストールされていることを確認してください
root@kitploit:~
python3 -m pip install --upgrade pip
python3 -m pip install ansible-core==2.12.6
python3 -m pip install pywinrm
  1. ansible-galaxy の要件をすべてインストールします
    • ansible windows
    • ansible community.windows
    • ansible community.general
root@kitploit:~
ansible-galaxy install -r requirements.yml

Terraform

Terraform は、公式サイトのガイドに従ってインストールする必要があります hashicorp.com

Linux に Terraform を手動でインストールする場合:

root@kitploit:~
sudo apt-get update && sudo apt-get install -y gnupg software-properties-common

# Install the HasiCorp GPG key
wget -O- https://apt.releases.hashicorp.com/gpg | \
    gpg --dearmor | \
    sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg

# Verify the key's fingerprint
gpg --no-default-keyring \
    --keyring /usr/share/keyrings/hashicorp-archive-keyring.gpg \
    --fingerprint
# It must match E8A0 32E0 94D8 EB4E A189 D270 DA41 8C88 A321 9F7B (from https://www.hashicorp.com/security)

# Add the official HashiCorp repository to your system
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] \
    https://apt.releases.hashicorp.com $(lsb_release -cs) main" | \
    sudo tee /etc/apt/sources.list.d/hashicorp.list

# Update, install, verify
sudo apt update
sudo apt install terraform
terraform -help

AWS CLI

AWS へのアクセスキーを設定するには、AWS CLI が必要です。公式サイトのインストールガイドに従ってください docs.aws.amazon.com

Linux の場合:

root@kitploit:~
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install

開始 / セットアップ

デフォルトのドメインは middle-earth.local で、サブネットは 10.0.1.0/24、各マシンには CPU 1基とメモリ 1024MB(t2.micro)のみが割り当てられています。これらのパフォーマンス設定を変更したい場合は、ファイル terraform/ami-instance.tf を編集できます。

ラボを起動して稼働させるには、次のコマンドを実行してください:

VM の作成

root@kitploit:~
pwd
/opt/LOAD  # place yourself in the LOAD folder (where you cloned the project)
cd terraform # start with AWS configuration

次の手順では、AWS 上で VM を設定する方法を説明します:

  1. var.tf.example を var.tf にコピーして値を変更します :

    • REGION : お好みのリージョンに合わせて変更します
    • MANAGEMENT_IPS : ラボにアクセスできる IPv4 アドレスを追加します
  2. AWS コンソールで terraform ユーザーを作成し、AWS キーを取得してください:

    • https://us-east-1.console.aws.amazon.com/iamv2/home#/users に移動します
    • ユーザー名 : terraform
    • AWS 認証情報タイプ : Access key - Programmatic access を選択します
    • 必要な権限を追加します
    • ユーザーを作成します
    • Access key ID と Secret access key をコピーします
  3. AWS CLI を使用して、マシンにキーを追加します:

root@kitploit:~
aws configure --profile terraform
    AWS Access Key ID [None]: <access_key_id>
    AWS Secret Access Key [None]: <secret_access_key>
  1. terraform 用の SSH 鍵を作成します:
root@kitploit:~
cd LOAD
ssh-keygen -t rsa -N "" -b 2048 -C "TerraformKey" -f ./terraform/keys/TerraformKey.pem
  1. Terraform を実行します
root@kitploit:~
terraform init
terraform apply

ラボを破棄したい場合:

root@kitploit:~
terraform destroy

VM のプロビジョニング

EC2 インスタンスを起動するたびに、ansible/hosts ファイルのパブリック IP を変更する必要があります。このコマンドの出力をファイルの末尾に追加してください:

root@kitploit:~
aws ec2 describe-instances --profile terraform --region eu-central-1 --query "Reservations[*].Instances[*].{Name:Tags[?Key=='Name'].Value|[],PublicIP:PublicIpAddress}" --filters "Name=instance-state-name,Values=running" --output text |tac |awk 'NR%2 ==0 {print $0}; NR%2 != 0 {print "["tolower(substr($2,5))"]"};'

VM を設定するには ansible-playbook コマンドを使用します。通常の実行時間 : 1時間30分

root@kitploit:~
ansible-playbook main.yml # this will configure the vms in order to play ansible when the vms are ready

docker コンテナからプロビジョニングを実行するには、次のコマンドを実行します(Dockerfile と同じフォルダにいる必要があります。まだテストされていません):

root@kitploit:~
sudo docker run -ti --rm --network host -h loadansible -v $(pwd):/load -w /load/ansible loadansible ansible-playbook main.yml

インストール中にエラーが発生することがあります。ほとんどの場合、プレイブックをもう一度実行するだけで動作するはずです。 プレイブックを1つずつ実行するには:

root@kitploit:~
# The main.yml playbook is build in multiples parts. each parts can be re-run independently but the play order must be keep in cas you want to play one by one :

ansible-playbook prepare.yml         # updates, passwords, dns settings...
ansible-playbook ad-servers.yml      # create servers configuration
ansible-playbook ad-trusts.yml       # create the trust relationships
ansible-playbook ad-data.yml         # import the ad datas : users/groups...
ansible-playbook ad-groups.yml       # set the rights and the group domains relations
ansible-playbook servers.yml         # create IIS and MSSQL
ansible-playbook adcs.yml            # add adcs and adcs templates
ansible-playbook ad-acl.yml          # set ACL
ansible-playbook linux.yml           # configure linux entrypoint with GLPI

ansible-playbook security.yml        # enable or disable windows defender here
ansible-playbook vulnerabilities.yml # specifics vulns linked to the scenario are here

# You can also install wireguard VPN on the linux host, for that check the VPN paragraph

プレイブックの特定の部分だけを実行したい場合は、タグを使用できます(常に data タグを付けてください):

root@kitploit:~
ansible-playbook servers.yml
ansible-playbook servers.yml --tags data,iis
ansible-playbook linux.yml --tags data,glpi

AWS CLI

AWS ラボの管理に役立つコマンドです(見た目は良くありませんが動作します):

root@kitploit:~
# aws cli profile : terraform
# region : eu-central-1 

# Disable instance metadata
for i in $(aws ec2 --profile terraform --region eu-central-1 describe-instances --filters "Name=tag:Name,Values=lab-*" --query 'Reservations[].Instances[].InstanceId' |cut -d '"' -f2); do aws ec2 --profile terraform --region eu-central-1 modify-instance-metadata-options --http-endpoint disabled --instance-id $i --output json --no-cli-pager;done

# Start instances
aws ec2 --profile terraform --region eu-central-1 start-instances --instance-ids `aws ec2 --profile terraform --region eu-central-1 describe-instances --filters "Name=tag:Name,Values=lab-*" "Name=instance-state-name,Values=stopping,stopped" --query 'Reservations[].Instances[].InstanceId' --output text`

# Get running instance and output it to ansible format
aws ec2 describe-instances --profile terraform --region eu-central-1 --query "Reservations[*].Instances[*].{Name:Tags[?Key=='Name'].Value|[],PublicIP:PublicIpAddress}" --filters "Name=instance-state-name,Values=running" --output text |tac |awk 'NR%2 ==0 {print $0}; NR%2 != 0 {print "["tolower(substr($2,5))"]"};'

VPN サーバー

必要に応じて、Linux ホストに VPN サーバーを追加し、好きなだけクライアントを設定できます。 まず VPN サーバーの鍵を生成し、クライアントの数を変更します:

root@kitploit:~
apt install wireguard

# generate wireguard keys
privkey=$(wg genkey) sh -c 'echo "
    server_privkey: $privkey
    server_pubkey: $(echo $privkey | wg pubkey)"'

# encrypt server_privkey with ansible-vault and 
ansible-vault encrypt_string --ask-vault-password --stdin-name server_privkey

# Add the result to group_vars/all.yml
# You can change the number of client configuration files it will create. By default it creates 6 clients.

次のコマンドで VPN プレイブックを実行します(コマンドを実行するたびにクライアントの鍵が変更されます):

root@kitploit:~
ansible-playbook --ask-vault-password vpn.yml

Timeout (12s) waiting for privilege escalation prompt というエラーが発生した場合は、コマンドをもう一度実行してください。

クライアント設定ファイルは ansible/wireguard/lab_client[0-9].conf にあります。

VPN に接続するには、クライアントファイルを秘密鍵と一緒にローカルホストの /etc/wireguard/ にコピーする必要があります。

最初のクライアントの VPN 接続は次のコマンドで開始します:

root@kitploit:~
sudo wg-quick up lab_client1

10.0.20.0/24 の IP を取得します。

脆弱性

schema

LINUX

root@kitploit:~
SHIRE (srv02)
    - GLPI SQLi
    - GLPI-htmlawed-CVE-2022-35914

USERS
    - privesc user with vulnerable crontab
    - privesc root with password in bash_history and sudo nopasswd for /bin/systemctl

ERIADOR.MIDDLE-EARTH.LOCAL

root@kitploit:~
RIVENDELL (dc02)
    - anonymous RPC (enum users, pass pol, groups / rpcclient)
    - brute force users names

ELF
    - celebrian    Responder crack hash (bot 3min)
    - elrond:      Responder with NTLM relay domain admin (bot 5min)

HOBBIT
    - bilbo:       password in description
    - pippin:      ASREPROAST 
    - merry:       Constrained delegation with protocol transition / Kerberoasting
    - froddo:
    - sam:

MIDDLE-EARTH.LOCAL

root@kitploit:~
MINAS-TIRITH(dc01)
    - Open share RW, LNK exploit
    - khamul.easterling : Open backup share, with GPO with cpassword, password increment

MORIA (srv01)
    - MSSQL trusted link : donPapi to get sql_svc password
    - mitm6 SRV01 -> DC01

MEN
    - denethor:    DOMAIN ADMIN
    - theoden:     ACL self-self-membership-on-group DOMAIN ADMIN
    - faramir:     ACL genericwrite-on-user Denethor
    - boromir:     ACL genericall-on-user Denethor
                   ACL forcechangepassword on Faramir 
                   WriteDACL MEN 

FELLOWSHIP
    - legolas:     execute as user on MSSQL
                   KERBEROASTING 
    - gimli:       ACL genericall-on-computer MORIA
                   ACL writeproperty-self-membership DOMAIN ADMIN
    - aragorn:     execute as login on mssql / administrator
    - gandalf:     mssql admin
                   group cross domain
                   mssql trusted link
                   ACL writeproperty-self-membership Domain Admins #TODO change for someone who is not administrator, he has DCSYNC (administrator?)

ENTS
    - treebeard:   ACL writeproperty-on-group DOMAIN ADMIN
    - skinbark:    ACL genericall-on-group DOMAIN ADMIN
    - ginglas:     ACL write owner on group DOMAIN ADMIN

MORDOR.LOCAL

コンピューター

root@kitploit:~
BARAD-DUR (dc03)
    - Coerced DC + ntlmrelayx to ldaps
    - ADCS ESC1, ESC2, ESC3, ESC4, ESC8
    - NTLM downgrade attack

MINAS-MORGL (srv03)
    - IIS upload webshell
    - Privilege escalation Windows 2016 : SeImpersontePrivilege

DARKFORCE
    - sauron:     domain admin MORDOR
    - saruman:    mssql admin / GenericAll on gothmog (shadow credentials) / GenericAll on ECS4
    - balrog:

PRISONER
    - gollum:     mssql trusted link
                  password spray -> user=pwd
ORC
    - gothmog:    DOMAIN ADMIN
    - lurtz:
    - ugluk:
    - guritz:

NAZGUL
    - angmar:

ToDo

  • Linux サーバーを AD に接続して SSH を有効にする
  • sam で RemotePotato0
  • GLPI の認証情報を自動的に変更する
  • LAPS
ツールをダウンロード