Skip to content

Commit

Permalink
🔨 fix 400 bug
Browse files Browse the repository at this point in the history
🎉 update uncover version
  • Loading branch information
wjlin0 committed Aug 4, 2024
1 parent dc5c2ab commit 1aecfe9
Show file tree
Hide file tree
Showing 12 changed files with 74 additions and 190 deletions.
61 changes: 8 additions & 53 deletions .github/workflows/release-binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,67 +3,22 @@ name: 🎉 Release Binary
on:
push:
tags:
- v*
- '*'
workflow_dispatch:

jobs:
build-mac:
runs-on: macos-latest
steps:
- name: Code checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release -f .goreleaser/mac.yml --rm-dist
workdir: .
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-linux:
release:
runs-on: ubuntu-latest
steps:
- name: Code checkout
uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release -f .goreleaser/linux.yml --rm-dist
workdir: .
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

build-windows:
runs-on: windows-latest
steps:
- name: Code checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
uses: projectdiscovery/actions/setup/go@v1

- uses: projectdiscovery/actions/goreleaser@v1
with:
version: latest
args: release -f .goreleaser/windows.yml --rm-dist
workdir: .
release: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
60 changes: 6 additions & 54 deletions .github/workflows/release-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,67 +5,19 @@ on:
paths:
- '**.go'
- '**.mod'
- '**.yml'
workflow_dispatch:

jobs:
release-test-mac:
runs-on: macos-latest
release-test:
runs-on: ubuntu-latest-16-cores
steps:
- name: "Check out code"
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x

- name: release test
uses: goreleaser/goreleaser-action@v4
with:
args: "release --clean --snapshot -f .goreleaser/mac.yml"
version: latest
workdir: .

release-test-linux:
runs-on: ubuntu-latest
steps:
- name: "Check out code"
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x

uses: projectdiscovery/actions/setup/go@v1

- name: release test
uses: goreleaser/goreleaser-action@v4
with:
args: "release --clean --snapshot -f .goreleaser/linux.yml"
version: latest
workdir: .

release-test-windows:
runs-on: windows-latest
steps:
- name: "Check out code"
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x

- name: release test
uses: goreleaser/goreleaser-action@v4
with:
args: "release --clean --snapshot -f .goreleaser/windows.yml"
version: latest
workdir: .
- name: Release snapshot
uses: projectdiscovery/actions/goreleaser@v1
40 changes: 40 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
before:
hooks:
- go mod tidy

builds:
- main: cmd/pathScan/pathScan.go
binary: pathScan
env:
- CGO_ENABLED=0

goos: [windows,linux,darwin]
goarch: [amd64,386,arm,arm64]
ignore:
- goos: darwin
goarch: 386
- goos: windows
goarch: arm
- goos: windows
goarch: arm64

flags:
- -trimpath

#- main: cmd/tmc/main.go
# binary: tmc
# id: annotate
#
# env:
# - CGO_ENABLED=0
#
# goos: [linux]
# goarch: [amd64]

archives:
- format: zip
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ if eq .Os "darwin" }}macOS{{ else }}{{ .Os }}{{ end }}_{{ .Arch }}'

checksum:
name_template: "{{ .ProjectName }}-linux-checksums.txt"

25 changes: 0 additions & 25 deletions .goreleaser/linux.yml

This file was deleted.

24 changes: 0 additions & 24 deletions .goreleaser/mac.yml

This file was deleted.

23 changes: 0 additions & 23 deletions .goreleaser/windows.yml

This file was deleted.

