Dark Reading is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them.Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.

Application Security

3/29/2021
10:00 AM
Connect Directly
Twitter
LinkedIn
RSS
E-Mail vvv
50%
50%

4 Open Source Tools to Add to Your Security Arsenal

Open source solutions can offer an accessible and powerful way to enhance your security-testing capabilities.

Security research often requires a wide variety of tools and approaches. Open source tools can offer an accessible and powerful way to enhance security-testing capabilities. If you work in the security space, here are several open source tools that might be worth adding to your security tool arsenal. 

Doxygen Documentation Generator
Doxygen is a documentation generator for a variety of popular programming languages. It allows users to extract the code structure from source files and highlight relationships between the code elements. This tool essentially provides a visual representation of your code, and it can help provide a deeper, more comprehensive understanding of particularly complex code bases. Doxygen allows users to analyze the flow of the code and can, for example, help visually inspect whether assets flow through input validation functions at expected execution stages. 

Related Content:

How Us Shady Geeks Put Others Off Security

Special Report: Building an Effective Cybersecurity Incident Response Team

New From The Edge: 3 Classes of Account Fraud That Can Cost Your Company Big Time

Being able to visually examine large or complex code bases can supplement existing manual code reviews and fuzzing, and it can help pinpoint issues that you might have otherwise overlooked. (Here's a short list of steps you can follow to create a call graph with Doxygen.) For example, have you ever wondered how the Linux sudo command works? Here's a graphic representation of the code made with Doxygen. 

Doxygen call graph for sudo Linux utility
(Source: Maggie Jauregui; generated with Doxygen)
Doxygen call graph for sudo Linux utility (Source: Maggie Jauregui; generated with Doxygen)

Z3 Constraint Solver
Next is Z3, a constraint solver tool that can complement software analysis, verification, and fuzzing tools. It provides bindings for several programming languages, including C/C++ and Python. Z3 tries to find solutions that satisfy a specific set of defined constraints. This can become useful, for example, to cross-check input validation constraints to find potential escapes that could result in unwanted states. 

While manual code review and fuzzing can help identify problematic states, Z3 adds comprehensive mathematical and logical verification into the mix, which provides an extra level of review for the code. You can use this tool to model a feature or a particular block of code to test out the constraints and discover potential hidden issues like buffer overflow, integer wraparounds, improper access to memory, and more. For example, Trail of Bits published a blog post describing how it used Z3 to find the Heartbleed vulnerability. The post walks through turning real code into functions and those functions into Z3 constraints, which results in a combination of values that overflows a CPU register and successfully calls a memory allocation routine with an invalid value, as visualized below. 

Heartbleed vulnerability detected by Trail of Bits using Z3 constraint solver. Top left shows the code, bottom left shows the functions, bottom center shows Z3, and bottom right shows Z3 results. (Source: Josh Watson, Trail of Bits)
Heartbleed vulnerability detected by Trail of Bits using Z3 constraint solver. Top left shows the code, bottom left shows the functions, bottom center shows Z3, and bottom right shows Z3 results. (Source: Josh Watson, Trail of Bits)

LibFuzzer Fuzzing Engine
The third tool is an open source fuzzer called libFuzzer. (It's worth noting that American fuzzy lop, or AFL, has been a prevalent choice for years, and libFuzzer is growing in popularity.) These types of tools are valuable to security research and assurance efforts in order to complement existing input-validation testing efforts. LibFuzzer typically looks for inputs that will cause a system to crash or hang. The fuzzing engine can take initial inputs and enable additional permutations to progressively explore the program. LibFuzzer makes it relatively straightforward to create a harness through which it can interact with and run fuzzed inputs against your program. 

Another great benefit is libFuzzer's ability to intercept compare operations to determine which values would allow reaching a broader set of coverage. This avoids the need to hard-code code constants or magic numbers to get past conditional checks, and simplifies the work of the fuzz tester.

Gcov Code Coverage Tool
The final tool, Gcov, is part of a tool category called code coverage, which goes hand-in-hand with fuzzers. Since fuzzers can run continuously for days or weeks at a time, it can be challenging for users to understand just how much of the code base they've covered, including which lines of code have been accessed (and which haven't). Code coverage tools provide a detailed view of a fuzzer's progress over time, allowing fuzzer adjustments that maximize the fuzzer's code coverage to help ensure that most aspects of the code flow/code base are verified. This helps increase confidence in the results. Here's a quick example that shows the lines covered in blue and the lines that weren't hit in red.

Gcov example showing progress of code examined, with red representing code that has not been accessed. (Source: Peter Oberparleiter, the Linux Test Project)
Gcov example showing progress of code examined, with red representing code that has not been accessed. (Source: Peter Oberparleiter, the Linux Test Project)

Strengthen Your Security with Open Source Solutions
The research and testing community is always on the hunt for better tools that can be used in the fight to build and deploy more resilient and reliable technology. There are many open source options that are not only simple but can be highly effective complements to your existing security toolkit. 

This article touched on Doxygen, Z3, libFuzzer, and Gcov, but there are a wide range of other tools and frameworks to explore, such as address sanitizers, source-code analysis tools, and domain-specific fuzzers, among others. Take some time to assess new open source solutions that can strengthen your security arsenal and improve your security research and assurance efforts.

Maggie Jauregui, Security Researcher, Programmable Solutions Group at Intel Maggie Jauregui is a firmware and hardware FPGA security researcher for Intel's Programmable Solutions Group. Throughout her career, she has presented and delivered training presentations on firmware ... View Full Bio
 

Recommended Reading:

Comment  | 
Print  | 
More Insights
Comments
Newest First  |  Oldest First  |  Threaded View
advocatemack
50%
50%
advocatemack,
User Rank: Author
4/19/2021 | 3:15:56 AM
Increase in open-source security
There has been a massive increase in open-source security tools that becoming increasingly popular. It is great to see. 
AlexLuther
50%
50%
AlexLuther,
User Rank: Apprentice
4/7/2021 | 7:16:48 PM
Blurry Image
Just wanted to let you know, the first image is too blurry to read.
News
US Formally Attributes SolarWinds Attack to Russian Intelligence Agency
Jai Vijayan, Contributing Writer,  4/15/2021
News
Dependency Problems Increase for Open Source Components
Robert Lemos, Contributing Writer,  4/14/2021
News
FBI Operation Remotely Removes Web Shells From Exchange Servers
Kelly Sheridan, Staff Editor, Dark Reading,  4/14/2021
Register for Dark Reading Newsletters
White Papers
Video
Cartoon Contest
Current Issue
2021 Top Enterprise IT Trends
We've identified the key trends that are poised to impact the IT landscape in 2021. Find out why they're important and how they will affect you today!
Flash Poll
How Enterprises are Developing Secure Applications
How Enterprises are Developing Secure Applications
Recent breaches of third-party apps are driving many organizations to think harder about the security of their off-the-shelf software as they continue to move left in secure software development practices.
Twitter Feed
Dark Reading - Bug Report
Bug Report
Enterprise Vulnerabilities
From DHS/US-CERT's National Vulnerability Database
CVE-2021-31607
PUBLISHED: 2021-04-23
In SaltStack Salt 2016.9 through 3002.6, a command injection vulnerability exists in the snapper module that allows for local privilege escalation on a minion. The attack requires that a file is created with a pathname that is backed up by snapper, and that the master calls the snapper.diff function...
CVE-2021-31597
PUBLISHED: 2021-04-23
The xmlhttprequest-ssl package before 1.6.1 for Node.js disables SSL certificate validation by default, because rejectUnauthorized (when the property exists but is undefined) is considered to be false within the https.request function of Node.js. In other words, no certificate is ever rejected.
CVE-2021-2296
PUBLISHED: 2021-04-22
Vulnerability in the Oracle VM VirtualBox product of Oracle Virtualization (component: Core). The supported version that is affected is Prior to 6.1.20. Difficult to exploit vulnerability allows high privileged attacker with logon to the infrastructure where Oracle VM VirtualBox executes to compromi...
CVE-2021-2297
PUBLISHED: 2021-04-22
Vulnerability in the Oracle VM VirtualBox product of Oracle Virtualization (component: Core). The supported version that is affected is Prior to 6.1.20. Difficult to exploit vulnerability allows high privileged attacker with logon to the infrastructure where Oracle VM VirtualBox executes to compromi...
CVE-2021-2298
PUBLISHED: 2021-04-22
Vulnerability in the MySQL Server product of Oracle MySQL (component: Server: Optimizer). Supported versions that are affected are 8.0.23 and prior. Easily exploitable vulnerability allows low privileged attacker with network access via multiple protocols to compromise MySQL Server. Successful attac...