示例#1
0
        static void SqlmapScanner(string[] args)
        {
            using (SqlmapSession session = new SqlmapSession("127.0.0.1", 8775))
            {
                using (SqlmapManager manager = new SqlmapManager(session))
                {
                    string taskid = manager.NewTask();

                    Dictionary <string, object> options = manager.GetOptions(taskid);
                    options["url"]          = args[0];
                    options["flushsession"] = true;

                    manager.StartTask(taskid, options);

                    SqlmapStatus status = manager.GetScanStatus(taskid);
                    while (status.Status != "terminated")
                    {
                        System.Threading.Thread.Sleep(new TimeSpan(0, 0, 10));
                        status = manager.GetScanStatus(taskid);
                    }

                    List <SqlmapLogItem> logItems = manager.GetLog(taskid);
                    foreach (SqlmapLogItem item in logItems)
                    {
                        Console.WriteLine(item.Message);
                    }

                    manager.DeleteTask(taskid);
                }
            }
        }
示例#2
0
 public SqlmapManager(SqlmapSession session)
 {
     if (session == null)
     {
         throw new ArgumentException("session");
     }
     _session = session;
 }
示例#3
0
 public void Dispose()
 {
     _session.Dispose();
     _session = null;
 }