Nmap Development mailing list archives

Re: payload file prototype


From: Jay Fink <jay.fink () gmail com>
Date: Thu, 4 Feb 2010 14:25:39 -0500

On Mon, Feb 1, 2010 at 1:32 PM, David Fifield <david () bamsoftware com> wrote:

I'm thinking of something like an std::map mapping (proto, port) pairs
to structs like
       struct Payload {
               char *data;
               ssize_t len;
               int sourceport;
       };

So as I have been researching this and going over how AllProbes works;
I ran into a question.

So I get that we want a global list of payloads but the problem I ran
into - and I am sure it *isn't* a problem I just dunno how to get
around it - is how do we account for the multiple ports in the global
list? For instance each item could look like:

struct payloads{
  char *protocol;
  int dport;
  char *payload_data;
  int sport;
  payload *nxt_payload;
};

so if we see this in the config file (this is an example and isn't real):

udp 1024,1025 "\x00 foo"

When we init and load it up how should we deal with it? Make dports a
sized array? Like:

int dport[sizeof[entries];

so in the above example the list record would look like:

payload.protocol = "udp"
payload.dports[0] = 1024;
payload.dports[1] = 1025;

Note I am not talking about the struct that gets populated and sent
back, that will be in the AllPayloads foo I come up with.

thx,
 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: