Пример #1
0
        public override CommandParser CreateCustomOpts(CommandParser cli)
        {
            cli.Argument("u", "username", "a valid MySQL username (required)", "database-username",
                         CommandArgumentFlags.TakesParameter, (p, v) => Options.Add("username", v));

            cli.Argument("c", "command", "Path to mysql if not in environment path", "command",
                         CommandArgumentFlags.TakesParameter, (p, v) => Options.Add("command", v));

            cli.Argument("d", "database", "MySQL database (required)", "database",
                         CommandArgumentFlags.TakesParameter, (p, v) => Options.Add("database", v));

            return cli;
        }
Пример #2
0
        public override CommandParser CreateCustomOpts(CommandParser cli)
        {
            cli.Argument("p", "password",
                         "Password will be passed via environment variable PGPASSWORD; this could be security issue on some systems",
                         "database-password",
                         CommandArgumentFlags.TakesParameter, (p, v) => Options.Add("password", v));

            return cli;
        }
Пример #3
0
        public static void Main(string[] args)
        {
            string host     = String.Empty;
            int    port     = 80;
            int    threads  = 1000;
            bool   usetor   = false;
            bool   showHelp = false;
            var    parser   = new CommandParser("NEMESIS DDoS Tool");

            parser.Argument("T", "usetor", "Use TOR", (p, v) => { usetor = true; });
            parser.Argument("h", "host", "Specify a host without http://", "host", CommandArgumentFlags.TakesParameter | CommandArgumentFlags.Required, (p, v) => { host = v; });
            parser.Argument("p", "port", "Specify webserver port", "port", CommandArgumentFlags.TakesParameter | CommandArgumentFlags.Required, (p, v) => { port = Convert.ToInt32(v); });
            parser.Argument("t", "threads", "Specify number of threads", "threads", CommandArgumentFlags.TakesParameter | CommandArgumentFlags.Required, (p, v) => { threads = Convert.ToInt32(v); });
            parser.Argument("?", "help", "Shows the help screen.", CommandArgumentFlags.HideInUsage, (p, v) => { showHelp = true; });
            //This fragment was copied from CommanParser's example ParserHarness, I hope, that I not broke copyright ;)
            parser.Parse();

            if (parser.UnknownCommands.Count > 0)
            {
                foreach (var unknown in parser.UnknownCommands)
                {
                    Console.WriteLine("Invalid command: " + unknown);
                }

                Console.WriteLine(parser.GetHelp());
            }
            else if (parser.MissingRequiredCommands.Count > 0)
            {
                foreach (var missing in parser.MissingRequiredCommands)
                {
                    Console.WriteLine("ERROR: Missing argument: " + missing);
                }

                Console.WriteLine(parser.GetHelp());
            }
            else if (!showHelp)
            {
                XFLOOD.HTTPFlood(host, port, usetor, threads);
            }
            else
            {
                Console.WriteLine(parser.GetHelp());
            }
        }
Пример #4
0
        public override CommandParser CreateCustomOpts(CommandParser cli)
        {
            cli.Argument("u", "username",
                         "a valid username for Microsoft SQL server. If none is set, a trusted connection (osql parameter -E) is used. If you specify a username, you need to add a password!",
                         "database-username",
                         CommandArgumentFlags.TakesParameter, (p, v) => Options.Add("username", v));

            cli.Argument("c", "command", "Path to osql if not in environment path", "command",
                         CommandArgumentFlags.TakesParameter, (p, v) => Options.Add("command", v));

            cli.Argument("d", "database", "database - can be left if your MSSQL user has a default database set",
                         "database",
                         CommandArgumentFlags.TakesParameter, (p, v) => Options.Add("database", v));

            cli.Argument("w", "winauth", "use Windows authentication - no user/password must be set",
                         "use-windows-auth", CommandArgumentFlags.None,
                         (p, v) => { _useWindowsAuth = true; });

            return cli;
        }
Пример #5
0
        private CommandParser CreateDefaultOpts(CommandParser cli)
        {
            cli.Argument("u", "username", "database username", "database-username",
                         CommandArgumentFlags.TakesParameter, (p, v) => Options.Add("username", v));

            cli.Argument("p", "password", "database password", "database-password",
                         CommandArgumentFlags.TakesParameter, (p, v) => Options.Add("password", v));

            cli.Argument("c", "command", "Path to osql if not in environment path", "command",
                         CommandArgumentFlags.TakesParameter, (p, v) => Options.Add("command", v));

            cli.Argument("h", "host", "Host", "database-host", CommandArgumentFlags.TakesParameter,
                         (p, v) => Options.Add("host", v));

            cli.Argument("d", "database", "database - can be left if default database for user is set", "database",
                         CommandArgumentFlags.TakesParameter, (p, v) => Options.Add("database", v));

            cli.Argument("a", "args", "Additional arguments which will added to osql command", "args",
                         CommandArgumentFlags.TakesParameter, (p, v) => Options.Add("args", v));

            cli.Argument("S", "suffix",
                         "Use only files with this suffix as migration scripts and ignore other resources (default: .sql)",
                         "migration-suffix",
                         CommandArgumentFlags.TakesParameter, (p, v) => Options.Add("suffix", v));

            cli.Argument("s", "strategy",
                         "can be \"flat\" or \"hierarchial\". flat means, that all scripts must be available inside this directory in form of yyyymmdd[-|_]<migration-number>-<name>.suffix. \"hierarchial\" means a directory structure in form of <major>\\<minor>\\<migration-number>[-|_]<name>.suffix",
                         "migration-strategy",
                         CommandArgumentFlags.TakesParameter, (p, v) => Options.Add("strategy", v));

            cli.Argument("i", "ini", "an .ini file from which to read all relevant settings",
                         "INI configuration file", CommandArgumentFlags.TakesParameter,
                         (p, v) => Options.Add("ini", v));

            cli.Argument("x", "section", "name of the section in which to look for", "INI section name",
                         CommandArgumentFlags.TakesParameter, (p, v) => Options.Add("section", v));

            cli.Argument("?", "help", "Help", "Help", CommandArgumentFlags.None, (p, v) => { _showHelp = true; });

            return cli;
        }