Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.1.1 release preparation #347

Merged
merged 71 commits into from
Aug 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
3e231ad
chore(deps): bump github.com/microcosm-cc/bluemonday
dependabot[bot] Jul 12, 2021
777579f
Merge pull request #318 from projectdiscovery/dependabot/go_modules/d…
ehsandeep Jul 12, 2021
a1ec734
chore(deps): bump golang from 1.14-alpine to 1.16.6-alpine
dependabot[bot] Jul 19, 2021
7d03fe8
Merge pull request #322 from projectdiscovery/dependabot/docker/dev/g…
ehsandeep Jul 19, 2021
63deca7
json output enhancement
LuitelSamikshya Jul 19, 2021
6d584e8
considering other flags when status flag is true
LuitelSamikshya Jul 23, 2021
9bb4f50
lint error fix
LuitelSamikshya Jul 23, 2021
67358d9
additional changes to status flag
LuitelSamikshya Jul 23, 2021
902791d
misc updates
ehsandeep Jul 23, 2021
e6a5006
version update
ehsandeep Jul 23, 2021
d01d046
Automation friendly
ehsandeep Jul 23, 2021
b9a1822
Merge pull request #323 from LuitelSamikshya/master
ehsandeep Jul 23, 2021
fca73b3
Small logic refactor
Mzack9999 Jul 24, 2021
c4faef8
remove deprecated golinter
Mzack9999 Jul 24, 2021
68757a3
rm test file
ehsandeep Jul 24, 2021
71be8fc
Merge pull request #326 from projectdiscovery/bugfix-misc
ehsandeep Jul 24, 2021
2257320
Updating deps
Mzack9999 Jul 24, 2021
7f4cbf3
Updating fastdialer
Mzack9999 Jul 24, 2021
8cf22a5
again updating fastdialer
Mzack9999 Jul 24, 2021
7ce3a40
Merge pull request #327 from projectdiscovery/bugfix-misc
Mzack9999 Jul 24, 2021
d42679f
Issue#315-rate-limit-support
LuitelSamikshya Jul 26, 2021
b78aee4
fixed linting errors
LuitelSamikshya Jul 26, 2021
e4fbceb
fixing lint errors
Mzack9999 Jul 27, 2021
ac07467
Merge branch 'dev' into issue-315-add-rate-limit
Mzack9999 Jul 27, 2021
7256eac
fixing deps after dev merge
Mzack9999 Jul 27, 2021
9c61145
ratelimiter call changes
LuitelSamikshya Jul 30, 2021
fc85527
Merge branch 'issue-315-add-rate-limit' of https://github.com/project…
LuitelSamikshya Jul 30, 2021
92f37a1
removed commented lines for rate-limiter
LuitelSamikshya Jul 30, 2021
a74c40c
Merge pull request #330 from projectdiscovery/issue-315-add-rate-limit
Mzack9999 Jul 30, 2021
3d08c8c
Sort technologies before output to make diffing results easier
jonare Aug 2, 2021
0b242cb
issue 328 exclude-cdn
LuitelSamikshya Aug 3, 2021
cbcf6d6
issue 328 exclude-cdn
LuitelSamikshya Aug 3, 2021
1252d74
issue 328 exclude-cdn
LuitelSamikshya Aug 3, 2021
03ae3d8
some changes
Mzack9999 Aug 3, 2021
3de0d5a
Merge pull request #336 from jonare/master
ehsandeep Aug 4, 2021
12c4b62
Adding support for non-ascii characters in path for unsafe requests
Mzack9999 Aug 5, 2021
07771d3
fixing double forward slash error
Mzack9999 Aug 5, 2021
2b0913b
Moving tls parsing code to shared library (used also by fastdialer)
Mzack9999 Aug 6, 2021
3181440
Merge pull request #340 from projectdiscovery/331-bugfix-non-ascii-ch…
ehsandeep Aug 6, 2021
a5b1d99
Fixing total target calculation
Mzack9999 Aug 6, 2021
1357a42
Fixing approx total requests calculation
Mzack9999 Aug 6, 2021
4b92bcf
Improving RPS calculation
Mzack9999 Aug 6, 2021
969133e
variable names refactor + more detailed output
Mzack9999 Aug 6, 2021
b7afe80
Adding stop-resume support
Mzack9999 Aug 6, 2021
de623bf
issue-325-max-response-body-size
LuitelSamikshya Aug 6, 2021
db8b729
Improving response max size cli options
Mzack9999 Aug 7, 2021
1f76441
updating cli flags
Mzack9999 Aug 7, 2021
d9ccc52
flag bugfix
Mzack9999 Aug 7, 2021
89505f6
Merge pull request #346 from projectdiscovery/issue-325-max-response-…
Mzack9999 Aug 7, 2021
129a78f
Merge branch 'dev' into maintenance-tls-code-as-shared-lib
Mzack9999 Aug 7, 2021
904bf15
reapplying "cleanup"
Mzack9999 Aug 3, 2021
13fa589
manual merging dev
Mzack9999 Aug 7, 2021
93e3c41
Merge pull request #344 from projectdiscovery/342-bugfix-stats-calcul…
Mzack9999 Aug 7, 2021
60df9c8
Merge pull request #343 from projectdiscovery/maintenance-tls-code-as…
Mzack9999 Aug 7, 2021
949dab6
Merge pull request #338 from projectdiscovery/issue-328-exclude-cdn
Mzack9999 Aug 7, 2021
5997cfb
merging dev
Mzack9999 Aug 7, 2021
200d5c9
adding missing check
Mzack9999 Aug 7, 2021
bce3462
Changing random UA as default
Mzack9999 Aug 7, 2021
a657905
Merge pull request #345 from projectdiscovery/219-feature-stop-resume
Mzack9999 Aug 7, 2021
0e14975
uniform release format
ehsandeep Aug 7, 2021
89bd3e6
go mod update
ehsandeep Aug 8, 2021
d114151
chore(deps): bump golang from 1.16.6-alpine to 1.16.7-alpine
dependabot[bot] Aug 9, 2021
60551cb
chore(deps): bump github.com/projectdiscovery/wappalyzergo
dependabot[bot] Aug 9, 2021
c418f56
Merge pull request #350 from projectdiscovery/dependabot/go_modules/d…
ehsandeep Aug 9, 2021
8309531
Merge pull request #349 from projectdiscovery/dependabot/docker/dev/g…
ehsandeep Aug 9, 2021
d197686
Small change in output stats
Mzack9999 Aug 9, 2021
f2428ef
Merge pull request #351 from projectdiscovery/maintenance-stats-count
ehsandeep Aug 9, 2021
98ee41e
Fixing error in logic
Mzack9999 Aug 9, 2021
ee6bc27
Merge pull request #352 from projectdiscovery/maintenance-stats-count
ehsandeep Aug 9, 2021
1f9fd09
misc changes
ehsandeep Aug 9, 2021
07a14c7
Merge branch 'dev' of https://github.com/projectdiscovery/httpx into dev
ehsandeep Aug 9, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 0 additions & 110 deletions .golangci.yml

