static void Main2(string[] args) { // Drive with RPCSession & RPCManager using (ArachniRPCSession session = new ArachniRPCSession("127.0.0.1", 7331, true)) { using (ArachniRPCManager manager = new ArachniRPCManager(session)) { Console.WriteLine("Using instance: " + session.InstanceName); manager.StartScan("http://demo.testfire.net/default.aspx"); bool isRunning = manager.IsBusy().AsBoolean(); List <uint> issues = new List <uint>(); DateTime start = DateTime.Now; Console.WriteLine("Starting scan at " + start.ToLongTimeString()); while (isRunning) { Thread.Sleep(10000); var progress = manager.GetProgress(issues); foreach (MessagePackObject p in progress.AsDictionary()["issues"].AsEnumerable()) { MessagePackObjectDictionary dict = p.AsDictionary(); Console.WriteLine("Issue Found: " + dict["name"].AsString()); issues.Add(dict["digest"].AsUInt32()); } isRunning = manager.IsBusy().AsBoolean(); } DateTime end = DateTime.Now; Console.WriteLine("Finishing scan at " + end.ToLongTimeString() + ". Scan took " + ((end - start).ToString()) + "."); } } }
public ArachniRPCManager(ArachniRPCSession session) { if (!session.IsInstanceStream) { throw new Exception("Session must be using an instance stream"); } _session = session; }