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

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

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

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

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
ghostbuster — 모든 AWS 계정 내 리소스에 대한 분석을 수행하여 고립된 탄력적 IP를 제거합니다. | Kitploit
도구/GitHubGitHub/assetnote/ghostbuster
ReconnaissanceVulnerability ScannersCloud SecuritySubdomain EnumerationDNS Analysis
GitHubassetnote/ghostbuster

ghostbuster

모든 AWS 계정 내 리소스에 대한 분석을 수행하여 고립된 탄력적 IP를 제거합니다.

저장소 보기
278361년 전Kitploit 검토 완료

인기

모두 보기 →

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

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유

목차

  • 목차
  • Ghostbuster
    • 문제점
    • 프로젝트 특징
    • Ghostbuster 설치
    • Ghostbuster 사용
    • 출력 예시
    • AWS 계정 설정
    • Cloudflare 설정 (선택 사항)
    • 저자
    • 라이선스

Ghostbuster

모든 AWS 계정 내 리소스를 분석하여 유령 탄력적 IP(dangling elastic IP)를 제거합니다.

Ghostbuster는 모든 AWS 계정(Route53)에 있는 모든 DNS 레코드를 수집하고, 선택적으로 CSV 입력 또는 Cloudflare를 통해 레코드를 받을 수 있습니다.

레코드가 수집된 후, Ghostbuster는 모든 AWS 탄력적 IP 및 네트워크 인터페이스 공용 IP를 반복하여 이 데이터를 수집합니다.

DNS 레코드(route53, 파일 입력 또는 Cloudflare에서)의 전체 그림과 조직이 소유한 AWS IP의 전체 그림을 확보함으로써 이 도구는 더 이상 소유하지 않는 IP(유령 탄력적 IP)를 가리키는 하위 도메인을 감지할 수 있습니다.

문제점

AWS에 인프라를 배포할 때 IP가 연결된 EC2 인스턴스를 생성할 수 있습니다. 이러한 IP를 가리키는 DNS 레코드를 생성했지만 EC2 인스턴스에 새 IP가 할당되거나 파괴된 후 DNS 레코드를 제거하는 것을 잊으면 하위 도메인 탈취 공격에 취약해집니다.

탄력적 IP 탈취에 대한 많은 연구가 진행되었으며, 공격자가 대상 회사의 하위 도메인과 연결된 IP를 얻을 때까지 지속적으로 탄력적 IP를 요청하는 것이 가능합니다.

AWS는 이러한 공격 패턴을 시도하는 계정을 자주 차단하지만, AWS에서 장기적인 해결책을 발표하지는 않았습니다.

유령 탄력적 IP 하위 도메인 탈취 공격의 영향은 일반적으로 제공되는 콘텐츠만 제어할 수 있는 일반적인 하위 도메인 탈취보다 더 심각합니다. 유령 탄력적 IP 탈취를 통해 공격자는 다음을 수행할 수 있습니다:

  • 하위 도메인에 대한 SSL 인증서 발급
  • 모든 포트에서 트래픽 수신 (잠재적으로 하위 도메인으로 여전히 전송되는 민감 정보 발견)
  • 서버 측 스크립트 실행으로 HTTPOnly 쿠키 탈취 가능, 일반적으로 *.domain.com 범위의 쿠키로 인해 한 번의 클릭으로 계정 탈취 공격으로 이어짐

프로젝트 특징

  • .aws/config에 구성된 각 AWS 프로필을 동적으로 반복
  • AWS Route53에서 A 레코드 가져오기
  • Cloudflare에서 A 레코드 가져오기 (선택 사항)
  • CSV 입력에서 A 레코드 가져오기 (선택 사항)
  • 모든 리전, 단일 리전 또는 쉼표로 구분된 리전 목록 반복
  • 모든 AWS 계정에 연결된 모든 탄력적 IP 획득
  • 모든 AWS 계정에 연결된 모든 공용 IP 획득
  • DNS 레코드와 조직이 소유한 IP를 교차 확인하여 잠재적 탈취 탐지
  • Slack Webhook 지원으로 탈취 알림 전송

중요:

이 도구가 효과적으로 작동하려면 AWS 환경의 전체 그림을 가지고 있어야 합니다. 전체 그림이 없으면 오탐(false positive) 결과가 발생할 수 있습니다.

