ค้นหาเว็บไซต์

Nikto - ช่องโหว่เว็บแอปพลิเคชันและสแกนเนอร์ CGI สำหรับเว็บเซิร์ฟเวอร์


Nikto Web Scanner เป็นอีกหนึ่งเครื่องมือที่ดีสำหรับคลังแสงของผู้ดูแลระบบ Linux เป็นเครื่องสแกนเว็บโอเพ่นซอร์สที่เผยแพร่ภายใต้ใบอนุญาต GPL ซึ่งใช้เพื่อทำการทดสอบที่ครอบคลุมบนเว็บเซิร์ฟเวอร์สำหรับหลายรายการ รวมถึง 6500 ไฟล์ ไฟล์/CGI ที่อาจเป็นอันตราย .

แนะนำให้อ่าน: WPSeku – เครื่องสแกนช่องโหว่เพื่อค้นหาปัญหาด้านความปลอดภัยใน WordPress

เขียนโดย Chris Solo และ David Lodge สำหรับการประเมิน ช่องโหว่ โดยจะตรวจสอบเวอร์ชันที่ล้าสมัยบนเว็บเซิร์ฟเวอร์ 1250 และ ปัญหาเฉพาะเวอร์ชันมากกว่า 270 นอกจากนี้ยังสแกนและรายงานซอฟต์แวร์และปลั๊กอินเว็บเซิร์ฟเวอร์ที่ล้าสมัยอีกด้วย

คุณสมบัติของ Nikto Web Scanner

  1. รองรับ SSL
  2. รองรับพร็อกซี HTTP เต็มรูปแบบ
  3. รองรับข้อความ, HTML, XML และ CSV เพื่อบันทึกรายงาน
  4. สแกนหาหลายพอร์ต
  5. สามารถสแกนบนเซิร์ฟเวอร์หลายเครื่องโดยรับอินพุตจากไฟล์เช่นเอาต์พุต nmap
  6. รองรับ LibWhisker IDS
  7. มีความสามารถเพียงพอในการระบุซอฟต์แวร์ที่ติดตั้งด้วยส่วนหัว ไฟล์ และไอคอน Fav
  8. บันทึกสำหรับ Metasploits
  9. รายงานส่วนหัว "ผิดปกติ"
  10. การแจงนับผู้ใช้ Apache และ cgiwrap
  11. ตรวจสอบโฮสต์ด้วย Basic และ NTLM
  12. การสแกนสามารถหยุดอัตโนมัติตามเวลาที่กำหนด

ข้อกำหนดของนิกโต

ระบบที่มีการติดตั้ง Perl, โมดูล Perl, OpenSSL พื้นฐาน ควรเปิดใช้งาน Nikto เพื่อให้ทำงานได้ ได้รับการทดสอบอย่างละเอียดบน Windows, Mac OSX และการกระจาย Unix/Linux ต่างๆ เช่น Red หมวก, เดเบียน, Ubuntu, BackTrack ฯลฯ

การติดตั้ง Nikto Web Scanner บน Linux

ระบบ Linux ในปัจจุบันส่วนใหญ่มาพร้อมกับแพ็คเกจ Perl, โมดูล Perl และ OpenSSL ที่ติดตั้งไว้ล่วงหน้า หากไม่ได้รวมไว้ คุณสามารถติดตั้งได้โดยใช้ยูทิลิตีตัวจัดการแพ็คเกจระบบเริ่มต้นที่เรียกว่า yum หรือ apt-get

บน Red Hat/CentOS/Fedora
[root@tecmint ]# yum install perl perl-Net-SSLeay openssl
บน Debian/Ubuntu/Linux Mint
[root@tecmint ]# apt-get install perl openssl libnet-ssleay-perl

จากนั้น โคลนไฟล์ต้นฉบับ Nikto ที่เสถียรล่าสุดจากที่เก็บ Github ย้ายไปยังไดเร็กทอรี 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

ตัวอย่างเช่น ฉันต้องการสแกนบน IP 172.16.27.56 บนพอร์ต TCP 80

[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] ตัวอย่างเช่น ฉันต้องการสแกนบน IP 172.16.27.56 บนพอร์ต TCP 443

[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) ตัวอย่างเช่น ฉันต้องการสแกนพอร์ต 80 และ 443 บนโฮสต์ 172.16.27.56

[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

ตอนนี้ ดำเนินการ Nikto โดยใช้ตัวเลือก “-useproxy” โปรดทราบว่าการเชื่อมต่อทั้งหมดจะถูกส่งผ่านพร็อกซี 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
การใช้บรรทัดคำสั่ง

หากต้องการเรียกใช้ Nikto โดยตรงจากบรรทัดคำสั่งโดยใช้ตัวเลือก “-useproxy” โดยการตั้งค่าพร็อกซีเป็นอาร์กิวเมนต์

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

คุณยังสามารถดาวน์โหลดและอัปเดตปลั๊กอินและฐานข้อมูล Nikto ได้ด้วยตนเองจาก http://cirt.net/nikto/UPDATES/

ลิงค์อ้างอิง

หน้าแรกของนิกโต