웹사이트 검색

Nikto - 웹 서버용 웹 애플리케이션 취약점 및 CGI 스캐너


Nikto Web Scanner는 Linux 관리자에게 유용한 도구입니다. 이는 GPL 라이선스에 따라 출시된 오픈 소스 웹 스캐너로, 잠재적으로 위험한 파일/CGI를 포함하여 6500개 이상의 여러 항목에 대해 웹 서버에서 포괄적인 테스트를 수행하는 데 사용됩니다. .

권장 읽기: WPSeku – WordPress의 보안 문제를 찾기 위한 취약점 스캐너

취약성 평가를 위해 Chris SoloDavid Lodge가 작성했으며 1250개 이상의 웹 서버와 오래된 버전을 확인합니다. 270 이상의 버전 관련 문제. 또한 오래된 웹 서버 소프트웨어 및 플러그인을 검색하고 보고합니다.

Nikto 웹 스캐너의 특징

  1. SSL 지원
  2. 전체 HTTP 프록시 지원
  3. 보고서를 저장하기 위해 텍스트, HTML, XML 및 CSV를 지원합니다.
  4. 여러 포트 검색
  5. nmap 출력과 같은 파일에서 입력을 가져와 여러 서버에서 스캔할 수 있습니다.
  6. LibWhisker IDS 지원
  7. 헤더, 파일, 파비콘으로 설치된 소프트웨어를 식별할 수 있을 만큼 충분히 가능합니다.
  8. 메타스플로잇 로그
  9. "비정상적인" 헤더에 대한 보고서입니다.
  10. Apache 및 cgiwrap 사용자 열거
  11. 기본 및 NTLM을 사용하여 호스트 인증
  12. 스캔은 지정된 시간에 자동으로 일시 중지될 수 있습니다.

Nikto 요구 사항

기본 Perl, Perl 모듈, OpenSSL이 설치된 시스템에서는 Nikto를 실행할 수 있습니다. Windows, Mac OSXRed와 같은 다양한 Unix/Linux 배포판에서 철저한 테스트를 거쳤습니다. Hat, Debian, Ubuntu, BackTrack

Linux에 Nikto Web Scanner 설치

오늘날 대부분의 Linux 시스템에는 Perl, Perl 모듈OpenSSL 패키지가 사전 설치된 상태로 제공됩니다. 포함되지 않은 경우 yum 또는 apt-get이라는 기본 시스템 패키지 관리자 유틸리티를 사용하여 설치할 수 있습니다.

Red Hat/CentOS/Fedora에서
[root@tecmint ]# yum install perl perl-Net-SSLeay openssl
데비안/우분투/리눅스 민트에서
[root@tecmint ]# apt-get install perl openssl libnet-ssleay-perl

다음으로 Github 저장소에서 안정적인 최신 Nikto 소스 파일을 복제하고 Nikto/programs/ 디렉토리로 이동한 후 Perl을 사용하여 실행합니다.

git clone https://github.com/sullo/nikto.git
cd nikto/programs
perl nikto.pl -h 
샘플 출력
Option host requires an argument

       -config+            Use this config file
       -Display+           Turn on/off display outputs
       -dbcheck            check database and other key files for syntax errors
       -Format+            save file (-o) format
       -Help               Extended help information
       -host+              target host
       -id+                Host authentication to use, format is id:pass or id:pass:realm
       -list-plugins       List all available plugins
       -output+            Write output to this file
       -nossl              Disables using SSL
       -no404              Disables 404 checks
       -Plugins+           List of plugins to run (default: ALL)
       -port+              Port to use (default 80)
       -root+              Prepend root value to all requests, format is /directory
       -ssl                Force ssl mode on port
       -Tuning+            Scan tuning
       -timeout+           Timeout for requests (default 10 seconds)
       -update             Update databases and plugins from CIRT.net
       -Version            Print plugin and database versions
       -vhost+             Virtual host (for Host header)
   		+ requires a value

	Note: This is the short help output. Use -H for full help text.

"옵션 호스트에는 인수가 필요합니다"는 테스트를 수행하는 동안 필요한 매개변수를 포함하지 않았음을 분명히 나타냅니다. 따라서 테스트 실행을 위해서는 기본적인 필수 매개변수를 추가해야 합니다.