This file was deleted.

50 changes: 31 additions & 19 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,33 @@
before:
hooks:
- go mod tidy

builds:
- binary: httpx
main: cmd/httpx/httpx.go
goos:
- linux
- windows
- darwin
goarch:
- amd64
- 386
- arm
- arm64

- env:
- CGO_ENABLED=0
goos:
- windows
- linux
- darwin
goarch:
- amd64
- 386
- arm
- arm64

ignore:
- goos: darwin
goarch: '386'
- goos: windows
goarch: 'arm'

binary: '{{ .ProjectName }}'
main: cmd/httpx/main.go

archives:
- id: tgz
format: tar.gz
replacements:
darwin: macOS
format_overrides:
- goos: windows
format: zip
- format: zip
replacements:
darwin: macOS

checksum:
algorithm: sha256
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.14-alpine AS builder
FROM golang:1.16.7-alpine AS builder
RUN apk add --no-cache git
RUN GO111MODULE=on go get -v github.com/projectdiscovery/httpx/cmd/httpx

Expand Down
60 changes: 41 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,12 @@ This will display help for the tool. Here are all the switches it supports.
<summary> 👉 httpx help menu 👈</summary>

```
Usage of ./httpx:

-H value
Custom Header
-allow value
Allowlist ip/cidr
-body string
Request Body
Content to send in body with HTTP request
-cdn
Check if domain's ip belongs to known CDN (akamai, cloudflare, ..)
-cname
Expand All @@ -99,6 +97,8 @@ Usage of ./httpx:
Debug mode
-deny value
Denylist ip/cidr
-exclude-cdn
Skip full port scans for CDNs (only checks for 80,443)
-extract-regex string
Extract Regex
-fc string
Expand Down Expand Up @@ -133,18 +133,18 @@ Usage of ./httpx:
Match Regex
-match-string string
Match string
-max-response-body-size int
Maximum response body size (default 2147483647)
-mc string
Match status code
-method
Output method
Display request method
-ml string
Match content length
-no-color
No Color
-no-fallback
If HTTPS on port 443 is successful on default configuration, probes also port 80 for HTTP
-no-fallback-scheme
The tool will respect and attempt the scheme specified in the url (if HTTPS is specified no HTTP is attempted)
-o string
File to write output to (optional)
-path string
Expand All @@ -155,14 +155,24 @@ Usage of ./httpx:
HTTP1.1 Pipeline
-ports value
ports range (nmap syntax: eg 1,2-10,11)
-probe
Display probe status
-random-agent
Use randomly selected HTTP User-Agent header value
Use randomly selected HTTP User-Agent header value (default true)
-rate-limit int
Maximum requests to send per second (default 150)
-request string
File containing raw request
-response-in-json
Show Raw HTTP Response In Output (-json only) (deprecated)
-response-size-to-read int
Max response size to read in bytes (default - unlimited)
-response-size-to-save int
Max response size to save in bytes (default - unlimited)
-response-time
Output the response time
-resume
Resume scan using resume.cfg
-retries int
Number of retries
-silent
Expand Down Expand Up @@ -241,19 +251,31 @@ https://support.hackerone.com

### Running httpx with file input

This will run the tool against all the hosts and subdomains in `hosts.txt` and returns URLs running HTTP webserver.
This will run the tool with the `probe` flag against all of the hosts in **hosts.txt** and return URLs with probed status.

```sh
▶ httpx -l hosts.txt -silent

