Skip to content

Commit

Permalink
添加 winrm密码爆破 2022-07-19 11:30:1658201411
Browse files Browse the repository at this point in the history
  • Loading branch information
x51pwn committed Jul 19, 2022
1 parent 8b0b880 commit b0c5924
Show file tree
Hide file tree
Showing 224 changed files with 26,915 additions and 12 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
并对这些集成对项目进行代码级别优化、参数优化,个别模块重写
原则上不重复造轮子,除非轮子bug、问题太多
- 跨平台:基于golang实现,轻量级、高度可定制、开源,支持Linux、windows、mac os等
- 支持【19】种密码爆破,支持自定义字典
- 支持【20】种密码爆破,支持自定义字典
* RDP
* SSH
* rsh-spx
Expand All @@ -36,10 +36,11 @@
* Snmp
* Wap-wsp(Elasticsearch)
* RouterOs
* HTTP
* HTTP BasicAuth
* Weblogic
* Tomcat
* Jboss
* Winrm(wsman)
- 默认开启http密码智能爆破,需要http密码时才会自动启动,无需人工干预
- 默认检测系统是否存在nmap,存在优先则使用nmap进行快速扫描
默认使用naabu完成端口扫描 -stats=true 可以查看扫描进度
Expand Down
6 changes: 2 additions & 4 deletions brute/fuzzAI.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ func StudyErrPageAI(req *pkg.Response, page *Page, fingerprintsTag string) {
if nil == req || nil == page || "" == req.Body {
return
}
lib.Wg.Add(1)
go func() {
defer lib.Wg.Done()
lib.DoSyncFunc(func() {
var data *ErrPage
body := []byte(req.Body)
szHs, szMd5 := fingerprint.GetHahsMd5(body)
Expand All @@ -79,7 +77,7 @@ func StudyErrPageAI(req *pkg.Response, page *Page, fingerprintsTag string) {
db.Create[ErrPage](data)
}
}
}()
})
}

