ms

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: BSD-3-Clause Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const MaxPendingReplies int = 256
View Source
const MaxProbeResponseTime time.Duration = time.Second * 2
View Source
const (
	Proxy = "" // 代理

)

Variables

View Source
var (
	UNIQUE_NAMES = map[string]string{
		"\x00": "Workstation Service",
		"\x03": "Messenger Service",
		"\x06": "RAS Server Service",
		"\x1F": "NetDDE Service",
		"\x20": "Server Service",
		"\x21": "RAS Client Service",
		"\xBE": "Network Monitor Agent",
		"\xBF": "Network Monitor Application",
		"\x1D": "Master Browser",
		"\x1B": "Domain Master Browser",
	}

	GROUP_NAMES = map[string]string{
		"\x00": "Domain Name",
		"\x1C": "Domain Controllers",
		"\x1E": "Browser Service Elections",
	}

	NetBIOS_ITEM_TYPE = map[string]string{
		"\x01\x00": "NetBIOS computer name",
		"\x02\x00": "NetBIOS domain name",
		"\x03\x00": "DNS computer name",
		"\x04\x00": "DNS domain name",
		"\x05\x00": "DNS tree name",
		"\x07\x00": "Time stamp",
	}
)
View Source
var IPv4_Mask_Sizes = []uint32{
	2147483648,
	1073741824,
	536870912,
	268435456,
	134217728,
	67108864,
	33554432,
	16777216,
	8388608,
	4194304,
	2097152,
	1048576,
	524288,
	262144,
	131072,
	65536,
	32768,
	16384,
	8192,
	4096,
	2048,
	1024,
	512,
	256,
	128,
	64,
	32,
	16,
	8,
	4,
	2,
	1,
}
View Source
var IPv4_Masks = map[uint32]uint32{
	1:          32,
	2:          31,
	4:          30,
	8:          29,
	16:         28,
	32:         27,
	64:         26,
	128:        25,
	256:        24,
	512:        23,
	1024:       22,
	2048:       21,
	4096:       20,
	8192:       19,
	16384:      18,
	32768:      17,
	65536:      16,
	131072:     15,
	262144:     14,
	524288:     13,
	1048576:    12,
	2097152:    11,
	4194304:    10,
	8388608:    9,
	16777216:   8,
	33554432:   7,
	67108864:   6,
	134217728:  5,
	268435456:  4,
	536870912:  3,
	1073741824: 2,
	2147483648: 1,
}
View Source
var Match_IPv4 = regexp.MustCompile(`^(?:(?:25[0-5]|2[0-4][0-9]|[0-1]?[0-9]{1,2})[.](?:25[0-5]|2[0-4][0-9]|[0-1]?[0-9]{1,2})[.](?:25[0-5]|2[0-4][0-9]|[0-1]?[0-9]{1,2})[.](?:25[0-5]|2[0-4][0-9]|[0-1]?[0-9]{1,2}))$`)
View Source
var Match_IPv6 = regexp.MustCompile(`^((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?$`)
View Source
var Scantype string

Functions

func AddressesFromCIDR

func AddressesFromCIDR(cidr string, o chan<- string)

func CVE_2018_14847

func CVE_2018_14847(ip string) []string

https://nvd.nist.gov/vuln/detail/cve-2018-14847 MikroTik RouterOS through 6.42 allows unauthenticated remote attackers to read arbitrary files and remote authenticated attackers to write arbitrary files due to a directory traversal vulnerability in the WinBox interface port 8291

func CheckCVE_2021_26855

func CheckCVE_2021_26855(target string) string

check CVE-2021-26855

https://github.com/righel/ms-exchange-version-nse/blob/main/ms-exchange-version.nse 指纹:path /ecp/Current/exporttool/microsoft.exchange.ediscovery.exporttool.application /ecp/%s/exporttool/microsoft.exchange.ediscovery.exporttool.application <assemblyIdentity.*version="(%d+.%d+.%d+.%d+)"

https://raw.githubusercontent.com/righel/ms-exchange-version-nse/main/ms-exchange-versions-dict.json https://raw.githubusercontent.com/righel/ms-exchange-version-nse/main/ms-exchange-unique-versions-dict.json https://raw.githubusercontent.com/righel/ms-exchange-version-nse/main/ms-exchange-versions-cves-dict.json port 443 https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-26855 add Microsoft Exchange Server Remote Code Execution Vulnerability CVE-2021-26855 finder https://www.msb365.blog/?p=4099

func CheckDCom

func CheckDCom(host string) ([]string, error)

135 port

func CheckExchange

func CheckExchange(host *string) []string

func DoMS17010

func DoMS17010(ip string)

https://docs.microsoft.com/en-us/security-updates/securitybulletins/2017/ms17-010 CVE-2017-0143 CVE-2017-0144 CVE-2017-0145 CVE-2017-0146 CVE-2017-0147 CVE-2017-0148

func GetExFQND

func GetExFQND(target string) string

add EXCHANGE Finder

func IPv4Range2CIDRs

func IPv4Range2CIDRs(s_ip string, e_ip string) ([]string, error)

func IPv4UIntRange2CIDRs

func IPv4UIntRange2CIDRs(s_i uint32, e_i uint32) []string

func IPv4_to_UInt

func IPv4_to_UInt(ips string) (uint32, error)

func Info

func Info(target string)

内网 ip 检测 调用入口

func InitPaths

func InitPaths() []string

返回路径 通常在指纹页面中添加

func MS17010

func MS17010(ip string, timeout time.Duration)

func Negotiate

func Negotiate() []byte

ntlm type1

func NetBIOS

func NetBIOS(info *HostInfo) (string, error)

func Ntlminfo

func Ntlminfo(targetUrl string) (fqdn string, domain string)

ntlm type2 fqdn

func Postxml

func Postxml(targetUrl string, fqdn string, xmlcontent string) string

func SmbGhostScan

func SmbGhostScan(szIp string) (bool, error)

SmbGhost port 445 SmbGhost

func Socks5Dailer

func Socks5Dailer(forward *net.Dialer) (proxy.Dialer, error)

func TrimName

func TrimName(name string) string

func UInt_to_IPv4

func UInt_to_IPv4(ipi uint32) string

func Userenumerate

func Userenumerate(targetUrl string, fqdn string, xmlcontent string, userfile string, domainneame string, stime int)

func Verify

func Verify(targetUrl string) bool

检测漏洞存在脚本

func WrapperTCP

func WrapperTCP(network, address string, forward *net.Dialer) (net.Conn, error)

func WrapperTcpWithTimeout

func WrapperTcpWithTimeout(network, address string, timeout time.Duration) (net.Conn, error)

Types

type HostInfo

type HostInfo struct {
	Host    string
	Ports   string
	Url     string
	Infostr []string
}

type NbnsName

type NbnsName struct {
	// contains filtered or unexported fields
}

func GetNbnsname

func GetNbnsname(info *HostInfo) (nbname NbnsName, err error)

func NetBIOS1

func NetBIOS1(info *HostInfo) (nbname NbnsName, err error)

type NetbiosInfo

type NetbiosInfo struct {
	// contains filtered or unexported fields
}

type NetbiosReplyAddress

type NetbiosReplyAddress struct {
	Flag    uint16
	Address [4]uint8
}

type NetbiosReplyHeader

type NetbiosReplyHeader struct {
	XID             uint16
	Flags           uint16
	QuestionCount   uint16
	AnswerCount     uint16
	AuthCount       uint16
	AdditionalCount uint16
	QuestionName    [34]byte
	RecordType      uint16
	RecordClass     uint16
	RecordTTL       uint32
	RecordLength    uint16
}

type NetbiosReplyName

type NetbiosReplyName struct {
	Name [15]byte
	Type uint8
	Flag uint16
}

type NetbiosReplyStatus

type NetbiosReplyStatus struct {
	Header    NetbiosReplyHeader
	HostName  [15]byte
	UserName  [15]byte
	Names     []NetbiosReplyName
	Addresses []NetbiosReplyAddress
	HWAddr    string
}

type Probe

type Probe struct {
	// contains filtered or unexported fields
}

func (*Probe) AddTarget

func (this *Probe) AddTarget(t string)

func (*Probe) CheckRateLimit

func (this *Probe) CheckRateLimit()

func (*Probe) CloseInput

func (this *Probe) CloseInput()

func (*Probe) Initialize

func (this *Probe) Initialize()

func (*Probe) SetLimiter

func (this *Probe) SetLimiter(limiter *rate.Limiter)

func (*Probe) SetOutput

func (this *Probe) SetOutput(c_out chan<- ScanResult)

func (*Probe) Setup

func (this *Probe) Setup()

func (*Probe) String

func (this *Probe) String() string

func (*Probe) Wait

func (this *Probe) Wait()

type ProbeNetbios

type ProbeNetbios struct {
	Probe
	// contains filtered or unexported fields
}

func (*ProbeNetbios) CreateNameRequest

func (this *ProbeNetbios) CreateNameRequest(name string) []byte

func (*ProbeNetbios) CreateStatusRequest

func (this *ProbeNetbios) CreateStatusRequest() []byte

func (*ProbeNetbios) DecodeNetbiosName

func (this *ProbeNetbios) DecodeNetbiosName(name [32]byte) [16]byte

func (*ProbeNetbios) EncodeNetbiosName

func (this *ProbeNetbios) EncodeNetbiosName(name [16]byte) [32]byte

func (*ProbeNetbios) Initialize

func (this *ProbeNetbios) Initialize()

func (*ProbeNetbios) ParseReply

func (this *ProbeNetbios) ParseReply(buff []byte) NetbiosReplyStatus

func (*ProbeNetbios) ProcessReplies

func (this *ProbeNetbios) ProcessReplies()

func (*ProbeNetbios) ReportIncompleteResults

func (this *ProbeNetbios) ReportIncompleteResults()

func (*ProbeNetbios) ReportResult

func (this *ProbeNetbios) ReportResult(ip string)

func (*ProbeNetbios) ResultFromIP

func (this *ProbeNetbios) ResultFromIP(ip string) ScanResult

func (*ProbeNetbios) SendNameRequest

func (this *ProbeNetbios) SendNameRequest(ip string)

func (*ProbeNetbios) SendRequest

func (this *ProbeNetbios) SendRequest(ip string, req []byte)

func (*ProbeNetbios) SendStatusRequest

func (this *ProbeNetbios) SendStatusRequest(ip string)

type Prober

type Prober interface {
	Setup()
	Initialize()
	Wait()
	AddTarget(string)
	CloseInput()
	SetOutput(chan<- ScanResult)
	CheckRateLimit()
	SetLimiter(*rate.Limiter)
}

type ScanResult

type ScanResult struct {
	Host  string            `json:"host"`
	Port  string            `json:"port,omitempty"`
	Proto string            `json:"proto,omitempty"`
	Probe string            `json:"probe,omitempty"`
	Name  string            `json:"name,omitempty"`
	Nets  []string          `json:"nets,omitempty"`
	Info  map[string]string `json:"info"`
}

Jump to

Keyboard shortcuts

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