httpx-featured-image

Mastering HTTPX: Installation, Usage, and Best Practices

Table of Contents

HTTPX is a fast and flexible HTTP toolkit created by Project Discovery. It allows security professionals to probe HTTP-based targets quickly and extract useful information like status codes, titles, redirects, web technologies, and much more.

In penetration testing, bug bounty hunting, and reconnaissance, speed and breadth matter. HTTPX makes it easy to automate web asset discovery, technology fingerprinting, and vulnerability mapping without heavy scripting. It’s built for high performance and deep inspection.


Why Use HTTPX?

  • Asynchronous Capabilities: This tool natively supports async/await syntax, enabling thousands of concurrent HTTP requests with minimal resource consumption.
  • HTTP/2 Support: Many modern APIs leverage HTTP/2 for better performance. This tool makes it easy to take advantage of that.
  • Better Timeout Control: Fine-grained timeout configurations help avoid hanging network calls.
  • Pluggable Transports: Customize your transport layer if you need specialized behaviors.
  • Connection Pooling and Keep-Alive: Optimized handling of multiple requests efficiently.
  • Drop-in Replacement for Requests: For many simple use cases, switching from requests to httpx requires minimal code changes.

Differences between HTTPX, Curl, Wget, Nmap

  • Curl/Wget: Good for fetching web pages or files. Not optimized for mass URL probing.
  • Nmap: Primarily a network scanner, not focused on detailed web probing.
  • HTTPX: Explicitly designed for HTTP probing at scale with detailed outputs (technologies, titles, redirects, etc.).

When to Use HTTPX?

When you need to scan thousands of subdomains, discover web apps quickly, detect tech stacks, or validate live targets, HTTPX is the tool to reach for.


Key Features

  • High-Performance HTTP Probing: Designed to handle thousands of targets with speed and stability.
  • Web Technology Detection: Identifies web technologies like server types, CMSs, and frameworks.
  • TLS and DNS Probing: Fetches SSL certificate information and DNS records.
  • HTTP2 and HTTP3 Support: Automatically detects and supports modern HTTP protocols.
  • Customizable Output: Supports JSON, CSV, silent output, and extensive filtering.
  • Title and Status Code Extraction: Quickly grabs web page titles, status codes, and redirection chains.
  • Silent Mode: For piping and clean automation workflows.
  • Flexible Filters and Matchers: Fine-tune output based on status codes, words, content length, and more.
  • Chainable with Other Tools: Works seamlessly with Subfinder, Naabu, and more for powerful recon automation.
  • Rate Limiting and Retries: Manage scanning intensity and handle unstable targets.

Supported Probes

ProbesDefault CheckProbesDefault Check
URLtrueIPtrue
TitletrueCNAMEtrue
Status CodetrueRaw HTTPfalse
Content LengthtrueHTTP2false
TLS CertificatetrueHTTP Pipelinefalse
CSP HeadertrueVirtual hostfalse
Line CounttrueWord Counttrue
Location HeadertrueCDNfalse
Web ServertruePathsfalse
Web SockettruePortsfalse
Response TimetrueRequest Methodtrue
Favicon HashfalseProbe Statusfalse
Body HashtrueHeader Hashtrue
Redirect chainfalseURL Schemetrue
JARM HashfalseASNfalse

Prerequisites


Install HTTPX

Installing the tool using go is really simple and straightforward.

go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest

Ensure Go is installed first. Then add $GOPATH/bin to your PATH if needed.

Or use Git via Project Discovery repositories:

git clone https://github.com/projectdiscovery/httpx.git;

cd httpx/cmd/httpx;

go build;
git-install-httpx
mv httpx /usr/local/bin/;

httpx -v
httpx-git-success

Basic Usage

  1. Checking Alive URLs
echo cyberthreatinsider.com | httpx
httpx-basic-run

By default, the tool outputs live/active URLs. A flag is not needed to check the active URL.

  1. Detecting Web Technologies
cat domains.txt | httpx -tech-detect
FlagDescription
-tech-detectIdentify the web technology used to make websites like Apache, Nginx, and WordPress.
httpx-detect-web-technology
  1. Fetching Titles, Status Codes, Redirects
cat domains.txt | httpx -title -status-code -follow-redirects
FlagDescription
-titleDisplays the title of the web page.
-status-codeDisplays the status code.
-follow-redirectsIt will follow the redirects.
-fcIt will filters the result by the status code together.
httpx-title-code-redirects
  1. Text Count
echo "cyberthreatinsider.com" | httpx -lc -wc
FlagDescription
-lcDisplays the number of lines of the web page.
-wcDisplays the number of words of the web page.
httpx-text-count

Advanced Features

  1. TLS Probing
cat domains.txt | httpx -tls-probe
FlagDescription
-tls-probeDisplays the SSL/TLS certificate information.
httpx-tls-probe
  1. HTTP2/3 Support with No FallBack

This tool supports probing with modern HTTP/2 and HTTP/3 protocols by default when servers support them. This ensures faster and more efficient connections.

If you want to strictly use HTTP/2 or HTTP/3 without falling back to HTTP/1.1 if a server does not support them, use the -no-fallback flag:

cat domains.txt | httpx -http2 -no-fallback
httpx-http2

Purpose: This ensures that only targets correctly supporting HTTP/2 or HTTP/3 are interacted with, which is useful for protocol-specific testing and performance analysis.

  1. Silent Mode and Output Customization
cat domains.txt | httpx -silent -json
FlagDescription
-silentOnly raw results, ignore extra text.
-outputWrite the output to the file. Just need location and file name.
-output-allSave the result in every format. Just need location and file name.
-jsonStore output in JSON format (ideal and structured format).
-csvStore output in CSV format.
httpx-output-json
  1. Filters and Matches
cat domains.txt | httpx -mc 200
FlagDescription
-mcMatches the response with given status code (Such as 200, 302)
-mlMatches the response with given content length.

Real-World Practical Example

  1. Find subdomains
subfinder -d example.com -silent > subs.txt

A subfinder is a tool to find subdomains of a website.

  1. Check live hosts and fetch titles
cat subs.txt | httpx -title -tech-detect -status-code -o ~/Desktop/result.txt

Quickly checks the live subdomains out of the subs.txt list.

  1. Port Scanning with Naabu
naabu -p 21,80 -list result.txt -json

Automate full-stack reconnaissance with minimal manual steps.


Common Errors and Troubleshooting

Common Installation Problems

  • Missing Go environment: Install Go first.
  • PATH issues: Ensure GOPATH/bin is in your system PATH.

Timeout/Connection Issues

  • Increase timeout with -timeout 20.
  • Adjust retries with -retries 3.

Output Errors

  • Use -json or -csv for clean structured output.
  • Validate input lists carefully (no empty lines).

Best Practices

How to Use it Safely and Efficiently

  • Always have permission or legal scope.
  • Limit scan intensity if unsure.

Rate Limiting and Respect for Targets

cat targets.txt | httpx -rate-limit 100
httpx-rate-limit

Throttle requests to avoid DoSing servers.

Automation Tips for Larger Scans

  • Pipe outputs to files.
  • Combine with xargs, jq, or Python scripts for advanced workflows.

Conclusion

HTTPX is a powerhouse for HTTP reconnaissance. It’s fast, lightweight, rich in features, and perfect for security workflows. Whether you’re doing bug bounty recon, internal audits, or mass technology mapping, HTTPX should be a permanent part of your toolkit.


Resources

  1. HTTPX – Project Discovery GitHub Page

Frequently Asked Questions (FAQs)

Share this post

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.