Commit 762775fa authored by robertdavidgraham's avatar robertdavidgraham
Browse files

udp scan

parent a1ff92e0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -94,7 +94,7 @@ status_print(struct Status *status, uint64_t count, uint64_t max_count)
        if (rate)
            finished  = (1.0 - percent_done/100.0) * (max_count / rate);
        /* (%u-days %02u:%02u:%02u remaining) */
        fprintf(stderr, "rate%6.2f-kpps, %5.2f%% done, %u:%02u:%02u remaining, %llutcbs             \r",
        fprintf(stderr, "rate:%6.2f-kpps, %5.2f%% done, %u:%02u:%02u remaining, %llu-tcbs             \r",
                        rate/1000.0,
                        percent_done,
            (unsigned)(finished/60/60),
+15 −14
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@

#include "rand-blackrock.h"     /* the BlackRock shuffling func */
#include "rand-lcg.h"           /* the LCG randomization func */
#include "tcpkt.h"              /* packet template, that we use to send */
#include "templ-pkt.h"          /* packet template, that we use to send */
#include "rawsock.h"            /* api on top of Linux, Windows, Mac OS X*/
#include "logger.h"             /* adjust with -v command-line opt */
#include "main-status.h"        /* printf() regular status updates */
@@ -147,7 +147,7 @@ transmit_thread(void *v) /*aka. scanning_thread() */
    uint64_t count_ips = rangelist_count(&masscan->targets);
    struct Status status;
    struct Throttler throttler;
    struct TcpPacket *pkt_template = masscan->pkt_template;
    struct TemplateSet *pkt_template = masscan->pkt_template;
    unsigned packet_trace = masscan->nmap.packet_trace;
    double timestamp_start;
    unsigned *picker;
@@ -244,7 +244,7 @@ transmit_thread(void *v) /*aka. scanning_thread() */

            /* Print --packet-trace if debugging */
            if (packet_trace)
                tcpkt_trace(pkt_template, ip, port, timestamp_start);
                template_packet_trace(pkt_template, ip, port, timestamp_start);

            /*
             * SEND THE PROBE
@@ -383,7 +383,7 @@ receive_thread(struct Masscan *masscan,
            (size_t)(masscan->max_rate/5), 
            masscan->transmit_queue, 
            masscan->packet_buffers,
            masscan->pkt_template,
            &masscan->pkt_template->pkts[Proto_TCP],
            output_report_banner,
            out,
            masscan->tcb.timeout
@@ -637,7 +637,7 @@ static void control_c_handler(int x)
static int
main_scan(struct Masscan *masscan)
{
    struct TcpPacket pkt[1];
    struct TemplateSet tmplset[1];
    uint64_t count_ips;
    uint64_t count_ports;
    unsigned adapter_ip = 0;
@@ -689,24 +689,25 @@ main_scan(struct Masscan *masscan)
     * we adjust the template with additional features, such as the IP address
     * and so on.
     */
    tcp_init_packet(pkt,
    template_packet_init(
                tmplset,
                adapter_ip,
                adapter_mac,
                router_mac);
    masscan->pkt_template = pkt;
    masscan->pkt_template = tmplset;

    /*
     * Reconfigure the packet template according to command-line options
     */
    if (masscan->adapter_port < 0x10000)
        tcpkt_set_source_port(pkt, masscan->adapter_port);
        template_set_source_port(tmplset, masscan->adapter_port);
    if (masscan->nmap.ttl)
        tcpkt_set_ttl(pkt, masscan->nmap.ttl);
        template_set_ttl(tmplset, masscan->nmap.ttl);

    /*
     * Read back what we've set
     */
    adapter_port = tcpkt_get_source_port(pkt);
    adapter_port = template_get_source_port(tmplset);



@@ -904,7 +905,7 @@ int main(int argc, char *argv[])
            x += blackrock_selftest();
            x += rawsock_selftest();
            x += randlcg_selftest();
            x += tcpkt_selftest();
            x += template_selftest();
            x += ranges_selftest();
            x += pixie_time_selftest();
            x += rte_ring_selftest();
+2 −2
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@
#include "packet-queue.h"

struct Adapter;
struct TcpPacket;
struct TemplateSet;
struct Banner1;

extern time_t global_now;
@@ -116,7 +116,7 @@ struct Masscan
    /**
     * The packet template we are current using
     */
    struct TcpPacket *pkt_template;
    struct TemplateSet *pkt_template;

    /**
     * Are we there yet? The scanning thread sets this to 1 when its done.
+3 −3
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@
#include "event-timeout.h"      /* for tracking future events */
#include "rawsock.h"
#include "logger.h"
#include "tcpkt.h"
#include "templ-pkt.h"
#include "pixie-timer.h"
#include "packet-queue.h"
#include "proto-banner1.h"
@@ -64,7 +64,7 @@ struct TCP_ConnectionTable {
    uint64_t active_count;

    struct Timeouts *timeouts;
    struct TcpPacket *pkt_template;
    struct TemplatePacket *pkt_template;
    PACKET_QUEUE *transmit_queue;
    PACKET_QUEUE *packet_buffers;

@@ -133,7 +133,7 @@ struct TCP_ConnectionTable *
tcpcon_create_table(    size_t entry_count,
                        PACKET_QUEUE *transmit_queue,
                        PACKET_QUEUE *packet_buffers,
                        struct TcpPacket *pkt_template,
                        struct TemplatePacket *pkt_template,
                        OUTPUT_REPORT_BANNER report_banner,
                        struct Output *out,
                        unsigned timeout
+2 −2
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@

struct Adapter;
struct TCP_Control_Block;
struct TcpPacket;
struct TemplatePacket;
#include "packet-queue.h"
#include "output.h"

@@ -31,7 +31,7 @@ struct TCP_ConnectionTable *
tcpcon_create_table(    size_t entry_count,
                        struct rte_ring *transmit_queue,
                        struct rte_ring *packet_buffers,
                        struct TcpPacket *pkt_template,
                        struct TemplatePacket *pkt_template,
                        OUTPUT_REPORT_BANNER report_banner,
                        struct Output *out,
                        unsigned timeout
Loading