Ghostbuster 설치

Ghostbuster 설치는 pip install ghostbuster 명령을 실행하는 것만큼 간단합니다. 그러면 CLI 도구를 ghostbuster 명령으로 사용할 수 있습니다.

Python 3.x 환경이 필요합니다.

Ghostbuster 사용

root@kitploit:~
❯ ghostbuster scan aws --help                                                                                                                                                                     
Usage: ghostbuster scan aws [OPTIONS]

  AWS 계정 내 유령 탄력적 IP를 스캔합니다.

Options:
  --profile TEXT          ghostbuster를 실행할 특정 AWS 프로필을 지정합니다.

  --skipascii             Ghostbuster 시작 시 ASCII 아트를 출력하지 않습니다.

  --json                  JSON 객체만 반환합니다.
  --slackwebhook TEXT     잠재적 탈취에 대한 알림을 보낼 Slack 웹훅 URL을
                          지정합니다.

  --records PATH          확인할 DNS 레코드를 수동으로 지정합니다.
                          Ghostbuster는 검색된 DNS 레코드를 확인한 후 이
                          IP들을 확인합니다. 예시는 records.csv를 참조하세요.

  --cloudflaretoken TEXT  Cloudflare에서 DNS 레코드를 가져옵니다. CF API
                          토큰을 제공하세요.

  --allregions            모든 리전에서 실행합니다.
  --exclude TEXT          제외할 프로필 이름의 쉼표로 구분된 목록입니다.
  --regions TEXT          실행할 리전의 쉼표로 구분된 목록입니다.
  --help                  이 메시지를 표시하고 종료합니다.

명령 예시

Cloudflare DNS 레코드에 접근하여 Ghostbuster를 실행하고, Slack 웹훅에 알림을 보내며, .aws/config 또는 .aws/credentials에 구성된 모든 AWS 프로필을 모든 AWS 리전에 대해 반복합니다.

root@kitploit:~
❯ ghostbuster scan aws --cloudflaretoken APIKEY --slackwebhook https://hooks.slack.com/services/KEY --allregions

수동으로 입력한 하위 도메인 A 레코드 목록으로 Ghostbuster 실행 (예제 파일은 이 저장소의 records.csv 참조):

root@kitploit:~
❯ ghostbuster scan aws --records records.csv

--regions를 사용하여 특정 리전을 지정할 수 있습니다. 쉼표로 구분된 리전 목록입니다. 예: us-east-1,us-west-1.

출력 예시

root@kitploit:~
❯ ghostbuster scan aws --cloudflaretoken whougonnacall
Obtaining all zone names from Cloudflare.
Obtaining DNS A records for all zones from Cloudflare.
Obtained 33 DNS A records so far.
Obtaining Route53 hosted zones for AWS profile: default.
Obtaining Route53 hosted zones for AWS profile: account-five.
Obtaining Route53 hosted zones for AWS profile: account-four.
Obtaining Route53 hosted zones for AWS profile: account-four-deploy.
Obtaining Route53 hosted zones for AWS profile: account-two-deploy.
Obtaining Route53 hosted zones for AWS profile: account-one-deploy.
Obtaining Route53 hosted zones for AWS profile: account-three-deploy.
Obtaining Route53 hosted zones for AWS profile: account-six.
Obtaining Route53 hosted zones for AWS profile: account-seven.
Obtaining Route53 hosted zones for AWS profile: account-one.
Obtained 124 DNS A records so far.
Obtaining EIPs for region: us-east-1, profile: default
Obtaining IPs for network interfaces for region: us-east-1, profile: default
Obtaining EIPs for region: us-east-1, profile: account-five
Obtaining IPs for network interfaces for region: us-east-1, profile: account-five
Obtaining EIPs for region: us-east-1, profile: account-four
Obtaining IPs for network interfaces for region: us-east-1, profile: account-four
Obtaining EIPs for region: us-east-1, profile: account-four-deploy
Obtaining IPs for network interfaces for region: us-east-1, profile: account-four-deploy
Obtaining EIPs for region: us-east-1, profile: account-two-deploy
Obtaining IPs for network interfaces for region: us-east-1, profile: account-two-deploy
Obtaining EIPs for region: us-east-1, profile: account-one-deploy
Obtaining IPs for network interfaces for region: us-east-1, profile: account-one-deploy
Obtaining EIPs for region: us-east-1, profile: account-three-deploy
Obtaining IPs for network interfaces for region: us-east-1, profile: account-three-deploy
Obtaining EIPs for region: us-east-1, profile: account-six
Obtaining IPs for network interfaces for region: us-east-1, profile: account-six
Obtaining EIPs for region: us-east-1, profile: account-seven
Obtaining IPs for network interfaces for region: us-east-1, profile: account-seven
Obtaining EIPs for region: us-east-1, profile: account-one
Obtaining IPs for network interfaces for region: us-east-1, profile: account-one
Obtained 415 unique elastic IPs from AWS.


