Blogs & Stories

SpiderLabs Blog

Attracting more than a half-million annual readers, this is the security community's go-to destination for technical breakdowns of the latest threats, critical vulnerability disclosures and cutting-edge research.

Zap(ped) into Foca(s)

An external penetration test isn't just about the network addresses to pwn, but sometimes about the web presence that is offered to the world at large. And web presence equals web applications. As a new addition to the SpiderLabs team, I've been working on perfecting my web profiling and penetration testing skills. I've come across two tools that when used in conjunction, can get a great view of both basic vulnerabilities as well as profiling for a web site. No tool is 100% accurate, and sometimes due to the size of the target, it can't handle the bandwidth. Layering tools allows you to cover more ground. And since a vulnerability scan typically works by identifying a system, then executing specific checks against it to determine if a vulnerability exists, a pentester then needs to manually attempt to exploit those potential vulnerabilities.

ZAP, which is an OWASP Project whose full name is Zed Attack Proxy and not a shortened name of the 1980 Scott Baio movie, is a free penetration tool for finding web application vulnerabilities. It is easily downloaded from the OWASP website HERE, with great in-depth directions and information which can be found HERE on the use and installation of ZAP.

Zap screen[Figure 1. A newly opened session showing the basic ZAP screen.]

Essentially, ZAP is an intercepting proxy used to scan a website both passively and actively. Once a website has been explored, and the pages have been registered within ZAP, the Spider option can be used to find any links that might have been missed. Next, an active scan can be run to find any potential vulnerabilities, and more than likely this will be when the alert flags start to pop up.

Zap alerts 2 [Figure 2. Alerts posted from a large cluster of webservers housing one main site.]

This list of alerts documents possible web application vulnerabilities. The fun of breaking things now comes into play, as with list in hand of URLs by the dozen, it is now time to manually test to see if these are real exploitable vulnerabilities or just some false positives.

Sadly, many web proxies aren't great at targeting a lot of webservers at once. As you can see in Figure 2., there are thousands of webpages with potential vulnerabilities. Worse still, since the website was so vast active scans were not completing. What's a pentester to do? She finds another tool to layer with this one to fill in the blanks.

FOCA is a fingerprinting and information gathering tool also used for pentesting. This tool is also free. A download can be obtained by submitting your email on the bottom of the FOCA webpage. A direct download link will then be sent to your email address.

FOCA FULL[Figure 3. FOCA project main screen.]

FOCA searches the World Wide Web using Google or Bing Web or API settings, DNS records, and Shodan & Robtex. It does a fantastic job of ferreting out all associated clients, servers, and domains. Yet interestingly when used on the same website as ZAP was above, it did not list out the same vulnerabilities. However, the metadata it was able to grab was content rich. Metadata is typically descriptive information about the file including the authors name and date, but can include additional interesting information such as internal share locations, software versions, and usernames. FOCA downloads all publicly-accessible, search engine indexed documents (Word files, PDFs, etc) hosted in the environment; and organizes the extracted metadata as shown in the Evidence section.

FOCA metadata list
[Figure 4. Metadata list of files and juicy information extracted and analyzed by FOCA.

FOCA software Metadata
[Figure 5. A breakdown of software extracted from metadata via FOCA.]

So the lesson to be learned here is that by layering tools you get a bigger picture of the environment you are testing. The metadata retrieved from FOCA could be used to leverage additional system compromises both externally and internally. With tools combined, you could pwn the world.