Shodan은 무료 API를 제공 — 노출된 장치를 스캔하기 (Python 예제 포함)
발행: (2026년 3월 25일 AM 07:38 GMT+9)
3 분 소요
원문: Dev.to
Source: Dev.to
Shodan 무료 API로 할 수 있는 일
- 노출된 데이터베이스(MongoDB, Elasticsearch, Redis) 찾기
- 서버에 열려 있는 포트가 있는지 확인
- 회사의 공격 표면 모니터링
- IoT 기기 보안 조사
- 특정 소프트웨어 버전을 실행 중인 서버 찾기
빠른 시작 (5분)
1. 무료 API 키 받기
회원가입 → Account → API Key.
무료 플랜: 검색당 100개 결과, 월 1회 스캔.
2. Python 라이브러리 설치
pip install shodan
3. 노출된 MongoDB 데이터베이스 검색
import shodan
api = shodan.Shodan('YOUR_API_KEY')
# 인증 없이 실행 중인 MongoDB 인스턴스 찾기
results = api.search('mongodb port:27017 -authentication')
print(f'Found {results["total"]} exposed MongoDB instances')
for result in results['matches'][:5]:
print(f' IP: {result["ip_str"]}:{result["port"]}')
print(f' Org: {result.get("org")}')
print(f' Country: {result.get("location")}')
print()
Output
Found 48,231 exposed MongoDB instances
IP: 203.x.x.x:27017
Org: Amazon Web Services
Country: United States
네, 인증 없이 노출된 MongoDB 인스턴스가 48 K개 이상 존재합니다(2026년 데이터).
유용한 검색 5가지
특정 기술을 실행 중인 서버 찾기
# 독일에 있는 모든 Nginx 서버 찾기
results = api.search('nginx country:DE')
print(f'Nginx servers in Germany: {results["total"]}')
자신의 IP 확인
# Shodan이 내 서버에 대해 알고 있는 정보 보기
host = api.host('YOUR_SERVER_IP')
print(f'Open ports: {host["ports"]}')
print(f'Vulns: {host.get("vulns")}')
for service in host['data']:
print(f' Port {service["port"]}: {service.get("product")}')
노출된 Elasticsearch 클러스터 찾기
results = api.search('elasticsearch port:9200')
for r in results['matches'][:3]:
print(f'{r["ip_str"]} — {r.get("org")} — indices: {r["data"][:100]}')
도메인 모니터링
# 도메인과 연관된 모든 장치 검색
results = api.search('hostname:example.com')
for r in results['matches']:
print(f'{r["ip_str"]}:{r["port"]} — {r.get("product")}')
취약점(CVE)으로 검색
# 특정 취약점을 가진 서버 찾기
results = api.search('vuln:CVE-2021-44228') # Log4Shell
print(f'Still vulnerable to Log4Shell: {results["total"]}')
무료 vs 유료
| 기능 | 무료 | 멤버십 ($49/월) |
|---|---|---|
| 검색 결과 | 100 | 무제한 |
| 스캔 | 월 1 회 | 무제한 |
| 필터 | 기본 | 전체 (vuln, port, ssl) |
| API 호출 | 월 100 회 | 무제한 |
| 알림 | ❌ | ✅ |
무료 티어만으로도 학습 및 기본 보안 점검에 충분합니다.
윤리적 고지
Shodan은 공개적으로 접근 가능한 데이터를 색인합니다. 소유하지 않은 시스템에 접근하는 것은 불법입니다. 다음 경우에만 사용하세요:
- 자신의 서버
- 허가받은 연구
- 버그 바운티 프로그램
- 학술 연구
추가 자료
- 무료 보안 도구 모음
- Awesome Web Scraping 2026