HackerOne Gateway’s self-managed Cloudflared configuration empowers customers to enable penetration testing teams to assess internal networks and their targets thoroughly. By using a machine designed as an endpoint for the tunnel, ethical hackers and pentesters can easily access internal assets through the HackerOne Gateway VPN.
Prerequisites
HackerOne Customers
An internal network not “air-gapped” (with access to the internet)
A machine acting as the tunnel’s endpoint, located in the internal network, where the Cloudflared solution will be installed and configured
Additional Requirements (Handled by HackerOne Staff)
An active HackerOne program, most commonly a HackerOne Pentest.*
Gateway V2 enabled for the program.*
Cloudflared internal testing enabled.*
*Included for visibility only. HackerOne customers and testing team members do not need to take any action.
Machine Minimum Requirements
To ensure optimal performance and security when using the Cloudflared tunnel for internal network testing, the endpoint machine should meet the following minimum requirements:
Operating Systems or Platform:
Windows (64-bit, 32-bit)
MacOS
Linux (amd64/x86–64, x86 (32 Bit), ARM (32 Bit), ARM64)
Docker
RAM: 8 GB or more.
CPU: 4 GHz quad-core or higher recommended for better performance
Network:
Stable and high-speed internet connection
Network interface supporting at least 1 Gbps (preferably 10 Gbps for high-throughput environments)
Additional Software:
OpenSSH or any other secure shell service for remote access (if applicable)
Penetration Testers
The WARP client must be installed on your local machine.
Instructions for HackerOne Customers
Authenticate Cloudflared and Create the Tunnel
After your machine is set up and running, you can proceed with installing Cloudflared, authenticating it, and creating the tunnel.
In the HackerOne platform, go to Program > Gateway > Internal testing, as shown in the image below.
Note: Ensure your HackerOne Technical Engagement manager enables the Cloudflared internal testing prerequisite. See the Prerequisites section above.Create the tunnel
The page will show instructions for the preferred environment
Paste and run the command found at the bottom of the page into your machine. Assuming your machine is based on Debian:
curl -L --output cloudflared.deb https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb &&
sudo dpkg -i cloudflared.deb &&
sudo cloudflared service install <REDACTED TOKEN>You should find the following output
2024-07-23T13:02:31Z INF Using Systemd
2024-07-23T13:02:32Z INF Linux service for cloudflared installed successfullyThe tunnel configuration and related Routes will appear to you as the following:
Make sure the Cloudflared status is: HEALTHY
Verify Connection
Verify the tunnel connection is correctly set up with your penetration testing team after they have completed all the steps. If you face issues with the connection, please contact your HackerOne Technical Engagement Manager or Solutions Architect.
The tunnel statuses are described here: Cloudflared tunnel status.
Additional Optional Setup
If you need to conduct tests on an internal network without any current assets, you can easily set up a test environment by hosting a simple web page:
Assuming the internal IP associated with the machine endpoint is 192.168.100.2, create a new machine and assign the associated internal IP to 192.168.100.3.
On the new machine, install a web server:
sudo apt update && sudo apt upgrade
sudo apt install apache2
sudo service apache2 start
sudo service apache2 statusCustomize the webpage:
cd /var/www/html
sudo rm index.html
sudo nano index.htmlCopy and paste the following HTML:
<html>
<head>
<meta charset="utf-8">
<title>Internal testing</title>
</head>
<body>
<div style="text-align: center; padding: 40px;">
<h1>Internat testing</h1>
<p>This is a test</p>
</div>
</body>
</html>Restart the server:
sudo service apache2 restart
The tester can now test the access using curl
Instructions for Pentesters
After setting up the Self-Managed Cloudflared Configuration, the testing team should follow these steps to gain and confirm access before starting the tests.
Get the Cloudflare team name domain for the HackerOne program by going to Profile > User Settings > Gateway.
Log in to WARP as described in Configure Client for a Specific Program and turn the WARP client on.
If the machine tunnel endpoint is correctly running, testers can now reach the in-scope assets
To make a test:
Assuming the Internal IP associated with the machine endpoint is 192.168.100.2
Assuming an asset is located on a machine with internal IP 192.168.100.3
Don’t rely on ping, as the ICMP protocol on WARP is not reliable yet
Use nmap instead:
sudo nmap 192.168.100.3
If provided by the customer, testers can connect via SSH:
ssh <user>@192.168.100.2