Giter VIP home page Giter VIP logo

tcp_scanner's People

Contributors

shpak86 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tcp_scanner's Issues

Open ports List Not Show in Some Time

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');
                                          }
                                        }

Empty closed ports list

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.