Code Monkey home page Code Monkey logo

netscan's Introduction

netscan

make-all make-image GoDoc

Scan a network for ports that are open on an ip/ip range, and ips that are in use on that network.

Table of Contents

Installation

Binaries

For installation instructions from binaries please visit the Releases Page.

Via Go

$ go get github.com/jessfraz/netscan

Usage

netscan -  Scan network ips and ports.

Usage: netscan <command>

Flags:

  -d, --debug    enable debug logging (default: false)
  -p, --ports    Ports to scan (ex. 80-443 or 80,443,8080 or 1-20,22,80-443) (default "80,443,8001,9001") 
  --proto        protocol to use (can be set more than once) (default "tcp")
  -t, --timeout  timeout for ping of port (default: 1s)

Commands:

  version  Show the version information.

Examples

# for a cidr
$ netscan 192.168.0.1/24

# for a single ip
$ netscan 192.168.104.30

netscan's People

Contributors

github-actions[bot] avatar jessfraz avatar meyskens avatar toc-me[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

netscan's Issues

Returned Address Sets always contains ip *.*.*.255

Hi,
if you run Scan() the result will always contain the number of open ips on the specific port but always the same IP (e.g. 10.0.1.255 or 192.168.1.255).

This is caused because you dereference a variable inside a GO Routine which was referenced inside a Range Loop.

func (s *Scanner) Scan() []AddressSet {
	...
         // here you get a reference to the specific id
	for _, ip := range s.ips {

and then

                                                
                                                 // here you use the referenced IP which is at this time the last item of the range loop
						results = append(results, AddressSet{
							IP:       copyIP(ip),
							Port:     port,
							Protocol: proto,
						})
					

To fix that, you need to copy the id first into a variable and pass it into the go routine (as you did with address).

With a large range cidr, netscan got panic!

./netscan -d --proto tcp --port 8545 101.37.128.0/17

goroutine 44247 [runnable]:
context.WithDeadline.func2()
/usr/local/opt/go/libexec/src/context/context.go:387
created by time.goFunc
/usr/local/opt/go/libexec/src/time/sleep.go:170 +0x44

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.