기본 테스트

기본 스캔에는 대상으로 삼으려는 호스트가 필요하며, 아무것도 지정되지 않은 경우 기본적으로 포트 80을 스캔합니다. 호스트는 시스템의 호스트 이름 또는 IP 주소일 수 있습니다. "-h" 옵션을 사용하여 호스트를 지정할 수 있습니다.

예를 들어, TCP 포트 80에서 IP 172.16.27.56을 검색하고 싶습니다.

[root@tecmint nikto-2.1.5]# perl nikto.pl -h 172.16.27.56
샘플 출력
- Nikto v2.1.5
---------------------------------------------------------------------------
+ Target IP:          172.16.27.56
+ Target Hostname:    example.com
+ Target Port:        80
+ Start Time:         2014-01-10 00:48:12 (GMT5.5)
---------------------------------------------------------------------------
+ Server: Apache/2.2.15 (CentOS)
+ Retrieved x-powered-by header: PHP/5.3.3
+ The anti-clickjacking X-Frame-Options header is not present.
+ Server leaks inodes via ETags, header found with file /robots.txt, inode: 5956160, size: 24, mtime: 0x4d4865a054e32
+ File/dir '/' in robots.txt returned a non-forbidden or redirect HTTP code (200)
+ "robots.txt" contains 1 entry which should be manually viewed.
+ Apache/2.2.15 appears to be outdated (current is at least Apache/2.2.22). Apache 1.3.42 (final release) and 2.0.64 are also current.
+ Multiple index files found: index.php, index.htm, index.html
+ DEBUG HTTP verb may show server debugging information. See http://msdn.microsoft.com/en-us/library/e8z01xdh%28VS.80%29.aspx for details.
+ OSVDB-877: HTTP TRACE method is active, suggesting the host is vulnerable to XST
+ OSVDB-3233: /phpinfo.php: Contains PHP configuration information
+ OSVDB-12184: /index.php?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000: PHP reveals potentially sensitive information via certain HTTP requests that contain specific QUERY strings.
+ OSVDB-3092: /test.html: This might be interesting...
+ OSVDB-3268: /icons/: Directory indexing found.
+ OSVDB-3233: /icons/README: Apache default file found.
+ /connect.php?path=http://cirt.net/rfiinc.txt?: Potential PHP MySQL database connection string found.
+ OSVDB-3092: /test.php: This might be interesting...
+ 6544 items checked: 0 error(s) and 16 item(s) reported on remote host
+ End Time:           2014-01-10 00:48:23 (GMT5.5) (11 seconds)
---------------------------------------------------------------------------
+ 1 host(s) tested

다른 포트 번호로 스캔하려면 “-p ” [-port] 옵션을 추가하세요. 예를 들어, TCP 포트 443에서 IP 172.16.27.56을 검색하고 싶습니다.

[root@tecmint nikto-2.1.5]# perl nikto.pl -h 172.16.27.56 -p 443
샘플 출력
- Nikto v2.1.5
---------------------------------------------------------------------------
+ Target IP:          172.16.27.56
+ Target Hostname:    example.com
+ Target Port:        443
---------------------------------------------------------------------------
+ SSL Info:        Subject: /O=*.mid-day.com/OU=Domain Control Validated/CN=*.mid-day.com
                   Ciphers: DHE-RSA-AES256-GCM-SHA384
                   Issuer:  /C=US/ST=Arizona/L=Scottsdale/O=Starfield Technologies, Inc./OU=http://certificates.starfieldtech.com/repository/CN=Starfield Secure Certification Authority/serialNumber=10688435
