-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnkscan.java
58 lines (47 loc) · 1.8 KB
/
nkscan.java
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
import java.util.Scanner;
public class nkscan {
//funzione gestione
public static void main(final String[] args) {
System.out.println("Welcome to NKscan\nThis software scans the entire North Korean Internet");
System.out.println(
"Select the scan type:\n1) Range (can take a lot of time!)\n2) Webservices (HTTP and HTTPS)\n3) SMTP\n4) FTP\n5) Custom port");
final Scanner in = new Scanner(System.in);
// Acquisisco il valore per la scelta
final int r = in.nextInt();
// Effettuo la verifica per l'evento selezionato
if (r == 1) {
System.out.println("Select the minimum");
final Scanner minim = new Scanner(System.in);
// Acquisisco il valore per la scelta
final int min = minim.nextInt();
System.out.println("Select the maximum");
final Scanner maxim = new Scanner(System.in);
// Acquisisco il valore per la scelta
final int max = maxim.nextInt();
portscan.scan(min, max);
}
if (r == 2) {
System.out.println("Starting a Web scan");
webscan.scan();
}
if (r == 3) {
System.out.println("Starting a SMTP search");
singlescan.scan(25);
}
if (r == 4) {
System.out.println("Starting a FTP search");
singlescan.scan(21);
}
if (r == 5) {
System.out.println("Please choose the port to scan: ");
final Scanner portascan = new Scanner(System.in);
// Acquisisco il valore per la scelta
final int toscan = portascan.nextInt();
singlescan.scan(toscan);
}
// Visualizzo l'errore di immissione di un valore non corretto
if ( r != 0 && r != 1 && r != 2 && r != 3 && r != 4 && r != 5){
System.out.println("Error");
}
}
}