GithubHelp home page GithubHelp logo

afwu / gomap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from justintimperio/gomap

0.0 1.0 0.0 185 KB

A fully self-contained Nmap like parallel port scanning module in pure Golang that supports SYN-ACK (Silent Scans)

License: MIT License

Go 100.00%

gomap's Introduction

gomap

GitHub Go Reference Go Report Card Codacy Badge

What is gomap?

Gomap is a fully self-contained nmap like module for Golang. Unlike other projects which provide nmap C bindings or rely on other local dependencies, gomap is a fully implemented in pure Go. Gomap imports zero non-core modules making it ideal for applications that have zero control on the clients operating system. Since this is a small library, it only focuses on providing a few core features. For the most part its API is stable with changes being applied to its unexposed internal scanning functions.

Features

  • Parallel port scanning using go routines
  • Automated CIDR range scanning
  • Service prediction by port number
  • SYN (Silent) Scanning Mode
  • UDP Scanning (Non-Stealth)
  • Fast and detailed scanning for common ports
  • Pure Go with zero dependencies
  • Easily integrated into other projects

Upcoming Features

  • CIDR range size detection

Example Usage - 1

Performs a fastscan for the most common ports on every IP on a local range

Create Files

  1. Create quickscan.go
package main

import (
	"fmt"

	"github.com/JustinTimperio/gomap"
)

func main() {
	var (
		proto    = "tcp"
		fastscan = true
		syn      = false
	)

	scan, err := gomap.ScanRange(proto, fastscan, syn)
	if err != nil {
		// handle error
	}
	fmt.Printf(scan.String())
}
  1. go mod init quickscan
  2. go mod tidy
  3. go run quickscan.go

Example Output

Host: computer-name (192.168.1.132)
        |     Port      Service
        |     ----      -------
        |---- 22        ssh
 
Host: server-nginx (192.168.1.143)
        |     Port      Service
        |     ----      -------
        |---- 443       https
        |---- 80        http
        |---- 22        ssh
 
Host: server-minio (192.168.1.112)
        |     Port      Service
        |     ----      -------
        |---- 22        ssh

Host: some-phone (192.168.1.155)
        |- No Open Ports

Example Usage - 2

Performs a detailed stealth scan on a single IP

Create Files

  1. Create stealthmap.go
package main

import (
	"fmt"

	"github.com/JustinTimperio/gomap"
)

func main() {
	// Stealth scans MUST be run as root/admin
	var (
		fastscan = false
		syn      = true
		proto    = "tcp"
		ip       = "192.168.1.120"
	)

	scan, err := gomap.ScanIP(ip, proto, fastscan, syn)
	if err != nil {
		// handle error
	}
	fmt.Printf(scan.String())
}
  1. go mod init stealthmap
  2. go mod tidy
  3. sudo go run stealthmap.go

Example Output

Host: 192.168.1.120 | Ports Scanned 3236/3236
Host: Voyager (192.168.1.120)
        |     Port      Service
        |     ----      -------
        |---- 22        SSH Remote Login Protocol
        |---- 80        World Wide Web HTTP
        |---- 443       HTTP protocol over TLS/SSL

gomap's People

Contributors

justintimperio avatar lu4p avatar schmenn avatar

Watchers

 avatar

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.