Burp Suite For Macos

Jul 17, 2021 Burp Suite is an integrated platform for performing security testing of web applications. Its various tools work seamlessly together to support the entire testing process, from initial mapping and analysis of an application's attack surface, through to finding and exploiting security vulnerabilities. Intruder is also available for the Community version, but it has a throttling that can be a bit slow. Installing Burp is really easy, you just need to visit their website and they offer an option for Mac OS, and you just download an install the.dmg file. Links: Burp Suite.

Intercepting HTTP proxies such as Burp Suite or mitmproxy are extremely helpful tools - not just for pentesting and security research but also for development, testing and exploring APIs. I actually find myself using Burp more for debugging and learning than for actual pentesting nowadays. It can be extremely helpful to look “under the hood” at actual HTTP requests being made to make sense of complex APIs or to test that one of my scripts or tools is working correctly.

The general use case for a tool like Burp or mitmproxy is to configure a browser to communicate through it, and there are plenty of write-ups and tutorials on how to configure Firefox, Chrome, etc to talk to Burp Suite and to trust the Burp self-signed Certificate Authority.

However, I often want/need to inspect traffic that comes from other tools besides browsers - most notably command line tools. A lot of CLI tools for popular services are just making HTTP requests, and being able to inspect and/or modify this traffic is really valuable. If a CLI tool is not working as expected and the error messages are unhelpful, the problem can become obvious as soon as you look at the actual HTTP requests and responses it’s making/receiving.

I have used these techniques to inspect popular CLI tools like the Azure CLI (az) and Zeit’s now utility. In the past, I have even proxied the CLI tools provided by a commercial security tool we used and learned about some undocumented APIs and behaviors that were not in their documentation. With this knowledge, I was able to automate certain things that were not possible through their vanilla CLI or the published API docs.

In this post, I want to show various techniques for configuring different CLI tools written in different languages to proxy their HTTP(S) traffic through Burp Suite - even if the tools themselves don’t offer easy proxy settings. In general there are two things we must configure:

  • Make the CLI proxy traffic to Burp
  • Make the CLI trust the Burp CA (or ignore trust)

The second step is often more difficult, but never impossible :)

In most of these examples, I have Burp Suite listening on localhost:8080 and am running the CLI tools from the same machine. If Burp is running on a different host or interface, you should be able to just replace localhost with the IP of Burp.

For the first example, I’ll show how to proxy the old standbys curl and wget. Both tools can easily be configured to point to a proxy and are “proxy aware”. They pick up their proxy settings from environment variables:

  • http_proxy
  • https_proxy

You can either export the variables first, or run them inline with the command:

We will see the curl and wget requests in Burp:

That works great because it’s just HTTP. What about HTTPS? If you try to run it out of the box, you will get failures:

curl does not trust the certificate that Burp is presenting. However the error message is quite helpful. Most CLI tools will fallback to the operating system when deciding what certificates to trust. So we have two main options:

  1. Disable trust verification
  2. Configure our operating system to trust the Burp CA

The first option is easiest. For curl use -k or for wget use --no-check-certificate:

And you will see the HTTPS traffic in Burp.

Trusting the Proxy Certificate at the OS Level

For option 2, we have to export the Burp CA from within Burp. We can download the Burp Certificate in DER format to ~/certs. We’ll also convert it to PEM:

Note: if you are using mitmproxy, the certs are already in ~/.mitmproxy

Installing and trusting the certificate is very OS dependent.

Note: be aware of what this is doing. You are weakening the security of your OS. Consider the risk.

Mac OSX

On a Mac, just double click the downloaded DER file and OSX will prompt you to add the cert to the keychain. If you select “System” it will be trusted by all users on the machine. Then after importing it, you must trust it. Search the keychain for “PortSwigger” and open up the certificate. Under “Trust” select “Always Trust” for SSL:

Windows

On Windows, double-click on the DER file and select “Install Certificate”. Select the “Trusted Root Certification Authorities” certificate store to install and trust the Burp CA.

Linux

For most distros, trusted certificates are in /usr/share/ca-certificates. Copy the burpca.crt file to /usr/share/ca-certificates and then run:

With the Burp CA trusted by your OS, you no longer have to use -k with curl or --no-check-certificates with wget and you will see HTTPS traffic in Burp:

Trusting the cert at the OS level may seem like overkill for curl and wget (and it is), but it is also the easiest way to proxy CLI tools when you can’t disable trust (as we’ll see later).

