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

10:00 AM
Connect Directly
E-Mail vvv

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
Oldest First  |  Newest First  |  Threaded View
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.
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. 
7 Old IT Things Every New InfoSec Pro Should Know
Joan Goodchild, Staff Editor,  4/20/2021
Cloud-Native Businesses Struggle With Security
Robert Lemos, Contributing Writer,  5/6/2021
Defending Against Web Scraping Attacks
Rob Simon, Principal Security Consultant at TrustedSec,  5/7/2021
Register for Dark Reading Newsletters
White Papers
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
PUBLISHED: 2021-05-15
A XSS Vulnerability in /uploads/dede/action_search.php in DedeCMS V5.7 SP2 allows an authenticated user to execute remote arbitrary code via the keyword parameter.
PUBLISHED: 2021-05-15
DedeCMS V5.7 SP2 contains a CSRF vulnerability that allows a remote attacker to send a malicious request to to the web manager allowing remote code execution.
PUBLISHED: 2021-05-14
The Linux kernel before 5.11.14 has a use-after-free in cipso_v4_genopt in net/ipv4/cipso_ipv4.c because the CIPSO and CALIPSO refcounting for the DOI definitions is mishandled, aka CID-ad5d07f4a9cd. This leads to writing an arbitrary value.
PUBLISHED: 2021-05-14
In the Linux kernel before 5.12.4, net/bluetooth/hci_event.c has a use-after-free when destroying an hci_chan, aka CID-5c4c8c954409. This leads to writing an arbitrary value.
PUBLISHED: 2021-05-14
The block subsystem in the Linux kernel before 5.2 has a use-after-free that can lead to arbitrary code execution in the kernel context and privilege escalation, aka CID-c3e2219216c9. This is related to blk_mq_free_rqs and blk_cleanup_queue.