Name changes, readme changes

This commit is contained in:
Alex 2017-10-04 11:20:17 -04:00
parent 3545d223e9
commit e7535b764d
5 changed files with 14 additions and 25 deletions

@ -1,4 +1,4 @@
Zgrab 2.0
ZGrab 2.0
=========
This repo contains the new ZGrab framework, and will eventually replace https://github.com/zmap/zgrab.
@ -22,7 +22,7 @@ $ make
## Single Module Usage
Zgrab2 supports modules. For example, to run the ssh module use
ZGrab2 supports modules. For example, to run the ssh module use
```
./zgrab2 ssh
@ -57,30 +57,19 @@ port=22
## Adding New Protocols
Add module to zmodules/ that satisfies the following interface:
```
type Protocol interface {
Scan(ip net.IP) (interface{}, error)
Validate(args []string) error
PerRoutineInitialize()
New() interface{}
}
```
Add module to modules/ that satisfies the following interfaces: `Scanner`, `ScanModule`, `ScanFlags`.
The struct must embed zgrab2.BaseProtocol. In the files `init()` function the following must be included.
The flags struct must embed zgrab2.BaseFlags. In the modules `init()` function the following must be included.
```
func init() {
var configStruct ConfigStruct
cmd, err := zgrab2.AddCommand("module", "short description", "long description of module", &configStruct)
var newModule NewModule
_, err := zgrab2.AddCommand("module", "short description", "long description of module", portNumber, &newModule)
if err != nil {
log.Fatal(err)
}
configStruct.SetDefaultPortAndName(cmd, uint(00), "module")
}
```
The `Validate()` function should make a call to `zgrab2.RegisterLookup()`.
## License
Zgrab is licensed under Apache 2.0 and ISC. For more information, see the LICENSE file.
ZGrab2.0 is licensed under Apache 2.0 and ISC. For more information, see the LICENSE file.

@ -8,7 +8,7 @@ import (
flags "github.com/ajholland/zflags"
log "github.com/sirupsen/logrus"
"github.com/zmap/zgrab2"
_ "github.com/zmap/zgrab2/zmodules"
_ "github.com/zmap/zgrab2/modules"
)
func main() {
@ -53,14 +53,14 @@ func main() {
s.Init(flag)
zgrab2.RegisterScan(moduleType, s)
}
m := zgrab2.MakeMonitor()
monitor := zgrab2.MakeMonitor()
start := time.Now()
log.Infof("started grab at %s", start.Format(time.RFC3339))
zgrab2.Process(m)
zgrab2.Process(monitor)
end := time.Now()
log.Infof("finished grab at %s", end.Format(time.RFC3339))
s := Summary{
StatusesPerModule: m.GetStatuses(),
StatusesPerModule: monitor.GetStatuses(),
StartTime: start.Format(time.RFC3339),
EndTime: end.Format(time.RFC3339),
Duration: end.Sub(start).String(),

@ -1,4 +1,4 @@
package zmodules
package modules
import (
log "github.com/sirupsen/logrus"

@ -1,4 +1,4 @@
package zmodules
package modules
import (
log "github.com/sirupsen/logrus"

@ -1,4 +1,4 @@
package zmodules
package modules
import (
log "github.com/sirupsen/logrus"