Skip to content

Commit

Permalink
fix: 修复 TLS 证书过期问题
Browse files Browse the repository at this point in the history
1. 修复 HTTP 请求过程中出现 TLS 证书过期导致报错的问题
2. 优化代码输出格式
  • Loading branch information
X1r0z committed Aug 7, 2023
1 parent cf1a66a commit 1096402
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 26 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ check

```shell
$ ./EBurstGo -url https://192.168.30.11 -check
[-] 不存在 https://192.168.30.11/owa/auth.owa 接口
[+] 存在 https://192.168.30.11/ews 接口, 可以爆破
[+] 存在 https://192.168.30.11/mapi 接口, 可以爆破
[+] 存在 https://192.168.30.11/oab 接口, 可以爆破
[-] 不存在 https://192.168.30.11/owa/auth.owa 接口
[+] 存在 https://192.168.30.11/powershell 接口, 可以爆破
[+] 存在 https://192.168.30.11/autodiscover 接口, 可以爆破
[+] 存在 https://192.168.30.11/Microsoft-Server-ActiveSync 接口, 可以爆破
[+] 存在 https://192.168.30.11/rpc 接口, 可以爆破
[+] 存在 owa 接口 (/owa/auth.owa), 可以爆破
[+] 存在 powershell 接口 (/powershell), 可以爆破
[+] 存在 ecp 接口 (/owa/auth.owa), 可以爆破
[+] 存在 autodiscover 接口 (/autodiscover), 可以爆破
[+] 存在 mapi 接口 (/mapi), 可以爆破
[+] 存在 activesync 接口 (/Microsoft-Server-ActiveSync), 可以爆破
[+] 存在 oab 接口 (/oab), 可以爆破
[+] 存在 ews 接口 (/ews), 可以爆破
[+] 存在 rpc 接口 (/rpc), 可以爆破
```

brute
Expand Down
8 changes: 4 additions & 4 deletions lib/basicbrute.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ func BasicBruteWorker(u string, domain string, task chan []string) {
req.Header.Add("Connection", "close")
res, _ := Client.Do(req)
if res.StatusCode != 401 && res.StatusCode != 408 && res.StatusCode != 504 {
color.Green("[+] 成功 %v", username+":"+password)
color.Green("[+] 成功: %v", username+":"+password)
} else {
//color.Red("[-] 失败 %v", username+":"+password)
//color.Red("[-] 失败: %v", username+":"+password)
}
}
}
Expand All @@ -29,7 +29,7 @@ func BasicBruteRun(targetUrl string, mode string, domain string, userDict []stri

authPath := ExchangeUrls[mode]
u, _ := url.JoinPath(targetUrl, authPath)
fmt.Println("[*] 使用", mode, "接口爆破", targetUrl)
fmt.Println("[*] 使用", mode, "接口爆破:", targetUrl)

task := make(chan []string, len(userDict)*len(passDict))

Expand All @@ -56,5 +56,5 @@ func BasicBruteRun(targetUrl string, mode string, domain string, userDict []stri
wg.Wait()

t2 := time.Now()
fmt.Println("[*] 耗时", t2.Sub(t1))
fmt.Println("[*] 耗时:", t2.Sub(t1))
}
19 changes: 15 additions & 4 deletions lib/check.go
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@
package lib

import (
"crypto/tls"
"github.com/fatih/color"
"net/http"
"net/url"
)

func Check(targetUrl string) {

for _, v := range ExchangeUrls {
for k, v := range ExchangeUrls {
u, _ := url.JoinPath(targetUrl, v)
res, err := Client.Get(u)

client := &http.Client{
Transport: &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: true,
Renegotiation: tls.RenegotiateOnceAsClient,
},
},
}
res, err := client.Get(u)
if err != nil {
panic(err)
}
if res.StatusCode != 404 && res.StatusCode != 403 && res.StatusCode != 301 && res.StatusCode != 302 {
color.Green("[+] 存在 %v 接口, 可以爆破", u)
color.Green("[+] 存在 %v 接口 (%v), 可以爆破", k, v)
} else {
color.Red("[-] 不存在 %v 接口", u)
color.Red("[-] 不存在 %v 接口 (%v)", k, v)
}
}
}
10 changes: 5 additions & 5 deletions lib/httpbrute.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ func HttpBruteWorker(targetUrl string, mode string, u string, domain string, tas
location := res.Header.Get("Location")

if location == "" {
//color.Red("[-] 失败 %v", username+":"+password)
//color.Red("[-] 失败: %v", username+":"+password)
} else if !strings.Contains(location, "reason") {
color.Green("[+] 成功 %v", username+":"+password)
color.Green("[+] 成功: %v", username+":"+password)
} else {
//color.Red("[-] 失败 %v", username+":"+password)
//color.Red("[-] 失败: %v", username+":"+password)
}
}
}
Expand All @@ -55,7 +55,7 @@ func HttpBruteRun(targetUrl string, mode string, domain string, userDict []strin

authPath := ExchangeUrls[mode]
u, _ := url.JoinPath(targetUrl, authPath)
fmt.Println("[*] 使用", mode, "接口爆破", targetUrl)
fmt.Println("[*] 使用", mode, "接口爆破:", targetUrl)

task := make(chan []string, len(userDict)*len(passDict))

Expand All @@ -82,5 +82,5 @@ func HttpBruteRun(targetUrl string, mode string, domain string, userDict []strin
wg.Wait()

t2 := time.Now()
fmt.Println("[*] 耗时", t2.Sub(t1))
fmt.Println("[*] 耗时:", t2.Sub(t1))
}
8 changes: 4 additions & 4 deletions lib/ntlmbrute.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ func NtlmBruteWorker(u string, domain string, task chan []string) {
req.SetBasicAuth(domain+"\\"+username, password)
res, _ := NtlmClient.Do(req)
if res.StatusCode != 401 && res.StatusCode != 408 && res.StatusCode != 504 {
color.Green("[+] 成功 %v", username+":"+password)
color.Green("[+] 成功: %v", username+":"+password)
} else {
//color.Red("[-] 失败 %v", username+":"+password)
//color.Red("[-] 失败: %v", username+":"+password)
}
}
}
Expand All @@ -28,7 +28,7 @@ func NtlmBruteRun(targetUrl string, mode string, domain string, userDict []strin

authPath := ExchangeUrls[mode]
u, _ := url.JoinPath(targetUrl, authPath)
fmt.Println("[*] 使用", mode, "接口爆破", targetUrl)
fmt.Println("[*] 使用", mode, "接口爆破:", targetUrl)

task := make(chan []string, len(userDict)*len(passDict))

Expand All @@ -55,5 +55,5 @@ func NtlmBruteRun(targetUrl string, mode string, domain string, userDict []strin
wg.Wait()

t2 := time.Now()
fmt.Println("[*] 耗时", t2.Sub(t1))
fmt.Println("[*] 耗时:", t2.Sub(t1))
}

0 comments on commit 1096402

Please sign in to comment.