Skip to content

Commit

Permalink
添加打印机指纹
Browse files Browse the repository at this point in the history
  • Loading branch information
shadow1ng committed May 14, 2021
1 parent b6133c4 commit 4431b42
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
18 changes: 13 additions & 5 deletions Plugins/webtitle.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func GOWebTitle(info *common.HostInfo) error {
}

err, result, CheckData := geturl(info, 1, CheckData)
if err != nil {
if err != nil && !strings.Contains(err.Error(), "EOF") {
return err
}
if strings.Contains(result, "://") {
Expand All @@ -69,6 +69,7 @@ func GOWebTitle(info *common.HostInfo) error {
}

if result == "https" {
info.Url = strings.Replace(info.Url, "http://", "https://", 1)
err, result, CheckData = geturl(info, 1, CheckData)
if strings.Contains(result, "://") {
//有跳转
Expand Down Expand Up @@ -134,6 +135,7 @@ func geturl(info *common.HostInfo, flag int, CheckData []WebScan.CheckDatas) (er
if err == nil {
defer resp.Body.Close()
var title string
var text []byte
body, err := getRespBody(resp)
if err != nil {
return err, "", CheckData
Expand All @@ -142,7 +144,7 @@ func geturl(info *common.HostInfo, flag int, CheckData []WebScan.CheckDatas) (er
re := regexp.MustCompile("(?im)<title>(.*)</title>")
find := re.FindSubmatch(body)
if len(find) > 1 {
text := find[1]
text = find[1]
GetEncoding := func() string { // 判断Content-Type
r1, err := regexp.Compile(`(?im)charset=\s*?([\w-]+)`)
if err != nil {
Expand Down Expand Up @@ -191,7 +193,14 @@ func geturl(info *common.HostInfo, flag int, CheckData []WebScan.CheckDatas) (er
if len(title) > 100 {
title = title[:100]
}
result := fmt.Sprintf("[*] WebTitle:%-25v %-3v %v", Url, resp.StatusCode, title)
if title == "" {
title = "None"
}
length := resp.Header.Get("Content-Length")
if length == "" {
length = fmt.Sprintf("%v", len(text))
}
result := fmt.Sprintf("[*] WebTitle:%-25v code:%-3v len:%-6v title:%v", Url, resp.StatusCode, length, title)
common.LogSuccess(result)
}
CheckData = append(CheckData, WebScan.CheckDatas{body, fmt.Sprintf("%s", resp.Header)})
Expand All @@ -200,12 +209,11 @@ func geturl(info *common.HostInfo, flag int, CheckData []WebScan.CheckDatas) (er
return nil, redirURL.String(), CheckData
}
if resp.StatusCode == 400 && info.Url[:5] != "https" {
info.Url = strings.Replace(info.Url, "http://", "https://", 1)
return err, "https", CheckData
}
return err, "", CheckData
}
return err, "", CheckData
return err, "https", CheckData
}
return err, "", CheckData
}
Expand Down
2 changes: 2 additions & 0 deletions WebScan/info/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ var RuleDatas = []RuleData{
{"360网站安全检测", "code", "(webscan.360.cn/status/pai/hash)"},
{"H3C ER5200G2", "code", "(ER5200G2系统管理)"},
{"华为(HUAWEI)安全设备", "code", "(sweb-lib/resource/)"},
{"华为(HUAWEI)USG", "code", "(UI_component/commonDefine/UI_regex_define.js)"},
{"H3C ER6300", "code", "(ER6300系统管理)"},
{"华为_HUAWEI_ASG2100", "code", "(HUAWEI ASG2100)"},
{"TP-Link 3600 DD-WRT", "code", "(TP-Link 3600 DD-WRT)"},
Expand Down Expand Up @@ -126,6 +127,7 @@ var RuleDatas = []RuleData{
{"Jenkins", "code", "(Jenkins)"},
{"红帆OA", "code", "(iOffice)"},
{"VMware vSphere", "code", "(VMware vSphere)"},
{"打印机", "code", "(打印机|media/canon.gif)"},
}

var Md5Datas = []Md5Data{
Expand Down

0 comments on commit 4431b42

Please sign in to comment.