While I would obviously prefer a Python or npm package or a Go binary - a lot of CLI tools I deal with are JARs, including all the CLI utilities for my company’s SAST solution. Now some of these utilities have proxy support out of the box that can be configured with command line options, however some of them don’t and I need to force the JAR to talk to my proxy.

A few years go, a security scanner my company was using at the time had a horribly documented API, and the only approved way to interact with it using API tokens was through their Java JAR CLI tool. We needed to scale our automation and wanted to write a Python package for talking with the API, so I used this exact technique to proxy their JAR and figure out how to authenticate with API tokens and what APIs we needed to hit.

I won’t pick on that security vendor here, so instead I will demo on a random Atlassian CLI tool I found for talking with Jira. For example, I can use this CLI to query the Jira version running on a random cloud hosted instance:

Let’s figure out how it’s doing that so I can recreate the API calls manually. Unfortunately, the CLI tool doesn’t have any options for specifying a proxy. Thankfully, it’s actually pretty straightforward to force the JVM to use a proxy through some properties when launching Java:

  • http.proxyHost
  • http.proxyPort
  • https.proxyHost
  • https.proxyPort
  • http.nonProxyHosts

To proxy a JAR through Burpsuite, we need to set the first 4 options to our proxy, and ensure the last one is blank. This will force Java to proxy all hosts through Burp. We do that by adding these as command line flags to the java command before we specify the JAR:

But we now get an SSL error!

Even though I have the Burp certificate trusted in my OS keychain, Java actually uses its own keystore. So we need to add the Burp certificate there also.

Adding certificates to Java Keystore

The default keystore is located in $JAVA_HOME/lib/security/cacerts. If the $JAVA_HOME environment variable isn’t set for you, you can also quickly find it by using java:

To add certificates to Java’s keystore, we utilize Java’s keytool utility, which is included at $JAVA_HOME/bin/keytool. To import our Burp certificate, we must import the PEM formatted file to the trusted CA certs:

This will prompt you for the keystore password. By default the value is changeit. Then specify “yes” to trust the certificate:

Now with the Burp certificate trusted by Java, we can run the same command and see the HTTP traffic in Burp:

There it is! It makes a simple REST call to /rest/api/latest/serverinfo. Yes, this is publicly documented and I could have figured it out by RTFM but that’s not as fun :)

Moving along, this next example will focus on Python CLIs. Lately I’ve been using this a lot as I’ve doing quite a bit of Azure automation at work and wanted to peak under the hood of the official az CLI. In this example though, I’ve already installed the Azure CLI using homebrew (brew install azurecli) and done an az login.

I can view my available resource groups with:

Let’s intercept this request to figure out the call(s) it’s making.

Fortunately, Python will try to honor the “normal” proxy environment variables. However trying to set that results in…the typical SSL error:

Since I have the Burp CA trusted by my OS, Python is not using it.

Adding Certificates to Python

Python’s CA handling is a little strange. Most Python CLI’s probably use the requests library, which uses it’s own CA bundle, and then will also look at the CA bundle included with another library called certifi, which uses Mozilla’s bundle. To trust our CA, we can add it to the Mozilla bundle included with certifi.

It’s important to note that each Python interpreter get’s its own - so if you are using virtual environments you need to make sure you run the following commands with the correct Python.

First, I want to verify how az calls Python and which version it is using:

So az is calling its own embedded Python interpreter that was installed with homebrew at /usr/local/Cellar/azure-cli/2.0.74/libexec/bin/python.

First, to identify where the certificates are loaded from we import certifi and run certifi.where()

That cacert.pem file is a list of all trusted CAs in PEM format. To add our Burp CA, we can just append the PEM to the file:

With the Burp CA added to the Mozilla bundle, we can now proxy the az command!

And now any other az command we want to run we can start viewing/tampering with. This has been a lifesaver for me to see “real world” examples of Azure’s API I can recreate in my automation scripts.

In this example, I wanted to be able to proxy the traffic that comes from the now NPM package for interacting with https://zeit.co/. I have already installed the tool with

After logging in, I can view my current deployments with:

Unfortunately, it appears that Node does not honor the proxy environment variables. Running:

returns the data as expected, with nothing appearing in Burp. Unfortunately, Node does not support a global proxy setting, and there has been long discussions about it. But that doesn’t mean we can’t force one.

First, let’s see what the now command is calling:

The now utility is one large, ugly, minified JS file located in Node’s bin directory with a node shebang. We can also run the same now command by calling that file with node directly:

While node does not have global proxy support, this is an awesome project called global-agent which will set up a configurable proxy in a Node project by simply importing it. To use it, we use npm to install it into our current directory.