Takeover possible: {'name': 'takeover.assetnotecloud.com', 'records': ['52.54.24.193']}

AWS 계정 설정

첫 번째 단계는 AWS 계정에서 Route53 레코드를 읽고 탄력적 주소와 EC2 네트워크 인터페이스를 설명하는 데 필요한 권한을 부여하는 키 또는 역할을 생성하는 것입니다.

  1. AWS에서 새 IAM 사용자를 생성하려면 다음 URL을 방문하세요: https://console.aws.amazon.com/iam/home#/users$new?step=details
  2. 액세스 키 - 프로그래밍 방식 액세스만 선택하고 다음: 권한을 클릭합니다.
  3. 기존 정책 직접 연결을 클릭한 다음 정책 생성을 클릭합니다.
  4. JSON을 클릭하고 다음 정책을 붙여넣습니다:
root@kitploit:~
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "GhostbusterPolicy",
            "Effect": "Allow",
            "Action": [
                "ec2:DescribeAddresses",
                "ec2:DescribeNetworkInterfaces",
                "route53:ListResourceRecordSets",
                "route53:ListHostedZonesByName",
                "route53:GetTrafficPolicyInstance",
                "route53:GetTrafficPolicy"
            ],
            "Resource": "*"
        }
    ]
}
  1. 다음: 태그를 클릭한 다음 다음: 검토를 클릭합니다.
  2. 정책 이름을 GhostbusterPolicy로 설정합니다.
  3. 정책 생성을 클릭합니다.
  4. https://console.aws.amazon.com/iam/home#/users$new?step=permissions&accessKey&userNames=ghostbuster&permissionType=policies 로 이동합니다.
  5. GhostbusterPolicy를 선택합니다.
  6. 다음: 태그를 클릭한 다음 다음: 검토를 클릭합니다.
  7. 사용자 생성을 클릭하고 .aws/credentials 파일에 AWS 자격 증명을 설정합니다.

소유한 각 AWS 계정에 대해 위 단계를 반복합니다.

이 도구는 AWS 구성을 설정한 방식(여러 키 또는 교차 계정 역할 가장 프로필)에 관계없이 작동합니다. 이는 AWS와 인터페이스하는 데 사용되는 라이브러리인 boto3에 의해 관리됩니다.

예제 구성은 다음과 같습니다:

.aws/credentials:

root@kitploit:~
[default]
aws_access_key_id = AKIAIII...
aws_secret_access_key = faAaAaA...

.aws/config:

root@kitploit:~
[default]
output = table
region = us-east-1

[profile account-one]
role_arn = arn:aws:iam::911111111113:role/Ec2Route53Access
source_profile = default
region = us-east-1

[profile account-two]
role_arn = arn:aws:iam::911111111112:role/Ec2Route53Access
source_profile = default
region = us-east-1

[profile account-three]
region = us-east-1
role_arn = arn:aws:iam::911111111111:role/Ec2Route53Access
source_profile = default

또는 역할을 가장하는 대신, .aws/credentials 파일에 범위가 지정된 액세스 권한이 있는 프로필 및 연결된 키 목록을 구성할 수도 있습니다.

AWS 환경의 모든 계정으로 AWS 구성을 설정한 후, 다음 명령을 사용하여 도구를 실행할 수 있습니다:

--roles에 대한 AWS 권한 설정

