(s *session.Session)
| 15 | } |
| 16 | |
| 17 | func NewHttpsProxy(s *session.Session) *HttpsProxy { |
| 18 | mod := &HttpsProxy{ |
| 19 | SessionModule: session.NewSessionModule("https.proxy", s), |
| 20 | proxy: http_proxy.NewHTTPProxy(s, "https.proxy"), |
| 21 | } |
| 22 | |
| 23 | mod.AddParam(session.NewIntParameter("https.port", |
| 24 | "443", |
| 25 | "HTTPS port to redirect when the proxy is activated.")) |
| 26 | |
| 27 | mod.AddParam(session.NewStringParameter("https.proxy.address", |
| 28 | session.ParamIfaceAddress, |
| 29 | session.IPv4Validator, |
| 30 | "Address to bind the HTTPS proxy to.")) |
| 31 | |
| 32 | mod.AddParam(session.NewIntParameter("https.proxy.port", |
| 33 | "8083", |
| 34 | "Port to bind the HTTPS proxy to.")) |
| 35 | |
| 36 | mod.AddParam(session.NewBoolParameter("https.proxy.redirect", |
| 37 | "true", |
| 38 | "Enable or disable port redirection with iptables.")) |
| 39 | |
| 40 | mod.AddParam(session.NewBoolParameter("https.proxy.sslstrip", |
| 41 | "false", |
| 42 | "Enable or disable SSL stripping.")) |
| 43 | |
| 44 | mod.AddParam(session.NewStringParameter("https.proxy.injectjs", |
| 45 | "", |
| 46 | "", |
| 47 | "URL, path or javascript code to inject into every HTML page.")) |
| 48 | |
| 49 | mod.AddParam(session.NewStringParameter("https.proxy.certificate", |
| 50 | "~/.bettercap-ca.cert.pem", |
| 51 | "", |
| 52 | "HTTPS proxy certification authority TLS certificate file.")) |
| 53 | |
| 54 | mod.AddParam(session.NewStringParameter("https.proxy.key", |
| 55 | "~/.bettercap-ca.key.pem", |
| 56 | "", |
| 57 | "HTTPS proxy certification authority TLS key file.")) |
| 58 | |
| 59 | tls.CertConfigToModule("https.proxy", &mod.SessionModule, tls.DefaultSpoofConfig) |
| 60 | |
| 61 | mod.AddParam(session.NewStringParameter("https.proxy.script", |
| 62 | "", |
| 63 | "", |
| 64 | "Path of a proxy JS script.")) |
| 65 | |
| 66 | mod.AddParam(session.NewStringParameter("https.proxy.blacklist", "", "", |
| 67 | "Comma separated list of hostnames to skip while proxying (wildcard expressions can be used).")) |
| 68 | |
| 69 | mod.AddParam(session.NewStringParameter("https.proxy.whitelist", "", "", |
| 70 | "Comma separated list of hostnames to proxy if the blacklist is used (wildcard expressions can be used).")) |
| 71 | |
| 72 | mod.AddHandler(session.NewModuleHandler("https.proxy on", "", |
| 73 | "Start HTTPS proxy.", |
| 74 | func(args []string) error { |
no test coverage detected