+ Start Time:         2014-01-10 01:08:26 (GMT5.5)
---------------------------------------------------------------------------
+ Server: Apache/2.2.15 (CentOS)
+ Server leaks inodes via ETags, header found with file /, inode: 2817021, size: 5, mtime: 0x4d5123482b2e9
+ The anti-clickjacking X-Frame-Options header is not present.
+ Apache/2.2.15 appears to be outdated (current is at least Apache/2.2.22). Apache 1.3.42 (final release) and 2.0.64 are also current.
+ Server is using a wildcard certificate: '*.mid-day.com'
+ Allowed HTTP Methods: GET, HEAD, POST, OPTIONS, TRACE
+ OSVDB-877: HTTP TRACE method is active, suggesting the host is vulnerable to XST
+ OSVDB-3268: /icons/: Directory indexing found.
+ OSVDB-3233: /icons/README: Apache default file found.
+ 6544 items checked: 0 error(s) and 8 item(s) reported on remote host
+ End Time:           2014-01-10 01:11:20 (GMT5.5) (174 seconds)
---------------------------------------------------------------------------
+ 1 host(s) tested

전체 URL 구문을 사용하여 호스트, 포트프로토콜을 지정할 수도 있으며 이를 검사합니다.

[root@tecmint nikto-2.1.5]# perl nikto.pl -h http://172.16.27.56:80

모든 웹사이트를 스캔할 수도 있습니다. 예를 들어 여기서는 google.com을 검색했습니다.

[root@tecmint nikto-2.1.5]# perl nikto.pl -h http://www.google.com
샘플 출력
- Nikto v2.1.5
---------------------------------------------------------------------------
+ Target IP:          173.194.38.177
+ Target Hostname:    www.google.com
+ Target Port:        80
+ Start Time:         2014-01-10 01:13:36 (GMT5.5)
---------------------------------------------------------------------------
+ Server: gws
+ Cookie PREF created without the httponly flag
+ Cookie NID created without the httponly flag
+ Uncommon header 'x-frame-options' found, with contents: SAMEORIGIN
+ Uncommon header 'x-xss-protection' found, with contents: 1; mode=block
+ Uncommon header 'alternate-protocol' found, with contents: 80:quic
+ Root page / redirects to: http://www.google.co.in/?gws_rd=cr&ei=xIrOUomsCoXBrAee34DwCQ
+ Server banner has changed from 'gws' to 'sffe' which may suggest a WAF, load balancer or proxy is in place
+ Uncommon header 'x-content-type-options' found, with contents: nosniff
+ No CGI Directories found (use '-C all' to force check all possible dirs)
+ File/dir '/groups/' in robots.txt returned a non-forbidden or redirect HTTP code (302)
….

위 명령은 웹 서버에서 여러 http 요청(예: 2000개 이상의 테스트)을 수행합니다.

다중 포트 테스트

동일한 세션에서 여러 포트 검색을 수행할 수도 있습니다. 동일한 호스트에서 여러 포트를 검사하려면 "-p" [-port] 옵션을 추가하고 포트 목록을 지정합니다. 포트는 범위(예: 80-443)로 정의하거나 쉼표로 구분하여(예: 80,443) 정의할 수 있습니다. 예를 들어, 호스트 172.16.27.56에서 포트 80443을 스캔하고 싶습니다.

[root@tecmint nikto-2.1.5]# perl nikto.pl -h 172.16.27.56 -p 80,443
샘플 출력
- Nikto v2.1.5
---------------------------------------------------------------------------
+ No web server found on cmsstage.mid-day.com:88
---------------------------------------------------------------------------
+ Target IP:          172.16.27.56
+ Target Hostname:    example.com
+ Target Port:        80
+ Start Time:         2014-01-10 20:38:26 (GMT5.5)
---------------------------------------------------------------------------
+ Server: Apache/2.2.15 (CentOS)
+ Retrieved x-powered-by header: PHP/5.3.3
+ The anti-clickjacking X-Frame-Options header is not present.

---------------------------------------------------------------------------
+ Target IP:          172.16.27.56
+ Target Hostname:    example.com
+ Target Port:        443
---------------------------------------------------------------------------
+ SSL Info:        Subject: /O=*.mid-day.com/OU=Domain Control Validated/CN=*.mid-day.com
                   Ciphers: DHE-RSA-AES256-GCM-SHA384
                   Issuer:  /C=US/ST=Arizona/L=Scottsdale/O=Starfield Technologies, Inc./OU=http://certificates.starfieldtech.com/repository/CN=Starfield Secure Certification Authority/serialNumber=10688435
