Beispiel #1
0
        /// <summary>
        /// Returns a list of reports on the Nessus Server.
        /// </summary>
        /// <returns>List containing NessusReport objects.</returns>
        public List <NessusReport> GetReports()
        {
            Reply reply = Reply.Parse(SendRequest(URI + "/report/list", "seq=" + Random));

            if (reply != null)
            {
                return(reply.Content.Reports);
            }

            return(null);
        }
Beispiel #2
0
        /// <summary>
        /// Logon to the Nessus Server using the given username and password.
        /// </summary>
        /// <param name="username">Username</param>
        /// <param name="password">Password</param>
        /// <returns>bool</returns>
        public bool Login(string username, string password)
        {
            username = HttpUtility.UrlEncode(username);
            password = HttpUtility.UrlEncode(password);
            string p = String.Format("login={0}&password={1}&seq={2}", username, password, Random);

            bool ok = false;

            try
            {
                Reply reply = Reply.Parse(SendRequest(URI + "/login", p));
                Token = reply.Content.Token;
                ok    = true;
            }
            catch (Exception e)
            {
                Console.WriteLine("Error: {0} {1}", e.GetType(), e.Message);
            }

            return(ok);
        }
Beispiel #3
0
        /// <summary>
        /// Returns the OS/Platform the Nessus Server is running on.
        /// </summary>
        /// <returns>string</returns>
        public string GetPlatform()
        {
            Reply reply = Reply.Parse(SendRequest(URI + "/server/load", "seq=" + Random));

            return(reply.Content.Platform);
        }
Beispiel #4
0
        /// <summary>
        /// Returns the ServerLoad object for this Nessus Server.
        /// </summary>
        /// <returns>ServerLoad</returns>
        public ServerLoad GetServerLoad()
        {
            Reply reply = Reply.Parse(SendRequest(URI + "/server/load", "seq=" + Random));

            return(reply.Content.ServerLoad);
        }