mirror of
https://github.com/shadow1ng/fscan.git
synced 2025-05-08 11:46:34 +00:00
添加打印机指纹
This commit is contained in:
parent
b6133c4a55
commit
4431b42b35
@ -53,7 +53,7 @@ func GOWebTitle(info *common.HostInfo) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
err, result, CheckData := geturl(info, 1, CheckData)
|
err, result, CheckData := geturl(info, 1, CheckData)
|
||||||
if err != nil {
|
if err != nil && !strings.Contains(err.Error(), "EOF") {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if strings.Contains(result, "://") {
|
if strings.Contains(result, "://") {
|
||||||
@ -69,6 +69,7 @@ func GOWebTitle(info *common.HostInfo) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if result == "https" {
|
if result == "https" {
|
||||||
|
info.Url = strings.Replace(info.Url, "http://", "https://", 1)
|
||||||
err, result, CheckData = geturl(info, 1, CheckData)
|
err, result, CheckData = geturl(info, 1, CheckData)
|
||||||
if strings.Contains(result, "://") {
|
if strings.Contains(result, "://") {
|
||||||
//有跳转
|
//有跳转
|
||||||
@ -134,6 +135,7 @@ func geturl(info *common.HostInfo, flag int, CheckData []WebScan.CheckDatas) (er
|
|||||||
if err == nil {
|
if err == nil {
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
var title string
|
var title string
|
||||||
|
var text []byte
|
||||||
body, err := getRespBody(resp)
|
body, err := getRespBody(resp)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err, "", CheckData
|
return err, "", CheckData
|
||||||
@ -142,7 +144,7 @@ func geturl(info *common.HostInfo, flag int, CheckData []WebScan.CheckDatas) (er
|
|||||||
re := regexp.MustCompile("(?im)<title>(.*)</title>")
|
re := regexp.MustCompile("(?im)<title>(.*)</title>")
|
||||||
find := re.FindSubmatch(body)
|
find := re.FindSubmatch(body)
|
||||||
if len(find) > 1 {
|
if len(find) > 1 {
|
||||||
text := find[1]
|
text = find[1]
|
||||||
GetEncoding := func() string { // 判断Content-Type
|
GetEncoding := func() string { // 判断Content-Type
|
||||||
r1, err := regexp.Compile(`(?im)charset=\s*?([\w-]+)`)
|
r1, err := regexp.Compile(`(?im)charset=\s*?([\w-]+)`)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -191,7 +193,14 @@ func geturl(info *common.HostInfo, flag int, CheckData []WebScan.CheckDatas) (er
|
|||||||
if len(title) > 100 {
|
if len(title) > 100 {
|
||||||
title = 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)
|
common.LogSuccess(result)
|
||||||
}
|
}
|
||||||
CheckData = append(CheckData, WebScan.CheckDatas{body, fmt.Sprintf("%s", resp.Header)})
|
CheckData = append(CheckData, WebScan.CheckDatas{body, fmt.Sprintf("%s", resp.Header)})
|
||||||
@ -200,12 +209,11 @@ func geturl(info *common.HostInfo, flag int, CheckData []WebScan.CheckDatas) (er
|
|||||||
return nil, redirURL.String(), CheckData
|
return nil, redirURL.String(), CheckData
|
||||||
}
|
}
|
||||||
if resp.StatusCode == 400 && info.Url[:5] != "https" {
|
if resp.StatusCode == 400 && info.Url[:5] != "https" {
|
||||||
info.Url = strings.Replace(info.Url, "http://", "https://", 1)
|
|
||||||
return err, "https", CheckData
|
return err, "https", CheckData
|
||||||
}
|
}
|
||||||
return err, "", CheckData
|
return err, "", CheckData
|
||||||
}
|
}
|
||||||
return err, "", CheckData
|
return err, "https", CheckData
|
||||||
}
|
}
|
||||||
return err, "", CheckData
|
return err, "", CheckData
|
||||||
}
|
}
|
||||||
|
@ -95,6 +95,7 @@ var RuleDatas = []RuleData{
|
|||||||
{"360网站安全检测", "code", "(webscan.360.cn/status/pai/hash)"},
|
{"360网站安全检测", "code", "(webscan.360.cn/status/pai/hash)"},
|
||||||
{"H3C ER5200G2", "code", "(ER5200G2系统管理)"},
|
{"H3C ER5200G2", "code", "(ER5200G2系统管理)"},
|
||||||
{"华为(HUAWEI)安全设备", "code", "(sweb-lib/resource/)"},
|
{"华为(HUAWEI)安全设备", "code", "(sweb-lib/resource/)"},
|
||||||
|
{"华为(HUAWEI)USG", "code", "(UI_component/commonDefine/UI_regex_define.js)"},
|
||||||
{"H3C ER6300", "code", "(ER6300系统管理)"},
|
{"H3C ER6300", "code", "(ER6300系统管理)"},
|
||||||
{"华为_HUAWEI_ASG2100", "code", "(HUAWEI ASG2100)"},
|
{"华为_HUAWEI_ASG2100", "code", "(HUAWEI ASG2100)"},
|
||||||
{"TP-Link 3600 DD-WRT", "code", "(TP-Link 3600 DD-WRT)"},
|
{"TP-Link 3600 DD-WRT", "code", "(TP-Link 3600 DD-WRT)"},
|
||||||
@ -126,6 +127,7 @@ var RuleDatas = []RuleData{
|
|||||||
{"Jenkins", "code", "(Jenkins)"},
|
{"Jenkins", "code", "(Jenkins)"},
|
||||||
{"红帆OA", "code", "(iOffice)"},
|
{"红帆OA", "code", "(iOffice)"},
|
||||||
{"VMware vSphere", "code", "(VMware vSphere)"},
|
{"VMware vSphere", "code", "(VMware vSphere)"},
|
||||||
|
{"打印机", "code", "(打印机|media/canon.gif)"},
|
||||||
}
|
}
|
||||||
|
|
||||||
var Md5Datas = []Md5Data{
|
var Md5Datas = []Md5Data{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user