Skip to content
This repository was archived by the owner on Apr 3, 2025. It is now read-only.

Commit cf9f707

Browse files
authored
Merge pull request #31 from surface-security/upstream-to-pr/rev-344c54a
Upstream revision 344c54a
2 parents 8908643 + d09ec97 commit cf9f707

20 files changed

Lines changed: 368 additions & 565 deletions

File tree

.github/workflows/build-test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: 🔨 Build Test
22

33
on:
44
pull_request:
5+
paths:
6+
- '**.go'
7+
- '**.mod'
58
workflow_dispatch:
69

710
jobs:

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ name: 🚨 CodeQL Analysis
33
on:
44
workflow_dispatch:
55
pull_request:
6+
paths:
7+
- '**.go'
68
branches:
79
- dev
810

911
jobs:
1012
analyze:
1113
name: Analyze
12-
runs-on: ubuntu-latest
14+
runs-on: ubuntu-latest-16-cores
1315
permissions:
1416
actions: read
1517
contents: read

.github/workflows/dockerhub-push.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ on:
99

1010
jobs:
1111
docker:
12-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-latest-16-cores
1313
steps:
1414
- name: Checkout
1515
uses: actions/checkout@v3
1616

1717
- name: Get Github tag
1818
id: meta
1919
run: |
20-
echo "::set-output name=tag::$(curl --silent "https://api.github.com/repos/projectdiscovery/httpx/releases/latest" | jq -r .tag_name)"
20+
curl --silent "https://api.github.com/repos/projectdiscovery/httpx/releases/latest" | jq -r .tag_name | xargs -I {} echo TAG={} >> $GITHUB_OUTPUT
2121
2222
- name: Set up QEMU
2323
uses: docker/setup-qemu-action@v2
@@ -32,9 +32,9 @@ jobs:
3232
password: ${{ secrets.DOCKER_TOKEN }}
3333

3434
- name: Build and push
35-
uses: docker/build-push-action@v3
35+
uses: docker/build-push-action@v4
3636
with:
3737
context: .
3838
platforms: linux/amd64,linux/arm64,linux/arm
3939
push: true
40-
tags: projectdiscovery/httpx:latest,projectdiscovery/httpx:${{ steps.meta.outputs.tag }}
40+
tags: projectdiscovery/httpx:latest,projectdiscovery/httpx:${{ steps.meta.outputs.TAG }}

.github/workflows/functional-test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: 🧪 Functional Test
22

33
on:
44
pull_request:
5+
paths:
6+
- '**.go'
7+
- '**.mod'
58
workflow_dispatch:
69

710
jobs:

.github/workflows/lint-test.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: 🙏🏻 Lint Test
22

33
on:
44
pull_request:
5+
paths:
6+
- '**.go'
7+
- '**.mod'
58
workflow_dispatch:
69

710
jobs:
@@ -16,7 +19,7 @@ jobs:
1619
- name: Checkout code
1720
uses: actions/checkout@v3
1821
- name: Run golangci-lint
19-
uses: golangci/golangci-lint-action@v3.3.1
22+
uses: golangci/golangci-lint-action@v3.4.0
2023
with:
2124
version: latest
2225
args: --timeout 5m

.github/workflows/sonarcloud.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

Dockerfile

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
FROM golang:1.19.4-alpine AS builder
2-
ARG BUILD_SOURCE_TAG=latest
1+
# Base
2+
FROM golang:1.20.2-alpine AS builder
3+
34
RUN apk add --no-cache git build-base gcc musl-dev
4-
RUN go install -v github.com/projectdiscovery/httpx/cmd/httpx@${BUILD_SOURCE_TAG}
5+
WORKDIR /app
6+
COPY . /app
7+
RUN go mod download
8+
RUN go build ./cmd/httpx
59

6-
FROM alpine:3.17.0
10+
FROM alpine:3.17.2
711
RUN apk -U upgrade --no-cache \
812
&& apk add --no-cache bind-tools ca-certificates
9-
COPY --from=builder /go/bin/httpx /usr/local/bin/
13+
COPY --from=builder /app/httpx /usr/local/bin/
1014

11-
ENTRYPOINT ["httpx"]
15+
ENTRYPOINT ["httpx"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ MATCHERS:
115115
-mlc, -match-line-count string match response body with specified line count (-mlc 423,532)
116116
-mwc, -match-word-count string match response body with specified word count (-mwc 43,55)
117117
-mfc, -match-favicon string[] match response with specified favicon hash (-mfc 1494302000)
118-
-ms, -match-string string match response with specified string (-ms admin)
118+
-ms, -match-string string match response with specified string (case insensitive) (-ms admin)
119119
-mr, -match-regex string match response with specified regex (-mr admin)
120120
-mcdn, -match-cdn string[] match host with specified cdn provider (oracle, google, azure, cloudflare, cloudfront, fastly, incapsula, leaseweb, akamai, sucuri)
121121
-mrt, -match-response-time string match response with specified response time in seconds (-mrt '< 1')

cmd/functional-test/testcases.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ scanme.sh {{binary}} -silent -body 'a=b'
1616
scanme.sh {{binary}} -silent -exclude-cdn
1717
scanme.sh {{binary}} -silent -ports https:443
1818
scanme.sh {{binary}} -silent -ztls
19-
https://scanme.sh?a=1*1 {{binary}} -silent
19+
https://scanme.sh?a=1*1 {{binary}} -silent
20+
https://scanme.sh:443 {{binary}} -asn

cmd/httpx/httpx.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88

99
"github.com/projectdiscovery/gologger"
1010
"github.com/projectdiscovery/httpx/runner"
11+
errorutil "github.com/projectdiscovery/utils/errors"
1112
)
1213

1314
func main() {
@@ -58,3 +59,9 @@ func main() {
5859
httpxRunner.RunEnumeration()
5960
httpxRunner.Close()
6061
}
62+
63+
func init() {
64+
if os.Getenv("DEBUG") != "" {
65+
errorutil.ShowStackTrace = true
66+
}
67+
}

0 commit comments

Comments
 (0)