Skip to content

Commit

Permalink
Update: v2.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hanc00l committed Jan 3, 2024
1 parent 10364e7 commit 7d5221c
Show file tree
Hide file tree
Showing 21 changed files with 83 additions and 52 deletions.
6 changes: 3 additions & 3 deletions cmd/worker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (

func parseWorkerOptions() *comm.WorkerOption {
option := &comm.WorkerOption{WorkerTopic: make(map[string]struct{})}

flag.IntVar(&option.Concurrency, "c", 3, "concurrent number of tasks")
flag.IntVar(&option.WorkerPerformance, "p", 0, "worker performance,default is autodetect (0:autodetect, 1:high, 2:normal)")
flag.StringVar(&option.WorkerRunTaskMode, "m", "0", "worker run task mode; 0: all, 1:active, 2:finger, 3:passive, 4:pocscan, 5:custom; run multiple mode separated by \",\"")
Expand Down Expand Up @@ -165,9 +165,9 @@ func startWorkerConfMonitor() {
select {
case fileName := <-w.ChNeedWorkerSync:
logging.CLILog.Infof("reload config file:%s", fileName)
conf.WorkerReloadMutex.Lock()
conf.WorkerConfigReloadMutex.Lock()
conf.GlobalWorkerConfig().ReloadConfig()
conf.WorkerReloadMutex.Unlock()
conf.WorkerConfigReloadMutex.Unlock()

}
}
Expand Down
Binary file modified docs/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/image/1.dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/image/2.iplist.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/image/3.portscan.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/image/4.ipinfo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/image/5.domainlist.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/image/6.domainscan.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/image/7.domaininfo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/image/8.vulnerabilitylist.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/image/9-0.tasklist.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/image/9-3.worker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 30 additions & 8 deletions docs/install.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Nemo安装手册

## v1.2
## v1.3

2023-9-18
2024-1-3


Nemo分为**Server**端和**Worker**端两部份。Server提供Http访问、API接口、RPC接口、消息中间件服务以及文件同步接口。Worker是通过消息中间件从Worker接收任务并执行,通过RPC接口上传任务的结果,并通过文件同步接口接收Server的文件。
Expand Down Expand Up @@ -31,6 +31,7 @@ Nemo目前可运行在**x86-AMD**平台的MacOS、Linux及Windows平台,其它
- 5000:Http,web界面
- 5001:RPC接口,用于worker将任务结果保存到server
- 5002:文件同步,在server与worker之间同步文件
- 5010:本地socks5转发,用于chrome-headless支持带验证的socks5代理;如果该端口被占用,会自动递增1个可使用的端口
- 5672:rabbitmq消息中间件监听端口,用于Nemo的异步和分布式任务执行

如果启用API接口(需单独运行),会开启以下端口:
Expand Down Expand Up @@ -339,15 +340,20 @@ Server的Web(5000)、RPC(5001)及文件同步(5002)默认不使用TL
use TLS for RPC and filesync
-w string
workspace guid for custom task; multiple workspace separated by ","
-f string
worker default config file (default "conf/worker.yml")
-np
disable proxy configuration,include socks5 proxy and socks5forward
```
- -c参数:worker并发的任务数量,默认为3。
- -mh、mp及ma参数:Server文件同步的host、port及authKey,如果同时指定这三个参数,将执行文件同步功能,从server同步文件到worker。
- nf参数:指定参数则禁用文件同步功能
- -p参数:worker的的性能模式,默认为0;根据worker的性能模式(1:高性能,2:普通)不同,在任务的并发线程数会有所区别;参数为0则自动判断,判断规则为CPU>=4核、内存>=4G为高性能模式。
- -c worker并发的任务数量,默认为3。
- -mh、mp及ma Server文件同步的host、port及authKey,如果同时指定这三个参数,将执行文件同步功能,从server同步文件到worker。
- -nf 禁用文件同步功能
- -p worker的的性能模式,默认为0;根据worker的性能模式(1:高性能,2:普通)不同,在任务的并发线程数会有所区别;参数为0则自动判断,判断规则为CPU>=4核、内存>=4G为高性能模式。
- -m worker执行的任务类型
- -w worker执行自定义任务(-m 5)时,自定义任务所在的工作空间GUID
- -tls 启用TLS加密(server也必须使用-tls)
- -f worker配置文件,默认为conf/worker.yml
- -np 禁用socks5代理
#### 2、Goby的服务端部署模式
需在thirdparty/goby目录下运行:(Docker已自动运行)
Expand Down Expand Up @@ -430,7 +436,23 @@ Worker默认启动时参数为-m 0,将会执行所有类型(除custom)的
![nemo_vps](./image/nemo_vps.png)
## Worker使用Socks5代理
## Worker使用自定义的socks5代理
为提高Worker部署和扫描的灵活性,在v2.11版本后,Worker的部份任务功能支持sock5代理,包括:
- gogo的端口扫描
- 指纹获取
- 在线API接口
- 子域名任务被动收集(subfinder)和爬虫
- Nuclei漏洞验证
代理设置:Config-配置管理,支持同时配置多个socks5代理地址(地址格式为socks5://user:pass@host:port),多个地址将由worker每次任务时随机选择。
由于获取网站截图时调用的chrome-headless不支持验证功能的socks5代理,因此worker在启动时默认在127.0.0.1:5010地址进行代理转发到设置的socks5地址。
worker可通过命令行参数-np关闭代理功能。如果前端任务指定了代理扫描选项,但未配置socks5地址或worker关闭了代理功能,任务将会由不使用代理直接执行。
## Worker使用全局Socks5代理
在实战的高强度对抗中,使用代理可以降低IP被安设备BAN导致的信息收集不全。由于Nemo的特点是大量使用第三方组件,每个组件对代理的支持的方式和能力都不尽相同,因此建议通过第三方工具和技术,通过全局代理的方式来达到代理Worker的网络流量的目的。
Expand Down
16 changes: 4 additions & 12 deletions docs/question.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Nemo常见问题

##v1.2
##v1.3

2023-9-18
2024-1-3

### 1、Docker安装后无法使用

Expand Down Expand Up @@ -98,17 +98,9 @@ screen -r
#如果没有screen命令,可以通过apt install screen安装;详细使用方式请网上搜索参考文档。
```

### 9、Worker使用Socks5代理的实践
### 9、Worker使用Socks5代理

在实战的高强度对抗中,使用代理可以降低IP被安设备BAN导致的信息收集不全。由于Nemo的特点是大量使用第三方组件,每个组件对代理的支持的方式和能力都不尽相同,因此建议通过第三方工具和技术,通过全局代理的方式来达到代理Worker的网络流量的目的。

目前从实战中总结来说,经过比较和测试,比较推荐的方式为:
- Windows/MacOS:proxifier+socks5代理
- Linux:iptables+redsocks+socks5代理

proxifier在实战对抗中通过反向代理进行内网渗透的利器,具有GUI界面的易用性、规则配置的灵活性,具体使用方法可参照网上的教程。

iptables+redsocks的使用方法可参考[安装说明](install.md)中的详细步骤。
从v2.11开始,支持worker部份功能使用代理扫描,使用方法可参考[安装说明](install.md)中的详细步骤。

### 10、IPV6资产

Expand Down
13 changes: 10 additions & 3 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Nemo快速上手

## v1.0
## v1.1

2023-7-8
2024-1-3

## 一、Docker安装

Expand Down Expand Up @@ -78,7 +78,14 @@ Nemo使用的工具大部份已经集成在thirdparty目录中了。但为了更
## 四、在内网渗透中的信息收集

**前提条件:**
+ 已获得跳板机,并搭建好稳定的反向代理通道;能上传gogo或fscan到跳板机上可对内网进行探测
+ 已获得跳板机,并搭建好稳定的反向代理通道

### 1.通过socks5代理

+ 在Server-Config-配置管理中,配置内网渗透的反向代理的socks5地址
+ 在IP/Domain任务中,指定端口扫描使用gogo,并指定“代理扫描”选项。

### 2.通过自定义任务方式
+ 在Nemo中为内网渗透创建专用的工作空间(比如名称为xx_net,GUID为x-x-x-x);设置登录用户具有该工作空间的权限;在“配置管理”-“自定义任务的工作空间”,添加一行:
```bash
x.x.x.x xx_net
Expand Down
37 changes: 31 additions & 6 deletions docs/usage.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Nemo使用手册

## v1.1
## v1.2

2023-8-3
2024-1-3

## 工作空间

Expand Down Expand Up @@ -32,6 +32,8 @@
- 任务切分
- 在线API
- 任务消息通知Token
- 自定义任务的工作空间GUID
- 代理配置

在Nemo的任务中,这些默认参数有些是Server生成任务时使用(任务切分、任务消息通知Token),有些是用于Worker任务执行时读取(具体可查看conf目录下server.yml和worker.yml)。

Expand Down Expand Up @@ -59,9 +61,10 @@

### 3、指纹获取
- Httpx:调用httpx,获取web指纹
- FingerprintHub:调用Observer_Ward,根据web_fingerprint_v3.json获取web指纹
- FingerprintHub:根据web_fingerprint_v3.json获取web指纹(不再调用Observer_Ward)
- Screenshot:调用chrome进行网页屏幕截图
- IconHash:获取web的favicon
- fingerprintx:调用fingerprintx获取非HTTP的端口指纹信息

### 4、任务切分
在新建任务,如果选择任务的执行方式为根据IP切分、根据端口拆分或根据IP和端口拆分时,会根据设置的切分数量,将一个任务分成多个任务执行。
Expand All @@ -88,11 +91,23 @@ Nemo支持调用相关平台的API发送任务执行结果消息,目前支持
### 7、自定义任务的工作空间GUID

Nemo将任务分为5种类型,worker启动时通过参数-m指定worker执行的任务类型;对自定义的任务:-m 5,需要用-w参数指定任务关联的工作空间GUID(比如-w 1a0ca919-7960-4067-9981-9abcb4eaa735)。
在Nemo的IP或Domain列表视图中,切换到第一步配置的工作空间,在新建任务或XScan任务后,只有启动命令为:-m 5 -w 1a0ca919-7960-4067-9981-9abcb4eaa735的worker才会收到任务并执行。
在Nemo的IP或Domain列表视图中,切换到第一步配置的工作空间,配置自定义任务的工作空间,这些工作空间的任务将会被设置为自定义任务;在新建任务或XScan任务后,只有启动命令为:-m 5 -w 1a0ca919-7960-4067-9981-9abcb4eaa735的worker才会收到任务并执行。

配置格式为:GUID 备注,可以每行配置一个配置多个如:
1a0ca919-7960-4067-9981-9abcb4eaa735 172网段;

### 8、代理配置

为提高Worker部署和扫描的灵活性,在v2.11版本后,Worker的部份任务功能支持sock5代理,包括:
- gogo的端口扫描
- 指纹获取
- 在线API接口
- 子域名任务被动收集(subfinder)和爬虫
- Nuclei漏洞验证

支持同时配置多个socks5代理地址(地址格式为socks5://user:pass@host:port),多个地址将由worker每次任务时随机选择。
由于获取网站截图时调用的chrome-headless不支持验证功能的socks5代理,因此worker在启动时默认在127.0.0.1:5010地址进行代理转发到设置的socks5地址。
worker可通过命令行参数-np关闭代理功能。如果前端任务指定了代理扫描选项,但未配置socks5地址或worker关闭了代理功能,任务将会不使用代理直接执行。

## 自定义管理

Expand Down Expand Up @@ -428,9 +443,8 @@ Nemo内置了RED、YELLOW、BLUE、GREEN、GRAY及BLANK六种颜色,供团队
- XRay
- Nuclei
- Goby
- Dirsearch

Dirsearch是通过go代码集成;XRay和Nuclei是通过命令行的方式传递参数调用并解析结果文件;Goby需通过服务端部署的模式,通过API调用和解析结果。
XRay和Nuclei是通过命令行的方式传递参数调用并解析结果文件;Goby需通过服务端部署的模式,通过API调用和解析结果。

**POC使用与管理**

Expand Down Expand Up @@ -510,3 +524,14 @@ Nemo比较推荐采用分布式worker的使用方式。为了方便对worker的
从v2.10后,worker的RuntimeLog通过RPC的方式上传到Server并保存到数据库中,从v2.9版本升级需导入runtimelog.sql以创建数据库表。

Nemo日志按从高到低分为Fatal、Error、Warning、Info、Debug及Trace六个级别,每条日常包含了来源Worker、产生日志的文件、函数及信息,重点需关注Error和Warning类。


## Worker管理

从v2.11后,支持对worker的任务执行情况、所在VPS的CPU/MEM资源使用率进行监控,同时可通过Server端动态修改Worker的启动参数;修改的启动参数由Daemon进程重启并传递到Worker执行。可修改的启动参数包括:
- 任务并发数(-c)
- 任务执行模式(-m)
- Worker性能模式(-p)
- 默认启动参数文件(-f)
- 自定义任务的工作空间GUID(-w)
- 关闭socks5代理功能(-np)
6 changes: 3 additions & 3 deletions pkg/conf/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var NoProxyByCmd bool
var Socks5ForwardAddr string
var ServerDefaultConfigfile = "conf/server.yml"
var WorkerDefaultConfigFile = "conf/worker.yml"
var WorkerReloadMutex sync.Mutex // worker读配置文件同步锁
var WorkerConfigReloadMutex sync.Mutex // worker读配置文件同步锁

// RunMode 运行模式:正式运行请使用Release模式,Debug模式只用于开发调试过程
var RunMode = Release
Expand All @@ -57,9 +57,9 @@ func GlobalWorkerConfig() *Worker {
if workerConfig == nil {
workerConfig = new(Worker)

WorkerReloadMutex.Lock()
WorkerConfigReloadMutex.Lock()
err := workerConfig.ReloadConfig()
WorkerReloadMutex.Unlock()
WorkerConfigReloadMutex.Unlock()

if err != nil {
fmt.Println("Load Worker config fail!")
Expand Down
14 changes: 0 additions & 14 deletions pkg/web/controllers/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,20 +133,6 @@ func (c *DashboardController) GetStartedTaskInfoAction() {
c.Data["json"] = tis
}

// WorkerAliveListAction 获取worker数据,用于dashboard列表显示
func (c *DashboardController) WorkerAliveListAction() {
defer c.ServeJSON()

req := DatableRequestParam{}
err := c.ParseForm(&req)
if err != nil {
logging.RuntimeLog.Error(err)
logging.CLILog.Error(err)
}
resp := getWorkerAliveList(&req)
c.Data["json"] = resp
}

// OnlineUserListAction 获取在线用户数据,用于Dashboard表表显示
func (c *DashboardController) OnlineUserListAction() {
defer c.ServeJSON()
Expand Down
1 change: 0 additions & 1 deletion pkg/web/routers/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ func init() {
web.CtrlGet("/dashboard", (*controllers.DashboardController).IndexAction)
web.CtrlPost("/dashboard", (*controllers.DashboardController).GetStatisticDataAction)
web.CtrlPost("/dashboard-task-info", (*controllers.DashboardController).GetTaskInfoAction)
web.CtrlPost("/worker-list", (*controllers.DashboardController).WorkerAliveListAction)
web.CtrlPost("/onlineuser-list", (*controllers.DashboardController).OnlineUserListAction)
web.CtrlPost("/dashboard-task-started-info", (*controllers.DashboardController).GetStartedTaskInfoAction)

Expand Down
Loading

0 comments on commit 7d5221c

Please sign in to comment.