Nexpose – Advanced Performance Tuning

Posted by trich on

Nexpose ships with a great amount of performance tuning options. There are situation were you want to take “the governor” off from time to time . For those cases, the below should yield some quite interesting results….

**The below should only be done on a LAN  and with high throughput.**

 

IN YOUR NEXPOSE CONSOLE:

In scan template change packets per second min and max to 15k

 

WINDOWS:

Create/Modify the CustomEnvironment.properties located in either the nsc, or nse directories of the install with the following lines (Based on a thread count of 5):

 

com.rapid7.nexpose.scan.nmap.custom=–max-hostgroup 5

 

Save the file and restart the service.

 

Note: when copying from Outlook in Windows it can change the dash’s (–) to a different type of dash and may need to be redone.

  

FOR CONSOLES:

sudo -i

echo “com.rapid7.nexpose.scan.nmap.custom=–max-hostgroup 5”>> /opt/rapid7/nexpose/nsc/CustomEnvironment.properties

 

FOR ENGINES:

sudo -i

echo “com.rapid7.nexpose.scan.nmap.custom=–max-hostgroup 5”>> /opt/rapid7/nexpose/nse/CustomEnvironment.properties

Topics: NeXpose | 1 Comment »

Why Would I Whitelist My ASV?

Posted by trich on

I came across this again and figured I’d post it as reference for future conversations. This many times is hard for folks to wrap their head around which I can completely understand. “An attacker isn’t going to have white listed access…”

The deal is no matter how good your vuln scanner is theres no replacement for human intelligence. Not to mention as PCI describes… technology SNAFU’s.

 

Perform a Scan without Interference from IDS/IPS

“In order to ensure that reliable scans can be conducted, the ASV scan solution must be allowed

to perform scanning without interference from intrusion detection systems (IDSs) or intrusion

prevention systems (IPSs). Such “active” protection systems may react differently to an

automated scanning solution than they would react to a targeted hacker attack, which could

cause inaccuracies in the scan report. ” PCI DSS, v1.2 ASV Program Guide Reference, v1.0 March 2010

 

SOURCE: https://www.pcisecuritystandards.org/pdfs/asv_program_guide_v1.0.pdf

OLDIE BUT GOODIE – NSA’s INTRO TO DEFENSE: http://www.nsa.gov/ia/_files/support/defenseindepth.pdf

Topics: NeXpose, Risk Assessment | Comments Off on Why Would I Whitelist My ASV?

Vulnerability Scanning Over VLANs

Posted by trich on

VLAN trunking has a number of benefits in an enterprise environment from cost and configuration reduction to security enhancements. VLAN trunking utilizes additional frame encapsulation in the IEEE 802.1Q format which contains guidance on where the traffic should be routed. This enables a single host to route traffic to various segments without needing multiple physical interfaces. In addition VLAN Trunking can allow devices to be logical grouped verse physical grouping allowing devices to be moved without requiring overhead with making additional configuration. Aside from the configuration benefits VLAN’s also make ARP Spoofing and ARP Poisoning much more difficult for an attacker.

The first requirement is to make sure you can route traffic properly, is a virtual or physical device that will tag the Ethernet frames with the 802.1Q tag. VLAN tagging can be done through a number of methods such as a virtual host (such as ESX) or by installing an 802.1Q support package at the OS level.
Below I’ve outlined two methods which will enable your NeXpose instance to recognize your currently configure VLAN/VDOM segments. Keep in mind that the target environment must have the drivers necessary to support 802.1Q in order to route traffic.
VMwares ESX server support 3 different methods for VLANing which can be found here.

*Make sure you confirm that there is not identical IP’s used in the various VLANs. If this is the case, it is recommended that additional engines are used to differentiate the segments.

The easiest method to install the vlan package is by using apt-get: apt-get install vlan This will install both the driver and the module needed. Additionally, it makes the module persistent across reboots.

