diff --git a/.github/build/mac_arm64.yml b/.github/build/mac_arm64.yml new file mode 100755 index 000000000..8d05f5e0e --- /dev/null +++ b/.github/build/mac_arm64.yml @@ -0,0 +1,26 @@ +env: + - GO111MODULE=on +before: + hooks: + - go mod tidy +project_name: scan4all +builds: + - id: scan4all-darwin + ldflags: + - -s -w + binary: scan4all + env: + - CGO_ENABLED=1 + main: main.go + goos: + - darwin + goarch: + - arm64 + +archives: +- format: zip + replacements: + darwin: macOS + +checksum: + name_template: "{{ .ProjectName }}-mac-arm64-checksums.txt" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 74df68633..98d69f5a6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,6 +6,26 @@ on: workflow_dispatch: jobs: + build-mac-arm: + runs-on: macos-latest + steps: + - name: Code checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.18 + - name: Install Dependences + run: brew install libpcap + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: release -f .github/build/mac_arm64.yml --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} build-mac: runs-on: macos-latest steps: diff --git a/projectdiscovery/nuclei_Yaml/nclruner/runner/runner.go b/projectdiscovery/nuclei_Yaml/nclruner/runner/runner.go index e90fae90f..123d36171 100644 --- a/projectdiscovery/nuclei_Yaml/nclruner/runner/runner.go +++ b/projectdiscovery/nuclei_Yaml/nclruner/runner/runner.go @@ -293,14 +293,30 @@ func (r *Runner) Close() { if r.projectFile != nil { r.projectFile.Close() } - r.hmapInputProvider.Close() + if nil != r.hmapInputProvider { + r.hmapInputProvider.Close() + } protocolinit.Close() if r.pprofServer != nil { _ = r.pprofServer.Shutdown(context.Background()) } - if r.interactsh != nil { - r.interactsh.Close() + //if r.interactsh != nil { + // r.interactsh.Close() + //} + if nil != r.issuesClient { + r.issuesClient.Close() + } + if nil != r.progress { + r.progress.Stop() + } + if nil != r.browser { + r.browser.Close() + r.browser = nil + } + if nil != r.pprofServer { + r.pprofServer.Close() } + } // RunEnumeration sets up the input layer for giving input nuclei. diff --git a/vendor/github.com/projectdiscovery/nuclei/v2/pkg/protocols/http/request.go b/vendor/github.com/projectdiscovery/nuclei/v2/pkg/protocols/http/request.go index 007c4dfea..8f0d572c3 100644 --- a/vendor/github.com/projectdiscovery/nuclei/v2/pkg/protocols/http/request.go +++ b/vendor/github.com/projectdiscovery/nuclei/v2/pkg/protocols/http/request.go @@ -346,7 +346,7 @@ func (request *Request) ExecuteWithResults(reqURL string, dynamicValues, previou const drainReqSize = int64(8 * 1024) var errStopExecution = errors.New("stop execution due to unresolved variables") - +var someMapMutex = sync.RWMutex{} // executeRequest executes the actual generated request and returns error if occurred func (request *Request) executeRequest(reqURL string, generatedRequest *generatedRequest, previousEvent output.InternalEvent, hasInteractMatchers bool, callback protocols.OutputEventCallback, requestCount int) error { request.setCustomHeaders(generatedRequest) @@ -582,6 +582,7 @@ func (request *Request) executeRequest(reqURL string, generatedRequest *generate if request.options.Interactsh != nil { request.options.Interactsh.MakePlaceholders(generatedRequest.interactshURLs, outputEvent) } + someMapMutex.Lock() for k, v := range previousEvent { finalEvent[k] = v } @@ -597,7 +598,7 @@ func (request *Request) executeRequest(reqURL string, generatedRequest *generate finalEvent[key] = v } } - + someMapMutex.Unlock() // prune signature internal values if any request.pruneSignatureInternalValues(generatedRequest.meta)