Skip to content

Commit

Permalink
Update:更新部份thirdparty组件的二进制文件,以及对应调整部份代码
Browse files Browse the repository at this point in the history
  • Loading branch information
hanc00l committed Jul 2, 2024
1 parent 8ba6291 commit 34e918c
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 42 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
# ChangeLog
## v2.13.0

2024-7-2

### Update

- 增加对部份任务的自动化测试(配合发布的nemo_test使用)
- 集成基于[MiniChat](https://github.com/okhanyu/minichat)的轻量级团队在线沟通工具(支持消息、文件上传分享,关闭后自动销毁历史记录)
- 增加对任务结果过滤的调整参数
- 更新部份thirdparty和qqwry.dat

### Thirdparty版本(更新)
-
- Httpx:1.6.2 (当前最新的1.6.5的无法正常屏幕截图)
- Subfinder:2.6.6
- Nuclei:3.2.9
- Gogo: 2.13.1

## v2.12.0

Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ require (
github.com/Qianlitp/crawlergo v0.4.4
github.com/RichardKnop/machinery/v2 v2.0.11
github.com/beego/beego/v2 v2.1.1
github.com/chainreactors/utils v0.0.0-20240528085651-ba1b255482c1
github.com/chromedp/cdproto v0.0.0-20221126224343-3a0787b8dd28
github.com/chromedp/chromedp v0.8.6
github.com/disintegration/imaging v1.6.2
Expand All @@ -32,7 +33,7 @@ require (
github.com/smallnest/rpcx v1.8.11
github.com/things-go/go-socks5 v0.0.4
github.com/tidwall/pretty v1.2.1
github.com/twmb/murmur3 v1.1.6
github.com/twmb/murmur3 v1.1.8
github.com/yl2chen/cidranger v1.0.2
github.com/zu1k/nali v0.7.3
golang.org/x/net v0.17.0
Expand Down
9 changes: 7 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/chainreactors/utils v0.0.0-20240528085651-ba1b255482c1 h1:+awuysRKLmdLQbVK+HPSOGvO3dFGdNSbM2jyLh+VYOA=
github.com/chainreactors/utils v0.0.0-20240528085651-ba1b255482c1/go.mod h1:JA4eiQZm+7AsfjXBcIzIdVKBEhDCb16eNtWFCGTxlvs=
github.com/chromedp/cdproto v0.0.0-20220515234810-83d799542a04/go.mod h1:5Y4sD/eXpwrChIuxhSr/G20n9CdbCmoerOHnuAf0Zr0=
github.com/chromedp/cdproto v0.0.0-20220629234738-4cfc9cdeeb92/go.mod h1:5Y4sD/eXpwrChIuxhSr/G20n9CdbCmoerOHnuAf0Zr0=
github.com/chromedp/cdproto v0.0.0-20221126224343-3a0787b8dd28 h1:i4vpMoaMguVwvDc0qSNbCHCRue6d0kbXjj5bDF4fHBA=
Expand Down Expand Up @@ -160,6 +162,9 @@ github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/go-dedup/megophone v0.0.0-20170830025436-f01be21026f5/go.mod h1:poR/Cp00iqtqu9ltFwl6C00sKC0HY13u/Gh05ZBmP54=
github.com/go-dedup/simhash v0.0.0-20170904020510-9ecaca7b509c/go.mod h1:gO3u2bjRAgUaLdQd2XK+3oooxrheOAx1BzS7WmPzw1s=
github.com/go-dedup/text v0.0.0-20170907015346-8bb1b95e3cb7/go.mod h1:wSsK4VOECOSfSYTzkBFw+iGY7wj59e7X96ABtNj9aCQ=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
Expand Down Expand Up @@ -599,8 +604,8 @@ github.com/tklauser/go-sysconf v0.3.11 h1:89WgdJhk5SNwJfu+GKyYveZ4IaJ7xAkecBo+Kd
github.com/tklauser/go-sysconf v0.3.11/go.mod h1:GqXfhXY3kiPa0nAXPDIQIWzJbMCB7AmcWpGR8lSZfqI=
github.com/tklauser/numcpus v0.6.0 h1:kebhY2Qt+3U6RNK7UqpYNA+tJ23IBEGKkB7JQBfDYms=
github.com/tklauser/numcpus v0.6.0/go.mod h1:FEZLMke0lhOUG6w2JadTzp0a+Nl8PF/GFkQ5UVIcaL4=
github.com/twmb/murmur3 v1.1.6 h1:mqrRot1BRxm+Yct+vavLMou2/iJt0tNVTTC0QoIjaZg=
github.com/twmb/murmur3 v1.1.6/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ=
github.com/twmb/murmur3 v1.1.8 h1:8Yt9taO/WN3l08xErzjeschgZU2QSrwm1kclYq+0aRg=
github.com/twmb/murmur3 v1.1.8/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ=
github.com/ulikunitz/xz v0.5.6/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8=
github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8=
github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
Expand Down
1 change: 1 addition & 0 deletions pkg/task/fingerprint/httpxall.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ type HttpxResult struct {
IconHash string `json:"favicon,omitempty"`
FaviconPath string `json:"favicon_path,omitempty"`
ScreenShotPath string `json:"screenshot_path,omitempty"`
Tech []string `json:"tech,omitempty"`
}

type TLS struct {
Expand Down
52 changes: 30 additions & 22 deletions pkg/task/portscan/gogo.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"compress/flate"
"encoding/json"
"fmt"
"github.com/chainreactors/utils/iutils"
"github.com/hanc00l/nemo_go/pkg/conf"
"github.com/hanc00l/nemo_go/pkg/logging"
"github.com/hanc00l/nemo_go/pkg/task/custom"
Expand Down Expand Up @@ -111,41 +112,47 @@ func (fs Frameworks) String() string {

type Vuln struct {
Name string `json:"name"`
Tags []string `json:"tags,omitempty"`
Payload map[string]interface{} `json:"payload,omitempty"`
Detail map[string]interface{} `json:"detail,omitempty"`
Detail map[string][]string `json:"detail,omitempty"`
SeverityLevel int `json:"severity"`
Framework *Framework `json:"-"`
}

func (v *Vuln) HasTag(tag string) bool {
for _, t := range v.Tags {
if t == tag {
return true
}
}
return false
}

func (v *Vuln) GetPayload() string {
return iutils.MapToString(v.Payload)
}

func (v *Vuln) GetDetail() string {
var s strings.Builder
for k, v := range v.Detail {
s.WriteString(fmt.Sprintf(" %s:%s ", k, strings.Join(v, ",")))
}
return s.String()
}

func (v *Vuln) String() string {
s := v.Name
if payload := v.GetPayload(); payload != "" {
s += fmt.Sprintf(" payloads:%s", payload)
s += fmt.Sprintf(" payloads:%s", iutils.AsciiEncode(payload))
}
if detail := v.GetDetail(); detail != "" {
s += fmt.Sprintf(" payloads:%s", detail)
}
return s
}
func MapToString(m map[string]interface{}) string {
if m == nil || len(m) == 0 {
return ""
}
var s string
for k, v := range m {
s += fmt.Sprintf(" %s:%s ", k, v.(string))
s += fmt.Sprintf(" payloads:%s", iutils.AsciiEncode(detail))
}
return s
}
func (v *Vuln) GetPayload() string {
return MapToString(v.Payload)
}

func (v *Vuln) GetDetail() string {
return MapToString(v.Detail)
}

type Vulns map[string]*Vuln
type GOGOResults []*GOGOResult
type Vulns []*Vuln
type Frameworks map[string]*Framework

type GOGOResult struct {
Expand Down Expand Up @@ -265,7 +272,8 @@ func (g *Gogo) Do() {
func (g *Gogo) loadGOGOResultData(input []byte) (gogoData *GOGOData) {
gogoData = &GOGOData{}
// 先直接解析为json,如果没有报错则直接返回结果
if err := json.Unmarshal(input, gogoData); err == nil {
err := json.Unmarshal(input, gogoData)
if err == nil {
return
}
// 如果不是json文件,则先解压后再解析
Expand Down
2 changes: 1 addition & 1 deletion pkg/task/test/pocscan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func TestXray_test(t *testing.T) {
}
xray := pocscan.NewXray(config)
xray.Do()
t.Log(xray.Result)
//t.Log(xray.Result)

for _, r := range xray.Result {
if _, ok := rXrayPocResult[r.Url]; ok {
Expand Down
37 changes: 22 additions & 15 deletions pkg/task/test/portscan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,6 @@ import (
"testing"
)

var rPortscan = map[string]map[int]bool{
"127.0.0.1": {
21: false,
22: false,
23: false,
80: false,
443: false,
5900: false,
9200: false,
},
}

func init() {
/*
nemo_test用于测试的server端口
Expand All @@ -35,11 +23,26 @@ func TestNmap_test(t *testing.T) {
doPortscan("nmap", t)
}

func TestMasscan_test(t *testing.T) {
doPortscan("masscan", t)
//func TestMasscan_test(t *testing.T) {
// doPortscan("masscan", t)
//}

func TestGogo_test(t *testing.T) {
doPortscan("gogo", t)
}

func doPortscan(cmdBin string, t *testing.T) {
var rPortscan = map[string]map[int]bool{
"127.0.0.1": {
21: false,
22: false,
23: false,
80: false,
443: false,
5900: false,
9200: false,
},
}
config := portscan.Config{
Target: "127.0.0.1,172.16.222.1",
ExcludeTarget: "",
Expand All @@ -58,6 +61,10 @@ func doPortscan(cmdBin string, t *testing.T) {
masscan := portscan.NewMasscan(config)
masscan.Do()
result = masscan.Result.IPResult
} else if cmdBin == "gogo" {
gogo := portscan.NewGogo(config)
gogo.Do()
result = gogo.Result.IPResult
} else {
t.Errorf("invalid cmdbin:%s", cmdBin)
return
Expand All @@ -66,7 +73,7 @@ func doPortscan(cmdBin string, t *testing.T) {
for ip, ipa := range result {
//t.Log(ip, ipa)
for port, _ := range ipa.Ports {
//t.Log(port, pa)
//t.Log(port, result[ip].Ports[port])
if ip == "127.0.0.1" {
if _, exist := rPortscan[ip][port]; exist {
rPortscan[ip][port] = true
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.12.0
2.13.0

0 comments on commit 34e918c

Please sign in to comment.