+ Start Time:         2014-01-10 20:38:36 (GMT5.5)
---------------------------------------------------------------------------
+ Server: Apache/2.2.15 (CentOS)
+ All CGI directories 'found', use '-C none' to test none
+ Apache/2.2.15 appears to be outdated (current is at least Apache/2.2.22). Apache 1.3.42 (final release) and 2.0.64 are also current.
.....

프록시 사용

Nikto가 실행 중인 시스템이 HTTP 프록시를 통해서만 대상 호스트에 액세스할 수 있다고 가정하면 테스트는 여전히 두 가지 다른 방법을 사용하여 수행될 수 있습니다. 하나는 nikto.conf 파일을 사용하는 것이고 또 다른 방법은 명령줄에서 직접 실행하는 것입니다.

Nikto.conf 파일 사용

명령줄 편집기를 사용하여 nikto.conf 파일을 엽니다.

[root@localhost nikto-2.1.5]# vi nikto.conf

변수 "PROXY"를 검색하고 표시된 대로 줄 시작 부분에서 '#'의 주석 처리를 제거합니다. 그런 다음 프록시 호스트, 포트, 프록시 사용자비밀번호를 추가합니다. 파일을 저장하고 닫습니다.

Proxy settings -- still must be enabled by -useproxy
PROXYHOST=172.16.16.37
PROXYPORT=8080
PROXYUSER=pg
PROXYPASS=pg

이제 "-useproxy" 옵션을 사용하여 Nikto를 실행합니다. 모든 연결은 HTTP 프록시를 통해 릴레이됩니다.

root@localhost nikto-2.1.5]# perl nikto.pl -h localhost -p 80 -useproxy
샘플 출력
- Nikto v2.1.5
---------------------------------------------------------------------------
+ Target IP:          127.0.0.1
+ Target Hostname:    localhost
+ Target Port:        80
+ Start Time:         2014-01-10 21:28:29 (GMT5.5)
---------------------------------------------------------------------------
+ Server: squid/2.6.STABLE6
+ Retrieved via header: 1.0 netserv:8080 (squid/2.6.STABLE6)
+ The anti-clickjacking X-Frame-Options header is not present.
+ Uncommon header 'x-squid-error' found, with contents: ERR_CACHE_ACCESS_DENIED 0
+ Uncommon header 'x-cache-lookup' found, with contents: NONE from netserv:8080
명령줄 사용

프록시를 인수로 설정하여 "-useproxy" 옵션을 사용하여 명령줄에서 직접 Nikto를 실행합니다.

root@localhost nikto-2.1.5]# perl nikto.pl -h localhost -useproxy http://172.16.16.37:8080/
샘플 출력
- Nikto v2.1.5
---------------------------------------------------------------------------
+ Target IP:          127.0.0.1
+ Target Hostname:    localhost
+ Target Port:        80
+ Start Time:         2014-01-10 21:34:51 (GMT5.5)
---------------------------------------------------------------------------
+ Server: squid/2.6.STABLE6
+ Retrieved via header: 1.0 netserv:8080 (squid/2.6.STABLE6)
+ The anti-clickjacking X-Frame-Options header is not present.
+ Uncommon header 'x-squid-error' found, with contents: ERR_CACHE_ACCESS_DENIED 0
+ Uncommon header 'x-cache-lookup' found, with contents: NONE from netserv:8080

Nikto 업데이트 중

Nikto를 최신 플러그인데이터베이스로 자동 업데이트할 수 있으며, 간단히 “-update” 명령을 실행하면 됩니다.

[root@localhost nikto-2.1.5]# perl nikto.pl -update

새 업데이트가 있으면 다운로드된 새 업데이트 목록이 표시됩니다.

+ Retrieving 'nikto_report_csv.plugin'
+ Retrieving 'nikto_headers.plugin'
+ Retrieving 'nikto_cookies.plugin'
+ Retrieving 'db_tests'
+ Retrieving 'db_parked_strings'
+ Retrieving 'CHANGES.txt'
+ CIRT.net message: Please submit Nikto bugs to http://trac2.assembla.com/Nikto_2/report/2

또한 http://cirt.net/nikto/UPDATES/에서 Nikto 플러그인과 데이터베이스를 수동으로 다운로드하고 업데이트할 수도 있습니다.

참조 링크

닉토 홈페이지