-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. 修复 HTTP 请求过程中出现 TLS 证书过期导致报错的问题 2. 优化代码输出格式
- Loading branch information
Showing
5 changed files
with
37 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters