From 42079a1ee743eebe6e37bbbc9f5ac3dcfd119b7d Mon Sep 17 00:00:00 2001 From: evilsocket Date: Mon, 8 Jan 2018 08:25:27 +0100 Subject: [PATCH] fix: fixed several go vet issues --- Makefile | 4 ++-- session/modules/http_proxy.go | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 2fe600c6..e8c1b53a 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ resources: vet: @echo "@ Running VET ..." - @go vet . + @go vet ./... fmt: @echo "@ Formatting ..." @@ -34,7 +34,7 @@ fmt: lint: @echo "@ Running LINT ..." - @golint . + @golint ./... deps: @echo "@ Installing dependencies ..." diff --git a/session/modules/http_proxy.go b/session/modules/http_proxy.go index 22bd442a..c7880e76 100644 --- a/session/modules/http_proxy.go +++ b/session/modules/http_proxy.go @@ -21,7 +21,7 @@ type HttpProxy struct { script *ProxyScript } -func (p HttpProxy) logAction(req *http.Request, jsres *JSResponse) { +func (p *HttpProxy) logAction(req *http.Request, jsres *JSResponse) { p.Session.Events.Add("http.proxy.spoofed-response", struct { To string Method string @@ -113,24 +113,24 @@ func NewHttpProxy(s *session.Session) *HttpProxy { return p } -func (p HttpProxy) Name() string { +func (p *HttpProxy) Name() string { return "HTTP Proxy" } -func (p HttpProxy) Description() string { +func (p *HttpProxy) Description() string { return "A full featured HTTP proxy that can be used to inject malicious contents into webpages, all HTTP traffic will be redirected to it." } -func (p HttpProxy) Author() string { +func (p *HttpProxy) Author() string { return "Simone Margaritelli " } -func (p HttpProxy) OnSessionStarted(s *session.Session) { +func (p *HttpProxy) OnSessionStarted(s *session.Session) { // refresh the address after session has been created s.Env.Set("http.proxy.address", s.Interface.IpAddress) } -func (p HttpProxy) OnSessionEnded(s *session.Session) { +func (p *HttpProxy) OnSessionEnded(s *session.Session) { if p.Running() { p.Stop() } @@ -222,7 +222,7 @@ func (p *HttpProxy) Stop() error { } } -func (p HttpProxy) doProxy(req *http.Request) bool { +func (p *HttpProxy) doProxy(req *http.Request) bool { blacklist := []string{ "localhost", "127.0.0.1",