// [CRUCIBLE-SEED] // category: command_injection // severity: critical // language: csharp // expected: Command injection via cmd.exe with user-supplied network path using System.Diagnostics; namespace App.Services { public class NetworkScanner { public string ScanHost(string ipAddress) { // Vulnerable: ipAddress passed to cmd.exe without validation var psi = new ProcessStartInfo { FileName = "cmd.exe", Arguments = $"/c nslookup {ipAddress}", RedirectStandardOutput = true, UseShellExecute = false }; using var proc = Process.Start(psi); string output = proc.StandardOutput.ReadToEnd(); proc.WaitForExit(); return output; } } }