pkg

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2024 License: MIT Imports: 16 Imported by: 1

README

scan是扫描模块,提供:

  • ip扫描
    • 192.168.0.1
  • ip段扫描
    • 192.168.1-10.55
    • 192.168.1.1-255
  • 端口扫描
    • 1-65535
  • 扫描结果展示

使用

scan是showme终端GUI显示,提供动态参数提示功能。

showme

=> host@127.0.0.1 # showme
>>> scan 192.168.50.1-255
            192.168.50.1-255  192网段  
            192.168.40.1-255  192网段  
            192.168.1.1-255   192网段  

参数

IP段参数说明

  • 支持单IP
  • 支持【-】指定范围IP,包括A、B、C、D段

GUI操作说明

  • Tab: Next View
  • Enter: Select IP/Commit Input
  • F5: Input New Scan IP or Port range
  • ↑ ↓: Move View
  • ^c: Exit
  • F1: Help
  • Space: search result with ip view and port view

Documentation

Index

Constants

View Source
const (
	TextLeft = Align(iota)
	TextRight
	TextCenter
)

Variables

This section is empty.

Functions

func AlignCenter

func AlignCenter(s string, n int) string

AlignCenter align center

func AlignLeft

func AlignLeft(s string, n int) string

AlignLeft align left

func AlignRight

func AlignRight(s string, n int) string

AlignRight align right

func CollectEasy

func CollectEasy() []string

func Colorize

func Colorize(text string, status string, background string, underline bool, highshow bool) string

文字字体 参数介绍:text->文本内容 status->文字颜色 background->背景颜色 underline->是否下划线 highshow->是否高亮 http://www.cnblogs.com/frydsh/p/4139922.html

func GetIps

func GetIps() []string

func GetNowTime

func GetNowTime() string

func ParseIps

func ParseIps(in string) ([]string, error)

10.1.1.1 10-20.1.1.0 1.2.3.4-200

func ParsePorts

func ParsePorts(ports string) ([]int, error)

80,3306,25-200

func Pings

func Pings(ips []string, rs chan PingResult) error

通过chan获取ip

func Pings2

func Pings2(ips []string, stop chan string, w io.Writer) error

func Pings3

func Pings3(ips []string, stop chan string) error

func Scan

func Scan(in string)

func ScanIp

func ScanIp(g *gocui.Gui, w *gocui.View, width int) error

func ScanIpPorts

func ScanIpPorts(g *gocui.Gui, w io.Writer, width int) error

func ScanPort

func ScanPort(host, port string) bool

func ScanPort2H

func ScanPort2H(ip string, ports string, stop chan string, w io.Writer) error

func TableTest

func TableTest(w io.Writer, width int)

Types

type Align

type Align int

type Col

type Col struct {
	Data      string
	Color     string
	BgColor   string
	TextAlign Align
}

func NewCol

func NewCol() *Col

func (*Col) SetBgColor

func (this *Col) SetBgColor(Color string) *Col

func (*Col) SetColor

func (this *Col) SetColor(Color string) *Col

func (*Col) SetTextAlign

func (this *Col) SetTextAlign(align Align) *Col

type PingResult

type PingResult struct {
	Ip  string
	Rtt string
}

type Table

type Table struct {
	Header       []*Col
	Rows         [][]*Col // row 行 col 列
	ColumnWidths []int
	ShowHeader   bool
	// contains filtered or unexported fields
}

func NewTable

func NewTable(width int) *Table

func (*Table) AddCol

func (this *Table) AddCol(title string) *Col

顺序添加列名

func (*Table) AddRow

func (this *Table) AddRow(row int, Data *Col)

顺序增加第row行的数据

func (*Table) AddRowByIndex

func (this *Table) AddRowByIndex(row int, Data *Col)

顺序增加第row行的数据 指定index

func (*Table) CalColumnWidths

func (this *Table) CalColumnWidths() error

func (*Table) Fprint

func (this *Table) Fprint(w io.Writer)

打印内容 正序其实打印数据只有一个

func (Table) FprintHeader

func (this Table) FprintHeader(w io.Writer)

func (*Table) FprintOrderDesc

func (this *Table) FprintOrderDesc(w io.Writer)

打印内容 倒序必须是全量数据

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL