Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

JAVA Portscanner

Empfohlene Antworten

Hallo Leute,

ich suche ein beispiel für einen einfachen JAVA Portscanner der überprüft welche Ports einer gegebenen IP-Adresse eine TCP-Verbindung zulassen.

Hat einer von euch sowas schoneinmal gemacht ?

Kann mir da vielleicht jemand helfen ??

hm, eigentlich ganz easy:

thread aufmachen, tcp verbindung herstellen, ergebniss in nen log schreiben, thread schliessen ... ;)

ist aber dann ein wirklich simpler portscanner ... weder stealth noch syn scan's etc. ;)

Kannst du mit der Klasse java.net.Socket machen.

Für jeden Port instanzierst du neu, tritt eine Exception auf dann kannst du nicht verbinden.

Socket s = null;

try {

s = new Socket(String Host, int Port)

System.out.println(Host + " : " + Port + ": offen");

s.close();

s = null;

}

catch (Exception) {

System.out.println(Host + " : " + Port + ": offen");

}

Socket s = null;

1 try {

2   s = new Socket(String Host, int Port)

3   System.out.println(Host + " : " + Port + ": offen");

4   s.close();

5   s = null;

6 }

7 catch (Exception) {

8   System.out.println(Host + " : " + Port + ": offen");

9 } 

Also die Meldung in Zeile 9 finde ich dann doch etwas seltsam :-)

Ciao

Christian

Original geschrieben von PerdianMG

Also die Meldung in Zeile 9 finde ich dann doch etwas seltsam :-)

Ist natürlich richtig, immer dieses ****** cut & paste.

Die Zeile im Catch-Block muss natürlich so oder ähnlich lauten:

System.out.println(Host + " : " + Port + " : nicht erreicht"

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Konto

Navigation

Suchen

Suchen

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.