start of cli args

This commit is contained in:
Alex 2017-04-13 10:29:04 -04:00
parent 62b9d41610
commit ae2ec445a1
2 changed files with 38 additions and 1 deletions

@ -1,4 +1,4 @@
ZGrab 1.0
Zrab 2.0
=========
This framework contains the new ZGrab framework, and will eventually replace https://github.com/zmap/zgrab.

37
main.go Normal file

@ -0,0 +1,37 @@
package main
import (
"os"
"gopkg.in/alecthomas/kingpin.v2"
)
var (
zgrab = kingpin.New("zgrab", "Banner Grabber")
outputFile = zgrab.Flag("output-file", "Output filename, use - for stdout").Default("-").String()
inputFile = zgrab.Flag("input-file", "Input filename, use - for stdin").Default("-").String()
metadataFile = zgrab.Flag("metadata-file", "File to record banner-grab metadata, use - for stdout").Default("-").String()
logFile = zgrab.Flag("log-file", "File to log to, use - for stderr").Default("-").String()
ssh = zgrab.Command("ssh", "SSH scan")
sshClient = ssh.Arg("ssh-client", "Mimic behavior of a specific SSH client").String()
sshHostKeyAlgorithms = ssh.Arg("ssh-host-key-algorithms", "Set SSH Host Key Algorithms").String()
sshKexAlgorithms = ssh.Arg("ssh-key-algorithms", "Set SSH Key Exchange Algorithms").String()
tls = zgrab.Command("tls", "TLS scan")
http = zgrab.Command("http", "HTTP scan")
ftp = zgrab.Command("ftp", "FTP scan")
)
func main() {
switch kingpin.MustParse(zgrab.Parse(os.Args[1:])) {
case ssh.FullCommand():
println("ssh scan")
case tls.FullCommand():
println("tls scan")
case http.FullCommand():
println("http scan")
case ftp.FullCommand():
println("ftp scan")
}
}