public IToolResults Run(Profile profile) { string cmd, output; cmd = "-sT -sU -p T:1-65535,U:53,67,68,123,135,137-138,161,445,631,1434,5353 -O " + (!string.IsNullOrEmpty(_options.Range) ? _options.Range : _options.Host); ProcessStartInfo si = new ProcessStartInfo(); si.RedirectStandardOutput = true; si.UseShellExecute = false; Process proc = new Process(); proc.StartInfo = si; proc.EnableRaisingEvents = false; proc.StartInfo.FileName = _options.Path; proc.StartInfo.Arguments = cmd; proc.Start(); output = proc.StandardOutput.ReadToEnd(); proc.WaitForExit(); NMapToolResults results = new NMapToolResults(output); return(results); }
public PersistentNMapResults(NMapToolResults results) { this.FullOutput = results.FullOutput; if (results.Hosts != null) { this.PersistentHosts = new List<PersistentNMapHost>(); foreach (NMapHost host in results.Hosts) { PersistentNMapHost h = new PersistentNMapHost(host); this.PersistentHosts.Add(h); } } }
public IToolResults Run(Profile profile) { string cmd, output; cmd = "-sT -sU -p T:1-65535,U:53,67,68,123,135,137-138,161,445,631,1434,5353 -O " + (!string.IsNullOrEmpty(_options.Range) ? _options.Range : _options.Host); ProcessStartInfo si = new ProcessStartInfo(); si.RedirectStandardOutput = true; si.UseShellExecute = false; Process proc = new Process(); proc.StartInfo = si; proc.EnableRaisingEvents = false; proc.StartInfo.FileName = _options.Path; proc.StartInfo.Arguments = cmd; proc.Start(); output = proc.StandardOutput.ReadToEnd(); proc.WaitForExit(); NMapToolResults results = new NMapToolResults(output); return results; }