If you need to install the package manually, then download the appropriate package for your kernel, OS, and hardware. This is tutorial will focus on Ubuntu 8.04 aka Hardy (currently the standard R7 Appliance build).You can select the appropriate VLAN package here.

After you get the dep package onto the machine you just run the following command to install it:
dpkg -i vlan_1.9-3_amd64.deb
You will need to load the module by hand using:
modprobe 8021q
Additionally, you will need to make the module persistent across reboots.
echo 8021q >> /etc/modules
Now that the driver and module have been installed and loaded, you can configure your VLANs. There are tools such as vconfig that can be used to configure the VLAN’s however its easy enough to do it manually.
You can locate your interfaces file here:
/etc/network/interfaces
The sub-interfaces method is used here (as its the traditional Linux convention however we could have just as well used vlan2, vlan3, etc. instead. If you have an internal schema that you define your vlans you should keep this consistant.
The VLAN’s do NOT need gateway’s entry defined. They will use the physical adapters gateway. The physical adapter will handle the vlan’s accordingly. There should only be 1 gateway, either associated with the physical interface or associated to a virtual interface.
VLAN’s are a switching functions and as such, operate at Layer 2 of the OSI Model. Therefore, in order to route packets between VLAN’s, a Layer 3 Router will be needed. It is assumed that if you are currently running 802.1Q this won’t be a problem.
To check the VLAN use:

cat /proc/net/vlan/eth0.2 or cat /proc/net/vlan/config

Below is a sample what your interfaces file should look like when completed:

# This file describes the network interfaces available on your system

# and how to activate them. For more information, see interfaces(5).

# The loopback network interface

auto lo

iface lo inet loopback


# PRIMARY physical interfaces(s)

auto eth0                   #First Physical Interface

iface eth0 inet dhcp        #Settings for DHCP

#THIS SECTION OF THE PRIMARY INTERFACES FILE SHOULD BE UN-COMMENTED IF A STATIC IP IS USED

#iface eth0 inet static     #Settings for Static IP

#address 10.0.1.2           #Static IP

#netmask 255.255.255.0      #Static Netmask

#gateway 10.0.1.1           #Static Gateway

#auto eth1                  #Second Physical Interface

#iface eth1 inet dhcp       #Settings for DHCP


# VLAN interface(s)

# VLAN2

auto eth0.2                 #Virtual Interface for VLAN2

iface eth0.2 inet static    #Settings for Static IP

address 192.168.2.2         #Static IP

netmask 255.255.255.0       #Static Netmask

vlan_raw_device eth0        #Associate virtual interface with physical device


# VLAN3

auto eth0.3                 #Virtual Interface for VLAN2

iface eth0.3 inet static    #Settings for Static IP

address 192.168.3.2         #Static IP

netmask 255.255.255.0       #Static Netmask

vlan_raw_device eth0        #Associate virtual interface with physical device

Topics: NeXpose, Risk Assessment | 1 Comment »

March Patch Tuesday Roundup

Posted by trich on

Since Microsoft is on this new staggered pattern of releases, we can expect a feast or famine every other month…so get used to it. Depending on what side of the desk you sit on you can adjust the context. With that being said, this month’s release brought us 3 patches addressing 4 vulnerabilities. I think we were all expecting to see the MHTML protocol handler issue resolved, however it didn’t make the cut. Make sure IE is in restricted mode or at least you’re restricting ActiveX and Active Scripting for your users until the fix is released. This vulnerability is already being leveraged for geo-political warfare according to Google.

The honorable mention of this release goes to MS11-015. MS11-015 is classified as the only “Critical” update this release.

MS11-015CVE-2011-0042

This vulnerability is exposed when the Stream Buffer Engine (SBE) trys to parse “.dvs-ms” files. This limitation will allow any of your IE users to be remotely exploited when using Windows Media Center or Media Player to play these files. You can expect social engineering vectors to be used here… emails pointing to a DVS file or an iFrame rendering one.

MS11-016 – CVE-2010-3146 & MS11-017 CVE-2011-0029

The last two I won’t spend too much time on them, as they fall in line with the not so surprising DLL Hijacking exposures we’ve been seeing from Microsoft. You’ll also see them called “binary planting vulnerabilities”…at the end of the day they’re the same issue. HD has a great post detailing the characteristics of this exposure here.

Below is the official breakdown of the March 2011 Patch Tuesday Release:

MS11-015/KB2510030 – Critical (XP, Vista, 7)/Important (2008 R2) Vulnerabilities in Windows Media Could Allow Remote Code Execution (2510030) This security update resolves one publicly disclosed vulnerability in DirectShow and one privately reported vulnerability in Windows Media Player and Windows Media Center. The more severe of these vulnerabilities could allow remote code execution if a user opens a specially crafted Microsoft Digital Video Recording (.dvr-ms) file. In all cases, a user cannot be forced to open the file; for an attack to be successful, a user must be convinced to do so. **PATCH ASAP**

MS11-016/KB2494047 – Important (Microsoft Groove 2007): Vulnerability in Remote Desktop Client Could Allow Remote Code Execution (2508062) This security update resolves a publicly disclosed vulnerability in Windows Remote Desktop Client. The vulnerability could allow remote code execution if a user opens a legitimate Remote Desktop configuration (.rdp) file located in the same network folder as a specially crafted library file. For an attack to be successful, a user must visit an untrusted remote file system location or WebDAV share and open a document from this location that is then loaded by a vulnerable application.

MS11-017/KB2508062 – Important (CP, Vista, 7, 2003, 2008, 2008 R2): Vulnerability in Microsoft Groove Could Allow Remote Code Execution (2494047) This security update resolves a publicly disclosed vulnerability in Microsoft Groove that could allow remote code execution if a user opens a legitimate Groove-related file that is located in the same network directory as a specially crafted library file. Users whose accounts are configured to have fewer user rights on the system could be less impacted than users who operate with administrative user rights.

Until next time….

Topics: Patch Tuesday, Risk Assessment | No Comments »

Intelligence Meets Automation – [Enter] JESS

Posted by trich on

For as long as I’ve been at R7, we’ve struggled with articulating the power JESS has on the assessment process. The ability to emulate human function is priceless when trying to identify exposures.

JESS has one of the more compelling stories in the evolution of multi-layered assessment. The ability for NeXpose to take information found real-time and action on it is game changing. Below Ernest Friedman-Hill demonstrates the AI engine at very basic but consumable level.

Source: www.jessrules.com

Topics: NeXpose, Risk Assessment | No Comments »

NeXpose Policy Files?

Posted by trich on

The ‘Pose ships with a number of policy checks that are pre-defined however can be modified. Many times this functionality is overlooked because the majority of the templates disable these checks by default. You can always enable them and use the “Exhaustive” scan template if you forget the syntax. There are a number of policy checks shiped, but I will focus on the most extensible.

The policy information is best found by viewing the file directly. You will see there are a number of checks here, but more advanced users typically utilize it as a framework. These files can be customized and used to harden  devices or enforce internal policy on Windows, Oracle and Domino.

If you have an organization specific policy that need to be enforce, custom vulnerability checks may be necessary. For example…”Here at Acme having USB drives enabled is a violation of our security policy”. A check would be written to identify this scenario creating a positive or negative condition. On the reporting side the policy report would present a conform or violate on the policy.

NeXpose Scan Template Syntax

To customize the predefined policy use the below syntax. Before you kick  off your scan, off make sure credentials are added.

Windows Policy

Workstation policy file name – basicwk.inf

basicsv.inf

Domain controller policy file name – basicdc.inf

Oracle Policy

oracle.xml

Domino Policy

domino.xml

The Files Are In The Computer…

If you want to review the predefined policies or create your own, the policy files can be found below.

Windows

nexpose/plugins/java/1/WindowsPolicyScanner/1

Oracle

nexpose/plugins/java/1/OraclePolicyScanner/1

Domino

nexpose/plugins/java/1/NotesPolicyScanner/1

Topics: NeXpose, Risk Assessment | 18 Comments »

February Patch Tuesday Roundup

Posted by trich on

I think we all knew this was coming…January’s release was just too light. This month Microsoft released 12 updates which address 22 vulnerabilities. There were 3 critical updates this release and 9 important fixes. The honorable mention would have to go to the CSS recursive import fix.

MS11-003 CVE-2010-3971- This issue effects the way Cascading Style Sheets access memory in IE. By creating a “use-after-free” condition the attacker is given an opportunity to slip in and execute code on the target.  This code execution occurs when a C++ object is re-used after it has been de-allocated. Memory that was previously allocated for the object can be re-used by an attacker. This bug would allow full control of the victims machine if exploited… “kinda” a big deal =|

MS11-006 CVE-2010-3970 – Say Cheese? Those holiday party pics are the perfect place for one of these shady images to be buried.  After convincing a user to browse to a network share to view a malious thumbnail, the exploit targets the Windows Shell. Because of IE’s inability to parse a negative “biClrUsed” value, the results is a stack-based buffer overflow.  This exploit allows an attacker to then take full control at the users privilege level.

MS11-007 CVE-2011-0033 – This issue targets the Microsoft/Adobe joint venture OpenType CFF(Compact Font Format). Your users are all smiles knowing that they have a secret admire for Valentines. After browsing a page and rendering the malicious font, “Be Mine”  takes on a whole new meaning. This vulnerability targets a weakness in the way that the OpenType CFF validates parameter values. If exploited this would let the attacker run arbitrary code in kernel mode. This is the perfect example of why security awareness trainings shouldn’t be back burnered.

Below is the official breakdown of the February 2011 Patch Tuesday Release:

MS11-003/KB2482017 – Critical (XP, Vista, 7)/Moderate(2003, 2008, 2008R2):

Cumulative Security Update for Internet Explorer (2482017)

This security update resolves two privately reported vulnerabilities and two publicly disclosed vulnerabilities in Internet Explorer. The vulnerabilities could allow remote code execution if a user views a specially crafted Web page using Internet Explorer or if a user opens a legitimate HTML file that loads a specially crafted library file. An attacker who successfully exploited any of these vulnerabilities could gain the same user rights as the local user. Users whose accounts are configured to have fewer user rights on the system could be less impacted than users who operate with administrative user rights.

MS11-006/KB2483185 – Critical (XP, Vista, 2003, 2008): Vulnerability in Windows Shell Graphics Processing Could Allow Remote Code Execution (2483185)

This security update resolves a publicly disclosed vulnerability in the Windows Shell graphics processor. The vulnerability could allow remote code execution if a user views a specially crafted thumbnail image. An attacker who successfully exploited this vulnerability could gain the same user rights as the logged-on user. Users whose accounts are configured to have fewer user rights on the system could be less impacted than users who operate with administrative user rights.

MS11-007/KB2485376 – Critical (Vista, 7, 2008, 2008R2)/Important (XP, 2003): Vulnerability in the OpenType Compact Font Format (CFF) Driver Could Allow Remote Code Execution (2485376)

This security update resolves a privately reported vulnerability in the Windows OpenType Compact Font Format (CFF) driver. The vulnerability could allow remote code execution if a user views content rendered in a specially crafted CFF font. In all cases, an attacker would have no way to force users to view the specially crafted content. Instead, an attacker would have to convince users to visit a Web site, typically by getting them to click a link in an e-mail message or Instant Messenger message that takes users to the attacker’s Web site.

MS11-004/KB2489256 – Important (Vista, 7, 2008, 2008R2): Vulnerability in Internet Information Services (IIS) FTP Service Could Allow Remote Code Execution (2489256)

This security update resolves a publicly disclosed vulnerability in Microsoft Internet Information Services (IIS) FTP Service. The vulnerability could allow remote code execution if an FTP server receives a specially crafted FTP command. FTP Service is not installed by default on IIS.

MS11-005/KB2478953 – Important (2003): Vulnerability in Active Directory Could Allow Denial of Service (2478953)

This security update resolves a publicly disclosed vulnerability in Active Directory. The vulnerability could allow denial of service if an attacker sent a specially crafted packet to an affected Active Directory server. The attacker must have valid local administrator privileges on the domain-joined computer in order to exploit this vulnerability.

MS11-008/KB2451879 – Important (Visio 2002, Visio 2003, Visio 2007): Vulnerabilities in Microsoft Visio Could Allow Remote Code Execution (2451879)

This security update resolves two privately reported vulnerabilities in Microsoft Visio. The vulnerabilities could allow remote code execution if a user opens a specially crafted Visio file. An attacker who successfully exploited either of these vulnerabilities could gain the same user rights as the logged-on user. Users whose accounts are configured to have fewer user rights on the system could be less impacted than users who operate with administrative user rights.

MS11-009/KB2475792 – Important (W7, 2008 R2): Vulnerability in JScript and VBScript Scripting Engines Could Allow Information Disclosure (2475792)

This security update resolves a privately reported vulnerability in the JScript and VBScript scripting engines. The vulnerability could allow information disclosure if a user visited a specially crafted Web site. An attacker would have no way to force users to visit these Web sites. Instead, an attacker would have to convince users to visit the Web site, typically by getting them to click a link in an e-mail message or Instant Messenger message that takes users to the attacker’s Web site.

MS11-010/KB2476687 – Important (XP, 2003): Vulnerability in Windows Client/Server Run-time Subsystem Could Allow Elevation of Privilege (2476687)

This security update resolves a privately reported vulnerability in the Microsoft Windows Client/Server Run-time Subsystem (CSRSS) in Windows XP and Windows Server 2003.

The vulnerability could allow elevation of privilege if an attacker logs on to a user’s system and starts a specially crafted application that continues running after the attacker logs off in order to obtain the logon credentials of subsequent users. An attacker must have valid logon credentials and be able to log on locally to exploit this vulnerability. The vulnerability could not be exploited remotely or by anonymous users.

MS11-011/KB2393802 – Important (XP, Vista, W7, 2003, 2008, 2008R2):

Vulnerabilities in Windows Kernel Could Allow Elevation of Privilege (2393802)

This security update resolves one publicly disclosed vulnerability and one privately reported vulnerability in Microsoft Windows. The vulnerabilities could allow elevation of privilege if an attacker logged on locally and ran a specially crafted application. An attacker must have valid logon credentials and be able to log on locally to exploit these vulnerabilities. The vulnerabilities could not be exploited remotely or by anonymous users.

MS11-012/KB2479628 – Important (XP, Vista, W7, 2003, 2008, 2008 R2):

Vulnerabilities in Windows Kernel-Mode Drivers Could Allow Elevation of Privilege (2479628)

This security update resolves five privately reported vulnerabilities in Microsoft Windows. The vulnerabilities could allow elevation of privilege if an attacker logged on locally and ran a specially crafted application. An attacker must have valid logon credentials and be able to log on locally to exploit these vulnerabilities. The vulnerabilities could not be exploited remotely or by anonymous users.

MS11-013/KB2496930 – Important (XP, 7, 2003, 2008 R2):

Vulnerabilities in Kerberos Could Allow Elevation of Privilege (2496930)

This security update resolves one privately reported vulnerability and one publicly disclosed vulnerability in Microsoft Windows. The more severe of these vulnerabilities could allow elevation of privilege if a local, authenticated attacker installs a malicious service on a domain-joined computer.

MS11-014/KB2478960 – Important (XP, 2003): Vulnerability in Local Security Authority Subsystem Service Could Allow Local Elevation of Privilege (2478960)

This security update resolves a privately reported vulnerability in the Local Security Authority Subsystem Service (LSASS) in Windows XP and Windows Server 2003.

The vulnerability could allow elevation of privilege if an attacker logs on to a system and runs a specially crafted application. An attacker must have valid logon credentials and be able to log on locally to exploit this vulnerability. The vulnerability could not be exploited remotely or by anonymous users.

Topics: Patch Tuesday | 1 Comment »

NeXpose Troubleshooting – Grepin’ Logs

Posted by trich on

As much as I would love to say NeXpose never has issues the reality is,its software. In many cases NeXpose will encounter an unfavorable response from a target or a peer will drop the connection when being probed. While trying to isolate errors, the ability to search through multiple logs at the same time is priceless. [Enters] grep!

I’ve outlined a number of key search phrases that can be used to isolate specific issues.

I recommend the below command to pipe the search findings to a text file for review. If you would just like the output of the search printed to your screen, then replace “ > out.txt” with “| less”. After going into the appropriate log folder (mentioned in my 1/13/10 post) the below string can be used:

grep [search term] ./[log directory]/ns* > out.txt

**Keep in mind that Linux is case sensitive**

  • Identify where external/remote scanning starts :

“Connecting to NSE”

  • Identify where a local scan starts

“Scan started”

  • Policy issues :

“nexpose is running as”

  • Serial Number  *This search is used in the NSC log

“AutoUpdate“

  • Fingerprint

“Starting fingerprinting”

  • Finished scan *The search is used in the NSE log

“Completed in”

  • Remote Engine Issues *This command is used in the NSC log

“Failure communicating with NSE”

  • Memory Error *This search is used in the NSE log

“OutOfMemoryError”

  • Java Heap Space Error

“Java heap space”

  • GC Memory Error

“GC overhead limit exceeded”

  • Find if scan stopped or started

a)  “(userID)” – find the specific user that started or stopped the scanner

