Получение подробной информации о веб-сервере
Чтобы узнать версию PHP удаленного веб-сервера, используйте Ruby-скрипт Whatweb.
С его помощью можно получить много информации о веб-сервере, если он не использует Cloudflare.
Вот пример:
whatweb https://hackthissite.org | tr "," "\n"
https://hackthissite.org [200 OK] Content-Language[en]
Cookies[HackThisSite]
Country[CANADA][CA]
HTTPServer[HackThisSite]
IP[137.74.187.101]
JQuery[1.8.1]
Meta-Author[HackThisSite.org Staff]
Open-Graph-Protocol[website]
PasswordField[password]
Script[text/javascript]
Strict-Transport-Security[max-age=31536000; includeSubDomains; preload]
Title[Hack This Site]
UncommonHeaders[upgrade
onion-location
access-control-allow-origin
content-security-policy
referrer-policy
feature-policy
public-key-pins-report-only
report-to
nel]
X-XSS-Protection[0]
Здесь отображаются номера версий любого программного обеспечения, работающего на сайте, например PHP.
Вот еще один пример:
whatweb https://mharatlms.com | tr "," "\n"
https://mharatlms.com [200 OK] Apache
Content-Language[ar]
Cookies[MoodleSession]
Country[UNITED STATES][US]
Email[Lms@mharat.com.sa
lms@mharat.com.sa]
HTML5
HTTPServer[Apache]
IP[162.214.194.214]
JQuery[3.5.1]
Moodle
PasswordField[password]
Script[text/css]
Title[منصة مهارات للتعليم عن بعد]
UncommonHeaders[content-script-type
content-style-type]
X-Frame-Options[sameorigin]
X-UA-Compatible[IE=edge]
Вы можете посмотреть только версию программного обеспечения.
whatweb https://mharatlms.com | tr "," "\n" | grep JQuery
JQuery[3.5.1]
см. также:
📜 Как проверить версию jQuery с помощью браузера – IT is good
Еще один способ получить исчерпывающую информацию о сайте при тестировании на проникновение – использовать Perl-скрипт Nikto.
Он вернет много очень полезной информации о сайте.
Скачать скрипт.
git clone https://github.com/sullo/nikto
Cloning into 'nikto'...
remote: Enumerating objects: 7237, done.
remote: Counting objects: 100% (1249/1249), done.
remote: Compressing objects: 100% (409/409), done.
remote: Total 7237 (delta 939), reused 1117 (delta 839), pack-reused 5988
Receiving objects: 100% (7237/7237), 4.91 MiB | 5.65 MiB/s, done.
Resolving deltas: 100% (5255/5255), done.
Затем загрузите необходимые модули Perl, если это необходимо.
dnf in perl-bignum perl-Net
После этого все должно быть готово.
Перейдите в нужный каталог и запустите nikto для сканирования сайта.
Это идеальное решение для сканирования веб-сайта на наличие уязвимостей.
./nikto.pl -h https://mharatlms.com
- Nikto v2.5.0
---------------------------------------------------------------------------
+ Target IP: 162.214.194.214
+ Target Hostname: mharatlms.com
+ Target Port: 443
---------------------------------------------------------------------------
+ SSL Info: Subject: /CN=mharatlms.jicclms.com
Altnames: mail.mharatlms.com, mharatlms.com, mharatlms.jicclms.com, www.mharatlms.com, www.mharatlms.jicclms.com
Ciphers: TLS_AES_256_GCM_SHA384
Issuer: /C=US/O=Let's Encrypt/CN=R3
+ Start Time: 2023-09-22 10:49:03 (GMT10)
---------------------------------------------------------------------------
+ Server: Apache
+ /: Cookie MoodleSession created without the httponly flag. See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies
+ /: Uncommon header 'content-style-type' found, with contents: text/css.
+ /: Uncommon header 'content-script-type' found, with contents: text/javascript.
+ /: The site uses TLS and the Strict-Transport-Security HTTP header is not defined. See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security
+ /: The X-Content-Type-Options header is not set. This could allow the user agent to render the content of the site in a different fashion to the MIME type. See: https://www.netsparker.com/web-vulnerability-scanner/vulnerabilities/missing-content-type-header/
+ /mharatlms.zip: Potentially interesting backup/cert file found. (NOTE: requested by IP address). See: https://cwe.mitre.org/data/definitions/530.html
+ /pluginfile.php/1/theme_edumy/favicon/1692706572/Mharat-Logo-Dark.png: Uncommon header 'content-disposition' found, with contents: inline; filename="Mharat-Logo-Dark.png".
+ /: Web Server returns a valid response with junk HTTP methods which may cause false positives.
+ /: DEBUG HTTP verb may show server debugging information. See: https://docs.microsoft.com/en-us/visualstudio/debugger/how-to-enable-debugging-for-aspnet-applications?view=vs-2017
+ /config.php: PHP Config file may contain database IDs and passwords.
+ /admin/: Uncommon header 'x-accel-buffering' found, with contents: no.
+ /admin/: Uncommon header 'x-redirect-by' found, with contents: Moodle /admin/index.php:786.
+ /mailman/listinfo: Mailman was found on the server. See: CWE-552
+ /auth/: This might be interesting.
+ /backup/: Directory indexing found.
+ /backup/: This might be interesting.
+ /install/: Directory indexing found.
+ /install/: This might be interesting.
+ /lib/: This might be interesting.
+ /login/: This might be interesting.
+ /pix/: Directory indexing found.
+ /pix/: This might be interesting.
+ /img-sys/: Default image directory should not allow directory listing.
+ /info.php: Output from the phpinfo() function was found.
+ /info.php: PHP is installed, and a test script which runs phpinfo() was found. This gives a lot of system information. See: CWE-552
+ /INSTALL.txt: Default file found.
+ /info.php?file=http://cirt.net/public/rfiinc.txt: Remote File Inclusion (RFI) from RSnake's RFI list. See: https://gist.github.com/mubix/5d269c686584875015a2
+ /test.php: This might be interesting.
+ /repository/: Directory indexing found.
+ /repository/: CRX WebDAV upload.
+ /composer.json: PHP Composer configuration file reveals configuration information. See: https://getcomposer.org/
+ /composer.lock: PHP Composer configuration file reveals configuration information. See: https://getcomposer.org/
+ 8768 requests: 0 error(s) and 32 item(s) reported on remote host
+ End Time: 2023-09-22 12:42:46 (GMT10) (6823 seconds)
---------------------------------------------------------------------------
+ 1 host(s) tested
У этого сайта проблемы…
Это займет некоторое время, так что будьте терпеливы.
Чаще всего это каталоги, которые не должны быть доступны в Интернете.
Это CWE 552.
Ее следует решить как можно скорее.
Использование файла .htaccess – хороший способ решить эту проблему.
Options -Indexes
Однако создание пустого файла index.php в папке – еще один способ решить эту проблему.
Как правильно расположить папку при использовании индексов
Чтобы запретить пользователям просматривать каталог:
Options +Indexes
IndexOptions +FancyIndexing
|
Или этот, чтобы иметь причудливую HTML-страницу со списком всех файлов
Options +Indexes
HeaderName HEADER.html
ReadmeName FOOTER.html
IndexIgnore .htaccess .??* *~ *# HEADER* FOOTER* README* RCS CVS *,v *,t *.inc ..
IndexOptions +SuppressHTMLPreamble SuppressDescription
|
см. также: