forked from NARKOZ/hacker-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFuckingCoffee.java
More file actions
34 lines (31 loc) · 1.14 KB
/
FuckingCoffee.java
File metadata and controls
34 lines (31 loc) · 1.14 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
import java.net.*;
import java.io.*;
public class FuckingCoffee{
private static final String MY_USERNAME = "my_username";
private static final String PASSWORD_PROMPT = "Password: ";
private static final String PASSWORD = "1234";
private static final String COFFEE_MACHINE_IP = "10.10.42.42";
private static int DELAY_BEFORE_BREW = 17;
private static int DELAY = 24;
public static void main(String[] args)throws Exception{
for(int i = 1; i< args.length ; i++){
if(!args[i].contains(MY_USERNAME)){
return;
}
}
Socket telnet = new Socket(COFFEE_MACHINE_IP, 23);
PrintWriter out = new PrintWriter(telnet.getOutputStream(), true);
BufferedReader in = new BufferedReader(new InputStreamReader(telnet.getInputStream()));
Thread.sleep(DELAY_BEFORE_BREW*1000);
if(!in.readLine().equals(PASSWORD_PROMPT)){
return ;
}
out.println(PASSWORD);
out.println("sys brew");
Thread.sleep(DELAY*1000);
out.println("sys pour");
out.close();
in.close();
telnet.close();
}
}