https://docs.hackerone.com
https://mta-sts.hackerone.com
https://mta-sts.managed.hackerone.com
https://mta-sts.forwarding.hackerone.com
https://www.hackerone.com
https://resources.hackerone.com
https://api.hackerone.com
https://support.hackerone.com
▶ httpx -l hosts.txt -silent -probe

http://ns.hackerone.com [FAILED]
https://docs.hackerone.com [SUCCESS]
https://mta-sts.hackerone.com [SUCCESS]
https://mta-sts.managed.hackerone.com [SUCCESS]
http://email.hackerone.com [FAILED]
https://mta-sts.forwarding.hackerone.com [SUCCESS]
http://links.hackerone.com [FAILED]
https://api.hackerone.com [SUCCESS]
https://www.hackerone.com [SUCCESS]
http://events.hackerone.com [FAILED]
https://support.hackerone.com [SUCCESS]
https://gslink.hackerone.com [SUCCESS]
http://o1.email.hackerone.com [FAILED]
http://info.hackerone.com [FAILED]
https://resources.hackerone.com [SUCCESS]
http://o2.email.hackerone.com [FAILED]
http://o3.email.hackerone.com [FAILED]
http://go.hackerone.com [FAILED]
http://a.ns.hackerone.com [FAILED]
http://b.ns.hackerone.com [FAILED]
```

### Running httpx with CIDR input
Expand Down Expand Up @@ -286,7 +308,7 @@ https://173.0.84.34


```sh
subfinder -d hackerone.com | httpx -title -tech-detect -status-code -follow-redirects
subfinder -d hackerone.com | httpx -title -tech-detect -status-code

__ __ __ _ __
/ /_ / /_/ /_____ | |/ /
Expand Down
28 changes: 25 additions & 3 deletions cmd/httpx/httpx.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package main

import (
"os"
"os/signal"

"github.com/projectdiscovery/gologger"
"github.com/projectdiscovery/httpx/runner"
)
Expand All @@ -9,10 +12,29 @@ func main() {
// Parse the command line flags and read config files
options := runner.ParseOptions()

r, err := runner.New(options)
httpxRunner, err := runner.New(options)
if err != nil {
gologger.Fatal().Msgf("Could not create runner: %s\n", err)
}
r.RunEnumeration()
r.Close()

// Setup graceful exits
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt)
go func() {
for range c {
gologger.Info().Msgf("CTRL+C pressed: Exiting\n")
httpxRunner.Close()
if options.ShouldSaveResume() {
gologger.Info().Msgf("Creating resume file: %s\n", runner.DefaultResumeFile)
err := httpxRunner.SaveResumeConfig()
if err != nil {
gologger.Error().Msgf("Couldn't create resume file: %s\n", err)
}
}
os.Exit(1)
}
}()

httpxRunner.RunEnumeration()
httpxRunner.Close()
}
5 changes: 3 additions & 2 deletions common/httpx/httpx.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package httpx
import (
"crypto/tls"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
Expand Down Expand Up @@ -112,7 +113,7 @@ func New(options *Options) (*HTTPX, error) {
httpx.htmlPolicy = bluemonday.NewPolicy()
httpx.CustomHeaders = httpx.Options.CustomHeaders
httpx.RequestOverride = &options.RequestOverride
if options.CdnCheck {
if options.CdnCheck || options.ExcludeCdn {
httpx.cdn, err = cdncheck.NewWithCache()
if err != nil {
return nil, fmt.Errorf("could not create cdn check: %s", err)
Expand Down Expand Up @@ -156,7 +157,7 @@ get_response:
// websockets don't have a readable body
if httpresp.StatusCode != http.StatusSwitchingProtocols {
var err error
respbody, err = ioutil.ReadAll(httpresp.Body)
respbody, err = ioutil.ReadAll(io.LimitReader(httpresp.Body, h.Options.MaxResponseBodySizeToRead))
if err != nil {
return nil, err
}
Expand Down
Loading