12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ go install -v github.com/wjlin0/pathScan/v2/cmd/pathScan@latest
```
下载准备运行的[二进制文件](https://github.com/wjlin0/pathScan/releases/latest)

- [macOS-arm64](https://github.com/wjlin0/pathScan/releases/download/v2.1.1/pathScan_2.1.1_macOS_arm64.zip)
- [macOS-arm64](https://github.com/wjlin0/pathScan/releases/download/v2.1.2/pathScan_2.1.2_macOS_arm64.zip)

- [macOS-amd64](https://github.com/wjlin0/pathScan/releases/download/v2.1.1/pathScan_2.1.1_macOS_amd64.zip)
- [macOS-amd64](https://github.com/wjlin0/pathScan/releases/download/v2.1.2/pathScan_2.1.2_macOS_amd64.zip)

- [linux-amd64](https://github.com/wjlin0/pathScan/releases/download/v2.1.1/pathScan_2.1.1_linux_amd64.zip)
- [linux-amd64](https://github.com/wjlin0/pathScan/releases/download/v2.1.2/pathScan_2.1.2_linux_amd64.zip)

- [windows-amd64](https://github.com/wjlin0/pathScan/releases/download/v2.1.1/pathScan_2.1.1_windows_amd64.zip)
- [windows-amd64](https://github.com/wjlin0/pathScan/releases/download/v2.1.2/pathScan_2.1.2_windows_amd64.zip)

- [windows-386](https://github.com/wjlin0/pathScan/releases/download/v2.1.1/pathScan_2.1.1_windows_386.zip)
- [windows-386](https://github.com/wjlin0/pathScan/releases/download/v2.1.2/pathScan_2.1.2_windows_386.zip)


# 用法
Expand All @@ -44,7 +44,7 @@ go install -v github.com/wjlin0/pathScan/v2/cmd/pathScan@latest
pathScan -h
```
```yaml
pathScan 2.1.1 Go 扫描、信息收集工具
pathScan 2.1.2 Go 扫描、信息收集工具

Usage:
pathScan [flags]
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ require (
github.com/projectdiscovery/retryablehttp-go v1.0.57
github.com/projectdiscovery/utils v0.0.90
github.com/remeh/sizedwaitgroup v1.0.0
github.com/wjlin0/uncover v1.1.3
github.com/wjlin0/uncover v1.1.4
github.com/wjlin0/utils v0.0.12
golang.org/x/net v0.24.0
golang.org/x/text v0.14.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,8 @@ github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyC
github.com/weppos/publicsuffix-go v0.13.0/go.mod h1:z3LCPQ38eedDQSwmsSRW4Y7t2L8Ln16JPQ02lHAdn5k=
github.com/weppos/publicsuffix-go v0.30.2-0.20230730094716-a20f9abcc222 h1:h2JizvZl9aIj6za9S5AyrkU+OzIS4CetQthH/ejO+lg=
github.com/weppos/publicsuffix-go v0.30.2-0.20230730094716-a20f9abcc222/go.mod h1:s41lQh6dIsDWIC1OWh7ChWJXLH0zkJ9KHZVqA7vHyuQ=
github.com/wjlin0/uncover v1.1.3 h1:hnZxcsXIlcCebETHWm8+H6t7mhw++M6WpHdZA8uYHGs=
github.com/wjlin0/uncover v1.1.3/go.mod h1:qG888gslDy7ESvpRblpEzzxg2FmWwgp3QX5ReKhLw7Q=
github.com/wjlin0/uncover v1.1.4 h1:mnTaGg/Ojk/M2AWyqgZnh1ltnvNGRhkZRHUhn1XxjJs=
github.com/wjlin0/uncover v1.1.4/go.mod h1:qG888gslDy7ESvpRblpEzzxg2FmWwgp3QX5ReKhLw7Q=
github.com/wjlin0/utils v0.0.12 h1:8jj0fy+hAuAnzKyU1yjTKwZjiZobFmTcptp6Oz8vHzg=
github.com/wjlin0/utils v0.0.12/go.mod h1:yclxie7kGzDJgNpRzFy5HSpiSmbGaRt2P5ngvz6tdjU=
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 h1:nIPpBwaJSVYIxUFsDv3M8ofmx9yWTog9BfvIu0q41lo=
Expand Down
2 changes: 1 addition & 1 deletion pkg/runner/banner.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const (
/ .__/\_,_/ \__//_//_//___/ \__/ \_,_//_//_/
/_/
`
Version = `2.1.1`
Version = `2.1.2`
userName = "wjlin0"
pathScanMatchRepoName = "pathScan-match"
pathScanRepoName = "pathScan"
Expand Down
2 changes: 1 addition & 1 deletion pkg/runner/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func ParserOptions() *types.Options {
set.BoolVarP(&options.Uncover, "uncover", "uc", false, "启用打开搜索引擎"),
set.StringSliceVarP(&options.UncoverQuery, "uncover-query", "uq", nil, "搜索查询", goflags.StringSliceOptions),
set.StringSliceVarP(&options.UncoverEngine, "uncover-engine", "ue", nil, fmt.Sprintf("支持的引擎 %s (default fofa)", uncover.UncoverAgents()), goflags.NormalizedStringSliceOptions),
set.StringVarP(&options.UncoverField, "uncover-field", "uf", "host", "引擎返回字段 (ip,port,host)"),
set.StringVarP(&options.UncoverField, "uncover-field", "uf", "host:port", "引擎返回字段 (ip,port,host)"),
set.IntVarP(&options.UncoverLimit, "uncover-limit", "ul", defaultUncoverLimit, "发现要返回的结果"),
set.StringVarP(&options.UncoverOutput, "uncover-output", "uo", "", "搜索引擎查询结果保存 支持csv格式输出"),
)
Expand Down
9 changes: 9 additions & 0 deletions pkg/scanner/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,15 @@ retry:
if err != nil {
return nil, output.ResultEvent{}, err
}
if event.Status == 400 && event.Title == "400 The plain HTTP request was sent to HTTPS port]" {
retried = true
if scheme == input.HTTP {
scheme = input.HTTPS
} else {
scheme = input.HTTP
}
goto retry
}
return resp, event, nil
}

Expand Down

0 comments on commit 1aecfe9

Please sign in to comment.