bettercap 1.4.1 → 1.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f64cdb79dca07a3c065c5f3366f7f671c6079bfe
4
- data.tar.gz: c0e595b1c5fbc9063ca6a0221e1abdf672285d90
3
+ metadata.gz: b2645aedfa3e74db2c01d8856b6c0149302317d5
4
+ data.tar.gz: 3e891382aec5781ff109d8e2e7705c48bc6cb3a7
5
5
  SHA512:
6
- metadata.gz: af93686ecafad8b4cea0f54358006c671687065a1c07374ff8791e170294fb5a51664acafa1a2b00c3e29e742366e53eaacf0a67b64d4f5be73dbc2f6faa490e
7
- data.tar.gz: 9bd343afaf63459684ddf4db394374cb07f65707da3dadf8d9747a59be8a8391c08181bf96b3b572808ec2c8d14db8ffd97bd898928c42ff6a982632fd19b51c
6
+ metadata.gz: a704b2a1156afa0a087a48d64041d3197f86664f778172acdf299fc34da6c6b602091961d86e484ca576f5c06408f3a91ec9610d324800285eb85747a1235d21
7
+ data.tar.gz: 33f2ed1ea9e4e643d196269f7015f4d47be69e175859355ca797bba1597d2bd8763cbe6bb011f6687a3725243d1f448a1e34bcc2318a42da410df8f4db4693bf
@@ -25,6 +25,7 @@ class Context
25
25
  attr_accessor :firewall
26
26
  # Network gateway IP address.
27
27
  attr_accessor :gateway
28
+ # A boolean value indicating if the gateway mac address was already resolved.
28
29
  attr_accessor :gateway_mac_resolved
29
30
  # A list of BetterCap::Target objects which is periodically updated.
30
31
  attr_accessor :targets
@@ -48,9 +48,9 @@ class Base
48
48
 
49
49
  # Return true if +ip+ must be skipped during discovery, otherwise false.
50
50
  def skip_address?(ip)
51
- # don't send probes to the gateway
52
- if ip == @ctx.gateway and @ctx.gateway_mac_resolved
53
- return true
51
+ # don't send probes to the gateway if we already have its MAC.
52
+ if ip == @ctx.gateway
53
+ return @ctx.gateway_mac_resolved
54
54
  # don't send probes to our device
55
55
  elsif ip == @local_ip
56
56
  return true
@@ -511,7 +511,7 @@ class Options
511
511
  def get_redirections ifconfig
512
512
  redirections = []
513
513
 
514
- if @dnsd
514
+ if @dnsd or @proxy
515
515
  redirections << redir( ifconfig[:ip_saddr], 53, @dnsd_port )
516
516
  redirections << redir( ifconfig[:ip_saddr], 53, @dnsd_port, 'UDP' )
517
517
  end
@@ -548,14 +548,14 @@ class Options
548
548
  on = '✔'.green
549
549
  off = '✘'.red
550
550
  status = {
551
- 'spoofing' => if has_spoofer? then on else off end,
552
- 'discovery' => if !target.nil? or arpcache then off else on end,
553
- 'sniffer' => if sniffer then on else off end,
554
- 'http-proxy' => if proxy then on else off end,
555
- 'https-proxy' => if proxy_https then on else off end,
556
- 'sslstrip' => if proxy and sslstrip then on else off end,
557
- 'http-server' => if httpd then on else off end,
558
- 'dns-server' => if dnsd then on else off end
551
+ 'spoofing' => ( has_spoofer? ? on : off ),
552
+ 'discovery' => ( ( !target.nil? or arpcache ) ? off : on ),
553
+ 'sniffer' => ( sniffer ? on : off ),
554
+ 'http-proxy' => ( proxy ? on : off ),
555
+ 'https-proxy' => ( proxy_https ? on : off ),
556
+ 'sslstrip' => ( ( proxy and sslstrip ) ? on : off ),
557
+ 'http-server' => ( httpd ? on : off ),
558
+ 'dns-server' => ( ( sslstrip or dnsd ) ? on : off )
559
559
  }
560
560
 
561
561
  msg = "Starting [ "
@@ -109,7 +109,11 @@ private
109
109
  hw = Network.get_hw_address( @ctx, @ctx.gateway )
110
110
  raise BetterCap::Error, "Couldn't determine router MAC" if hw.nil?
111
111
  @gateway = Network::Target.new( @ctx.gateway, hw )
112
+
113
+ # notify the system that the gateway mac is resolved, this will prevent
114
+ # the gateway ip to be unnecessarily probed from discovery agents.
112
115
  @ctx.gateway_mac_resolved = true
116
+
113
117
  Logger.info "[#{'GATEWAY'.green}] #{@gateway.to_s(false)}"
114
118
  end
115
119
 
@@ -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.4.1'
15
+ VERSION = '1.4.2'
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.4.1
4
+ version: 1.4.2
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-02-16 00:00:00.000000000 Z
11
+ date: 2016-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize