add mattermost ua
save bytes in req dump phrases: rename panel_group_promotion_registered_for to panel_group_promotion_reg_for rename panel_group_promotion_registered_months_suffix to panel_group_promotion_reg_months_suffix rename panel_group_promotion_registered_days_suffix to panel_group_promotion_reg_days_suffix rename panel_group_promotion_registered_hours_suffix to panel_group_promotion_reg_hours_suffix
This commit is contained in:
parent
48b0b410c9
commit
fc6544d620
110
gen_router.go
110
gen_router.go
|
@ -606,23 +606,24 @@ var agentMapEnum = map[string]int{
|
||||||
"slackbot": 32,
|
"slackbot": 32,
|
||||||
"apple": 33,
|
"apple": 33,
|
||||||
"discourse": 34,
|
"discourse": 34,
|
||||||
"alexa": 35,
|
"mattermost": 35,
|
||||||
"lynx": 36,
|
"alexa": 36,
|
||||||
"blank": 37,
|
"lynx": 37,
|
||||||
"malformed": 38,
|
"blank": 38,
|
||||||
"suspicious": 39,
|
"malformed": 39,
|
||||||
"semrush": 40,
|
"suspicious": 40,
|
||||||
"dotbot": 41,
|
"semrush": 41,
|
||||||
"ahrefs": 42,
|
"dotbot": 42,
|
||||||
"proximic": 43,
|
"ahrefs": 43,
|
||||||
"majestic": 44,
|
"proximic": 44,
|
||||||
"blexbot": 45,
|
"majestic": 45,
|
||||||
"aspiegel": 46,
|
"blexbot": 46,
|
||||||
"mail_ru": 47,
|
"aspiegel": 47,
|
||||||
"zgrab": 48,
|
"mail_ru": 48,
|
||||||
"curl": 49,
|
"zgrab": 49,
|
||||||
"python": 50,
|
"curl": 50,
|
||||||
"go": 51,
|
"python": 51,
|
||||||
|
"go": 52,
|
||||||
}
|
}
|
||||||
var reverseAgentMapEnum = map[int]string{
|
var reverseAgentMapEnum = map[int]string{
|
||||||
0: "unknown",
|
0: "unknown",
|
||||||
|
@ -660,23 +661,24 @@ var reverseAgentMapEnum = map[int]string{
|
||||||
32: "slackbot",
|
32: "slackbot",
|
||||||
33: "apple",
|
33: "apple",
|
||||||
34: "discourse",
|
34: "discourse",
|
||||||
35: "alexa",
|
35: "mattermost",
|
||||||
36: "lynx",
|
36: "alexa",
|
||||||
37: "blank",
|
37: "lynx",
|
||||||
38: "malformed",
|
38: "blank",
|
||||||
39: "suspicious",
|
39: "malformed",
|
||||||
40: "semrush",
|
40: "suspicious",
|
||||||
41: "dotbot",
|
41: "semrush",
|
||||||
42: "ahrefs",
|
42: "dotbot",
|
||||||
43: "proximic",
|
43: "ahrefs",
|
||||||
44: "majestic",
|
44: "proximic",
|
||||||
45: "blexbot",
|
45: "majestic",
|
||||||
46: "aspiegel",
|
46: "blexbot",
|
||||||
47: "mail_ru",
|
47: "aspiegel",
|
||||||
48: "zgrab",
|
48: "mail_ru",
|
||||||
49: "curl",
|
49: "zgrab",
|
||||||
50: "python",
|
50: "curl",
|
||||||
51: "go",
|
51: "python",
|
||||||
|
52: "go",
|
||||||
}
|
}
|
||||||
var markToAgent = map[string]string{
|
var markToAgent = map[string]string{
|
||||||
"OPR": "opera",
|
"OPR": "opera",
|
||||||
|
@ -718,6 +720,7 @@ var markToAgent = map[string]string{
|
||||||
"Facebot": "facebook",
|
"Facebot": "facebook",
|
||||||
"Applebot": "apple",
|
"Applebot": "apple",
|
||||||
"Discourse": "discourse",
|
"Discourse": "discourse",
|
||||||
|
"mattermost": "mattermost",
|
||||||
"ia_archiver": "alexa",
|
"ia_archiver": "alexa",
|
||||||
"SemrushBot": "semrush",
|
"SemrushBot": "semrush",
|
||||||
"DotBot": "dotbot",
|
"DotBot": "dotbot",
|
||||||
|
@ -740,7 +743,7 @@ var markToID = map[string]int{
|
||||||
"MSIE": 6,
|
"MSIE": 6,
|
||||||
"Trident": 7,
|
"Trident": 7,
|
||||||
"Edge": 5,
|
"Edge": 5,
|
||||||
"Lynx": 36,
|
"Lynx": 37,
|
||||||
"SamsungBrowser": 10,
|
"SamsungBrowser": 10,
|
||||||
"UCBrowser": 11,
|
"UCBrowser": 11,
|
||||||
"Google": 12,
|
"Google": 12,
|
||||||
|
@ -772,19 +775,20 @@ var markToID = map[string]int{
|
||||||
"Facebot": 28,
|
"Facebot": 28,
|
||||||
"Applebot": 33,
|
"Applebot": 33,
|
||||||
"Discourse": 34,
|
"Discourse": 34,
|
||||||
"ia_archiver": 35,
|
"mattermost": 35,
|
||||||
"SemrushBot": 40,
|
"ia_archiver": 36,
|
||||||
"DotBot": 41,
|
"SemrushBot": 41,
|
||||||
"AhrefsBot": 42,
|
"DotBot": 42,
|
||||||
"proximic": 43,
|
"AhrefsBot": 43,
|
||||||
"MJ12bot": 44,
|
"proximic": 44,
|
||||||
"BLEXBot": 45,
|
"MJ12bot": 45,
|
||||||
"AspiegelBot": 46,
|
"BLEXBot": 46,
|
||||||
"RU_Bot": 47,
|
"AspiegelBot": 47,
|
||||||
"zgrab": 48,
|
"RU_Bot": 48,
|
||||||
"curl": 49,
|
"zgrab": 49,
|
||||||
"python": 50,
|
"curl": 50,
|
||||||
"Go": 51,
|
"python": 51,
|
||||||
|
"Go": 52,
|
||||||
}
|
}
|
||||||
/*var agentRank = map[string]int{
|
/*var agentRank = map[string]int{
|
||||||
"opera":9,
|
"opera":9,
|
||||||
|
@ -901,7 +905,7 @@ func (r *GenRouter) DumpRequest(req *http.Request, pre string) {
|
||||||
var heads string
|
var heads string
|
||||||
for key, value := range req.Header {
|
for key, value := range req.Header {
|
||||||
for _, vvalue := range value {
|
for _, vvalue := range value {
|
||||||
heads += "Header '" + c.SanitiseSingleLine(key) + "': " + c.SanitiseSingleLine(vvalue) + "\n"
|
heads += "Head " + c.SanitiseSingleLine(key) + ": " + c.SanitiseSingleLine(vvalue) + "\n"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -920,7 +924,7 @@ func (r *GenRouter) SuspiciousRequest(req *http.Request, pre string) {
|
||||||
pre += "\n"
|
pre += "\n"
|
||||||
}
|
}
|
||||||
r.DumpRequest(req,pre+"Suspicious Request")
|
r.DumpRequest(req,pre+"Suspicious Request")
|
||||||
co.AgentViewCounter.Bump(39)
|
co.AgentViewCounter.Bump(40)
|
||||||
}
|
}
|
||||||
|
|
||||||
func isLocalHost(h string) bool {
|
func isLocalHost(h string) bool {
|
||||||
|
@ -935,7 +939,7 @@ func (r *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
w.WriteHeader(200) // 400
|
w.WriteHeader(200) // 400
|
||||||
w.Write([]byte(""))
|
w.Write([]byte(""))
|
||||||
r.DumpRequest(req,"Malformed Request T"+strconv.Itoa(typ))
|
r.DumpRequest(req,"Malformed Request T"+strconv.Itoa(typ))
|
||||||
co.AgentViewCounter.Bump(38)
|
co.AgentViewCounter.Bump(39)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Split the Host and Port string
|
// Split the Host and Port string
|
||||||
|
@ -1074,7 +1078,7 @@ func (r *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
|
|
||||||
ua := strings.TrimSpace(strings.Replace(strings.TrimPrefix(req.UserAgent(),"Mozilla/5.0 ")," Safari/537.36","",-1)) // Noise, no one's going to be running this and it would require some sort of agent ranking system to determine which identifier should be prioritised over another
|
ua := strings.TrimSpace(strings.Replace(strings.TrimPrefix(req.UserAgent(),"Mozilla/5.0 ")," Safari/537.36","",-1)) // Noise, no one's going to be running this and it would require some sort of agent ranking system to determine which identifier should be prioritised over another
|
||||||
if ua == "" {
|
if ua == "" {
|
||||||
co.AgentViewCounter.Bump(37)
|
co.AgentViewCounter.Bump(38)
|
||||||
if c.Dev.DebugMode {
|
if c.Dev.DebugMode {
|
||||||
var pre string
|
var pre string
|
||||||
for _, char := range req.UserAgent() {
|
for _, char := range req.UserAgent() {
|
||||||
|
@ -1156,7 +1160,7 @@ func (r *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||||
if strings.Contains(ua,"rv:11") {
|
if strings.Contains(ua,"rv:11") {
|
||||||
agent = 6
|
agent = 6
|
||||||
}
|
}
|
||||||
case 48:
|
case 49:
|
||||||
r.SuspiciousRequest(req,"Vulnerability Scanner")
|
r.SuspiciousRequest(req,"Vulnerability Scanner")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -220,6 +220,7 @@
|
||||||
"facebook":"Facebook",
|
"facebook":"Facebook",
|
||||||
"apple":"AppleBot",
|
"apple":"AppleBot",
|
||||||
"discourse":"Discourse Forum Onebox",
|
"discourse":"Discourse Forum Onebox",
|
||||||
|
"mattermost":"Mattermost",
|
||||||
"alexa":"Alexa",
|
"alexa":"Alexa",
|
||||||
"lynx":"Lynx",
|
"lynx":"Lynx",
|
||||||
|
|
||||||
|
@ -960,10 +961,10 @@
|
||||||
"panel_group_promotions_two_way":"Two Way",
|
"panel_group_promotions_two_way":"Two Way",
|
||||||
"panel_group_promotions_level":"Level",
|
"panel_group_promotions_level":"Level",
|
||||||
"panel_group_promotions_posts":"Posts",
|
"panel_group_promotions_posts":"Posts",
|
||||||
"panel_group_promotion_registered_for":"Registered For",
|
"panel_group_promotion_reg_for":"Registered For",
|
||||||
"panel_group_promotion_registered_months_suffix":" months",
|
"panel_group_promotion_reg_months_suffix":" months",
|
||||||
"panel_group_promotion_registered_days_suffix":" days",
|
"panel_group_promotion_reg_days_suffix":" days",
|
||||||
"panel_group_promotion_registered_hours_suffix":" hours",
|
"panel_group_promotion_reg_hours_suffix":" hours",
|
||||||
"panel_group_promotions_create_button":"Add Promotion",
|
"panel_group_promotions_create_button":"Add Promotion",
|
||||||
|
|
||||||
"panel_word_filters_head":"Word Filters",
|
"panel_word_filters_head":"Word Filters",
|
||||||
|
|
|
@ -266,6 +266,7 @@ func main() {
|
||||||
"slackbot",
|
"slackbot",
|
||||||
"apple",
|
"apple",
|
||||||
"discourse",
|
"discourse",
|
||||||
|
"mattermost",
|
||||||
"alexa",
|
"alexa",
|
||||||
"lynx",
|
"lynx",
|
||||||
"blank",
|
"blank",
|
||||||
|
@ -331,6 +332,7 @@ func main() {
|
||||||
"Facebot",
|
"Facebot",
|
||||||
"Applebot",
|
"Applebot",
|
||||||
"Discourse",
|
"Discourse",
|
||||||
|
"mattermost",
|
||||||
"ia_archiver",
|
"ia_archiver",
|
||||||
|
|
||||||
"SemrushBot",
|
"SemrushBot",
|
||||||
|
@ -388,6 +390,7 @@ func main() {
|
||||||
"Facebot": "facebook",
|
"Facebot": "facebook",
|
||||||
"Applebot": "apple",
|
"Applebot": "apple",
|
||||||
"Discourse": "discourse",
|
"Discourse": "discourse",
|
||||||
|
"mattermost":"mattermost",
|
||||||
"ia_archiver": "alexa",
|
"ia_archiver": "alexa",
|
||||||
|
|
||||||
"SemrushBot": "semrush",
|
"SemrushBot": "semrush",
|
||||||
|
@ -579,7 +582,7 @@ func (r *GenRouter) DumpRequest(req *http.Request, pre string) {
|
||||||
var heads string
|
var heads string
|
||||||
for key, value := range req.Header {
|
for key, value := range req.Header {
|
||||||
for _, vvalue := range value {
|
for _, vvalue := range value {
|
||||||
heads += "Header '" + c.SanitiseSingleLine(key) + "': " + c.SanitiseSingleLine(vvalue) + "\n"
|
heads += "Head " + c.SanitiseSingleLine(key) + ": " + c.SanitiseSingleLine(vvalue) + "\n"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,11 +64,11 @@
|
||||||
<div class="formitem"><input name="posts" type="number" value="0"></div>
|
<div class="formitem"><input name="posts" type="number" value="0"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="formrow">
|
<div class="formrow">
|
||||||
<div class="formitem formlabel"><a>{{lang "panel_group_promotion_registered_for"}}</a></div>
|
<div class="formitem formlabel"><a>{{lang "panel_group_promotion_reg_for"}}</a></div>
|
||||||
<div class="formitem">
|
<div class="formitem">
|
||||||
<input name="registered_months" type="number" value="0">{{lang "panel_group_promotion_registered_months_suffix"}}<br>
|
<input name="reg_months" type="number" value="0">{{lang "panel_group_promotion_reg_months_suffix"}}<br>
|
||||||
<input name="registered_days" type="number" value="0">{{lang "panel_group_promotion_registered_days_suffix"}}<br>
|
<input name="reg_days" type="number" value="0">{{lang "panel_group_promotion_reg_days_suffix"}}<br>
|
||||||
<input name="registered_hours" type="number" value="0">{{lang "panel_group_promotion_registered_hours_suffix"}}
|
<input name="reg_hours" type="number" value="0">{{lang "panel_group_promotion_reg_hours_suffix"}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="formrow form_button_row">
|
<div class="formrow form_button_row">
|
||||||
|
|
Loading…
Reference in New Issue