Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wjlin0 committed Aug 5, 2024
1 parent 7a60c52 commit 9ed9023
Show file tree
Hide file tree
Showing 20 changed files with 56 additions and 197 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*
- '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
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.

2 changes: 1 addition & 1 deletion runner/banners.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const banner = `
`

// Version is the current version of uncover
const version = `v1.1.3`
const version = `v1.1.4`

// showBanner is used to show the banner to the user
func showBanner() {
Expand Down
4 changes: 3 additions & 1 deletion sources/agent/anubis-spider/anubis.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/json"
"fmt"
"github.com/wjlin0/uncover/sources"
util "github.com/wjlin0/uncover/utils"
"io"
"net/http"
"strings"
Expand Down Expand Up @@ -69,7 +70,8 @@ func (agent *Agent) query(URL string, session *sources.Session, anubis *anubisRe
sub = sources.MatchSubdomains(anubis.Domain, body.String(), true)
for _, anu := range sub {
result := sources.Result{Source: agent.Name()}
result.Host = anu
_, result.Host, result.Port = util.GetProtocolHostAndPort(anu)
result.IP = result.Host
raw, _ := json.Marshal(result)
result.Raw = raw
results <- result
Expand Down
6 changes: 3 additions & 3 deletions sources/agent/binaryedge/binary.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"github.com/pkg/errors"
"github.com/wjlin0/uncover/sources"
util "github.com/wjlin0/uncover/utils"
"io"
"net/http"
"net/url"
Expand Down Expand Up @@ -89,9 +90,8 @@ func (agent *Agent) query(session *sources.Session, binaryRequest *BinaryRequest
}
for _, binaryResult := range binaryResponse.Data {
result := sources.Result{Source: agent.Name()}
result.Host = binaryResult
result.Port = 80
result.IP = binaryResult
_, result.Host, result.Port = util.GetProtocolHostAndPort(binaryResult)
result.IP = result.Host
raw, _ := json.Marshal(result)
result.Raw = raw
results <- result
Expand Down
1 change: 1 addition & 0 deletions sources/agent/bing-spider/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ func (q *query) updates(subdomains []string) {
protocol, host, port := util.GetProtocolHostAndPort(subdomain)
result := sources.Result{Source: q.agent.Name()}
result.Host = host
result.IP = host
result.Port = port
portStr := fmt.Sprintf("%d", port)
result.Url = protocol + "://" + host + ":" + portStr
Expand Down
3 changes: 2 additions & 1 deletion sources/agent/censys/censys.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/json"
"errors"
"fmt"
util "github.com/wjlin0/uncover/utils"
"net/http"
"net/url"

Expand Down Expand Up @@ -97,7 +98,7 @@ func (agent *Agent) query(URL string, session *sources.Session, censysRequest *C
result.IP = ip.(string)
}
if name, ok := censysResult["name"]; ok {
result.Host = name.(string)
_, result.Host, _ = util.GetProtocolHostAndPort(name.(string))
}
if services, ok := censysResult["services"]; ok {
for _, serviceData := range services.([]interface{}) {
Expand Down
4 changes: 3 additions & 1 deletion sources/agent/chinaz-spider/chinaz.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/json"
"fmt"
"github.com/wjlin0/uncover/sources"
util "github.com/wjlin0/uncover/utils"
"io"
"net/http"
"strings"
Expand Down Expand Up @@ -70,7 +71,8 @@ func (agent *Agent) query(URL string, session *sources.Session, chinaz *chinazRe
sub = sources.MatchSubdomains(chinaz.Domain, body.String(), true)
for _, ch := range sub {
result := sources.Result{Source: agent.Name()}
result.Host = ch
_, result.Host, result.Port = util.GetProtocolHostAndPort(ch)
result.IP = result.Host
raw, _ := json.Marshal(result)
result.Raw = raw
results <- result
Expand Down
1 change: 1 addition & 0 deletions sources/agent/fullhunt/fullhunt.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ func (agent *Agent) query(session *sources.Session, URL string, fullhunt *fullhu
protocol, host, port := util.GetProtocolHostAndPort(host)
result.Url = fmt.Sprintf("%s://%s:%d", protocol, host, port)
result.Host = host
result.IP = host
result.Port = port
raw, _ := json.Marshal(result)
result.Raw = raw
Expand Down
4 changes: 3 additions & 1 deletion sources/agent/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/json"
"errors"
"fmt"
util "github.com/wjlin0/uncover/utils"
"net/http"

"github.com/wjlin0/uncover/sources"
Expand Down Expand Up @@ -88,7 +89,8 @@ func (agent *Agent) query(URL string, session *sources.Session, githubRequest *g
subdomains := sources.MatchSubdomains(githubRequest.Query, body.String(), true)
for _, sub := range subdomains {
result := sources.Result{Source: agent.Name()}
result.Host = sub
_, result.Host, result.Port = util.GetProtocolHostAndPort(sub)
result.IP = result.Host
raw, _ := json.Marshal(result)
result.Raw = raw
results <- result
Expand Down
7 changes: 6 additions & 1 deletion sources/agent/hunter/hunter.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"errors"
"fmt"
"github.com/wjlin0/uncover/sources"
util "github.com/wjlin0/uncover/utils"
"net/http"
)

Expand Down Expand Up @@ -75,7 +76,11 @@ func (agent *Agent) query(URL string, session *sources.Session, hunterRequest *R
for _, hunterResult := range hunterResponse.Data.Arr {
result := sources.Result{Source: agent.Name()}
result.IP = hunterResult.IP
result.Port = hunterResult.Port
_, host, port := util.GetProtocolHostAndPort(hunterResult.Domain)
result.Host = host
if result.Port = hunterResult.Port; result.Port == 0 {
result.Port = port
}
result.Host = hunterResult.Domain
raw, _ := json.Marshal(result)
result.Raw = raw
Expand Down
4 changes: 3 additions & 1 deletion sources/agent/qianxun-spider/qianxun.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"github.com/pkg/errors"
"github.com/wjlin0/uncover/sources"
util "github.com/wjlin0/uncover/utils"
"io"
"net/http"
"strings"
Expand Down Expand Up @@ -92,7 +93,8 @@ func (agent *Agent) query(session *sources.Session, domain string, URL string, D
continue
}
result := sources.Result{Source: Source}
result.Host = qianxun
_, result.Host, result.Port = util.GetProtocolHostAndPort(qianxun)
result.IP = result.Host
raw, _ := json.Marshal(result)
result.Raw = raw
results <- result
Expand Down
Loading

0 comments on commit 9ed9023

Please sign in to comment.