Nmap Development mailing list archives

Re: payload file prototype


From: Jay Fink <jay.fink () gmail com>
Date: Thu, 11 Feb 2010 21:43:57 -0500

On Wed, Feb 10, 2010 at 12:23 AM, David Fifield <david () bamsoftware com> wrote:

I was thinking to use an std::map<proto_port, Payload> for the global
list of payloads, where proto_port would be like

struct proto_port {
       u8 proto;
       u16 port;
};

Okay so that would be mapped into the global list or are you referring
when were looking it up?

Right now, for the actual list itself, following is what I banged out
last weekend. It is missing search and init but here is the header
file for it, I trimmed out everything else, the functions listed
(including constructor) work, some of them are just for practice at
this point and might get tossed. My current test program initializes 3
payloads inside the calling test itself. I am planning on using
something similar to services to load up the file in the init portion.
The next steps are load, then search (map):

struct Payload {
    char *proto; // number?
    int dport; // dest port
    char *data; // Payload data
    int sport; // source port if we care
    Payload* next; // next payload
};
class AllPayloads {
    public:
        AllPayloads();
        ~AllPayloads();
        int Count();
        Payload* head;
        int Add(Payload* Item);
        Payload *Retrieve(int pos);
        bool Find(Payload* Item);
    private:
        int size;
};

thanks,
 j
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: