shpak86 / tcp_scanner Goto Github PK
View Code? Open in Web Editor NEWPorts scanner package
Home Page: https://pub.dev/packages/tcp_scanner
License: MIT License
Ports scanner package
Home Page: https://pub.dev/packages/tcp_scanner
License: MIT License
I am trying to scan a port [1883] Using TcpScannerTask some time it return report.openPort but mostly not
for (var element in addressList) {
var stopwatch1 = Stopwatch();
stopwatch1.start();
// Simple scan
try {
var scannerTask = TcpScannerTask(element, [1883], shuffle: false, parallelism: 1);
Future.delayed(const Duration(seconds: 10), () {
print('ScannerTask cancelled by timeout after ${stopwatch1.elapsed}');
scannerTask
.cancel()
.then((report) => print('Host ${report.host} scan was cancelled\n'
'Scanned ports:\t${report.openPorts.length + report.closedPorts.length}\n'
'Open ports:\t${report.openPorts}\n'
'Status:\t${report.status}\n'
'Elapsed:\t${stopwatch1.elapsed}\n'))
.catchError((error) => stderr.writeln(error));
});
await scannerTask.start().then((report) async {
print('Host ${report.host} scan completed\n'
'Scanned ports:\t${report.ports.length}\n'
'Close ports:\t${report.openPorts}\n'
'Open ports:\t${report.openPorts}\n'
'Status:\t${report.status}\n'
'Elapsed:\t${stopwatch1.elapsed}\n');
if (report.openPorts.contains(1883)) {
esp32Devices.add(report.host);
print('Here is the ESP32 Devices Available on $esp32Devices');
if (esp32Devices.isNotEmpty) {
await mqttClientWorking();
}
}
})
// Catch errors during the scan
.catchError((error) => stderr.writeln(error));
} catch (e) {
// Here you can catch exceptions threw in the constructor
stderr.writeln('Error: $e');
}
}
Why I get the closed ports list empty? the host is reachable as you can see.
I/flutter (19317): HTTP ports scan result
I/flutter (19317): Host: 192.168.4.1
I/flutter (19317): Scanned ports: [503, 513]
I/flutter (19317): Open ports: [503]
I/flutter (19317): Closed ports: []
I/flutter (19317): Elapsed time: 0.783s
We should support the "Stop" function to stop the scanning process.
@shpak86 @jahan-addison
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.