Skip to content

Commit

Permalink
v1.1.1 修复docker未提前下载配置文件
Browse files Browse the repository at this point in the history
  • Loading branch information
wjlin0 committed Apr 11, 2023
1 parent f623b5e commit c21431e
Show file tree
Hide file tree
Showing 32 changed files with 129 additions and 70 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.idea
back
dist
text
3 changes: 3 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ builds:
- linux
- windows
- darwin
ldflags:
- -s -w
main: .

archives:
- format: zip
Expand Down
14 changes: 9 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
FROM golang:1.19.3 AS builder
RUN go install -v github.com/wjlin0/pathScan@latest

FROM golang:1.19-alpine AS builder
ENV CGO_ENABLED=0
RUN apk add --no-cache git && git clone https://github.com/wjlin0/pathScan.git && cd pathScan && go build -ldflags="-w -s" && unzip -d /tmp/dict/ ./config/dict.zip
FROM alpine:3.17.1
COPY --from=builder /go/bin/pathScan /usr/local/bin/pathScan
ENTRYPOINT ["pathScan"]
COPY --from=builder /go/pathScan/pathScan /usr/local/bin/pathScan
COPY --from=builder /tmp/dict/ /root/.config/pathScan/dict
COPY --from=builder /go/pathScan/config/match-config.yaml /root/.config/pathScan/match-config.yaml
RUN pathScan

ENTRYPOINT ["pathScan"]
58 changes: 53 additions & 5 deletions config/match-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
version: "v1.0.0"
version: "v1.0.1"
rules:
- name: "Thinkphp"
matchers:
- type: regex
- type: word
part: header
regex:
word:
- "ThinkPHP"
- name: "Apache"
matchers:
Expand Down Expand Up @@ -34,8 +34,9 @@ rules:
matchers:
- type: regex
part: header
name: php
regex:
- "X-Powered-By: (PHP[\\d\\.\\/]*?)"
- 'X-Powered-By: (PHP/?(\d+\.\d+\.\d+)?)'
group: 1
- name: "Tomcat"
matchers:
Expand Down Expand Up @@ -77,4 +78,51 @@ rules:
- type: word
part: body
words:
- '<img class="product-logo" src="img/nacos.png">'
- '<img class="product-logo" src="img/nacos.png">'
- name: "WordPress"
matchers:
- type: regex
part: body
name: wordpress
group: 1
regex:
- '<meta name="generator" content="(WordPress (\d+\.\d+\.\d+))"'
- name: "Solr-Admin"
matchers-condition: and
matchers:
- type: regex
part: body
name: solr
group: 1
regex:
- '<a href="#/~logging">Logging</a>'
- type: word
part: body
words:
- '<a href="#/" id="solr"><span>Apache SOLR</span></a>'
- '<a href="#/~logging">Logging</a>'
- '<a href="#/~cloud">Cloud</a>'
- '<a href="#/~collections">Collections</a>'
condition: and
- name: "Phpinfo"
matchers-condition: and
matchers:
- type: regex
part: body
name: phpinfo
group: 1
regex:
- '<h1 class="p">PHP Version (\d+\.\d+\.\d+)</h1>'
- type: word
part: body
words:
- '<td class="e">System </td>'
- '<td class="e">Server API </td>'
- '<td class="e">disable_functions</td>'
condition: or
- name: "Splunk-Enterprise"
matchers:
- type: word
part: body
words:
- '<p>Splunk relies on JavaScript to function properly.<br>Please enable JavaScript and then refresh the page to login.</p>'
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/wjlin0/pathScan
module pathScan

go 1.19

Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package main
import (
"fmt"
"github.com/projectdiscovery/gologger"
"github.com/wjlin0/pathScan/pkg/runner"
"github.com/wjlin0/pathScan/pkg/util"
"os"
"os/signal"
"path/filepath"
"pathScan/pkg/runner"
"pathScan/pkg/util"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/common/identification/identification.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"github.com/projectdiscovery/fileutil"
"github.com/projectdiscovery/gologger"
folderutil "github.com/projectdiscovery/utils/folder"
"github.com/wjlin0/pathScan/pkg/common/identification/matchers"
"path/filepath"
"pathScan/pkg/common/identification/matchers"
)