Note: you must be on Node 12 or higher

The module uses the GLOBAL_AGENT_HTTP_PROXY environment variable, so we must export that first. Now from within that directory (because it’s where node_modules is) we can inject the new requirement into the now package:

Node forces the now client to import global-agent/bootstrap which runs automatically. Now the now command will proxy requests to the URL set in the environment variable.

Now to add the SSL certificate for Burp.

Adding Certificates to Node

This is actually quite a bit easier than Python. The Node command understands an environment variable called NODE_EXTRA_CA_CERTS. To load our Burp certificate as trusted, we just export that environment variable as well and point it to the PEM file from Burp:

And it now works! We can view the traffic from the now package in Burp:

It is becoming increasingly popular for developers to distribute CLIs as static Go binaries. This is, of course, awesome because Go is awesome. It’s also awesome because proxying Go is actually very easy since out of the box every Go program understands the environment variables http_proxy and https_proxy.

Burp

For this example, I’ll proxy Github’s hub utility. With hub downloaded and installed, in a Git repo I can check on my current CI status like this:

Since hub is a Go binary, I simply need to set the environment variable for the proxy:

And we get an SSL error.

Trusting Certificates with Go

Unfortunately, Go doesn’t have a convenient place to trust an additional CA certificate. For each platform, Go looks in OS dependent places for trusted CAs. You can view these in the source code:

This is where you have to add the Burp certificate to your system keychain (as outlined above). After that, Go will pick it up and you can proxy Go binaries just fine:

Hopefully you find this as helpful as I do. Whether you are pentesting an app or CLI, or just developing and wanting to debug - intercepting HTTP traffic is really valuable. I love when I can apply some of my pentesting skills to increase development velocity and be creative.

Python, Node and Go encompass the vast majority of CLI tools I use, but of course there are others. In a future post, I’ll cover how to force an invisible proxy onto a process that is not proxy aware at all through layer 3 redirection.

Let me know if you have any questions or other ideas I missed!

-ropnop

tl;dr

See also

Penetration testing has become an essential part of the security verification process. While it’s great that there are many penetration testing tools to choose from, with so many that perform similar functions it can become confusing which tools provide you the best value for your time.

We are going to review some of the best pentesting tools available to pentesters today and organize them by category.

Get the Free Pen Testing Active Directory Environments EBook

“This really opened my eyes to AD security in a way defensive work never did.”
Burp suite for mac os 11

Ways to Best Use Penetration Testing Tools

While pentesting tools are usually used in the context of a larger security assessment of a network or service, there’s nothing holding back sysadmin’s or developers from deploying the exact same tools to validate the strength of their own work.

Top Pentesting Tools

Below is a list of the best pentesting tools to tackle different penetration testing tasks. We also included what each tool is best used for and which platforms they’re supported on.

1. Powershell-Suite

The PowerShell-suite is a collection of PowerShell scripts that extract information about the handles, processes, DLLs, and many other aspects of Windows machines. By scripting together specific tasks, you can quickly navigate and check which systems on a network are vulnerable to exploit.

  • Best Used For: Easily automated tasks to discover weak exploitable assets on a network.
  • Supported Platforms: Windows

2. Zmap

Zmap is a lightweight network scanner that is capable of scanning everything from a home network to the entire Internet. This free network scanner is best used to gather baseline details about a network. If you only have an IP range to go off of, use to get a lay of the land quickly.

  • Best Used For Information gathering and initial triage of the attack landscape.
  • Supported Platforms: Zmap is supported on various Linux platforms and macOS

3. Xray

Xray is an excellent network mapping tool that uses the OSINT framework to help guide its tactics. Xray uses wordlists, DNS requests, and any API keys to help identify open ports on a network from the outside looking in.

  • Best Used For: Pentesters tasked with gaining access to a network with no help
  • Supported Platforms: Linux and Windows

4. SimplyEmail

SimplyEmail is an email recon tool used to help gather associated information found on the internet based on someone’s email address. SimplyEmail is based on the harvester solution and works to search the internet for any data that can help provide intelligence around any given email address.

  • Best Used For Pentesters looking to create account lists for enterprise testing engagements.
  • Supported Platforms: Docker, Kali, Debian, Ubuntu, macOS

5. Wireshark

Wireshark is likely the most widely used network protocol analyzer across the world. Network traffic captured via Wireshark can show what protocols and systems are live, what accounts are most active, and allow attackers to intercept sensitive data.

  • Best Used For Deep level network visibility into communications.
  • Supported Platforms: Windows, Linux, macOS, Solaris

