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:
push:
tags:
- '*'
permissions:
contents: write
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
goreleaser:
build:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: -f .github/conf/.goreleaser.yml
workdir: .
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- name: Build
run: CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -ldflags="-s -w" -trimpath -race main.go
- name: Delete-tag-and-release
uses: dev-drprasad/delete-tag-and-release@v0.2.0
with:
delete_release: true # default: false
tag_name: AutoBuild # tag name to delete
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
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"
"time"
"github.com/shadow1ng/fscan/common"
"example.com/fxscan/common"
)
const (

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -12,7 +12,7 @@ import (
"github.com/google/cel-go/common/types"
"github.com/google/cel-go/common/types/ref"
"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"
"io"
"io/ioutil"

View File

@ -5,6 +5,8 @@ import (
"runtime"
"runtime/debug"
"time"
"os"
"strings"
)
func init() {
@ -22,14 +24,7 @@ func GC() {
}
func Banner() {
banner := `
___ _
/ _ \ ___ ___ _ __ __ _ ___| | __
/ /_\/____/ __|/ __| '__/ _` + "`" + ` |/ __| |/ /
/ /_\\_____\__ \ (__| | | (_| | (__| <
\____/ |___/\___|_| \__,_|\___|_|\_\
fscan version: ` + version + `
`
banner := `version: ` + version
print(banner)
}
@ -81,5 +76,10 @@ func Flag(Info *HostInfo) {
flag.StringVar(&SC, "sc", "", "ms17 shellcode,as -sc add")
flag.BoolVar(&IsWmi, "wmi", false, "start wmi")
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

View File

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