Esempio n. 1
0
        static void Main(string[] args)
        {
            //CuckooSession session = new CuckooSession("127.0.0.1", 8090);
            //JObject response = session.ExecuteCommand("/cuckoo/status", "GET");
            //Console.WriteLine(response.ToString());

            CuckooSession session = new CuckooSession("127.0.0.1", 8090);

            using (CuckooManager manager = new CuckooManager(session))
            {
                FileTask task = new FileTask();
                task.Filepath = "/var/www/payload.exe";

                int taskID = manager.CreateTask(task);
                Console.WriteLine("Created task: " + task.ID);

                task = (FileTask)manager.GetTaskDetails(taskID);
                while (task.Status == "pending" || task.Status == "running")
                {
                    Console.WriteLine("Waiting 30 seconds..." + task.Status);
                    System.Threading.Thread.Sleep(30000);
                    task = (FileTask)manager.GetTaskDetails(taskID);
                }

                if (task.Status == "failure")
                {
                    Console.Error.WriteLine("There was an error:");
                    foreach (var error in task.Errors)
                    {
                        Console.Error.WriteLine(error);
                    }

                    return;
                }

                string report = manager.GetTaskReport(taskID).ToString();
                Console.WriteLine(report);
            }
        }
Esempio n. 2
0
 public void Dispose()
 {
     _session = null;
 }
Esempio n. 3
0
 public CuckooManager(CuckooSession session)
 {
     _session = session;
 }