6. Hashcat

Hashcat is one of the fastest password recovery tools to date. By downloading the Suite version, you have access to the password recovery tool, a word generator, and a password cracking element. Dictionary, combination, brute-force, rule-based, toggle-case, and Hybrid password attacks are all fully supported. Best of all is hashcat has a great online community to help support the tool with patching, a WiKi page, and walkthroughs.

  • Best Used For Up and coming pentesters or system recovery specialists looking for the best password recovery tool to stake a claim in their business.
  • Supported Platforms: Linux, Windows, and macOS

Burp Suite For Macos Catalina

7. John the Ripper

John the Ripper is the original password cracking tool. Its sole purpose is to find weak passwords on a given system and expose them. John the Ripper is a pentesting tool that can be used for both a security and a compliance perspective. John is famous for its ability to expose weak passwords within a short timeframe quickly.

  • Best Used For: Password cracking for novices
  • Supported Platforms: Windows, Unix, macOS, Windows

8. Hydra

Hydra is another password cracking tool but with a twist. Hydra is the only password pentesting tool that supports multiple protocols and parallel connections at once. This feature allows a penetration tester to attempt to crack numerous passwords on different systems at the same time without losing connection if unbeaten.

  • Best Used For: Password cracking for professionals
  • Supported Platforms: Linux, Windows, Solaris, macOS

9. Aircrack-ng

Aircrack-ng is a wireless network security tool that is an all in one package for penetration testing. Aircrack-ng has four primary functions that make it the ultimate standout in its class; It does monitoring of network packets, attacking via packet injection, testing of WiFi capabilities, and finally, password cracking.

  • Best Used For Command-line heavy users that prefer to script out attacks or defense measures.
  • Supported Platforms: Windows, OS X Solaris, Linux

10. Burp Suite

For pentesting web applications, Burp Suite is your go-to tool. Incorporating not only vulnerability scanning but Fully Proxy capturing and command injection services as well. Burps UI is fully optimized for the working professional with built-in profiles to allow you to save your configurations on a per-job basis.

  • Best Used For Enterprise professionals in charge of application security
  • Supported Platforms: Windows, macOS, and Linux

11. Metasploit

Comparable to Burp Suite, Metasploit started as an open-source solution and has gained some traction over the years. Some of the tasks that can be accomplished in Metasploit from a pentesting perspective include vulnerability scanning, listening, exploiting known vulnerabilities, evidence collection, and project reporting.

  • Best Used For Pentesters managing several different companies at once or have multiple applications to be tested.
  • Supported Platforms: Windows, macOS, and Linux

12. Nikto

Nikto is a loud and proud web application scanning solution. It is open-source and contains features like a web server scanner, a pre-packaged list of potentially dangerous files, and a misconfiguration checker as well. Nikto is not stealthy, nor does it try to be; it doesn’t try to hide its presence, but it will get the job done.

  • Best Used For Enterprise Pentesters or SOCs that have the full permission to scan systems in a purple team type exercise. Best used to help build out monitoring around scanning activity within a SOC environment.
  • Supported Platforms: Windows and Linux

13. Fuzzdb

Fuzzdb is a special kind of penetration testing tool as it contains pre-built attack payloads to run against web applications to discover if vulnerabilities are genuinely exploitable. On top of being able to simulate attack patterns, Fuzzdb can run discovery scans and perform analysis on the responses received from these scans to narrow better the focus of where vulnerabilities exist.

Burp Suite For Mac Os Catalina

  • Best Used For Pentesting professionals that are hired to attempt to exploit vulnerabilities.
  • Supported Platforms: Windows, Linux, and macOS

14. NMAP/ZenMap

NMAP is a pentesters best friend. This network security mapping tool gives you a quick look at the open ports on any given network. NMAP commands allow you to dig into the feasibility of specific network-level vulnerabilities. NMAP also has a friendly GUI interface called ZenMap that is easy to use for any skill level. NMAP also comes with a debugging tool, a comparison tool for comparing scan results, and a packet generation tool as well.

  • Best Used For: All skill level pentesters or security professionals to validate and test vulnerability management.
  • Supported Platforms: Linux, Microsoft Windows, FreeBSD, OpenBSD, Solaris, IRIX, Mac OS X, HP-UX, NetBSD, Sun OS, and Amiga

15. sqlmap

Burp Suite Pro Macos