// 相似度精准度
Expand Down
12 changes: 12 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ require (
github.com/lcvvvv/gonmap v1.1.8
github.com/lib/pq v1.10.0
github.com/lunixbochs/struc v0.0.0-20200707160740-784aaebc1d40
github.com/masterzen/winrm v0.0.0-20220513085036-69f69afcd9e9
github.com/mfonda/simhash v0.0.0-20151007195837-79f94a1100d6
github.com/olekukonko/tablewriter v0.0.5
github.com/olivere/elastic v6.2.37+incompatible
Expand All @@ -128,6 +129,8 @@ require (
require (
git.mills.io/prologic/smtpd v0.0.0-20210710122116-a525b76c287a // indirect
github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96 // indirect
github.com/Azure/go-ntlmssp v0.0.0-20211209120228-48547f28849e // indirect
github.com/ChrisTrenkamp/goxpath v0.0.0-20210404020558-97928f7e12b6 // indirect
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible // indirect
github.com/Mzack9999/go-http-digest-auth-client v0.6.1-0.20220414142836-eb8883508809 // indirect
github.com/Mzack9999/ldapserver v1.0.2-0.20211229000134-b44a0d6ad0dd // indirect
Expand Down Expand Up @@ -164,6 +167,7 @@ require (
github.com/gobwas/httphead v0.1.0 // indirect
github.com/gobwas/pool v0.2.1 // indirect
github.com/gobwas/ws v1.1.0 // indirect
github.com/gofrs/uuid v4.2.0+incompatible // indirect
github.com/golang-jwt/jwt/v4 v4.3.0 // indirect
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe // indirect
github.com/golang-sql/sqlexp v0.1.0 // indirect
Expand All @@ -181,11 +185,18 @@ require (
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-retryablehttp v0.7.1 // indirect
github.com/hashicorp/go-uuid v1.0.2 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0 // indirect
github.com/itchyny/gojq v0.12.8 // indirect
github.com/itchyny/timefmt-go v0.1.3 // indirect
github.com/jcmturner/aescts/v2 v2.0.0 // indirect
github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect
github.com/jcmturner/gofork v1.0.0 // indirect
github.com/jcmturner/goidentity/v6 v6.0.1 // indirect
github.com/jcmturner/gokrb5/v8 v8.4.2 // indirect
github.com/jcmturner/rpc/v2 v2.0.3 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
Expand All @@ -200,6 +211,7 @@ require (
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/masterzen/simplexml v0.0.0-20190410153822-31eea3082786 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
Expand Down
28 changes: 28 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,12 @@ github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96/go.mod h1:bOv
github.com/Azure/azure-sdk-for-go/sdk/azcore v0.19.0/go.mod h1:h6H6c8enJmmocHUbLiiGY6sx7f9i+X3m1CHdd5c6Rdw=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.11.0/go.mod h1:HcM1YX14R7CJcghJGOYCgdezslRSVzqwLf/q+4Y2r/0=
github.com/Azure/azure-sdk-for-go/sdk/internal v0.7.0/go.mod h1:yqy467j36fJxcRV2TzfVZ1pCb5vxm4BtZPUdYWe/Xo8=
github.com/Azure/go-ntlmssp v0.0.0-20211209120228-48547f28849e h1:ZU22z/2YRFLyf/P4ZwUYSdNCWsMEI0VeyrFoI2rAhJQ=
github.com/Azure/go-ntlmssp v0.0.0-20211209120228-48547f28849e/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/ChrisTrenkamp/goxpath v0.0.0-20210404020558-97928f7e12b6 h1:w0E0fgc1YafGEh5cROhlROMWXiNoZqApk2PDN0M1+Ns=
github.com/ChrisTrenkamp/goxpath v0.0.0-20210404020558-97928f7e12b6/go.mod h1:nuWgzSkT5PnyOd+272uUmV0dnAnAn42Mk7PiQC5VzN4=
github.com/DataDog/gostackparse v0.5.0/go.mod h1:lTfqcJKqS9KnXQGnyQMCugq3u1FP6UZMfWR0aitKFMM=
github.com/Ice3man543/nvd v1.0.8/go.mod h1:0DxLJk6revOcJKiZxa2K+rNF/HO1zJO97lqQtXhXfSc=
github.com/Knetic/govaluate v3.0.0+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
Expand Down Expand Up @@ -253,6 +257,8 @@ github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6Wezm
github.com/gobwas/ws v1.1.0 h1:7RFti/xnNkMJnrK7D1yQ/iCIB5OrrY/54/H930kIbHA=
github.com/gobwas/ws v1.1.0/go.mod h1:nzvNcVha5eUziGrbxFCo6qFIojQHjJV5cLYIbezhfL0=
github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/gofrs/uuid v4.2.0+incompatible h1:yyYWMnhkhrKwwr8gAOcOCYxOOscHgDS9yZgBrnJfGa0=
github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
github.com/golang-jwt/jwt/v4 v4.3.0 h1:kHL1vqdqWNfATmA0FNMdmZNMyZI1U6O31X4rlIPoBog=
github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
Expand Down Expand Up @@ -352,6 +358,10 @@ github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGa
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY=
github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c=
github.com/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ=
github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4=
github.com/gorilla/sessions v1.2.1 h1:DHd3rPN5lE3Ts3D8rKkQ8x/0kqfeNmBAaiSi+o7FsgI=
github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gosnmp/gosnmp v1.35.0 h1:EuWWNPxTCdAUx2/NbQcSa3WdNxjzpy4Phv57b4MWpJM=
Expand All @@ -377,6 +387,8 @@ github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9
github.com/hashicorp/go-retryablehttp v0.6.8/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
github.com/hashicorp/go-retryablehttp v0.7.1 h1:sUiuQAnLlbvmExtFQs72iFW/HXeUn8Z1aJLQ4LJJbTQ=
github.com/hashicorp/go-retryablehttp v0.7.1/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE=
github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-version v1.3.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/go-version v1.5.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek=
Expand Down Expand Up @@ -408,6 +420,18 @@ github.com/itchyny/timefmt-go v0.1.3/go.mod h1:0osSSCQSASBJMsIZnhAaF1C2fCBTJZXrn
github.com/jarcoal/httpmock v1.0.4 h1:jp+dy/+nonJE4g4xbVtl9QdrUNbn6/3hDT5R4nDIZnA=
github.com/jarcoal/httpmock v1.0.4/go.mod h1:ATjnClrvW/3tijVmpL/va5Z3aAyGvqU3gCT8nX0Txik=
github.com/jasonlvhit/gocron v0.0.1/go.mod h1:k9a3TV8VcU73XZxfVHCHWMWF9SOqgoku0/QlY2yvlA4=
github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8=
github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs=
github.com/jcmturner/dnsutils/v2 v2.0.0 h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo=
github.com/jcmturner/dnsutils/v2 v2.0.0/go.mod h1:b0TnjGOvI/n42bZa+hmXL+kFJZsFT7G4t3HTlQ184QM=
github.com/jcmturner/gofork v1.0.0 h1:J7uCkflzTEhUZ64xqKnkDxq3kzc96ajM1Gli5ktUem8=
github.com/jcmturner/gofork v1.0.0/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o=
github.com/jcmturner/goidentity/v6 v6.0.1 h1:VKnZd2oEIMorCTsFBnJWbExfNN7yZr3EhJAxwOkZg6o=
github.com/jcmturner/goidentity/v6 v6.0.1/go.mod h1:X1YW3bgtvwAXju7V3LCIMpY0Gbxyjn/mY9zx4tFonSg=
github.com/jcmturner/gokrb5/v8 v8.4.2 h1:6ZIM6b/JJN0X8UM43ZOM6Z4SJzla+a/u7scXFJzodkA=
github.com/jcmturner/gokrb5/v8 v8.4.2/go.mod h1:sb+Xq/fTY5yktf/VxLsE3wlfPqQjp0aWNYyvBVK62bc=
github.com/jcmturner/rpc/v2 v2.0.3 h1:7FXXj8Ti1IaVFpSAziCZWNzbNuZmnvw/i6CqLNdWfZY=
github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc=
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
Expand Down Expand Up @@ -488,6 +512,10 @@ github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamh
github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/masterzen/simplexml v0.0.0-20190410153822-31eea3082786 h1:2ZKn+w/BJeL43sCxI2jhPLRv73oVVOjEKZjKkflyqxg=
github.com/masterzen/simplexml v0.0.0-20190410153822-31eea3082786/go.mod h1:kCEbxUJlNDEBNbdQMkPSp6yaKcRXVI6f4ddk8Riv4bc=
github.com/masterzen/winrm v0.0.0-20220513085036-69f69afcd9e9 h1:DhrKMJR75+SJf7pb/mPjiF527ftzAw/91QeNS/HX8cg=
github.com/masterzen/winrm v0.0.0-20220513085036-69f69afcd9e9/go.mod h1:Iju3u6NzoTAvjuhsGCZc+7fReNnr/Bd6DsWj3WTokIU=
github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ=
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40=
Expand Down
18 changes: 18 additions & 0 deletions lib/Const.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,24 @@ var Ctx_global, StopAll = context.WithCancel(RootContext)
// 多次使用,一次性编译效率更高
var DeleteMe = regexp.MustCompile("rememberMe=deleteMe")

// 异步执行方法,只适合无返回值、或使用管道返回值的方法
// 程序main整体等待
func DoSyncFunc(cbk func()) {
Wg.Add(1)
go func() {
defer Wg.Done()
for {
select {
case <-Ctx_global.Done():
return
default:
cbk()
return
}
}
}()
}

// 检查 cookie
// Shiro CVE_2016_4437 cookie
// 其他POC cookie同一检查入口
Expand Down
12 changes: 12 additions & 0 deletions pkg/hydra/cracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/hktalent/scan4all/pkg/hydra/snmp"
"github.com/hktalent/scan4all/pkg/hydra/ssh"
"github.com/hktalent/scan4all/pkg/hydra/telnet"
"github.com/hktalent/scan4all/pkg/hydra/winrm"
"github.com/hktalent/scan4all/pkg/kscan/core/slog"
"github.com/hktalent/scan4all/pkg/kscan/lib/gotelnet"
"github.com/hktalent/scan4all/pkg/kscan/lib/grdp"
Expand Down Expand Up @@ -151,6 +152,17 @@ func snmpCracker(i interface{}) interface{} {
return nil
}

func WinrmCracker(i interface{}) interface{} {
info := i.(AuthInfo)
info.Auth.MakePassword()
// info.IPAddr, info.Auth.Username, info.Auth.Password, info.Port
if ok, err := winrm.WinrmAuth(info.IPAddr, info.Auth.Username, info.Auth.Password, info.Port); ok {
slog.Printf(slog.DEBUG, "%s:%s@%s:%d:%s", info.Auth.Username, info.Auth.Password, info.IPAddr, info.Port, err)
info.Status = true
return info
}
return nil
}
func RouterOsCracker(i interface{}) interface{} {
info := i.(AuthInfo)
info.Auth.MakePassword()
Expand Down
11 changes: 6 additions & 5 deletions pkg/hydra/doNmapResult.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,14 @@ import (

// 弱口令检测
func CheckWeakPassword(ip, service string, port int) {
lib.Wg.Add(1)
go func() {
defer lib.Wg.Done()
lib.DoSyncFunc(func() {
// 在弱口令检测范围就开始检测,结果....
service = strings.ToLower(service)
if pkg.Contains(ProtocolList, service) {
//log.Println("start CheckWeakPassword ", ip, ":", port, "(", service, ")")
Start(ip, port, service)
}
}()
})
}

// 开启了es
Expand Down Expand Up @@ -66,7 +64,7 @@ func DoParseXml(s string, bf *bytes.Buffer) {
ip := x1
szPort := GetAttr(x.Attr, "portid")
port, _ := strconv.Atoi(szPort)
service := GetAttr(x.SelectElement("service").Attr, "name")
service := strings.ToLower(GetAttr(x.SelectElement("service").Attr, "name"))
//bf.Write([]byte(fmt.Sprintf("%s:%s\n", ip, szPort)))
szUlr := fmt.Sprintf("http://%s:%s\n", ip, szPort)
bf.Write([]byte(szUlr))
Expand Down Expand Up @@ -95,7 +93,10 @@ func DoParseXml(s string, bf *bytes.Buffer) {
}
if bCheckWeakPassword && "8728" == szPort && service == "unknown" {
CheckWeakPassword(ip, "router", port)
} else if bCheckWeakPassword && ("5985" == szPort || "5986" == szPort) && -1 < strings.Index(service, "microsoft ") {
CheckWeakPassword(ip, "winrm", port)
}

log.Printf("%s\t%d\t%s\n", ip, port, service)
}
}
Expand Down
4 changes: 3 additions & 1 deletion pkg/hydra/hydra.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var (
CustomAuthMap *AuthList
// rtsp://admin:admin@192.168.0.111:554/0x8b6c42
// rtsp: 554, 5554,8554
ProtocolList = strings.Split("rdp,ssh,rsh-spx,mysql,mssql,oracle,postgresql,redis,ftp,mongodb,smb,telnet,snmp,wap-wsp,router", ",")
ProtocolList = strings.Split("rdp,ssh,rsh-spx,mysql,mssql,oracle,postgresql,redis,ftp,mongodb,smb,telnet,snmp,wap-wsp,router,winrm", ",")
)

func NewCracker(info *AuthInfo, isAuthUpdate bool, threads int) *Cracker {
Expand Down Expand Up @@ -106,6 +106,8 @@ func (c *Cracker) Run() {
// 8728/tcp open unknown syn-ack
case "router": //
c.Pool.Function = RouterOsCracker
case "winrm":
c.Pool.Function = WinrmCracker
case "mongodb":
c.Pool.Function = mongodbCracker
case "redis":
Expand Down
1 change: 1 addition & 0 deletions pkg/hydra/loadDicts.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ func init() {
Paswd: pkg.GetVal4File("smb_pswd", smb_pswd),
DefaultUp: pkg.GetVal4Filedefault("smb_default", smb_default),
}
md["winrm"] = md["smb"]
md["telnet"] = PPDict{
Username: pkg.GetVal4File("telnet_username", telnetusername),
Paswd: pkg.GetVal4File("telnet_pswd", telnet_pswd),
Expand Down
27 changes: 27 additions & 0 deletions pkg/hydra/winrm/winrm.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package winrm

import (
"os"
)
import (
"github.com/masterzen/winrm"
)

// https://pentestlab.blog/tag/winrm/
// nmap -p 5985 -sV 10.0.0.2 10.0.0.1
// https://www.hackingarticles.in/winrm-penetration-testing/
// port: wsman/WinRM service
// 5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
func WinrmAuth(host, user, pass string, port int) (result bool, err error) {
result = false
endpoint := winrm.NewEndpoint(host, port, false, false, nil, nil, nil, 0)
client, err := winrm.NewClient(endpoint, user, pass)
if err != nil {
//log.Println("WinrmAuth ",err)
}
res, err := client.Run("echo ISOK", os.Stdout, os.Stderr)
if res == 0 {
result = true
}
return result, err
}
2 changes: 2 additions & 0 deletions pocs_go/ms/CVE-2020-0796.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,11 @@ func WrapperTcpWithTimeout(network, address string, timeout time.Duration) (net.
return WrapperTCP(network, address, d)
}

// SmbGhost
// port 445
// SmbGhost
func SmbGhostScan(szIp string) (bool, error) {
go DoMS17010(szIp)
ip, port, timeout := szIp, 445, time.Duration(10)*time.Second
addr := fmt.Sprintf("%s:%v", ip, port)
conn, err := WrapperTcpWithTimeout("tcp", addr, timeout)
Expand Down
Loading

0 comments on commit b0c5924

Please sign in to comment.