Ghostbuster는 프로필 대신 역할을 사용할 수 있으므로 한 곳에 많은 자격 증명이 필요하지 않습니다. 그러나 역할 접근 방식은 조직 내에서 추가 IAM 정책을 생성해야 합니다.

역할은 --roles roles.csv 또는 --autoroles 플래그를 사용하여 사용할 수 있습니다. --roles가 작동하도록 설정하려면 스캔되는 모든 계정에 정확히 같은 이름으로 GhostbusterTargetAccountRole 역할을 생성해야 합니다:

root@kitploit:~
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "GhostbusterTargetAccountRole",
            "Effect": "Allow",
            "Action": [
                "ec2:DescribeAddresses",
                "ec2:DescribeNetworkInterfaces",
                "ec2:DescribeRegions",
                "route53:ListResourceRecordSets",
                "route53:ListHostedZonesByName",
                "route53:GetTrafficPolicyInstance",
                "route53:GetTrafficPolicy"
            ],
            "Resource": "*"
        }
    ]
}

ghostbuster는 lambda/ec2 등에서 ghostbuster 역할로 실행됩니다. 이 역할을 ghostbuster 마스터 역할이라고 부르겠습니다. 마스터 역할은 TargetAccountRoles를 가장할 수 있어야 합니다.

root@kitploit:~
resource "aws_iam_policy" "ghostbuster_target_account_roles" {
  name        = "ghostbuster_target_account_roles"
  path        = "/"
  description = "DNS 및 탄력적 IP 데이터 검사 허용."

  policy = jsonencode({
    "Version" : "2012-10-17",
    "Statement" : [
      {
        "Effect" : "Allow",
        "Action" : "sts:AssumeRole",
        "Resource" : ["arn:aws:iam::*:role/GhostbusterTargetAccountRole"]
    }]
  })

  tags = {
    Project = "ghostbuster"
  }
}

--autoroles에 대한 AWS 권한 설정

자동 계정 검색에는 --roles에 비해 추가 권한이 필요합니다. --roles가 작동하도록 설정한 후, 조직 개요가 있는 계정에 다음 IAM 정책을 추가하는 것을 고려하세요:

root@kitploit:~
{
    sid = "BaseAccess"

    actions = [
      "organizations:DescribeAccount",
      "organizations:ListAccounts"
    ]

    resources = ["*"]
    effect    = "Allow"
  }
}

그런 다음, ghostbuster를 실행하는 계정에서 ghostbuster 마스터 역할에 다음 정책을 연결하여 조직 조회 역할을 가장할 수 있도록 합니다:

root@kitploit:~
{
    "Version" : "2012-10-17",
    "Statement" : [
      {
        "Effect" : "Allow",
        "Action" : "sts:AssumeRole",
        "Resource" : ["arn:aws:iam::ORG_LOOKUP_ACCOUNT_ID:role/ghostbuster-org-role"]
    }]
}

ORG_LOOKUP_ACCOUNT_ID를 실제 계정 ID로 바꾸는 것을 잊지 마세요.

Cloudflare 설정 (선택 사항)

Ghostbuster가 Cloudflare에 설정된 모든 A 레코드를 가져오게 하려면 영역을 읽을 수 있는 API 토큰을 설정해야 합니다.

https://dash.cloudflare.com/profile/api-tokens

아래 스크린샷과 같이 Cloudflare API 토큰을 설정하세요:

이 API 토큰을 얻은 후, 안전한 곳(비밀번호 관리자)에 기록해 두세요. Ghostbuster에서 사용하려면 cloudflaretoken 인수를 통해 전달하세요.

저자

  • Shubham Shah - 초기 작업 - github

이 프로젝트에 참여한 기여자 목도 참조하세요.

라이선스

GNU Affero General Public License

Ghostbuster 테스트

  1. 이 저장소를 클론합니다.
  2. pip3 install virtualenv를 사용하여 virtualenv를 설치합니다.
  3. virtualenv venv를 사용하여 가상 환경을 생성합니다.
  4. . venv/bin/activate를 사용하여 가상 환경을 활성화합니다.
  5. 저장소 루트로 이동하여 pip3 install --editable .를 실행하여 ghostbuster를 설치합니다.
  6. 변경 사항을 적용하고 ghostbuster 명령을 실행합니다.
도구 다운로드