{"id":1264,"date":"2012-09-03T08:50:54","date_gmt":"2012-09-03T08:50:54","guid":{"rendered":"http:\/\/blog.designed79.co.uk\/?p=1264"},"modified":"2012-09-03T08:50:54","modified_gmt":"2012-09-03T08:50:54","slug":"penetration-mac-os-x-server-with-nessus-5","status":"publish","type":"post","link":"https:\/\/blog.designed79.co.uk\/?p=1264","title":{"rendered":"Penetration Mac OS X Server With Nessus 5"},"content":{"rendered":"<p>One of my favorite tools for penetration testing is Nessus from Tenable Network Security. Nessus 5 is the latest release in the family of vulnerability scanners that is probably amongst the most prolific. Nessus 5 does discovery, configuration auditing, profiling, looks at patch management and performs vulnerability analysis on a variety of platforms. Nessus can also run on a Linux, Windows or Mac OS X and can be used to scan and keep track of vulnerabilities for practically any platform, including Mac OS X.<\/p>\n<p>To install Nessus, go to the\u00a0<a href=\"http:\/\/www.nessus.org\/products\/nessus\">Nessus site<\/a>\u00a0and click on the Download button, around the middle of the page. Agree to the download agreement and then choose the version that is right for you (Mac OS X in this case).<\/p>\n<p><a href=\"http:\/\/krypted.com\/wp-content\/uploads\/2012\/02\/Screen-Shot-2012-02-23-at-8.50.35-PM.png\" rel=\"lightbox[7403]\"><img loading=\"lazy\" decoding=\"async\" title=\"Download Nessus\" src=\"http:\/\/krypted.com\/wp-content\/uploads\/2012\/02\/Screen-Shot-2012-02-23-at-8.50.35-PM-300x286.png\" alt=\"Download Nessus for Mac OS X\" width=\"300\" height=\"286\" \/><\/a><\/p>\n<p>Download Nessus for Mac OS X<\/p>\n<p>The software will then download and need to be installed. Once downloaded, open the Nessus dmg and extract it. Inside will be the Nessus 5 package installer.<\/p>\n<p><a href=\"http:\/\/krypted.com\/wp-content\/uploads\/2012\/02\/Screen-Shot-2012-02-23-at-8.53.02-PM.png\" rel=\"lightbox[7403]\"><img loading=\"lazy\" decoding=\"async\" title=\"The Nessus Installer pkg\" src=\"http:\/\/krypted.com\/wp-content\/uploads\/2012\/02\/Screen-Shot-2012-02-23-at-8.53.02-PM-300x170.png\" alt=\"The Nessus Installer pkg\" width=\"300\" height=\"170\" \/><\/a><\/p>\n<p>The Nessus Installer pkg<\/p>\n<p>Open the installer and click through the defaults to perform a basic installation.<\/p>\n<p><a href=\"http:\/\/krypted.com\/wp-content\/uploads\/2012\/02\/Screen-Shot-2012-02-23-at-8.54.42-PM.png\" rel=\"lightbox[7403]\"><img loading=\"lazy\" decoding=\"async\" title=\"Installing Nessus\" src=\"http:\/\/krypted.com\/wp-content\/uploads\/2012\/02\/Screen-Shot-2012-02-23-at-8.54.42-PM-300x212.png\" alt=\"Installing Nessus\" width=\"300\" height=\"212\" \/><\/a><\/p>\n<p>Installing Nessus<\/p>\n<p>Once done, you\u2019ll have the Nessus Server Manager and Nessus Client.url in a Nessus folder in the Applications directory.<\/p>\n<p><a href=\"http:\/\/krypted.com\/wp-content\/uploads\/2012\/02\/Screen-Shot-2012-02-23-at-8.55.12-PM.png\" rel=\"lightbox[7403]\"><img loading=\"lazy\" decoding=\"async\" title=\"The Nessus Applications\" src=\"http:\/\/krypted.com\/wp-content\/uploads\/2012\/02\/Screen-Shot-2012-02-23-at-8.55.12-PM-300x173.png\" alt=\"The Nessus Applications\" width=\"300\" height=\"173\" \/><\/a><\/p>\n<p>The Nessus Applications<\/p>\n<p>Open the Nessus Server Manager and authenticate as an administrator when prompted. When you downloaded the software you would have been prompted for registration. Provide that information in the registration field. Then click on Update plugins to make sure all of the Nessus plugins are running the latest version. Finally, click on Manager Users\u2026 to create your users.<\/p>\n<p><a href=\"http:\/\/krypted.com\/wp-content\/uploads\/2012\/02\/Screen-Shot-2012-02-23-at-8.57.55-PM.png\" rel=\"lightbox[7403]\"><img loading=\"lazy\" decoding=\"async\" title=\"Nessus Server Configuration\" src=\"http:\/\/krypted.com\/wp-content\/uploads\/2012\/02\/Screen-Shot-2012-02-23-at-8.57.55-PM-236x300.png\" alt=\"Nessus Server Configuration\" width=\"236\" height=\"300\" \/><\/a><\/p>\n<p>Nessus Server Configuration<\/p>\n<p>At the list of Nessus users, click on the plus sign and create a new user, likely making the user an admin (I see few vulnerability scanning stations that have non-administrative users, which would just be for viewing reports and the such). Click Save to create the user and then close at the List of users screen.<\/p>\n<p><a href=\"http:\/\/krypted.com\/wp-content\/uploads\/2012\/02\/Screen-Shot-2012-02-23-at-9.01.19-PM.png\" rel=\"lightbox[7403]\"><img loading=\"lazy\" decoding=\"async\" title=\"Create Nessus Users\" src=\"http:\/\/krypted.com\/wp-content\/uploads\/2012\/02\/Screen-Shot-2012-02-23-at-9.01.19-PM-236x300.png\" alt=\"Create Nessus Users\" width=\"236\" height=\"300\" \/><\/a><\/p>\n<p>Create Nessus Users<\/p>\n<p>If the Nessus server isn\u2019t started, click on Start Nessus Server. Then click on the Nessus Client.url file back where the Nessus Server manager was accessed. At the Nessus login screen, provide the username and password for the Nessus server that was previously created.<\/p>\n<p><a href=\"http:\/\/krypted.com\/wp-content\/uploads\/2012\/02\/Screen-Shot-2012-02-23-at-9.03.19-PM.png\" rel=\"lightbox[7403]\"><img loading=\"lazy\" decoding=\"async\" title=\"Authenticate to Nessus\" src=\"http:\/\/krypted.com\/wp-content\/uploads\/2012\/02\/Screen-Shot-2012-02-23-at-9.03.19-PM-282x300.png\" alt=\"Authenticate to Nessus\" width=\"282\" height=\"300\" \/><\/a><\/p>\n<p>Authenticate to Nessus<\/p>\n<p>Once authenticated, you will be placed in the Scans screen. Before we configure any scans, we\u2019re first going to create a Policy (which defines how a scan operates for the most part). To do so, click on Policies and then click on the Add button. There are four policy tabs (aligned on the left sidebar). In the General pane, you will configure the name for the Policy, \u201cMac Servers\u201d in this example. Then we\u2019re going to check the boxes in the Scan section for Designate Hosts by their DNS Name, Log Scan Details to Server, Stop Host Scan on Disconnect and Avoid Sequential Scans. Then check the boxes in the Port Scanners section for TCP, SYN, SNMP, Netstat SSH and Ping Host. Leave the Port Scan Range set to default and the Performance options at their default values as well. These are useful when you\u2019re done tinkerating to get better performance out of the system, but we\u2019re not really there just yet.<\/p>\n<p><a href=\"http:\/\/krypted.com\/wp-content\/uploads\/2012\/02\/Screen-Shot-2012-02-23-at-9.21.29-PM.png\" rel=\"lightbox[7403]\"><img loading=\"lazy\" decoding=\"async\" title=\"Nessus' General Policy Settings\" src=\"http:\/\/krypted.com\/wp-content\/uploads\/2012\/02\/Screen-Shot-2012-02-23-at-9.21.29-PM-300x238.png\" alt=\"Nessus' General Policy Settings\" width=\"300\" height=\"238\" \/><\/a><\/p>\n<p>Nessus&#8217; General Policy Settings<\/p>\n<p>Click on the Next button to define any credentials you\u2019ll use during scans. Initially, I\u2019d leave this blank, although you can provide SMB information for up to 4 accounts to see what kind of access users have. You can also define Kerberos, SSH and various cleartext credentials as well. We\u2019re going to skip that for now and click Next to define the Plugins.<\/p>\n<p><a href=\"http:\/\/krypted.com\/wp-content\/uploads\/2012\/02\/Screen-Shot-2012-02-23-at-9.23.07-PM.png\" rel=\"lightbox[7403]\"><img loading=\"lazy\" decoding=\"async\" title=\"Giving Nessus Credentials To Your Boxen\" src=\"http:\/\/krypted.com\/wp-content\/uploads\/2012\/02\/Screen-Shot-2012-02-23-at-9.23.07-PM-300x238.png\" alt=\"Giving Nessus Credentials To Your Boxen\" width=\"300\" height=\"238\" \/><\/a><\/p>\n<p>Giving Nessus Credentials To Your Boxen<\/p>\n<p>At the Plugins screen, we\u2019re initially going to leave all of the plugins on. The reason for this is that many of the Lion Server services are similar to those of the various Unix and Linux variants and we can scan SMB with the Windows plugins. These can\u2019t hurt, they might just waste a little time though. Clicking on a Family and then a plugin will show you what each does. Clicking on the green light for each will disable it.<\/p>\n<p><a href=\"http:\/\/krypted.com\/wp-content\/uploads\/2012\/02\/Screen-Shot-2012-02-23-at-9.26.48-PM.png\" rel=\"lightbox[7403]\"><img loading=\"lazy\" decoding=\"async\" title=\"Choosing Nessus Plugins\" src=\"http:\/\/krypted.com\/wp-content\/uploads\/2012\/02\/Screen-Shot-2012-02-23-at-9.26.48-PM-300x238.png\" alt=\"Choosing Nessus Plugins\" width=\"300\" height=\"238\" \/><\/a><\/p>\n<p>Choosing Nessus Plugins<\/p>\n<p>Click on Preferences and define any preferences that you need. Amongst the plugin preferences I usually enable network printer scanning, CGI scanning, Enable experimental scripts, set my Report verbosity to Verbose, provide any certificates needed and then hit Submit to create the new Policy.<\/p>\n<p><a href=\"http:\/\/krypted.com\/wp-content\/uploads\/2012\/02\/Screen-Shot-2012-02-23-at-9.30.06-PM.png\" rel=\"lightbox[7403]\"><img loading=\"lazy\" decoding=\"async\" title=\"Defining Nessus Options\" src=\"http:\/\/krypted.com\/wp-content\/uploads\/2012\/02\/Screen-Shot-2012-02-23-at-9.30.06-PM-300x238.png\" alt=\"Defining Nessus Options\" width=\"300\" height=\"238\" \/><\/a><\/p>\n<p>Defining Nessus Options<\/p>\n<p>Next, let\u2019s click back on Scans in the navigation bar on the screen. As you can see here, I\u2019ve created a few template scans, but we\u2019re going to create a new one by clicking on the Add button.<\/p>\n<p><a href=\"http:\/\/krypted.com\/wp-content\/uploads\/2012\/02\/Screen-Shot-2012-02-23-at-9.05.09-PM.png\" rel=\"lightbox[7403]\"><img loading=\"lazy\" decoding=\"async\" title=\"Adding A Nessus Template\" src=\"http:\/\/krypted.com\/wp-content\/uploads\/2012\/02\/Screen-Shot-2012-02-23-at-9.05.09-PM-300x85.png\" alt=\"Adding A Nessus Template\" width=\"300\" height=\"85\" \/><\/a><\/p>\n<p>Adding A Nessus Template<\/p>\n<p>Provide a name for the scan and then choose the Policy you just created. Set the Type to Run Now (since we\u2019re just testing) and put the IP address of a target into the Scan Targets field. You can also import a large set of targets using the Brows button and a csv file or use Schedule or Template rather than Run Now in the Type field to schedule scans or create a template scan. Click Launch to kick off the first scan.<\/p>\n<p><a href=\"http:\/\/krypted.com\/wp-content\/uploads\/2012\/02\/Screen-Shot-2012-02-23-at-9.34.33-PM.png\" rel=\"lightbox[7403]\"><img loading=\"lazy\" decoding=\"async\" title=\"Running a Manual Test Scan\" src=\"http:\/\/krypted.com\/wp-content\/uploads\/2012\/02\/Screen-Shot-2012-02-23-at-9.34.33-PM-300x185.png\" alt=\"Running a Manual Test Scan\" width=\"300\" height=\"185\" \/><\/a><\/p>\n<p>Running a Manual Test Scan<\/p>\n<p>Once started, click on the Reports button in the top nav bar to see the status of the scan.<\/p>\n<p><a href=\"http:\/\/krypted.com\/wp-content\/uploads\/2012\/02\/Screen-Shot-2012-02-23-at-9.47.00-PM.png\" rel=\"lightbox[7403]\"><img loading=\"lazy\" decoding=\"async\" title=\"Completed Nessus Scan\" src=\"http:\/\/krypted.com\/wp-content\/uploads\/2012\/02\/Screen-Shot-2012-02-23-at-9.47.00-PM-300x185.png\" alt=\"Completed Nessus Scan\" width=\"300\" height=\"185\" \/><\/a><\/p>\n<p>Completed Nessus Scan<\/p>\n<p>Once the scan is finished, click on the scan to see a list of vulnerabilities and open ports, sorted by the severity of issues. Here, double-click on the host.<\/p>\n<p><a href=\"http:\/\/krypted.com\/wp-content\/uploads\/2012\/02\/Screen-Shot-2012-02-23-at-9.48.44-PM.png\" rel=\"lightbox[7403]\"><img loading=\"lazy\" decoding=\"async\" title=\"Nessus Scan Results Overview\" src=\"http:\/\/krypted.com\/wp-content\/uploads\/2012\/02\/Screen-Shot-2012-02-23-at-9.48.44-PM-300x185.png\" alt=\"Nessus Scan Results Overview\" width=\"300\" height=\"185\" \/><\/a><\/p>\n<p>Nessus Scan Results Overview<\/p>\n<p>The Report screen then shows each service and the vulnerabilities found for that service. Click on one of the vulnerabilities to see what Nessus thinks is problematic with it.<\/p>\n<p><a href=\"http:\/\/krypted.com\/wp-content\/uploads\/2012\/02\/Screen-Shot-2012-02-23-at-9.51.11-PM.png\" rel=\"lightbox[7403]\"><img loading=\"lazy\" decoding=\"async\" title=\"Nessus' Service List\" src=\"http:\/\/krypted.com\/wp-content\/uploads\/2012\/02\/Screen-Shot-2012-02-23-at-9.51.11-PM-300x117.png\" alt=\"Nessus' Service List\" width=\"300\" height=\"117\" \/><\/a><\/p>\n<p>Nessus&#8217; Service List<\/p>\n<p>Now for the fun part. Each of the vulnerabilities listed will have CVEs attached.<\/p>\n<p><a href=\"http:\/\/krypted.com\/wp-content\/uploads\/2012\/02\/Screen-Shot-2012-02-23-at-9.52.40-PM.png\" rel=\"lightbox[7403]\"><img loading=\"lazy\" decoding=\"async\" title=\"Nessus Vulnerability Listing\" src=\"http:\/\/krypted.com\/wp-content\/uploads\/2012\/02\/Screen-Shot-2012-02-23-at-9.52.40-PM-300x275.png\" alt=\"Nessus Vulnerability Listing\" width=\"300\" height=\"275\" \/><\/a><\/p>\n<p>Nessus Vulnerability Listing<\/p>\n<p>By default, Nessus is just looking at the service banners to determine vulnerabilities. If you look up the CVE at CVE Details or PacketStorm you\u2019ll see that it was patched a few months ago by most vendors. Now Nessus can get things wrong with Mac OS X. The issue is that Apple forks the code for many open source projects, not always updating version numbers on banners. Looking up or testing whether a vulnerability is still applicable can be tedious but would likely need to be done per service according to your internal security policies.<\/p>\n<p>An easy way to test these vulnerabilities is to use Metasploit, a tool I\u2019m long overdue to write an article on. Another way is to try and run the exploit against the host. Apple does a pretty good job of addressing CVEs in their security updates, so don\u2019t waste a lot of time trying things if Apple has already patched them. I have found a really good tool for automatically attempting to exploit via msf + nessus to be Carlos Perez\u2019 auto exploit tool, available on\u00a0<a href=\"https:\/\/github.com\/darkoperator\/Metasploit-Plugins\/blob\/master\/auto-exploit.rb\">github<\/a>.<\/p>\n<p>Finally, Nessus is a great tool for scripting. One of the big differences that throws off many an experienced Nessus operator off with the version for the Mac is the location of the Nessus binaries. They are in \/Library\/Nessus\/run\/bin. In here you\u2019ll find nasal, nessus, nessus-fetch, nessuscmd etc. The command line control here is pretty awesome. Let\u2019s run nessuscmd to scan a net mask of hosts (192.168.210.0\/24):<\/p>\n<p>sudo \/Library\/Nessus\/run\/bin\/nessuscmd 192.168.210.0\/24<\/p>\n<p>There are tons of other options for nessuscmd, such as adding ssh keys, smb logins, scanner options, using a remote nessus server, etc. Or use the nessus binary to kick off scans using a nessus config file. The nessus.conf file is also stored in the \/Library\/Nessus\/run\/etc\/nessus directory, worth looking into.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of my favorite tools for penetration testing is Nessus from Tenable Network Security. Nessus 5 is the latest release in the [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1264","post","type-post","status-publish","format-standard","hentry","category-info-on-tech"],"_links":{"self":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1264","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1264"}],"version-history":[{"count":0,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1264\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1264"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1264"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1264"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}