bettercap 1.5.3 → 1.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5f4c77bd2bccc140b9a3671bd93d8db8c9b396ed
4
- data.tar.gz: 15ecce5e711f0aa850ea01bc990d662d12653e7a
3
+ metadata.gz: 41e3ec675b769d7ac29357593472c14af387f440
4
+ data.tar.gz: a0a7fdf3060cf8179dd1bb9baa59d2e54658bf88
5
5
  SHA512:
6
- metadata.gz: 1d90461987e6333dd563de4e2ea721d13ddaf22ebe914a38c03b569ec3fe159351f5367f81f89fd69eb83932fcb4e899127c503b3b21546985cf924700bd5659
7
- data.tar.gz: ed7f74e1fabed25df2c1764e6fbe4530f08ec9354952611eb6fde8539a84ef58fd0164a7a844793135f06388e029c53b305c82d68eec0ed53419347240d63e93
6
+ metadata.gz: afb795ebe9f9ece60e02235d60519814f49483078cf9898b6755ee8e2d68409d3f420905bca98325749f329624665777b06e6183758fbff200cc9de963701fee
7
+ data.tar.gz: 389117b84b7c6c2bc3b63a9479ed9a5c3a375c7eac5c2afbf53a9394f3a2b898e4f5879ff07c146e2c372686c6ebb1b32a8da5d030a401664d88d2fe6bc3fa4f
@@ -31,7 +31,6 @@ module PacketFu
31
31
  class Utils
32
32
  def self.ifconfig(iface='eth0')
33
33
  ret = {}
34
- iface = iface.to_s.scan(/[0-9A-Za-z]/).join
35
34
 
36
35
  BetterCap::Logger.debug "ifconfig #{iface}"
37
36
 
@@ -103,13 +103,21 @@ class Options
103
103
 
104
104
  if @proxies.proxy
105
105
  @proxies.http_ports.each do |port|
106
- redirections << redir( iface.ip, port, @proxies.proxy_port )
106
+ if @proxies.proxy_upstream_address.nil?
107
+ redirections << redir( iface.ip, port, @proxies.proxy_port )
108
+ else
109
+ redirections << redir_single( @proxies.proxy_upstream_address, iface.ip, port, @proxies.proxy_port )
110
+ end
107
111
  end
108
112
  end
109
113
 
110
114
  if @proxies.proxy_https
111
115
  @proxies.https_ports.each do |port|
112
- redirections << redir( iface.ip, port, @proxies.proxy_https_port )
116
+ if @proxies.proxy_upstream_address.nil?
117
+ redirections << redir( iface.ip, port, @proxies.proxy_https_port )
118
+ else
119
+ redirections << redir_single( @proxies.proxy_upstream_address, iface.ip, port, @proxies.proxy_port )
120
+ end
113
121
  end
114
122
  end
115
123
 
@@ -18,6 +18,8 @@ class ProxyOptions
18
18
  attr_accessor :proxy
19
19
  # If true, HTTPS transparent proxy will be enabled.
20
20
  attr_accessor :proxy_https
21
+ # If set, only this address will be redirected to the HTTP(S) proxiy.
22
+ attr_accessor :proxy_upstream_address
21
23
  # HTTP proxy port.
22
24
  attr_accessor :proxy_port
23
25
  # List of HTTP ports, [ 80 ] by default.
@@ -32,6 +34,8 @@ class ProxyOptions
32
34
  attr_accessor :proxy_module
33
35
  # If true, sslstrip is enabled.
34
36
  attr_accessor :sslstrip
37
+ # If true, direct connections to the IP of this machine will be allowed.
38
+ attr_accessor :allow_local_connections
35
39
  # If true, TCP proxy will be enabled.
36
40
  attr_accessor :tcp_proxy
37
41
  # TCP proxy local port.
@@ -58,11 +62,13 @@ class ProxyOptions
58
62
  @https_ports = [ 443 ]
59
63
  @proxy = false
60
64
  @proxy_https = false
65
+ @proxy_upstream_address = nil
61
66
  @proxy_port = 8080
62
67
  @proxy_https_port = 8083
63
68
  @proxy_pem_file = nil
64
69
  @proxy_module = nil
65
70
  @sslstrip = true
71
+ @allow_local_connections = false
66
72
 
67
73
  @tcp_proxy = false
68
74
  @tcp_proxy_port = 2222
@@ -144,6 +150,11 @@ class ProxyOptions
144
150
  @proxy_port = v.to_i
145
151
  end
146
152
 
153
+ opts.on( '--allow-local-connections', "Allow direct connections to the proxy instance, default to #{@allow_local_connections.to_s.yellow}." ) do |v|
154
+ @proxy = true
155
+ @allow_local_connections = true
156
+ end
157
+
147
158
  opts.on( '--no-sslstrip', 'Disable SSLStrip.' ) do
148
159
  @proxy = true
149
160
  @sslstrip = false
@@ -159,6 +170,11 @@ class ProxyOptions
159
170
  @proxy = true
160
171
  end
161
172
 
173
+ opts.on( '--proxy-upstream-address ADDRESS', 'If set, only requests coming from this server address will be redirected to the HTTP/HTTPS proxies.' ) do |v|
174
+ v, _ = validate_address v
175
+ @proxy_upstream_address = v
176
+ end
177
+
162
178
  opts.separator ""
163
179
  opts.separator " HTTPS:"
164
180
  opts.separator ""
@@ -26,6 +26,7 @@ class Proxy
26
26
  @is_https = is_https
27
27
  @type = is_https ? 'HTTPS' : 'HTTP'
28
28
  @upstream_port = is_https ? 443 : 80
29
+ @allow_local = Context.get.options.proxies.allow_local_connections
29
30
  @server = nil
30
31
  @sslserver = nil
31
32
  @main_thread = nil
@@ -148,7 +149,7 @@ class Proxy
148
149
  if @streamer.was_stripped?( request, client )
149
150
  @streamer.handle( request, client )
150
151
  # someone is having fun with us =)
151
- elsif is_self_request? request
152
+ elsif !@allow_local and is_self_request? request
152
153
  @streamer.rickroll( client )
153
154
  # handle request
154
155
  else
@@ -3,9 +3,9 @@
3
3
 
4
4
  BETTERCAP
5
5
 
6
- Author : Simone 'evilsocket' Margaritelli
7
- Email : evilsocket@gmail.com
8
- Blog : http://www.evilsocket.net/
6
+ Some code copyright (c) 2005, Zed Shaw
7
+ Copyright (c) 2011, Evan Phoenix
8
+ Copyright (c) 2015, Simone Margaritelli
9
9
 
10
10
  This project is released under the GPL 3 license.
11
11
 
@@ -14,7 +14,6 @@ This project is released under the GPL 3 license.
14
14
  module BetterCap
15
15
  module Proxy
16
16
  # Thread pool class used by the BetterCap::Proxy::*.
17
- # Tnx to Puma ThreadPool!
18
17
  class ThreadPool
19
18
 
20
19
  # Maintain a minimum of +min+ and maximum of +max+ threads
@@ -12,7 +12,7 @@ This project is released under the GPL 3 license.
12
12
  =end
13
13
  module BetterCap
14
14
  # Current version of bettercap.
15
- VERSION = '1.5.3'
15
+ VERSION = '1.5.4'
16
16
  # Program banner.
17
17
  BANNER = File.read( File.dirname(__FILE__) + '/banner' ).gsub( '#VERSION#', "v#{VERSION}")
18
18
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bettercap
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.3
4
+ version: 1.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simone Margaritelli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-28 00:00:00.000000000 Z
11
+ date: 2016-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize