
RustScan
1. Cargo를 통한 설치 (권장)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source ~/.cargo/env
cargo install rustscan
2. Docker를 통한 사용
docker run -it --rm --name rustscan --net=host rustscan/rustscan -a [Target IP]
기본 사용법
1. 단일 호스트 스캔
rustscan -a 10.10.10.1
rustscan -a 10.10.10.1 -r 1-65535
rustscan -a 10.10.10.1 -p 80,443,22,21
2. 여러 호스트 스캔
rustscan -a 10.10.10.1,10.10.10.2,10.10.10.3
rustscan -a 10.10.10.1-10.10.10.100
rustscan -a 10.10.10.0/24
3. 파일에서 호스트 목록 읽기
rustscan -a hosts.txt
10.10.10.1
10.10.10.2
192.168.1.1-192.168.1.100
고급 옵션
1. 속도 및 성능 설정
rustscan -a 10.10.10.1 -b 1000
rustscan -a 10.10.10.1 -t 3000
rustscan -a 10.10.10.1 --ulimit 5000
2. Nmap 통합
rustscan -a 10.10.10.1 -- -sV -sC
rustscan -a 10.10.10.1 -- -A
rustscan -a 10.10.10.1 -- --script vuln
3. 출력 형식 설정
rustscan -a 10.10.10.1 -o json
rustscan -a 10.10.10.1 -o json > scan_results.json
rustscan -a 10.10.10.1 -q
실용적인 사용 예시
1. 빠른 네트워크 발견
rustscan -a 192.168.1.0/24 -p 80,443,22,21,23,25,53,135,139,445
rustscan -a 192.168.1.0/24 -p 80,443,8080,8443
2. CTF/모의해킹에서의 활용
rustscan -a 10.10.10.1 -r 1-1000
rustscan -a 10.10.10.1 -p 22,80,443 -- -sV -sC -A
rustscan -a 10.10.10.1 -r 1-65535 -t 5000 -b 2000
3. 스테가노그래피와 결합
rustscan -a 10.10.10.1 -o json | jq '.[] | select(.port == 80)'
설정 파일 사용
config.toml 파일 생성
~/.config/rustscan/config.toml
설정 파일 내용 예시
# ~/.config/rustscan/config.toml
[scanning]
batch_size = 4500
timeout = 1500
tries = 1
port_strategy = "serial"
[misc]
accessible = false
일반적인 명령어 조합
1. 기본 정찰
rustscan -a target.com -t 2000 -b 3000
rustscan -a target.com -r 1-65535 -- -sV
2. 스텔스 스캔
rustscan -a target.com -t 5000 -b 500 -- -T2 -sS
3. 서비스 식별
rustscan -a target.com -- -sV -sC
rustscan -a target.com -- -O -sV -sC
문제 해결
1. 권한 문제
sudo rustscan -a 10.10.10.1
sudo setcap cap_net_raw+ep /usr/local/bin/rustscan
2. ulimit 설정
ulimit -n
ulimit -n 5000
3. 방화벽 문제
rustscan -a target.com -- -sU
rustscan -a target.com -- -sA
성능 최적화 팁
- 배치 크기 조정: 네트워크 상황에 따라
-b 옵션 조정
- 타임아웃 설정: 느린 네트워크에서는
-t 값 증가
- 포트 범위 제한: 필요한 포트만 스캔하여 시간 단축
- 병렬 처리:
--ulimit 옵션으로 동시 연결 수 증가
보안 고려사항
- RustScan은 매우 빠르므로 탐지될 가능성이 높음
- 스텔스가 필요한 경우 타임아웃을 늘리고 배치 크기를 줄임
- 대상 시스템에 부하를 줄 수 있으므로 주의 필요
- 합법적인 모의해킹이나 자신의 시스템에서만 사용
유용한 별칭 설정
alias rs='rustscan'
alias rsfast='rustscan -t 1000 -b 5000'
alias rsslow='rustscan -t 5000 -b 1000'
alias rsall='rustscan -r 1-65535'