대상 URL 에 대한 스캔 실행
이제 sqlmap 명령을 구성했으므로 터미널에서 실행할 차례입니다. 이렇게 하면 자동화된 SQL 인젝션 스캔이 시작됩니다.
터미널에서 이전 단계에서 구성한 sqlmap 명령을 실행합니다.
sqlmap -u "http://localhost/index.php?id=1"
sqlmap은 다양한 유형의 SQL 인젝션 취약점을 테스트하기 위해 id 매개변수에 다양한 페이로드 (payload) 를 보내기 시작합니다. 스캔 중에 sqlmap이 몇 가지 질문을 할 수 있습니다. 이 기본 스캔의 경우, 프롬프트가 나타날 때 Enter를 누르거나 y (yes) 를 입력하여 기본 옵션을 일반적으로 수락할 수 있습니다.
예를 들어, sqlmap은 다음과 같이 질문할 수 있습니다.
[INFO] the back-end DBMS is MySQL. Do you want to skip test payloads specific for other DBMSs? [Y/n]
Y를 입력하고 Enter를 누릅니다.
또한 다음과 같이 질문할 수도 있습니다.
for the URL 'http://localhost/index.php?id=1', parameter 'id' appears to be injectable. Do you want to keep testing others (if any)? [y/N]
식별된 취약한 매개변수에 집중하기 위해 N을 입력하고 Enter를 누릅니다.
스캔이 진행되며, 진행 상황과 수행되는 테스트를 나타내는 다양한 메시지가 표시됩니다.
_
___ ___ ___ ___
|_ -| . | . | . |
|___|_ |_ |_ |
|_| |_| |_| 3.7#stable
[INFO] starting @ 12:34:56 /2023-01-01/
[INFO] testing connection to the target URL
[INFO] checking if the target is protected by some kind of WAF/IPS
[INFO] the back-end DBMS is MySQL. Do you want to skip test payloads specific for other DBMSs? [Y/n] Y
[INFO] for the URL 'http://localhost/index.php?id=1', parameter 'id' appears to be injectable. Do you want to keep testing others (if any)? [y/N] N
[INFO] GET parameter 'id' is vulnerable.
... (truncated output) ...