type Options struct {
Expand Down
26 changes: 13 additions & 13 deletions pkg/common/uncover/uncorver.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ import (
"github.com/projectdiscovery/ratelimit"
folderutil "github.com/projectdiscovery/utils/folder"
"github.com/remeh/sizedwaitgroup"
ucRunner "github.com/wjlin0/pathScan/pkg/projectdiscovery/uncover/runner"
"github.com/wjlin0/pathScan/pkg/projectdiscovery/uncover/uncover"
"github.com/wjlin0/pathScan/pkg/projectdiscovery/uncover/uncover/agent/binary"
"github.com/wjlin0/pathScan/pkg/projectdiscovery/uncover/uncover/agent/censys"
"github.com/wjlin0/pathScan/pkg/projectdiscovery/uncover/uncover/agent/fofa"
"github.com/wjlin0/pathScan/pkg/projectdiscovery/uncover/uncover/agent/hunter"
"github.com/wjlin0/pathScan/pkg/projectdiscovery/uncover/uncover/agent/netlas"
"github.com/wjlin0/pathScan/pkg/projectdiscovery/uncover/uncover/agent/quake"
"github.com/wjlin0/pathScan/pkg/projectdiscovery/uncover/uncover/agent/shodan"
"github.com/wjlin0/pathScan/pkg/projectdiscovery/uncover/uncover/agent/shodanidb"
"github.com/wjlin0/pathScan/pkg/projectdiscovery/uncover/uncover/agent/zone"
"github.com/wjlin0/pathScan/pkg/projectdiscovery/uncover/uncover/agent/zoomeye"
"github.com/wjlin0/pathScan/pkg/util"
"golang.org/x/net/context"
"os"
"path/filepath"
ucRunner "pathScan/pkg/projectdiscovery/uncover/runner"
"pathScan/pkg/projectdiscovery/uncover/uncover"
"pathScan/pkg/projectdiscovery/uncover/uncover/agent/binary"
"pathScan/pkg/projectdiscovery/uncover/uncover/agent/censys"
"pathScan/pkg/projectdiscovery/uncover/uncover/agent/fofa"
"pathScan/pkg/projectdiscovery/uncover/uncover/agent/hunter"
"pathScan/pkg/projectdiscovery/uncover/uncover/agent/netlas"
"pathScan/pkg/projectdiscovery/uncover/uncover/agent/quake"
"pathScan/pkg/projectdiscovery/uncover/uncover/agent/shodan"
"pathScan/pkg/projectdiscovery/uncover/uncover/agent/shodanidb"
"pathScan/pkg/projectdiscovery/uncover/uncover/agent/zone"
"pathScan/pkg/projectdiscovery/uncover/uncover/agent/zoomeye"
"pathScan/pkg/util"
"regexp"
"runtime"
"strconv"
Expand Down
2 changes: 1 addition & 1 deletion pkg/projectdiscovery/uncover/runner/output_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"sync"

lru "github.com/hashicorp/golang-lru"
"github.com/wjlin0/pathScan/pkg/projectdiscovery/uncover/uncover"
"pathScan/pkg/projectdiscovery/uncover/uncover"
)

type OutputWriter struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/projectdiscovery/uncover/runner/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"math/rand"
"strings"

"github.com/wjlin0/pathScan/pkg/projectdiscovery/uncover/uncover"
"pathScan/pkg/projectdiscovery/uncover/uncover"
)

type Provider struct {
Expand Down
20 changes: 10 additions & 10 deletions pkg/projectdiscovery/uncover/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ import (
"github.com/projectdiscovery/gologger"
"github.com/projectdiscovery/ratelimit"
"github.com/projectdiscovery/stringsutil"
"github.com/wjlin0/pathScan/pkg/projectdiscovery/uncover/uncover"
"github.com/wjlin0/pathScan/pkg/projectdiscovery/uncover/uncover/agent/censys"
"github.com/wjlin0/pathScan/pkg/projectdiscovery/uncover/uncover/agent/criminalip"
"github.com/wjlin0/pathScan/pkg/projectdiscovery/uncover/uncover/agent/fofa"
"github.com/wjlin0/pathScan/pkg/projectdiscovery/uncover/uncover/agent/hunter"
"github.com/wjlin0/pathScan/pkg/projectdiscovery/uncover/uncover/agent/netlas"
"github.com/wjlin0/pathScan/pkg/projectdiscovery/uncover/uncover/agent/quake"
"github.com/wjlin0/pathScan/pkg/projectdiscovery/uncover/uncover/agent/shodan"
"github.com/wjlin0/pathScan/pkg/projectdiscovery/uncover/uncover/agent/shodanidb"
"github.com/wjlin0/pathScan/pkg/projectdiscovery/uncover/uncover/agent/zoomeye"
"pathScan/pkg/projectdiscovery/uncover/uncover"
"pathScan/pkg/projectdiscovery/uncover/uncover/agent/censys"
"pathScan/pkg/projectdiscovery/uncover/uncover/agent/criminalip"
"pathScan/pkg/projectdiscovery/uncover/uncover/agent/fofa"
"pathScan/pkg/projectdiscovery/uncover/uncover/agent/hunter"
"pathScan/pkg/projectdiscovery/uncover/uncover/agent/netlas"
"pathScan/pkg/projectdiscovery/uncover/uncover/agent/quake"
"pathScan/pkg/projectdiscovery/uncover/uncover/agent/shodan"
"pathScan/pkg/projectdiscovery/uncover/uncover/agent/shodanidb"
"pathScan/pkg/projectdiscovery/uncover/uncover/agent/zoomeye"
)

func init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
"encoding/json"
"fmt"
"github.com/pkg/errors"
"github.com/wjlin0/pathScan/pkg/projectdiscovery/uncover/uncover"
"io"
"net/http"
"net/url"
"pathScan/pkg/projectdiscovery/uncover/uncover"
)

