Nmap Security Scanner
*Intro
*Ref Guide
*Install Guide
*Download
*Changelog
*Book
*Docs
Security Lists
*Nmap Hackers
*Nmap Dev
*Bugtraq
*Full Disclosure
*Pen Test
*Basics
*More
Security Tools
*Pass crackers
*Sniffers
*Vuln Scanners
*Web scanners
*Wireless
*Exploitation
*Packet crafters
*More
Site News
Site Search:
Exploit World
Advertising
About/Contact
Credits
Sponsors:
edgeos



Nmap Development: Re: [NSE] WHOIS - Attempts to queue coroutines to limit the number of whois queries.

Re: [NSE] WHOIS - Attempts to queue coroutines to limit the number of whois queries.

From: majek04 <majek04+nmap-dev_at_gmail.com>
Date: Wed, 9 Apr 2008 03:32:52 +0200

On Fri, Feb 15, 2008 at 3:54 AM, jah <jah_at_zadkiel.plus.com> wrote:
> My problem is; how to make a coroutine wait?

In os.nse [1] I use this solution, based on pcap (raw sockets):

    -- hack used only to go back to event loop
    local pcap = nmap.new_socket()
    function pcap_callback() return 'xxx' end
    pcap:pcap_open(interface, 64, 0, pcap_callback,
        "tcp[0] == 0xDE and ((tcp[tcpflags] & tcp-fin) != 0) " )

    -- go back to the event loop for a while
                    pcap:set_timeout(XXX) -- XXXms
                    pcap:pcap_register('aaa')
                    _, _, _, _, _ = pcap:pcap_receive()

> I'm going to go and do some reading about how to utilise raw packet
> network I/O and see if I can get any success there, but I should be most
> grateful for any predictions as to its usefulness, in this context, in
> the meantime. If anyone has any thoughts on how I might bend coroutines
> to my will without having to do something to the API (which I'm not
> currently qualified to attempt - although I am learning C/C++ and should
> be so qualified sometime in 2012) then I'd love to hear those thoughts.

But we really should create something more standard, like nmap.sleep().
Maybe it's a good idea for SoC?

[1]
http://ai.pjwstk.edu.pl/~majek/dump/os.nse (see fingerprints_match)

Cheers!
  Marek Majkowski

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org
Received on Apr 08 2008

[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]