-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDay47s1.java
More file actions
39 lines (31 loc) · 1.39 KB
/
Day47s1.java
File metadata and controls
39 lines (31 loc) · 1.39 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
import java.net.*;
import java.util.Scanner;
public class Day47s1 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("Port Tarayıcı - Siber Güvenlik Aracı");
System.out.println("-----------------------------------");
System.out.print("Hedef IP adresini girin: ");
String ipAddress = scanner.nextLine();
System.out.print("Başlangıç port numarası: ");
int startPort = scanner.nextInt();
System.out.print("Bitiş port numarası: ");
int endPort = scanner.nextInt();
System.out.println("\nPort taraması başlatılıyor...");
System.out.println("Hedef: " + ipAddress);
System.out.println("Port aralığı: " + startPort + " - " + endPort);
System.out.println("-----------------------------------");
for (int port = startPort; port <= endPort; port++) {
try {
Socket socket = new Socket();
socket.connect(new InetSocketAddress(ipAddress, port), 200);
System.out.println("Port " + port + " açık!");
socket.close();
} catch (Exception e) {
// Port kapalı veya erişilemez
}
}
System.out.println("\nTarama tamamlandı!");
scanner.close();
}
}