{"id":1423,"date":"2017-05-06T11:51:57","date_gmt":"2017-05-06T06:21:57","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=1423"},"modified":"2017-05-06T11:51:57","modified_gmt":"2017-05-06T06:21:57","slug":"nikto-vulnerability-scan-domainsshell-script-scan-cpanel-accounts","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/nikto-vulnerability-scan-domainsshell-script-scan-cpanel-accounts\/","title":{"rendered":"Nikto vulnerability scan for domains|Shell script to scan cPanel accounts"},"content":{"rendered":"<h3>Nikto vulnerability scan for domains|Shell script to scan cPanel accounts<\/h3>\n<p><strong>Date Posted: 06-05-2017<\/strong><\/p>\n<p>Nikto is an opensource webserver scanner which helps to perform security scan on the webserver. In this post, we will explain on how to install nikto scan tool and create a script to scan cPanel accounts.<\/p>\n<h4>Installation:<\/h4>\n<p>Download the nikto script.<\/p>\n<p><code>cd \/usr\/local\/src<\/code><\/p>\n<p><code>wget https:\/\/cirt.net\/nikto\/nikto-2.1.5.tar.gz<\/code><\/p>\n<p>Extract the downloaded file.<\/p>\n<p><code>tar -xzf\u00a0nikto-2.1.5.tar.gz<\/code><\/p>\n<p>Change the directory nikto directory.<\/p>\n<p><code>cd nikto-*<\/code><\/p>\n<p>You can perform the scan of a single account using the below command.<\/p>\n<p><code>\/bin\/perl \/usr\/local\/src\/nikto-2.1.5\/nikto.pl -host &lt;hostIPaddress&gt;\u00a0-vhost domain.tld -p 80<\/code><\/p>\n<h4>Script to take backup of cPanel account:<\/h4>\n<p>Copy the script on any location and execute the script.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">#!\/bin\/bash\r\nfor vhost in `cat \/etc\/trueuserdomains|cut -d : -f1`; \r\ndo \t\r\n  echo \"+++++++\" ; \r\n  echo $vhost ; \r\n  echo \"+++++++\"; \r\n  digip=`dig +short $vhost`\r\n  check_serverip=$(\/scripts\/ipusage |grep $digip|awk '{print $1}')\r\n  if [[ $digip == $check_serverip ]];\r\n  then\r\n    echo -e \"Creating tmp directory for $vhost \"\r\n    mkdir -p \/tmp\/niktoscan\/$vhost\r\n    \/bin\/perl \/usr\/local\/src\/nikto-2.1.5\/nikto.pl -host $digip -vhost $vhost -p 80 &gt; \/tmp\/niktoscan\/$vhost\/niktoscanreport.txt\r\n  else\r\n    echo \"Both Result doesn't match\"\r\n  fi\r\ndone<\/pre>\n<p>The above script will scan the accounts which points to the same server. The results will be stored on\u00a0<strong><em>\/tmp\/niktoscan\/domain.tld\/niktoscanreport.txt.\u00a0<\/em><\/strong><\/p>\n<p>For each domain, separate file will be created on\u00a0<em>\/tml\/niktoscan.\u00a0<\/em>Analyse the result and take necessary action for the vulnerable items.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Nikto vulnerability scan for domains|Shell script to scan cPanel accounts Date Posted: 06-05-2017 Nikto is an opensource webserver scanner which [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1024],"tags":[263,331,332],"class_list":["post-1423","post","type-post","status-publish","format-standard","hentry","category-security","tag-cpanel","tag-niktoscan","tag-shellscript","psol-cat-security"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-mX","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1423","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=1423"}],"version-history":[{"count":0,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1423\/revisions"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=1423"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=1423"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=1423"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}