
셀레니움 기반 웹 스크래퍼로 비밀번호 목록 생성
Selenium 기반 웹 스크래퍼로 비밀번호 목록을 생성합니다.
# Firefox 웹드라이버를 https://github.com/mozilla/geckodriver/releases 에서 다운로드
$ tar xzf geckodriver-v{VERSION-HERE}.tar.gz
$ sudo mv geckodriver /usr/local/bin # PATH에 포함되어 있는지 확인
$ geckodriver --version # 웹드라이버가 제대로 설치되었는지 확인
$ git clone https://github.com/dariusztytko/words-scraper
$ sudo pip3 install -r words-scraper/requirements.txt
$ python3 words-scraper.py -o words.txt https://www.example.com https://blog.example.com
이렇게 생성된 단어 목록은 온라인 무차별 대입 공격을 수행하거나 해시 크래킹에 사용할 수 있습니다:
$ hashcat -m 0 hashes.txt words.txt
--depth 옵션을 사용하여 연결된 페이지에서도 단어를 스크래핑할 수 있습니다. 선택적 --show-gui 스위치를 사용하여 진행 상황을 추적하고 페이지를 빠르게 볼 수 있습니다:
$ python3 words-scraper.py -o words.txt --depth 1 --show-gui https://www.example.com
생성된 단어 목록은 words-converter.py 스크립트를 사용하여 확장할 수 있습니다. 이 스크립트는 특수 문자와 악센트를 제거합니다. 예를 들어 폴란드어 단어 źdźbło! 는 다음 단어들로 변환됩니다:
$ cat words.txt | python3 words-converter.py | sort -u > words2.txt
Twitter 페이지는 스크롤할 때 동적으로 로드됩니다. --max-scrolls 옵션을 사용하여 단어를 스크래핑:
$ python3 words-scraper.py -o words.txt --max-scrolls 300 --show-gui https://twitter.com/example.com
$ ssh -D 1080 -Nf {USER-HERE}@{IP-HERE} >/dev/null 2>&
$ python3 words-scraper.py -o words.txt --socks-proxy 127.0.0.1:1080 https://www.example.com
usage: words-scraper.py [-h] [--depth DEPTH] [--max-scrolls MAX_SCROLLS]
[--min-word-length MIN_WORD_LENGTH]
[--page-load-delay PAGE_LOAD_DELAY]
[--page-scroll-delay PAGE_SCROLL_DELAY] [--show-gui]
[--socks-proxy SOCKS_PROXY] -o OUTPUT_FILE
url [url ...]
Words scraper (version: 1.0)
positional arguments:
url 스크래핑할 URL
optional arguments:
-h, --help 도움말 메시지를 표시하고 종료
--depth DEPTH 스크래핑 깊이, 기본값: 0
--max-scrolls MAX_SCROLLS
최대 페이지 스크롤 횟수, 기본값: 0
--min-word-length MIN_WORD_LENGTH
기본값: 3
--page-load-delay PAGE_LOAD_DELAY
페이지 로딩 지연 시간, 기본값: 3.0
--page-scroll-delay PAGE_SCROLL_DELAY
페이지 스크롤 지연 시간, 기본값: 1.0
--show-gui 브라우저 GUI 표시
--socks-proxy SOCKS_PROXY
Socks 프록시 (예: 127.0.0.1:1080)
-o OUTPUT_FILE, --output-file OUTPUT_FILE
단어를 파일에 저장
CHANGELOG를 참조하십시오.