-
Notifications
You must be signed in to change notification settings - Fork 122
Expand file tree
/
Copy pathProgram.cs
More file actions
54 lines (52 loc) · 1.51 KB
/
Copy pathProgram.cs
File metadata and controls
54 lines (52 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
using SharpMapExec.args;
using System;
using System.IO;
namespace SharpMapExec
{
internal class Program
{
// TOOD:
// computer list
// more ldap data
// smb null scan
// smb file scan
private static void Main(string[] args)
{
if (!Directory.Exists("loot"))
{
Directory.CreateDirectory("loot");
}
string commandName = "";
var parsed = ArgumentParser.Parse(args);
if (parsed.ParsedOk == false)
{
Console.WriteLine("\r\n[!] bad parameters:\r\n");
Info.ShowUsage();
return;
}
if (args.Length != 0 && args[1].Contains("/"))
{
commandName = args[0];
}
else if (args.Length != 0 && !(args[1].Contains("/")))
{
commandName = args[0] + args[1];
}
Console.WriteLine(commandName);
try
{
var commandFound = new CommandCollection().ExecuteCommand(commandName.ToLower(), parsed.Arguments);
if (commandFound == false)
{
Console.WriteLine("\r\n[!] bad command:\r\n");
Info.ShowUsage();
}
}
catch (Exception e)
{
Console.WriteLine("\r\n[!] Unhandled exception:\r\n");
Console.WriteLine(e);
}
}
}
}