Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interactive mode support #79

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion Rubeus/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public static string MainString(string command)
return output;
}

public static void Main(string[] args)
public static void MainArgs(string[] args)
{
// try to parse the command line arguments, show usage on failure and then bail
var parsed = ArgumentParser.Parse(args);
Expand All @@ -119,5 +119,27 @@ public static void Main(string[] args)
MainExecute(commandName, parsed.Arguments);
}
}

public static void Main(string[] args)
{
if (args.Length > 0 && args[0] != "")
{
MainArgs(args);
}
else
{
string command;
do
{
Console.Write("Rubeus # ");
command = Console.ReadLine();
if (command != "" && command != "exit")
{
args = command.Split();
MainArgs(args);
}
} while (command != "exit");
}
}
}
}