commands

package
v0.3.28 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2018 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AppHelpTemplate = `` /* 464-byte string literal not displayed */

AppHelpTemplate custom app help template

View Source
var CommandHelpTemplate = `` /* 202-byte string literal not displayed */

CommandHelpTemplate custom command help template

View Source
var Commands = []cli.Command{
	{
		Name:        "scan",
		Usage:       "Scan a file",
		Description: "File to be scanned.",
		Flags: []cli.Flag{
			cli.BoolFlag{
				Name:  "logs",
				Usage: "Display the Logs of the Plugin containers",
			},
		},
		Action: func(c *cli.Context) error { return cmdScan(c.Args().First(), c.Bool("logs")) },
	},
	{
		Name:        "watch",
		Usage:       "Watch a folder",
		Description: "Folder to be watched.",
		Flags: []cli.Flag{
			cli.BoolFlag{
				Name:  "logs",
				Usage: "Display the Logs of the Plugin containers",
			},
		},
		Action: func(c *cli.Context) error { return cmdWatch(c.Args().First(), c.Bool("logs")) },
	},
	{
		Name:      "lookup",
		Usage:     "Look up a file hash (md5/sha1)",
		ArgsUsage: "hash of file to lookup `HASH`",

		Flags: []cli.Flag{
			cli.BoolFlag{
				Name:  "logs",
				Usage: "Display the Logs of the Plugin containers",
			},
		},
		Action: func(c *cli.Context) error {
			if c.Args().Present() {
				return cmdLookUp(c.Args().First(), c.Bool("logs"))
			}
			log.Error("Please supply a MD5/SHA1 hash to query.")

			return nil
		},
	},
	{
		Name:        "elk",
		Usage:       "Start the ELK docker container",
		Description: "This ELK container will attach to the ElasticSearch data for all previous malice scans.",
		Flags: []cli.Flag{
			cli.BoolFlag{
				Name:  "logs",
				Usage: "Display the Logs from the ELK Container",
			},
		},
		Action: func(c *cli.Context) error { return cmdELK(c.Bool("logs")) },
	},

	{
		Name:  "plugin",
		Usage: "List, Install or Remove Plugins",
		Subcommands: []cli.Command{
			{
				Name:  "list",
				Usage: "list enabled installed plugins",
				Flags: []cli.Flag{
					cli.BoolFlag{
						Name:  "all",
						Usage: "display all installed plugins",
					},
					cli.BoolFlag{
						Name:  "detail,d",
						Usage: "display plugin details",
					},
				},
				Action: func(c *cli.Context) error { return cmdListPlugins(c.Bool("all"), c.Bool("detail")) },
			},
			{
				Name:   "install",
				Usage:  "install plugin",
				Action: func(c *cli.Context) error { return cmdInstallPlugin(c.Args().First()) },
			},
			{
				Name:   "remove",
				Usage:  "remove plugin",
				Action: func(c *cli.Context) error { return cmdRemovePlugin(c.Args().First()) },
			},
			{
				Name:  "update",
				Usage: "update plugin",
				Flags: []cli.Flag{
					cli.BoolFlag{
						Name:  "all",
						Usage: "update all installed plugins",
					},
					cli.BoolFlag{
						Name:  "s,source",
						Usage: "update plugin from source repo",
					},
				},
				Action: func(c *cli.Context) error { return cmdUpdatePlugin(c.Args().First(), c.Bool("all"), c.Bool("source")) },
			},
		},
		BashComplete: func(c *cli.Context) {

			if len(c.Args()) > 0 {
				return
			}
			for _, t := range tasks {
				fmt.Println(t)
			}
		},
	},
}

Commands are the codegangsta/cli commands for Malice

Functions

func APILookUp

func APILookUp(hash string) error

APILookUp is an API wrapper for cmdLookUp

func APIScan

func APIScan(file string) error

APIScan is an API wrapper for cmdScan

func CmdNotFound

func CmdNotFound(c *cli.Context, command string)

CmdNotFound outputs a formatted command not found message

func NewWatcher

func NewWatcher(folder string)

NewWatcher creates a new watcher for the user supplied folder

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL