mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 13:09:49 -07:00
fix: fixed several go vet issues
This commit is contained in:
parent
78c393a195
commit
42079a1ee7
2 changed files with 9 additions and 9 deletions
4
Makefile
4
Makefile
|
@ -26,7 +26,7 @@ resources:
|
||||||
|
|
||||||
vet:
|
vet:
|
||||||
@echo "@ Running VET ..."
|
@echo "@ Running VET ..."
|
||||||
@go vet .
|
@go vet ./...
|
||||||
|
|
||||||
fmt:
|
fmt:
|
||||||
@echo "@ Formatting ..."
|
@echo "@ Formatting ..."
|
||||||
|
@ -34,7 +34,7 @@ fmt:
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
@echo "@ Running LINT ..."
|
@echo "@ Running LINT ..."
|
||||||
@golint .
|
@golint ./...
|
||||||
|
|
||||||
deps:
|
deps:
|
||||||
@echo "@ Installing dependencies ..."
|
@echo "@ Installing dependencies ..."
|
||||||
|
|
|
@ -21,7 +21,7 @@ type HttpProxy struct {
|
||||||
script *ProxyScript
|
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 {
|
p.Session.Events.Add("http.proxy.spoofed-response", struct {
|
||||||
To string
|
To string
|
||||||
Method string
|
Method string
|
||||||
|
@ -113,24 +113,24 @@ func NewHttpProxy(s *session.Session) *HttpProxy {
|
||||||
return p
|
return p
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p HttpProxy) Name() string {
|
func (p *HttpProxy) Name() string {
|
||||||
return "HTTP Proxy"
|
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."
|
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 <evilsocket@protonmail.com>"
|
return "Simone Margaritelli <evilsocket@protonmail.com>"
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p HttpProxy) OnSessionStarted(s *session.Session) {
|
func (p *HttpProxy) OnSessionStarted(s *session.Session) {
|
||||||
// refresh the address after session has been created
|
// refresh the address after session has been created
|
||||||
s.Env.Set("http.proxy.address", s.Interface.IpAddress)
|
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() {
|
if p.Running() {
|
||||||
p.Stop()
|
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{
|
blacklist := []string{
|
||||||
"localhost",
|
"localhost",
|
||||||
"127.0.0.1",
|
"127.0.0.1",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue