From ae2ec445a16bfddbdccd5921dd6d6de5446b003a Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 13 Apr 2017 10:29:04 -0400 Subject: [PATCH] start of cli args --- README.md | 2 +- main.go | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 main.go diff --git a/README.md b/README.md index e9868ed..9d15481 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/main.go b/main.go new file mode 100644 index 0000000..534813b --- /dev/null +++ b/main.go @@ -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") + } +}