Sqlmap is an open-source penetration tool that helps bring validity to possible SQL injection flaws that may affect your database servers. This automated testing tool comes with a slew of detailed features, including DB fingerprinting, remote commands, and its detection engine.

  • Best Used For Expert Pentesters strictly focusing on exploiting databases.
  • Supported Platforms: MySQL, Oracle, PostgreSQL, Microsoft SQL Server, Microsoft Access, IBM DB2, SQLite, Firebird, Sybase and SAP MaxDB

16. MobSF

For mobile platform vulnerability discovery, MobSF is your tool. This hacking tool is an all in one platform for pen-testing and vulnerability discovery via static and dynamic application analysis. MobSF also has built-in REST APIs to provide an integrated experience into your development pipeline. ModSF is ultimately a vulnerability scanner for mobile applications.

  • Best Used For Enterprise or individual mobile application vulnerability pentesting.
  • Supported Platforms: Android, iOS, and Windows

17. Linux-Exploit-Suggester

Linux-Exploit-Suggester is an excellent tool for on the fly security testing of Linux systems without dealing with the overhead of a beefy vulnerability scanner. LES was created for system admins to get a quick sense of the. Based on its lightweight compatibility, LES is a great vulnerability catalog for pentesters looking to get a quick overview of a systems configuration, without creating too much noise via resource consumption.

  • Best Used For: Pentesters to quickly find a potential host that is vulnerable to start crafting an exploit without drawing too much attention to themselves.
  • Supported Platforms: Linux

18. Apktool

Apktool is for those Pentesters or security researchers that are attempting to reverse engineer malware to determine a way to better protect against it. Apktool only supports 3rd party, android applications. Apktool’s feature set includes being able to disassemble and reassemble to original form, debugging and help to automate repetitive tasks.

  • Best Used For Pentesters looking to craft a custom payload specific to a company’s android application or security researchers looking to find a fix for a known android vulnerability.
  • Supported Platforms: Android

19. Resource Hacker

Resource Hacker is a windows specific file editor that allows anyone to decompile a windows file and recompile it at a later time. The great thing about this reverse engineering tool is that it comes with a GUI interface that makes it easy for novice pentesters to learn and use.

  • Best Used For Novice file editor for windows files.
  • Supported Platforms: Windows

20. IDA

IDA is the Kleenex of disassembler tools as it is widely supported and used in commercial validation testing. IDA is interactive as a disassembler as well as a debugger, thus providing you with a whole solution as a professional. Best of all, it supports all major OS system types.

  • Best Used For Professional level malware disassembly.
  • Supported Platforms: Windows, Linux, macOS

21. Radare

Lastly, we have Radare, which is one of the most widely accepted and versatile disassembly tools available. Some of its features include multiple OS and mobile OS support, file system forensics, data carving capabilities, and visualizing data structures.

  • Best Used For: experienced pentesters who have a vast knowledge of multiple platforms.
  • Supported Platforms: Linux, *BSD, Windows, OSX, Android, iOS, Solaris and Haiku

22. Email or Chat Software

If it is available to you, the best way to send out compromised data is through the account you compromised in the first place. Most of the time you will have the ability to use the user’s account to send ether emails out or you could try to use the installed enterprise chat solution in place to accomplish the same outcome. For pentesters trying to remain anonymous, this is a great technique as long as you limit the size of the emails so that it isn’t detected as an anomaly by any DLP solution that might be watching.

  • Best Used For: Pentesters trying to remain anonymous and test the detection capabilities of any DLP solutions in place.
  • Supported Platforms: Supported on most OS

23. Srm

Srm stands for Secure remove, and it takes the hassle out, ensuring a file is entirely removed from a system. As a pentester, Srm is great for removing temporary files created while accessing a system, If your intent is to cover up your tracks, Srm is the tool required to remove any rootkit files that may have been used during the exploit process. Srm removes and rewrites over the data location to ensure all traces of the data are thoroughly wiped from the system. Best of all, it is a command-line program that is quick to set up and use.

  • Best Used For: permanent file deletion, not even forensics software can recover.
  • Supported Platforms: Unix and Windows

24. Catfish

Catfish is a pentesting tool that is used by many to quickly search for specific files that tend to contain sensitive data or can provide them with additional access (like a password file). Catfish allows the end-user to explore a system for any files containing a particular string within its name. It is simple but highly effective at what it does.

  • Best Used For Quick file name searching on a machine.
  • Supported Platforms: Linux based OS

Performing penetration tests is an essential part of verifying that systems are secure. Using the right penetration testing tools saves time and helps to improve your overall security posture.