public class PortScanner extends Observable implements Runnable
Observable
threaded class that scans a specified range of IP ports for access and notifies the Observer when access is available.
The user can specify the target IP addres and the port range. Once you start this thread register it with an Observer.PortScannerApp
for a basic implementation.Modifier and Type | Field and Description |
---|---|
boolean |
completed
Class var indicating when this Observable class thread has completed
|
private int |
fromPort
the starting port to start the scan [default=0].
|
private String |
target
The class field for the IP address to target this scan.
|
private int |
toPort
sets the last port in the scan range [default=65535].
|
Constructor and Description |
---|
PortScanner() |
Modifier and Type | Method and Description |
---|---|
void |
run()
Thread Implementation.
|
void |
setFromPort(int fromPort)
sets the starting port to start the scan.
|
void |
setTarget(String target)
sets IP address to scan.
|
void |
setToPort(int toPort)
sets the last port in the scan range.
|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
private int fromPort
private int toPort
public boolean completed
public PortScanner()
public void setFromPort(int fromPort)
public void setToPort(int toPort)
public void setTarget(String target)
target
- is the String representation of the IP address to scan.WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses