This commit is contained in:
qwqdanchun 2023-08-04 12:37:55 +08:00
parent 4cc65afe14
commit 4b885f4e43
33 changed files with 93 additions and 151 deletions

View File

@ -1,76 +0,0 @@
before:
hooks:
- sudo apt -y install libprotobuf-dev protobuf-compiler protoc-gen-go
- go mod tidy
- go generate ./...
builds:
- id: "with-upx"
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
- arm
- "386"
goarm:
- "6"
- "7"
flags:
- -trimpath
ldflags:
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{ .CommitDate }} -X main.builtBy=goreleaser
ignore:
- goos: windows
goarch: arm64
- goos: windows
goarch: arm
- goos: linux
goarch: mips64
hooks:
post: upx --best -f -q "{{ .Path }}"
# UnknownExecutableFormatException
# CantPackException: can't pack new-exe
- id: "without-upx"
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- mips64
- arm
goarm:
- "6"
- "7"
flags:
- -trimpath
ldflags:
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{ .CommitDate }} -X main.builtBy=goreleaser
ignore:
- goos: linux
goarch: arm
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'

View File

@ -1,35 +1,53 @@
name: goreleaser name: Go-AutoBuild
on: on:
push: push:
tags: branches: [ "master" ]
- '*' pull_request:
branches: [ "master" ]
permissions:
contents: write
jobs: jobs:
goreleaser:
build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 60
steps: steps:
- - uses: actions/checkout@v3
name: Checkout
uses: actions/checkout@v2 - name: Set up Go
with: uses: actions/setup-go@v3
fetch-depth: 0 with:
- go-version: 1.19
name: Set up Go
uses: actions/setup-go@v2 - name: Build
with: run: CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -ldflags="-s -w" -trimpath -race main.go
go-version: 1.19
- - name: Delete-tag-and-release
name: Run GoReleaser uses: dev-drprasad/delete-tag-and-release@v0.2.0
uses: goreleaser/goreleaser-action@v2 with:
with: delete_release: true # default: false
distribution: goreleaser tag_name: AutoBuild # tag name to delete
version: latest env:
args: -f .github/conf/.goreleaser.yml GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
workdir: .
env: - name: Create Release
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: AutoBuild
release_name: AutoBuild
body: ${{ steps.changelog.outputs.changelog }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./main.exe
asset_name: fscan32.exe
asset_content_type: application/exe

View File

@ -5,7 +5,7 @@ import (
"fmt" "fmt"
"time" "time"
"github.com/shadow1ng/fscan/common" "example.com/fxscan/common"
) )
const ( const (

View File

@ -4,7 +4,7 @@ import (
"bytes" "bytes"
"errors" "errors"
"fmt" "fmt"
"github.com/shadow1ng/fscan/common" "example.com/fxscan/common"
"gopkg.in/yaml.v3" "gopkg.in/yaml.v3"
"net" "net"
"strconv" "strconv"

View File

@ -6,7 +6,7 @@ import (
"encoding/binary" "encoding/binary"
"errors" "errors"
"fmt" "fmt"
"github.com/shadow1ng/fscan/common" "example.com/fxscan/common"
"io" "io"
"strconv" "strconv"
"strings" "strings"

View File

@ -4,7 +4,7 @@ import (
"bytes" "bytes"
"encoding/hex" "encoding/hex"
"fmt" "fmt"
"github.com/shadow1ng/fscan/common" "example.com/fxscan/common"
"strings" "strings"
"time" "time"
) )

View File

@ -3,7 +3,7 @@ package Plugins
import ( import (
"fmt" "fmt"
"github.com/jlaffaye/ftp" "github.com/jlaffaye/ftp"
"github.com/shadow1ng/fscan/common" "example.com/fxscan/common"
"strings" "strings"
"time" "time"
) )

View File

@ -3,7 +3,7 @@ package Plugins
import ( import (
"bytes" "bytes"
"fmt" "fmt"
"github.com/shadow1ng/fscan/common" "example.com/fxscan/common"
"golang.org/x/net/icmp" "golang.org/x/net/icmp"
"net" "net"
"os/exec" "os/exec"

View File

@ -2,7 +2,7 @@ package Plugins
import ( import (
"fmt" "fmt"
"github.com/shadow1ng/fscan/common" "example.com/fxscan/common"
"strings" "strings"
"time" "time"
) )

View File

@ -2,7 +2,7 @@ package Plugins
import ( import (
"fmt" "fmt"
"github.com/shadow1ng/fscan/common" "example.com/fxscan/common"
"strings" "strings"
"time" "time"
) )

View File

@ -5,7 +5,7 @@ import (
"encoding/binary" "encoding/binary"
"encoding/hex" "encoding/hex"
"fmt" "fmt"
"github.com/shadow1ng/fscan/common" "example.com/fxscan/common"
"io" "io"
"io/ioutil" "io/ioutil"
"net" "net"

View File

@ -5,7 +5,7 @@ import (
"encoding/hex" "encoding/hex"
"errors" "errors"
"fmt" "fmt"
"github.com/shadow1ng/fscan/common" "example.com/fxscan/common"
"strings" "strings"
"time" "time"
) )

View File

@ -4,7 +4,7 @@ import (
"database/sql" "database/sql"
"fmt" "fmt"
_ "github.com/denisenkom/go-mssqldb" _ "github.com/denisenkom/go-mssqldb"
"github.com/shadow1ng/fscan/common" "example.com/fxscan/common"
"strings" "strings"
"time" "time"
) )

View File

@ -4,7 +4,7 @@ import (
"database/sql" "database/sql"
"fmt" "fmt"
_ "github.com/go-sql-driver/mysql" _ "github.com/go-sql-driver/mysql"
"github.com/shadow1ng/fscan/common" "example.com/fxscan/common"
"strings" "strings"
"time" "time"
) )

View File

@ -3,7 +3,7 @@ package Plugins
import ( import (
"database/sql" "database/sql"
"fmt" "fmt"
"github.com/shadow1ng/fscan/common" "example.com/fxscan/common"
_ "github.com/sijms/go-ora/v2" _ "github.com/sijms/go-ora/v2"
"strings" "strings"
"time" "time"

View File

@ -2,7 +2,7 @@ package Plugins
import ( import (
"fmt" "fmt"
"github.com/shadow1ng/fscan/common" "example.com/fxscan/common"
"sort" "sort"
"strconv" "strconv"
"sync" "sync"

View File

@ -4,7 +4,7 @@ import (
"database/sql" "database/sql"
"fmt" "fmt"
_ "github.com/lib/pq" _ "github.com/lib/pq"
"github.com/shadow1ng/fscan/common" "example.com/fxscan/common"
"strings" "strings"
"time" "time"
) )

View File

@ -3,7 +3,7 @@ package Plugins
import ( import (
"errors" "errors"
"fmt" "fmt"
"github.com/shadow1ng/fscan/common" "example.com/fxscan/common"
"github.com/tomatome/grdp/core" "github.com/tomatome/grdp/core"
"github.com/tomatome/grdp/glog" "github.com/tomatome/grdp/glog"
"github.com/tomatome/grdp/protocol/nla" "github.com/tomatome/grdp/protocol/nla"

View File

@ -3,7 +3,7 @@ package Plugins
import ( import (
"bufio" "bufio"
"fmt" "fmt"
"github.com/shadow1ng/fscan/common" "example.com/fxscan/common"
"net" "net"
"os" "os"
"strings" "strings"

View File

@ -2,8 +2,8 @@ package Plugins
import ( import (
"fmt" "fmt"
"github.com/shadow1ng/fscan/WebScan/lib" "example.com/fxscan/WebScan/lib"
"github.com/shadow1ng/fscan/common" "example.com/fxscan/common"
"reflect" "reflect"
"strconv" "strconv"
"strings" "strings"

View File

@ -3,7 +3,7 @@ package Plugins
import ( import (
"errors" "errors"
"fmt" "fmt"
"github.com/shadow1ng/fscan/common" "example.com/fxscan/common"
"github.com/stacktitan/smb/smb" "github.com/stacktitan/smb/smb"
"strings" "strings"
"time" "time"

View File

@ -2,7 +2,7 @@ package Plugins
import ( import (
"fmt" "fmt"
"github.com/shadow1ng/fscan/common" "example.com/fxscan/common"
"net" "net"
"os" "os"
"strings" "strings"

View File

@ -3,7 +3,7 @@ package Plugins
import ( import (
"errors" "errors"
"fmt" "fmt"
"github.com/shadow1ng/fscan/common" "example.com/fxscan/common"
"golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh"
"io/ioutil" "io/ioutil"
"net" "net"

View File

@ -13,9 +13,9 @@ import (
"time" "time"
"unicode/utf8" "unicode/utf8"
"github.com/shadow1ng/fscan/WebScan" "example.com/fxscan/WebScan"
"github.com/shadow1ng/fscan/WebScan/lib" "example.com/fxscan/WebScan/lib"
"github.com/shadow1ng/fscan/common" "example.com/fxscan/common"
"golang.org/x/text/encoding/simplifiedchinese" "golang.org/x/text/encoding/simplifiedchinese"
) )

View File

@ -3,7 +3,7 @@ package Plugins
import ( import (
"errors" "errors"
"fmt" "fmt"
"github.com/shadow1ng/fscan/common" "example.com/fxscan/common"
"os" "os"
"strings" "strings"
"time" "time"

View File

@ -3,8 +3,8 @@ package WebScan
import ( import (
"crypto/md5" "crypto/md5"
"fmt" "fmt"
"github.com/shadow1ng/fscan/WebScan/info" "example.com/fxscan/WebScan/info"
"github.com/shadow1ng/fscan/common" "example.com/fxscan/common"
"regexp" "regexp"
) )

View File

@ -3,8 +3,8 @@ package WebScan
import ( import (
"embed" "embed"
"fmt" "fmt"
"github.com/shadow1ng/fscan/WebScan/lib" "example.com/fxscan/WebScan/lib"
"github.com/shadow1ng/fscan/common" "example.com/fxscan/common"
"net/http" "net/http"
"os" "os"
"path/filepath" "path/filepath"

View File

@ -4,8 +4,8 @@ import (
"crypto/md5" "crypto/md5"
"fmt" "fmt"
"github.com/google/cel-go/cel" "github.com/google/cel-go/cel"
"github.com/shadow1ng/fscan/WebScan/info" "example.com/fxscan/WebScan/info"
"github.com/shadow1ng/fscan/common" "example.com/fxscan/common"
"math/rand" "math/rand"
"net/http" "net/http"
"net/url" "net/url"

View File

@ -6,7 +6,7 @@ import (
"embed" "embed"
"errors" "errors"
"fmt" "fmt"
"github.com/shadow1ng/fscan/common" "example.com/fxscan/common"
"golang.org/x/net/proxy" "golang.org/x/net/proxy"
"gopkg.in/yaml.v2" "gopkg.in/yaml.v2"
"io/ioutil" "io/ioutil"

View File

@ -12,7 +12,7 @@ import (
"github.com/google/cel-go/common/types" "github.com/google/cel-go/common/types"
"github.com/google/cel-go/common/types/ref" "github.com/google/cel-go/common/types/ref"
"github.com/google/cel-go/interpreter/functions" "github.com/google/cel-go/interpreter/functions"
"github.com/shadow1ng/fscan/common" "example.com/fxscan/common"
exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1" exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
"io" "io"
"io/ioutil" "io/ioutil"

View File

@ -5,6 +5,8 @@ import (
"runtime" "runtime"
"runtime/debug" "runtime/debug"
"time" "time"
"os"
"strings"
) )
func init() { func init() {
@ -22,14 +24,7 @@ func GC() {
} }
func Banner() { func Banner() {
banner := ` banner := `version: ` + version
___ _
/ _ \ ___ ___ _ __ __ _ ___| | __
/ /_\/____/ __|/ __| '__/ _` + "`" + ` |/ __| |/ /
/ /_\\_____\__ \ (__| | | (_| | (__| <
\____/ |___/\___|_| \__,_|\___|_|\_\
fscan version: ` + version + `
`
print(banner) print(banner)
} }
@ -81,5 +76,10 @@ func Flag(Info *HostInfo) {
flag.StringVar(&SC, "sc", "", "ms17 shellcode,as -sc add") flag.StringVar(&SC, "sc", "", "ms17 shellcode,as -sc add")
flag.BoolVar(&IsWmi, "wmi", false, "start wmi") flag.BoolVar(&IsWmi, "wmi", false, "start wmi")
flag.StringVar(&Hash, "hash", "", "hash") flag.StringVar(&Hash, "hash", "", "hash")
flag.Parse() if(len(os.Args)>2&&strings.Contains(os.Args[1],"lua")){
flag.CommandLine.Parse(os.Args[2:])
}else
{
flag.Parse()
}
} }

2
go.mod
View File

@ -1,4 +1,4 @@
module github.com/shadow1ng/fscan module example.com/fxscan
go 1.19 go 1.19

View File

@ -2,8 +2,8 @@ package main
import ( import (
"fmt" "fmt"
"github.com/shadow1ng/fscan/Plugins" "example.com/fxscan/Plugins"
"github.com/shadow1ng/fscan/common" "example.com/fxscan/common"
"time" "time"
) )
@ -14,5 +14,5 @@ func main() {
common.Parse(&Info) common.Parse(&Info)
Plugins.Scan(Info) Plugins.Scan(Info)
t := time.Now().Sub(start) t := time.Now().Sub(start)
fmt.Printf("[*] 扫描结束,耗时: %s\n", t) fmt.Printf("[*] 扫描结束,耗时: %s\n", t)
} }