Skip to content

Commit

Permalink
fix CheckIsErrPageAI bug;add support windows nmap 2022-07-21
Browse files Browse the repository at this point in the history
  • Loading branch information
x51pwn committed Jul 21, 2022
1 parent 5c9ae23 commit bb20ba9
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 15 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
并对这些集成对项目进行代码级别优化、参数优化,个别模块重写
原则上不重复造轮子,除非轮子bug、问题太多
- 跨平台:基于golang实现,轻量级、高度可定制、开源,支持Linux、windows、mac os等
- 支持【20】种密码爆破,支持自定义字典
- 支持【20】种密码爆破,支持自定义字典, 通过 "priorityNmap": true 开启
* RDP
* SSH
* rsh-spx
Expand Down Expand Up @@ -100,7 +100,7 @@

# 如何安装
```bash
go install github.com/hktalent/scan4all@2.5.8
go install github.com/hktalent/scan4all@2.5.9
scan4all -h
```
# 如何使用
Expand Down
4 changes: 2 additions & 2 deletions config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@
"EnableKsubdomain": true,
"KsubdomainRegxp": "([0-9a-zA-Z\\-]+\\.[0-9a-zA-Z\\-]+)$",
"naabu_dns": {},
"naabu": {"TopPorts": "http","ScanAllIPS": true,"Threads": 50,"EnableProgressBar": false},
"priorityNmap": false,
"naabu": {"TopPorts": "1000","ScanAllIPS": true,"Threads": 50,"EnableProgressBar": false},
"priorityNmap": true,
"enableNuclei": false,
"nuclei": {
"Severities": "critical,high,medium",
Expand Down
2 changes: 1 addition & 1 deletion config/config_me.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"EnableHoneyportDetection": true,
"KsubdomainRegxp": "([0-9a-zA-Z\\-]+\\.[0-9a-zA-Z\\-]+)$",
"naabu_dns": {},
"naabu": {"TopPorts": "http","ScanAllIPS": true,"Threads": 64,"EnableProgressBar": false},
"naabu": {"TopPorts": "full","ScanAllIPS": true,"Threads": 64,"EnableProgressBar": false},
"enableNuclei": true,
"nuclei": {
"RateLimit": 150,
Expand Down
1 change: 1 addition & 0 deletions config/doNmapScanWin.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nmap.exe -F --top-ports=65535 -n --unique --resolve-all -Pn -sU -sS --min-hostgroup 64 --max-retries 0 --host-timeout 10m --script-timeout 3m --version-intensity 9 --min-rate 5000 -T4 -iL %1 -oX %2
2 changes: 1 addition & 1 deletion pkg/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ func GetNmap() string {
var hvNmap = false

func CheckHvNmap() bool {
if runtime.GOOS == "windows" || !GetValAsBool("priorityNmap") {
if !GetValAsBool("priorityNmap") {
return false
}
if hvNmap {
Expand Down
4 changes: 2 additions & 2 deletions pkg/kscan/lib/color/color.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package color

import (
"fmt"
"github.com/hktalent/scan4all/pkg"
"math/rand"
"os"
"runtime"
"strconv"
"strings"
Expand Down Expand Up @@ -52,7 +52,7 @@ func Init(b bool) bool {
mod = 1
return false
}
if os.Getenv("github.com/hktalent/scan4all/pkg/kscan_COLOR") == "TRUE" {
if !pkg.GetValAsBool("kscan_COLOR") {
return false
}
mod = 0
Expand Down
5 changes: 0 additions & 5 deletions pkg/kvDb.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import (
"encoding/json"
"github.com/dgraph-io/badger"
"log"
"os"
"runtime"
"sync"
)

Expand Down Expand Up @@ -35,9 +33,6 @@ func (r *KvDbOp) SetExpiresAt(ExpiresAt uint64) {
}

func (r *KvDbOp) Init(szDb string) error {
if runtime.GOOS == "windows" {
os.RemoveAll(szDb)
}
opts := badger.DefaultOptions(szDb)
opts.CompactL0OnClose = true
opts.EventLogging = false
Expand Down
7 changes: 6 additions & 1 deletion pkg/naabu/v2/pkg/runner/targets.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"net/url"
"os"
"regexp"
"runtime"
"strings"
)

Expand Down Expand Up @@ -182,7 +183,11 @@ func (r *Runner) DoTargets() (bool, error) {
tempInput1, err := ioutil.TempFile("", "stdin-out-*")
if err == nil {
defer tempInput1.Close()
x := pkg.SzPwd + "/config/doNmapScan.sh " + r.targetsFile + " " + tempInput1.Name()
s009 := "/config/doNmapScan.sh "
if runtime.GOOS == "windows" {
s009 = "/config/doNmapScanWin.bat "
}
x := pkg.SzPwd + s009 + r.targetsFile + " " + tempInput1.Name()
log.Println(x)
ss, err := pkg.DoCmd(strings.Split(x, " ")...)
s0 := tempInput1.Name()
Expand Down
3 changes: 2 additions & 1 deletion pocs_go/go_poc_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,8 @@ func init() {
close(lib.PocCheck_pipe)
return
}
fmt.Printf(" go-POC-check wait %d ....\r", nMax-nCnt)
var f01 float32 = float32(nCnt/nMax) * 100
fmt.Printf(" Asynchronous go PoCs detection task %%%0.2f ....\r", f01)
<-time.After(time.Duration(1) * time.Second)
nCnt += 1
}
Expand Down

0 comments on commit bb20ba9

Please sign in to comment.