Commit 75c43c5c authored by robertdavidgraham's avatar robertdavidgraham
Browse files

rawsock getroute and stuff

parent 20e3bcf7
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
Copyright (c) 2013 Robert Graham

There is no license.

You do not have permission to use/run this code.

You can read it, though.
+7 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@ LIBS = -lrt -lpcap -lm
INCLUDES = -I.
DEFINES = 
CC = gcc
CFLAGS = -g $(INCLUDES) $(DEFINES) -Wall -Wstrict-aliasing=2 -O3 -rdynamic
CFLAGS = -g $(INCLUDES) $(DEFINES) -Wall -O3 -rdynamic
.SUFFIXES: .c .cpp

tmp/%.o: src/%.c
@@ -19,4 +19,10 @@ clean:
	rm tmp/*.o
	rm bin/masscan

regress: bin/masscan
	bin/masscan --selftest

install: bin/masscan
	echo "No install, binary is bin/masscan"
	
default: bin/masscan
+15 −14
Original line number Diff line number Diff line
# MASSCAN: Mass IPv4 port scanner

This is a port scanner with the following features:
* very large ranges (like the entire Internet or 10.x.x.x)
* very fast (millions of packets/second)
* randomization of port/IP combo
* stateless
* kill list (easily avoid certain ranges)
This is a port scanner. It spews out packets at a high rate, then catches any
responses asynchronously. Because it's asynchronous, it's a lot faster than 
''nmap'' -- and a lot less feature rich.

This port scanner has the following limitations:
* only tests if port is open/closed, no banner checking
* only 'raw' packet support
The intent is to be a 48-bit scanner -- scanning all ports (16-bits) on all
IPv4 addresses (32-bits). It's also useful on smaller problems, such as the
10.x.x.x address space within a company.

It randomizes the IPv4+port combination, whereas nmap only randomizes the
IPv4 address. This is so that we can send out 10-million packet per second
when scanning the entire Internet, but the owner of a Class C network will
only see 1 packet per second comming in.


# Building
@@ -29,13 +31,12 @@ On Windows, use the VisualStudio 2010 project.

The project contains a built-in self-test:

	$ masscan --selftest
	$ make regress
	masscan --selftest
	selftest: success!

If the self-test succeeds, you'll get a simple success message, and the
program returns the value of 0 if you want to script it. Otherwise, it'll
print an error message indicating which module failed, and return a 1
as the code.
If the self-test fails, the program returns an exit code of '1' and an
error message particular to which module and subtest failed.

The regression test is completely offline: it doesn't send any packets.
It's just testing the invidual units within the program. I plan to create
+2 −2
Original line number Diff line number Diff line
/*
    log messages to console, spending on verbose level
    log messages to console, depending on verbose level
*/
#include "logger.h"

#include <stdarg.h>
#include <stdio.h>

int verbosity = 0;
int verbosity = 0; /* yea! a global variable!! */

void vLOG(int level, const char *fmt, va_list marker)
{
+1 −0
Original line number Diff line number Diff line
#ifndef LOGGER_H
#define LOGGER_H


void LOG(int level, const char *fmt, ...);


Loading