b)  “<>” –  find if a scan was stopped or started

  • Beginning of Scan Configuration *This command is used in the NSC log (helpful to find the list of sites)

“Scan configs” – This can be used this to find where the config ids start. You should being reading from Using it with grep will show the beginning of the scan configuration. It’s better to search for it in a program like notepad++ where we can begin to view the ids themselves after it.

  • Search config Site by site

“Site:”

  • IP’s in a site

“range from=”

  • Starting Scan *This command is used in the NSC log

“job JobID”

  • Scan Stopped

“stopped:”

  • Look for connection to remote engines

“Updating remote scan engines”

  • Look for recent successful connection to host

“Scan engine is current”

  • Find complete scans

“completed in”

  • If engine is shutdown

“stopped: Scan Engine Shutdown”

  • Web service shutting down *This command is used in the NSC log

“HTTPServerMain shutting down…”

  • Null Pointer

“NullPointerException”

  • Update issue *The search is used in the NSE log

FAILURE =>”

  • Alert delivery failure

“Failed to deliver”

  • Export issue

“Generating report: Database Export”

Topics: NeXpose | No Comments »

PCI 2.0 Changes Summarized

Posted by trich on

As you know PCI is an ever changing beast. Whats nice is that many folks are finding funding for security efforts because of the mandate, but keeping up with the changes is a bit of a task. I’ve included a handy-dandy summary of the most recent changes effective January 1, 2011. You can also find the expanded version of this summary here.


Topics: Risk Assessment | No Comments »

Metasploit – AntiVirus Evasion

Posted by trich on

I’ve had alot of people ask why would anyone pay for MS-Pro, when they can just use the Framework. There are a number of things that stand out between the products (like VPN Pivoting and even just basic things you can’t live without like a detailed audit trail). One of the key areas of improvement added to MS-Pro, is the ability to generate valid signed binarys for EXE’s. The payload is also placed in the signature section of the binary which obfuscates it even further.

This allows you to increase the success rate of exploitation substantially…especially when you’re up against white-listing or group policy restrictions. I’ve included the lab break down below.

Topics: Metasploit, Risk Assessment | No Comments »

Next Entries »