mazepa.git


mazepa

~ linux userland keylogger
git clone https://github.com/djnnvx/mazepa.git
log | files | refs | archive | README

parser.go (550B)

      1 package cli
      2 
      3 import (
      4 	"mazepa-server/icmp"
      5 
      6 	"github.com/spf13/cobra"
      7 )
      8 
      9 func GetParser(opts *MazepaOptions) *cobra.Command {
     10 
     11 	var rootCmd = &cobra.Command{
     12 		Use:   "run",
     13 		Short: "Run the server",
     14 		Long:  "Runs the ICMP listener & display all received keys on stdout",
     15 		Args:  cobra.MinimumNArgs(0),
     16 		Run: func(cmd *cobra.Command, args []string) {
     17 
     18 			icmp.ListenAndPrint(opts.IP)
     19 		},
     20 	}
     21 
     22 	defaults := GetDefaultOptions()
     23 	rootCmd.Flags().StringVarP(&opts.IP, "ip", "i", defaults.IP, "Address to listen on (IPv4 or IPv6)")
     24 	return rootCmd
     25 }