type Agent struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/pkg/errors"

"github.com/wjlin0/pathScan/pkg/projectdiscovery/uncover/uncover"
"pathScan/pkg/projectdiscovery/uncover/uncover"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/pkg/errors"

"github.com/wjlin0/pathScan/pkg/projectdiscovery/uncover/uncover"
"pathScan/pkg/projectdiscovery/uncover/uncover"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion pkg/projectdiscovery/uncover/uncover/agent/fofa/fofa.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/pkg/errors"

"github.com/wjlin0/pathScan/pkg/projectdiscovery/uncover/uncover"
"pathScan/pkg/projectdiscovery/uncover/uncover"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"fmt"
"net/http"

"github.com/wjlin0/pathScan/pkg/projectdiscovery/uncover/uncover"
"pathScan/pkg/projectdiscovery/uncover/uncover"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"errors"
"net/http"

"github.com/wjlin0/pathScan/pkg/projectdiscovery/uncover/uncover"
"pathScan/pkg/projectdiscovery/uncover/uncover"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion pkg/projectdiscovery/uncover/uncover/agent/quake/quake.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"bytes"
"encoding/json"
"errors"
"github.com/wjlin0/pathScan/pkg/projectdiscovery/uncover/uncover"
"io"
"net/http"
"pathScan/pkg/projectdiscovery/uncover/uncover"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/pkg/errors"

"github.com/wjlin0/pathScan/pkg/projectdiscovery/uncover/uncover"
"pathScan/pkg/projectdiscovery/uncover/uncover"
)

const (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/pkg/errors"
"github.com/projectdiscovery/mapcidr"
iputil "github.com/projectdiscovery/utils/ip"
"github.com/wjlin0/pathScan/pkg/projectdiscovery/uncover/uncover"
"pathScan/pkg/projectdiscovery/uncover/uncover"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion pkg/projectdiscovery/uncover/uncover/agent/zone/zone.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
jsoniter "github.com/json-iterator/go"
"github.com/json-iterator/go/extra"
"github.com/pkg/errors"
"github.com/wjlin0/pathScan/pkg/projectdiscovery/uncover/uncover"
"io"
"net/http"
"net/url"
"pathScan/pkg/projectdiscovery/uncover/uncover"
"strconv"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"net/http"
"net/url"

"github.com/wjlin0/pathScan/pkg/projectdiscovery/uncover/uncover"
"pathScan/pkg/projectdiscovery/uncover/uncover"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions pkg/runner/banner.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ const banner = `
__ __ ____
___ ___ _ / /_ / / / __/____ ___ _ ___
/ _ \/ _ // __// _ \ _\ \ / __// _ // _ \
/ .__/\_,_/ \__//_//_//___/ \__/ \_,_//_//_/ v1.1.0
/ .__/\_,_/ \__//_//_//___/ \__/ \_,_//_//_/ v1.1.1
/_/
`

const Version = `1.1.0`
const Version = `1.1.1`

// showBanner is used to show the banner to the user
func showBanner() {
Expand Down
6 changes: 3 additions & 3 deletions pkg/runner/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import (
"bufio"
"github.com/projectdiscovery/gologger"
fileutil "github.com/projectdiscovery/utils/file"
"github.com/wjlin0/pathScan/pkg/common/uncover"
"github.com/wjlin0/pathScan/pkg/util"
"io"
"net/http"
"net/url"
"os"
"pathScan/pkg/common/uncover"
"pathScan/pkg/util"
"strings"
)

Expand Down Expand Up @@ -115,7 +115,7 @@ func addPathsToSet(pathList []string, pathSet map[string]struct{}) {

func (r *Runner) handlerGetFilePath(filename string) []string {

path := util.DataRoot("dict", "v"+Version, filename)
path := util.DataRoot("dict", filename)
out, err := fileutil.ReadFile(path)
if err != nil {
return nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/runner/operators.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package runner

import (
"github.com/projectdiscovery/nuclei/v2/pkg/types"
"github.com/wjlin0/pathScan/pkg/common/identification/matchers"
"pathScan/pkg/common/identification/matchers"
"strings"
)

Expand Down
6 changes: 3 additions & 3 deletions pkg/runner/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import (
"github.com/projectdiscovery/gologger/formatter"
"github.com/projectdiscovery/gologger/levels"
folderutil "github.com/projectdiscovery/utils/folder"
"github.com/wjlin0/pathScan/pkg/common/identification"
"github.com/wjlin0/pathScan/pkg/common/uncover"
ucRunner "github.com/wjlin0/pathScan/pkg/projectdiscovery/uncover/runner"
"os"
"path/filepath"
"pathScan/pkg/common/identification"
"pathScan/pkg/common/uncover"
ucRunner "pathScan/pkg/projectdiscovery/uncover/runner"
"time"
)

Expand Down
Loading

0 comments on commit c21431e

Please sign in to comment.