آموزش نفوذ به سایت – راهنمای کاربردی پیدا کردن ضعفهای امنیتی وبسایت


یک هکر یا تستکننده نفوذ پیش از حمله به یک وبسایت، ابتدا فهرستی از سطوح هدف تهیه میکند. پس از آن که عملیات شناسایی به خوبی انجام شد و مکانهای مناسب برای حمله مشخص گردید، از یک ابزار اسکن وبسرور مانند Nikto برای شکار آسیبپذیریها استفاده میشود تا جهات بالقوه حملات مشخص شوند. در این مطلب به توضیح اصول بسیار مقدماتی آموزش نفوذ به سایت میپردازیم. توجه کنید که این مطلب صرفاً با هدف آموزش و آگاهسازی در خصوص روشهای مقابله با هک نگارش یافته است و مجموعه فرادرس در مورد هر نوع سوءاستفاده از این مطلب در جهت نفوذ غیر قانونی و بدون اجازه به وبسایتها از خود سلب مسئولیت میکند.
Nikto یک اسکنر ساده و اوپن سورس وبسرور است که وبسایت را مورد بررسی قرار داده و آسیبپذیریهایی که پیدا میکند را گزارش میدهد. این آسیبپذیریها میتوانند برای سوءاستفاده یا هک کردن یک وبسایت مورد استفاده قرار گیرند. همچنین Nikto یکی از پراستفادهترین ابزارهای بررسی آسیبپذیریهای وبسایت است و از جهات مختلف یک ابزار استاندارد محسوب میشود.
با این که این ابزار بسیار کارآمد است، اما به هیچ وجه پنهانکار نیست. هر سایت دارای سیستم کشف نفوذ یا دیگر تدابیر امنیتی متوجه خواهد شد که در حال اسکن شدن است. این ابزار در ابتدا به منظور تستهای امنیتی طراحی شده است و از این رو پنهانکاری اصلاً دغدغهای محسوب نمیشد.
روش صحیح استفاده از Nikto
اگر اولین بار است که Nikto را روی یک وبسایت مقصد اجرا کنید، شاید ندانید که با اطلاعات به دست آمده از اسکن باید چه بکنید. Nikto در واقع بیشتر شبیه یک اشارهگر لیزی است تا یک شمشیر لیزری که در جنگ ستارگان دیدهایم.
نخست باید در مورد سطوح هدف صحبت کنیم. منظور از سطوح هدف در واقع هر جایی است که یک هکر میتواند حمله کند و میتواند شامل چیزهایی مانند پرینترهای افشاشده در شبکه و یک وبسرور باشد. هنگامی که در ادامه به استفاده از Nikto عادت کنیم، باید یکی از سه اطلاعات زیر را در اختیار آن قرار دهیم: یک نشانی IP برای سرویس لوکال، یک دامنه وب برای حمله یا یک وبسایت SSL/HTTPS.
پیش از آن که دست به اسکن با Nikto بزنیم، بهتر است قبلاً برخی کارهای شناسایی را با استفاده از ابرارهای تجسسی اوپن سورس مانند Maltego انجام دهیم. ابزارهایی مانند این میتوانند به ساخت یک پروفایل و لیست متمرکزتری از اهداف در دسترس که باید رویان تمرکز کرد کمک کنند. زمانی که این کار انجام یافت، میتوان از Nikto برای بررسی آسیبپذیریهای بالقوه روی اهداف داخل لیست استفاده کرد.
در صورتی که خوششانس باشیم، یک آسیبپذیری با یک اکسپلویت پیدا میکنیم یعنی ابزاری وجود دارد که قبلاً از مزیت این ضعف بهرهبرداری کرده است. با بهرهگیری از ابزار متناسب که به طور خودکار از یک آسیبپذیری بهرهبرداری میکند هکر میتواند به هدف دسترسی یافته و چندین حمله مانند افزودن کد برای اجرای فعالیت مخرب در پشت صحنه اجرا کند.
گام یکم: نصب Nikto
اگر کالی لینوکس را اجرا میکنید، Nikto از قبل روی سیستم نصب شده است و از این رو نیازی به دانلود یا نصب چیز دیگر ندارید. این ابزار در دسته Vulnerability Analysis قرار دارد. اگر به هر دلیلی به این ابزار دسترسی ندارید، میتوانید Nikto را از صفحه گیتهاب آن (+) دانلود کنید و یا از دستور apt install بهره بگیرید.
apt install nikto
اگر این کار را روی یک سیستم مک انجام میدهید، امکان استفاده از Homebrew برای نصب نیکتو نیز وجود دارد.
brew install nikto
گام دوم: آشنایی با Nikto
پیش از آن که دست به اسکن کردن وبسرورها با Nikto بزنیم، میتوانیم از گزینه Help- استفاده کرده و کارهایی که میتوان با این ابزار اجرا کرد، مشاهده کنیم.
nikto –Help
Options: -ask+ Whether to ask about submitting updates yes Ask about each (default) no Don't ask, don't send auto Don't ask, just send -Cgidirs+ Scan these CGI dirs: "none", "all", or values like "/cgi/ /cgi-a/" -config+ Use this config file -Display+ Turn on/off display outputs: 1 Show redirects 2 Show cookies received 3 Show all 200/OK responses 4 Show URLs which require authentication D Debug output E Display all HTTP errors P Print progress to STDOUT S Scrub output of IPs and hostnames V Verbose output -dbcheck Check database and other key files for syntax errors -evasion+ Encoding technique: 1 Random URI encoding (non-UTF8) 2 Directory self-reference (/./) 3 Premature URL ending 4 Prepend long random string 5 Fake parameter 6 TAB as request spacer 7 Change the case of the URL 8 Use Windows directory separator (\) A Use a carriage return (0x0d) as a request spacer B Use binary value 0x0b as a request spacer -Format+ Save file (-o) format: csv Comma-separated-value htm HTML Format nbe Nessus NBE format sql Generic SQL (see docs for schema) txt Plain text xml XML Format (if not specified the format will be taken from the file extension passed to -output) -Help Extended help information -host+ Target host -404code Ignore these HTTP codes as negative responses (always). Format is "302,301". -404string Ignore this string in response body content as negative response (always). Can be a regular expression. -id+ Host authentication to use, format is id:pass or id:pass:realm -key+ Client certificate key file -list-plugins List all available plugins, perform no testing -maxtime+ Maximum testing time per host (e.g., 1h, 60m, 3600s) -mutate+ Guess additional file names: 1 Test all files with all root directories 2 Guess for password file names 3 Enumerate user names via Apache (/~user type requests) 4 Enumerate user names via cgiwrap (/cgi-bin/cgiwrap/~user type requests) 5 Attempt to brute force sub-domain names, assume that the host name is the parent domain 6 Attempt to guess directory names from the supplied dictionary file -mutate-options Provide information for mutates -nointeractive Disables interactive features -nolookup Disables DNS lookups -nossl Disables the use of SSL -no404 Disables nikto attempting to guess a 404 page -Option Over-ride an option in nikto.conf, can be issued multiple times -output+ Write output to this file ('.' for auto-name) -Pause+ Pause between tests (seconds, integer or float) -Plugins+ List of plugins to run (default: ALL) -port+ Port to use (default 80) -RSAcert+ Client certificate file -root+ Prepend root value to all requests, format is /directory -Save Save positive responses to this directory ('.' for auto-name) -ssl Force ssl mode on port -Tuning+ Scan tuning: 1 Interesting File / Seen in logs 2 Misconfiguration / Default File 3 Information Disclosure 4 Injection (XSS/Script/HTML) 5 Remote File Retrieval - Inside Web Root 6 Denial of Service 7 Remote File Retrieval - Server Wide 8 Command Execution / Remote Shell 9 SQL Injection 0 File Upload a Authentication Bypass b Software Identification c Remote Source Inclusion d WebService e Administrative Console x Reverse Tuning Options (i.e., include all except specified) -timeout+ Timeout for requests (default 10 seconds) -Userdbs Load only user databases, not the standard databases all Disable standard dbs and load only user dbs tests Disable only db_tests and load udb_tests -useragent Over-rides the default useragent -until Run until the specified time or duration -update Update databases and plugins from CIRT.net -useproxy Use the proxy defined in nikto.conf, or argument http://server:port -Version Print plugin and database versions -vhost+ Virtual host (for Host header) + requires a value
گام سوم: استفاده از ساختار مقدماتی
چنان که در گام پیش دیدیم، Nikto گزینههای زیادی دارد. اما با توجه به اهداف مورد نظرمان فعلاً روی ساختار مقدماتی تمرکز میکنیم. در دستور زیر به جای عبارت <IP or hostname> یک نشانی IP واقعی یا نام میزبان را داخل علامتهای <> وارد کنید:
nikto -h <IP or hostname>
با این حال توانایی اجرای اسکن SSL و پورت 443 یعنی پورت وبسایتهای HTTPS دارد. بنابراین محدود به اسکن کردن وبسایتهای قدیمی نیستیم و میتوانیم ارزیابی امنیتی در مورد سایتهایی که از SSL استفاده میکنند نیز داشته باشیم.
اگر بدانیم که وبسایت مقصد ما از نوع SSL است، میتوانیم در Nikto این موضوع را تعیین کنیم و به این ترتیب با افزودن گزینه ssl- به انتهای دستور در زمان مورد نیاز برای اجرای دستور صرفهجویی میکنیم.
nikto -h <IP or hostname> -ssl
گام چهارم: اسکن کردن یک وبسایت SSL
برای نمونه کار خود را با اسکن کردن وبسایت pbs.org شروع میکنیم تا بخشی از اطلاعاتی که این ابزار میتواند به ما نشان دهد را مشاهده کنیم. پس از این که Nikto به پورت 443 وصل شد، میبینیم که برخی اطلاعات مفید در مورد cipher و همچنین لیستی از دیگر جزییات مانند نوع وبسرور که Nginx است نشان میدهد، اما این اطلاعات که نمایش یافتهاند چیزی نیستند که چندان برای ما جالب باشند.
- Nikto v2.1.6 ------------------------------------------------------------------------------ - STATUS: Starting up! + Target IP: 54.225.198.196 + Target Hostname: pbs.org + Traget Port: 443 ------------------------------------------------------------------------------ + SSl Info: Subject: /CN=www.pbs.org Altnames: account.pbs.org, admin.pgs.org, dipsy-tc.pbs.org, docs.pbs.org, ga.video.cdn.pbs.org, git.pbs.org, heart.ops.pbs.org, hub-dev.pbs.org, image.pbs.org, jaws..pbs.org, kids.pbs.org, koth-qa.svp.pbs.org, login.pbs.org, ops.pbs.org, pbs.org, player.pbs.org, projects.pbs.org, sentry.pbs.org, teacherline.pbs.org, urs.pbs.org, video.pbs.org, weta-qa.svp.pbs.org, whut-qa.svp.pbs.org, wnet.video-qa.pbs.org, wnet.video-staging.pbs.org, www-cache.pbs.org, www.pbs.org Ciphers: ECDHE-RSA-AES128-GCM-SHA256 Issuer: /C-US/0=Let's Encrypt/CN=Let's Encrypt Authority X3 + Start Time: 2018-12-05 23:34:06 (GMT-8) ------------------------------------------------------------------------------ + Server: nginx + The anti-clickjacking X-Frame-Options header is not present. + The X-XSS-Protection header is not defined. This header can hint to the user agent to protect against some forms of XSS + Uncommon header 'x-pbs-fwsrvname' found, with contents: fwcacheproxy1 + The site uses SSL and the Strict-Transport-Security HTTP header is not defined. + 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 + Root page / redirects to: https://www.pbs.org/ + No CGI Directories found (use '-C all' to force check all possible dirs) + RC-1918 IP address found in the 'x-pbs-appsvrip' header: The IP is "10.137.181.52". + Uncommon header 'x-cache-fs-status' found, with contents: EXPIRED + Uncommon header 'x-pbs-appsvrname' found, with contents: fwcacheproxy1 + Uncommon header 'x-pbs-appsvrip' found, with contents: 10.137.181.52 + Server leaks inodes via ETags, header found with file /pbs.org.zip, fields: 0x5b96537e 0x1678 + 7446 requests: 0 error(s) and 10 item(s) reported on remote host + End Time: 2018-12-06 00:30:29 (GMT-8) (3383 seconds) ------------------------------------------------------------------------------ + 1 host(s) tested
گام پنجم: اسکن کردن یک نشانی IP
اکنون که یک اسکن سریع روی یک وبسایت اجرا کردهایم، میتوانیم از Nikto روی یک شبکه لوکال استفاده کنیم تا سرورهای جاسازیشده مانند صفحه لاگین برای یک روتر یا یک سرویس HTTP روی یک ماشین دیگر که سروری بدون وبسایت است را پیدا کنیم.
برای شروع باید نشانی IP را با کمک دستور ifconfig پیدا کنیم:
ifconfig
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500 inet 192.168.0.48 netmask 0xffffff00 broadcast 192.168.0.255 inet6 XXXX::XXX:XXXX:XXXX:XXXX%en0 prefixlen 64 secured scopeid 0x8 ether XX:XX:XX:XX:XX:XX txqueuelen 1000 (Ethernet) inet6 XXXX::XXX:XXXX:XXXX:XXXX%en0 prefixlen 64 autoconf secured inet6 XXXX::XXX:XXXX:XXXX:XXXX%en0 prefixlen 64 autoconf temporary nd6 options=201<PERFORMNUD,DAD> media: autoselect status: active en2: flags=8863<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500 options=60<TS04,TS06> ether XX:XX:XX:XX:XX:XX media: autoselect <full-duplex> status: inactive
نشانی آیپی همان نشانی inet است. در ادامه میتوانیم دستور ipcalc را روی آن اجر کنیم تا محدوده شبکه خود را به دست آوریم. اگر ipcalc را ندارید، میتوانید با استفاده از دستور زیر نصب کنید:
apt install ipcalc
این محدوده در ادامه کلمه Network نمایش مییابد و در این مورد 192.168.0.0/24 است.
ipcalc 192.168.0.48
Address: 192.168.0.48 11000000.10101000.00000000. 00110000 Netmask: 255.255.255.0 = 24 11111111.11111111.11111111. 00000000 Wildcard: 0.0.0.255 00000000.00000000.00000000. 11111111 => Network: 192.168.0.0/24 11000000.10101000.00000000. 00000000 HostMin: 192.168.0.1 11000000.10101000.00000000. 00000001 HostMax: 192.168.0.254 11000000.10101000.00000000. 11111110 Broadcast: 192.168.0.255 11000000.10101000.00000000. 11111111 Hosts/Net: 254 Class C, Private Internet
اکنون میخواهیم Nmap را اجرا کرده و سرویسهایی که روی محدوده شبکه در حال اجرا است را پیدا کنیم. ابتدا پورت 80 را با محدوده شبکه اسکن میکنیم و گزینه –oG را هم اضافه میکنیم تا تنها میزبانیهایی استخراج شوند که راهاندازی شده و در حال اجرا هستند. این میزبانها نشان میدهند که پورت 80 باز است. در ادامه همه چیز را در یک فایل ذخیره میکنیم که در این مورد نام آن را nullbyte.txt گذاشتهایم، اما شما میتوانید از هر نامی استفاده کنید.
nmap -p 80 192.168.0.0/24 -oG nullbyte.txt
Starting Nmap 7.60 ( https://nmap.org ) at 2018-12-06 00:43 PST Nmap scan report for 192.168.0.1 Host is up (0.021s latency). PORT STATE SERVICE 80/tcp open http Nmap scan report for 192.168.0.2 Host is up (0.088s latency). PORT STATE SERVICE 80/tcp open http Nmap scan report for 192.168.0.4 Host is up (0.032s latency). PORT STATE SERVICE 80/tcp open http Nmap scan report for 192.168.0.5 Host is up (0.020s latency). PORT STATE SERVICE 80/tcp open http Nmap scan report for 192.168.0.11 Host is up (0.068s latency). PORT STATE SERVICE 80/tcp closed http Nmap scan report for 192.168.0.24 Host is up (0.023s latency). PORT STATE SERVICE 80/tcp closed http Nmap scan report for 192.168.0.31 Host is up (0.059s latency). PORT STATE SERVICE 80/tcp closed http Nmap scan report for 192.168.0.48 Host is up (0.030s latency). PORT STATE SERVICE 80/tcp closed http Nmap scan report for 192.168.0.60 Host is up (0.092s latency). PORT STATE SERVICE 80/tcp closed http Nmap done: 256 IP addresses (9 hosts up) scanned in 8.92 seconds
یک ترفند کوچک و زیبا وجود دارد که میتوان همه میزبانها را مستقیماً به Nikto ارسال کرد تا اسکن کند. ما از دستور cat برای خواندن خروجی ذخیره شده در سند nullbyte.txt استفاده میکنیم. در ادامه دستور awk را میبینیم که یک ابزار لینوکسی برای جستجوی الگوهای خاص است. Up به این معنی است که میزبان آغاز شده و print $2 به این معنی است که کلمه دوم در هر خط باید چنین یعنی نشانی IP باشد. در ادامه دادهها را به یک فایل جدید به نام targetIP.txt ارسال میکنیم.
cat nullbyte.txt | awk '/Up$/{print $2}' | cat >> targetIP.txt
اکنون میتوانیم محتوای فایل جدید را با دستور cat مشاهده کنیم تا همه نشانیهای IP که پورت 80 آنها باز است را ببینیم.
192.168.0.1 192.168.0.2 192.168.0.4 192.168.0.5 192.168.0.11 192.168.0.24 192.168.0.31 192.168.0.48 192.168.0.60
این اطلاعات برای Nikto ذیقیمت هستند، زیرا به سادگی میتواند فایلهایی مانند این را تفسیر کند. ازا این رو این خروجی را با دستور زیر به Nikto ارسال میکنیم.
nikto -h targetIP.txt
نتایج مشابه نتایجی هستند که در زمان اجرای اسکن SSL مشاهده کردیم.
گام ششم: اسکن کردن یک وبسایت HTTP
در گام پیشین یک وبسایت امن و یک نشانی IP را روی شبکه لوکال اسکن کردیم. اکنون زمان آن رسیده است که یک دامنه وب ناامن را با استفاده از پورت 80 اسکن کنیم. در این مثال از دامنه afl.com.au استفاده میکنیم که در زان اجرای اسکن مجهز به پروتکل SSL نبوده است.
- Nikto v2.1.6 --------------------------------------------------------------------------- + Target IP: 159.180.84.10 + Target Hostname: www.afl.com.au + Target Port: 80 + Start Time: 2018-12-05 21:48:32 (GMT-8) --------------------------------------------------------------------------- + Server: instart/nginx + Retried via header: 1.1 varnish (Varnish/6.1), 1.1 e9ba0a9a729ff2960a04323bf1833df8.cloudfront.net (CloudFront) + The anti-clickjacking X-Frame-Options header is not present. + The X-XSS-Protection header is not defined. This header can hint to the user agent to protect against some forms of XSS + Uncommon header 'x-cache' found, with contents: Miss from cloudfront + Uncommon header 'x-instart-cache-id' found, with contents: 17:12768802731504004780::1544075250 + Uncommon header 'v-cache-hit' found, with contents: Hit + Uncommon header 'x-amz-cf-id' found, with contents: Dr-r6OwO5kk9ABt4ejzpc7R7AIF6SuH6kfJHQgP0v6xZoHwMLE55rQ== + Uncommon header 'x-instart-request-id' found, with contents: 12814413144077601501:BEQ01-CPVNPPRY18:1552504721:0 + Uncommon header 'x-oneagent-js-injection' found, with contents: true + Uncommon header 'grace' found, with contents: cache + 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 + Uncommon header 'x-ruxit-js-agent' found, with contents: true + Cookie dtCookie created without the httponly flag + Server banner has changed from 'instart/nginx' to 'nginx' which may suggest a WAF, load balancer or proxy is in place + No CGI Directories found (use '-C all' to force check all possible dirs) + Entry '/sites/' in robots.txt returned a non-forbidden or redirect HTTP code (200) + Entry '/search/' in robots.txt returned a non-forbidden or redirect HTTP code (200) + Entry '*.mobileapp' in robots.txt returned a non-forbidden or redirect HTTP code (400) + Entry '*.liveradio' in robots.txt returned a non-forbidden or redirect HTTP code (400) + Entry '*.smartmobile' in robots.txt returned a non-forbidden or redirect HTTP code (400) + Entry '*.responsive' in robots.txt returned a non-forbidden or redirect HTTP code (400) + Entry '/stats?*/' in robots.txt returned a non-forbidden or redirect HTTP code (200) + "robots.txt" contains 8 entries which should be manually viewed. + OSVDB-3092: /sitemap.xml: This gives a nice listing of the site content. + OSVDB-3092: /psql_history: This might be interesting... + OSVDB-3092: /global/: This might be interesting... + OSVDB-3092: /home/: This might be interesting... + OSVDB-3092: /news: This might be interesting... + OSVDB-3092: /search.vts: This might be interesting... + OSVDB-3092: /stats.htm: This might be interesting... + OSVDB-3092: /stats.txt: This might be interesting... + OSVDB-3092: /stats/: This might be interesting... + OSVDB-3092: /Stats/: This might be interesting... + OSVDB-3093: /.wwwacl: Contains authorization information + OSVDB-3093: /.www_acl: Contains authorization information + OSVDB-3093: /.htpasswd: Contains authorization information + OSVDB-3093: /.access: Contains authorization information + OSVDB-3093: /.addressbook: PINE addressbook, may store sensitive e-mail address contact information and notes + OSVDB-3093: /.bashrc: User home dir was found with a shell rc file. This may reveal file and path information. + OSVDB-3093: /.bash_history: A user's home directory may be set to the web root, the shell history was retrieved. This should not be accessible via the web. + OSVDB-3093: /.forward: User home dir was found with a mail forward file. May reveal where the user's mail is being forwarded to. + OSVDB-3093: /.history: A user's home directory may be set to the web root, the shell history was retrieved. This should not be accessible via the web. + OSVDB-3093: /.htaccess: Contains configuration and/or authorization information + OSVDB-3093: /.lynx_cookies: User home dir found with LYNX cookie file. May reveal cookies received from arbitrary web sites. + OSVDB-3093: /.mysql_history: Database SQL? + OSVDB-3093: /.passwd: Contains authorization information + OSVDB-3093: /.pinerc: User home dir found with a PINE rc file. May reveal system information, directories and more. + OSVDB-3093: /.plan: User home dir with a .plan, a now mostly outdated file for delivering information via the finger protocol + OSVDB-3093: /.proclog: User home dir with a Procmail rc file. May reveal mail traffic, directories and more. + OSVDB-3093: /.procmailrc: User home dir with a Procmail rc file. May reveal subdirectories, mail contacts and more. + OSVDB-3093: /.profile: User home dir with a shell profile was found. May reveal directory information and system configuration. + OSVDB-3093: /.rhosts: A user's home directory may be set to the web root, a .rhosts file was retrieved. This should not be accessible via the web. + OSVDB-3093: /.sh_history: A user's home directory may be set to the web root, the shell history was retrieved. This should not be accessible via the web. + OSVDB-3093: /.ssh: A user's home directory may be set to the web root, an ssh file was retrieved. This should not be accessible via the web. + OSVDB-5709: /.nsconfig: Contains authorization information + /portal/changelog: Vignette richtext HTML editor changelog found. + 7587 requests: 4 error(s) and 55 item(s) reported on remote host + End Time: 2018-12-05 22:42:41 (GMT-8) (3249 seconds) --------------------------------------------------------------------------- + 1 host(s) tested
در خروجی فوق میبینیم که یک سرور Varnish و برخی هدرها وجود دارند که به مشخص شدن شیوه پیکربندی وبسایت کمک میکنند. با این حال بخش جذاب ماجرا دایرکتوریهایی هستند که پیدا شدهاند و به فایلهای پیکربندی کمک میکنند تا به برخی اطلاعات احراز هویت یا دیگر چیزهایی که ممکن است به طور نادرستی پیکربندی شده باشند و یا بدون تنظیم دسترسی رها شده باشند، دسترسی پیدا کنیم.
آیتمهای دارای پیشوند OSVDB آسیبپذیریهایی هستند که در پایگاه داده آسیبپذیریهای اوپن سورس (این سایت در سال 2016 خاموش شده است) گزارش شده بودند. البته پایگاههای داده دیگری در مورد آسیبپذیریها مانند SecurityFocus, Microsoft's Technet, و Common Vulnerabilities and Exposures وجود دارند و یکی از بهترین مکانها برای بررسی National Vulnerability Database است.
با این که از بین نتایج این اسکن چیز عمدهای که بتوان از آن بهرهبرداری کرد پیدا نکردیم، اما اگر چنین چیزی وجود میداشت میشد از ابزار CVE reference (+) برای بازگردانی شناسه OSVDB به موجودیت CVE استفاده کرد و به این ترتیب از یکی از سایتهای فوق برای کسب اطلاعات بیشتر در خصوص این آسیبپذیری به خصوص بهره جست.
فرض کنید ما نوعی اکسپلویت باارزش مانند CVE-2018-10933 (+) یافته باشیم که یک آسیبپذیری Libssh است. CVE شامل اطلاعاتی در مورد آن چه میتوان بهرهبرداری کرد، نمره شدت آسیبپذیری و برخی اطلاعات دیگر است که میتواند به ساخت بردار حمله کمک کند. اگر ارزش استفاده داشته باشد، میتوان از ابزار Metasploit برای جستجو کرد چون حتماً کسی قبلاً یک ماژول برای بهرهبرداری آسانتر از این آسیبپذیری توسعه داده است.
گام هفتم: همراهی اسکن با Metasploit
یکی از بهترین نکات در مورد Nikto این است که میتوان عملاً اطلاعات را در فرمتی اکسپورت کرد که Metasploit در زمان اجرای اسکن بتواند بخواند. به این منظور کافی است با دستورهای فوق اسکن را آغاز کنید اما به انتهایان عبارت -Format msf+ را اضافه کنید. این فرمت موجب میشود دادههای بازیابی شده به سرعت در اختیار یک اکسپلویت مسلح قرار گیرد.
nikto -h <IP or hostname> -Format msf+
سخن پایانی
در این راهنما اقدام به تعیین سطوح هدف برای یافتن آسیبپذیریها و سپس جفت کردن آن با یک اکسپلویت کردیم تا امان نفوذ به وبسایت را پیدا بکنیم. از آنجا که نیکتو یک ابزار پنهانکار نیست، بهتر است این نوع از اسکنها را از طریق یک VPN مانند Tor یا دیگر انواع سرویسهایی که نشانی IP واقعی را پنهان میکنند انجام دهیم. در نهیت باید مجدداً اشاره کنیم که تمام اطلاعات ارائه شده در این مطلب صرفاً با مقاصد آگاهی بخشی برای جلوگیری از هک ارائه شدهاند و مسئولیت هر گونه سوء استفاده از این مطالب در جهت نفوذ غیر قانونی و بدون کسب اجازه به سایتهای مختلف بر عهده فرد مورد نظر خواهد بود.