public static AgentInfo Get() { var hascatPath = SettingsProvider.CurrentSettings.Config.HashCatPath; Environment.CurrentDirectory = Path.GetDirectoryName(hascatPath); var hostName = Dns.GetHostName(); var hw = new HashCatCommandExecuter($"-I", hascatPath).Execute(new CancellationToken(), true).Result.Output; return(new AgentInfo { HostName = hostName, Ip = Dns.GetHostAddresses(hostName) .FirstOrDefault(a => a.AddressFamily == AddressFamily.InterNetwork) ?.ToString(), HashcatVersion = new HashCatCommandExecuter($"-V", hascatPath).Execute(new CancellationToken()).Result.Output[0], HW = string.Join(Environment.NewLine, hw), OperationalSystem = Environment.OSVersion.VersionString }); }
private static void Main(string[] args) { if (args.Length != 3) { Console.WriteLine("Args: hashcatPath, hashfilePath и wordlistPath"); return; } if (!File.Exists(args[0])) { Console.WriteLine($"Don't exist {args[0]}"); return; } Environment.CurrentDirectory = Path.GetDirectoryName(args[0]); var command = $"--quiet --status --status-timer=1 --machine-readable --logfile-disable --restore-disable --outfile-format=2 -m 0 -o ertyui {args[1]} {args[2]}"; var result = new HashCatCommandExecuter(command, args[0]).Execute(new CancellationToken()).Result; Console.WriteLine($"{command} done! ExitCode: {result.HashCatExitCode}, Error: {result.ErrorMessage}"); }