bettercap 1.3.2 → 1.3.3
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 +4 -4
- data/bin/bettercap +1 -0
- data/lib/bettercap.rb +1 -0
- data/lib/bettercap/context.rb +1 -0
- data/lib/bettercap/discovery/agents/arp.rb +1 -0
- data/lib/bettercap/discovery/agents/base.rb +1 -0
- data/lib/bettercap/discovery/agents/icmp.rb +1 -0
- data/lib/bettercap/discovery/agents/udp.rb +1 -0
- data/lib/bettercap/discovery/thread.rb +1 -0
- data/lib/bettercap/error.rb +1 -0
- data/lib/bettercap/factories/firewall.rb +1 -0
- data/lib/bettercap/factories/parser.rb +1 -0
- data/lib/bettercap/factories/spoofer.rb +1 -0
- data/lib/bettercap/firewalls/base.rb +1 -0
- data/lib/bettercap/firewalls/linux.rb +1 -0
- data/lib/bettercap/firewalls/osx.rb +1 -0
- data/lib/bettercap/firewalls/redirection.rb +1 -0
- data/lib/bettercap/httpd/server.rb +1 -0
- data/lib/bettercap/loader.rb +1 -0
- data/lib/bettercap/logger.rb +29 -14
- data/lib/bettercap/monkey/packetfu/utils.rb +5 -2
- data/lib/bettercap/network/arp_reader.rb +5 -0
- data/lib/bettercap/network/network.rb +1 -0
- data/lib/bettercap/network/packet_queue.rb +5 -0
- data/lib/bettercap/network/target.rb +1 -0
- data/lib/bettercap/options.rb +11 -3
- data/lib/bettercap/proxy/certstore.rb +1 -0
- data/lib/bettercap/proxy/module.rb +1 -0
- data/lib/bettercap/proxy/modules/injectcss.rb +1 -0
- data/lib/bettercap/proxy/modules/injecthtml.rb +1 -0
- data/lib/bettercap/proxy/modules/injectjs.rb +1 -0
- data/lib/bettercap/proxy/proxy.rb +3 -2
- data/lib/bettercap/proxy/request.rb +1 -0
- data/lib/bettercap/proxy/response.rb +1 -0
- data/lib/bettercap/proxy/sslstrip/cookiemonitor.rb +1 -0
- data/lib/bettercap/proxy/sslstrip/strip.rb +1 -0
- data/lib/bettercap/proxy/sslstrip/urlmonitor.rb +2 -1
- data/lib/bettercap/proxy/stream_logger.rb +1 -0
- data/lib/bettercap/proxy/streamer.rb +1 -0
- data/lib/bettercap/proxy/thread_pool.rb +1 -0
- data/lib/bettercap/shell.rb +5 -0
- data/lib/bettercap/sniffer/parsers/base.rb +1 -0
- data/lib/bettercap/sniffer/parsers/custom.rb +1 -0
- data/lib/bettercap/sniffer/parsers/dict.rb +38 -0
- data/lib/bettercap/sniffer/parsers/ftp.rb +1 -0
- data/lib/bettercap/sniffer/parsers/httpauth.rb +2 -1
- data/lib/bettercap/sniffer/parsers/https.rb +2 -1
- data/lib/bettercap/sniffer/parsers/irc.rb +1 -0
- data/lib/bettercap/sniffer/parsers/mail.rb +2 -1
- data/lib/bettercap/sniffer/parsers/mpd.rb +37 -0
- data/lib/bettercap/sniffer/parsers/nntp.rb +1 -0
- data/lib/bettercap/sniffer/parsers/ntlmss.rb +1 -0
- data/lib/bettercap/sniffer/parsers/post.rb +1 -0
- data/lib/bettercap/sniffer/parsers/redis.rb +40 -0
- data/lib/bettercap/sniffer/parsers/rlogin.rb +46 -0
- data/lib/bettercap/sniffer/parsers/snpp.rb +38 -0
- data/lib/bettercap/sniffer/parsers/url.rb +2 -1
- data/lib/bettercap/sniffer/sniffer.rb +1 -0
- data/lib/bettercap/spoofers/arp.rb +1 -0
- data/lib/bettercap/spoofers/base.rb +1 -0
- data/lib/bettercap/spoofers/icmp.rb +1 -0
- data/lib/bettercap/spoofers/none.rb +1 -0
- data/lib/bettercap/update_checker.rb +1 -0
- data/lib/bettercap/version.rb +2 -1
- metadata +7 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 31a820a7730bbf4c4b05afeffaa33bbdddd5c4a3
|
|
4
|
+
data.tar.gz: 6983bea70e9ed11c583aa03ed1eddf4a746a8363
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 222922d21c654249874b8c3de9fdad45844dc3bd31766d71ac930bcef3ea2620d54502654f4439636c92cd79b6da745669172bf30cffc3825ee0c698c468ee68
|
|
7
|
+
data.tar.gz: b70724787a5dc6f6979f1dd00aa367b605c7b30bde931d79695187a0880ae686e669dd2cf11394e6f801d5052b50db1c665bba86c8231874173f9a49887cb642
|
data/bin/bettercap
CHANGED
data/lib/bettercap.rb
CHANGED
data/lib/bettercap/context.rb
CHANGED
data/lib/bettercap/error.rb
CHANGED
data/lib/bettercap/loader.rb
CHANGED
data/lib/bettercap/logger.rb
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
1
2
|
=begin
|
|
2
3
|
|
|
3
4
|
BETTERCAP
|
|
@@ -13,24 +14,27 @@ module BetterCap
|
|
|
13
14
|
# Class responsible for console and file logging.
|
|
14
15
|
module Logger
|
|
15
16
|
class << self
|
|
16
|
-
@@ctx
|
|
17
|
-
@@queue
|
|
18
|
-
@@debug
|
|
19
|
-
@@
|
|
20
|
-
@@
|
|
21
|
-
@@
|
|
17
|
+
@@ctx = nil
|
|
18
|
+
@@queue = Queue.new
|
|
19
|
+
@@debug = false
|
|
20
|
+
@@timestamp = false
|
|
21
|
+
@@silent = false
|
|
22
|
+
@@logfile = nil
|
|
23
|
+
@@thread = nil
|
|
22
24
|
|
|
23
25
|
# Initialize the logging system.
|
|
24
26
|
# If +debug+ is true, debug logging will be enabled.
|
|
25
27
|
# If +logfile+ is not nil, every message will be saved to that file.
|
|
26
28
|
# If +silent+ is true, all messages will be suppressed if they're not errors
|
|
27
29
|
# or warnings.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
@@
|
|
31
|
-
@@
|
|
32
|
-
@@
|
|
33
|
-
@@
|
|
30
|
+
# If +with_timestamp+ is true, a timestamp will be prepended to each line.
|
|
31
|
+
def init( debug, logfile, silent, with_timestamp )
|
|
32
|
+
@@debug = debug
|
|
33
|
+
@@logfile = logfile
|
|
34
|
+
@@thread = Thread.new { worker }
|
|
35
|
+
@@silent = silent
|
|
36
|
+
@@timestamp = with_timestamp
|
|
37
|
+
@@ctx = Context.get
|
|
34
38
|
end
|
|
35
39
|
|
|
36
40
|
# Log an error +message+.
|
|
@@ -57,7 +61,7 @@ module Logger
|
|
|
57
61
|
|
|
58
62
|
# Log a +message+ as it is.
|
|
59
63
|
def raw(message)
|
|
60
|
-
@@queue.push( message )
|
|
64
|
+
@@queue.push( formatted_message( message, nil ) )
|
|
61
65
|
end
|
|
62
66
|
|
|
63
67
|
# Wait for the messages queue to be empty.
|
|
@@ -95,7 +99,18 @@ module Logger
|
|
|
95
99
|
|
|
96
100
|
# Format +message+ for the given +message_type+.
|
|
97
101
|
def formatted_message(message, message_type)
|
|
98
|
-
|
|
102
|
+
# raw message?
|
|
103
|
+
if message_type.nil?
|
|
104
|
+
if @@timestamp and !message.strip.empty?
|
|
105
|
+
"[#{Time.now}] #{message}"
|
|
106
|
+
else
|
|
107
|
+
message
|
|
108
|
+
end
|
|
109
|
+
elsif @@timestamp
|
|
110
|
+
"[#{Time.now}] [#{message_type}] #{message}"
|
|
111
|
+
else
|
|
112
|
+
"[#{message_type}] #{message}"
|
|
113
|
+
end
|
|
99
114
|
end
|
|
100
115
|
end
|
|
101
116
|
end
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
1
2
|
=begin
|
|
2
3
|
|
|
3
4
|
BETTERCAP
|
|
@@ -69,8 +70,10 @@ module PacketFu
|
|
|
69
70
|
ret[:ip4_obj] = IPAddr.new($1)
|
|
70
71
|
ret[:ip4_obj] = ret[:ip4_obj].mask($3) if $3
|
|
71
72
|
when /inet6 [a-z]+:[\s]*([0-9a-fA-F:\x2f]+)/
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
begin
|
|
74
|
+
ret[:ip6_saddr] = $1
|
|
75
|
+
ret[:ip6_obj] = IPAddr.new($1)
|
|
76
|
+
rescue; end
|
|
74
77
|
when /ether[\s]+([0-9a-fA-F:]{17})/i
|
|
75
78
|
ret[:eth_saddr] = $1.downcase
|
|
76
79
|
ret[:eth_src] = EthHeader.mac2str(ret[:eth_saddr])
|
data/lib/bettercap/options.rb
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
1
2
|
=begin
|
|
2
3
|
|
|
3
4
|
BETTERCAP
|
|
@@ -26,6 +27,8 @@ class Options
|
|
|
26
27
|
attr_accessor :target
|
|
27
28
|
# Log file name.
|
|
28
29
|
attr_accessor :logfile
|
|
30
|
+
# If true the Logger will prepend timestamps to each line.
|
|
31
|
+
attr_accessor :log_timestamp
|
|
29
32
|
# If true will suppress every log message which is not an error or a warning.
|
|
30
33
|
attr_accessor :silent
|
|
31
34
|
# If true will enable debug messages.
|
|
@@ -100,6 +103,7 @@ class Options
|
|
|
100
103
|
@half_duplex = false
|
|
101
104
|
@target = nil
|
|
102
105
|
@logfile = nil
|
|
106
|
+
@log_timestamp = false
|
|
103
107
|
@silent = false
|
|
104
108
|
@debug = false
|
|
105
109
|
@arpcache = false
|
|
@@ -177,6 +181,10 @@ class Options
|
|
|
177
181
|
ctx.options.logfile = v
|
|
178
182
|
end
|
|
179
183
|
|
|
184
|
+
opts.on( '--log-timestamp', 'Enable logging with timestamps for each line, disabled by default.' ) do
|
|
185
|
+
ctx.options.log_timestamp = true
|
|
186
|
+
end
|
|
187
|
+
|
|
180
188
|
opts.on( '-D', '--debug', 'Enable debug logging.' ) do
|
|
181
189
|
ctx.options.debug = true
|
|
182
190
|
end
|
|
@@ -328,7 +336,7 @@ class Options
|
|
|
328
336
|
end
|
|
329
337
|
end.parse!
|
|
330
338
|
|
|
331
|
-
Logger.init( ctx.options.debug, ctx.options.logfile, ctx.options.silent )
|
|
339
|
+
Logger.init( ctx.options.debug, ctx.options.logfile, ctx.options.silent, ctx.options.log_timestamp )
|
|
332
340
|
|
|
333
341
|
if ctx.options.check_updates
|
|
334
342
|
UpdateChecker.check
|
|
@@ -520,8 +528,8 @@ class Options
|
|
|
520
528
|
|
|
521
529
|
# Print the starting status message.
|
|
522
530
|
def starting_message
|
|
523
|
-
on = '
|
|
524
|
-
off = '
|
|
531
|
+
on = '✔'.green
|
|
532
|
+
off = '✘'.red
|
|
525
533
|
status = {
|
|
526
534
|
'spoofing' => if has_spoofer? then on else off end,
|
|
527
535
|
'discovery' => if !target.nil? or arpcache then off else on end,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
1
2
|
=begin
|
|
2
3
|
|
|
3
4
|
BETTERCAP
|
|
@@ -132,8 +133,8 @@ class Proxy
|
|
|
132
133
|
|
|
133
134
|
rescue Exception => e
|
|
134
135
|
if request.host
|
|
135
|
-
Logger.warn "Error while serving #{request.host}#{request.url}: #{e.
|
|
136
|
-
Logger.
|
|
136
|
+
Logger.warn "Error while serving #{request.host}#{request.url}: #{e.message}"
|
|
137
|
+
Logger.debug e.backtrace.join("\n")
|
|
137
138
|
end
|
|
138
139
|
end
|
|
139
140
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
1
2
|
=begin
|
|
2
3
|
|
|
3
4
|
BETTERCAP
|
|
@@ -25,7 +26,7 @@ class URLMonitor
|
|
|
25
26
|
def was_stripped?( client, url )
|
|
26
27
|
@urls.include?([client, url])
|
|
27
28
|
end
|
|
28
|
-
|
|
29
|
+
|
|
29
30
|
# Add the object (client, url) to this list.
|
|
30
31
|
def add!( client, url )
|
|
31
32
|
unless was_stripped?(client, url)
|
data/lib/bettercap/shell.rb
CHANGED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
|
|
3
|
+
BETTERCAP
|
|
4
|
+
|
|
5
|
+
Author : Simone 'evilsocket' Margaritelli
|
|
6
|
+
Email : evilsocket@gmail.com
|
|
7
|
+
Blog : http://www.evilsocket.net/
|
|
8
|
+
|
|
9
|
+
This project is released under the GPL 3 license.
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
require 'bettercap/sniffer/parsers/base'
|
|
13
|
+
|
|
14
|
+
module BetterCap
|
|
15
|
+
module Parsers
|
|
16
|
+
# DICT authentication parser.
|
|
17
|
+
class Dict < Base
|
|
18
|
+
def initialize
|
|
19
|
+
@name = 'DICT'
|
|
20
|
+
end
|
|
21
|
+
def on_packet( pkt )
|
|
22
|
+
begin
|
|
23
|
+
if pkt.tcp_dst == 2628
|
|
24
|
+
lines = pkt.to_s.split(/\r?\n/)
|
|
25
|
+
lines.each do |line|
|
|
26
|
+
if line =~ /AUTH\s+(.+)\s+(.+)$/
|
|
27
|
+
user = $1
|
|
28
|
+
pass = $2
|
|
29
|
+
StreamLogger.log_raw( pkt, @name, "username=#{user} password=#{pass}" )
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
rescue
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
1
2
|
=begin
|
|
2
3
|
|
|
3
4
|
BETTERCAP
|
|
@@ -15,7 +16,7 @@ require 'base64'
|
|
|
15
16
|
|
|
16
17
|
module BetterCap
|
|
17
18
|
module Parsers
|
|
18
|
-
# HTTP basic and digest authentication parser.
|
|
19
|
+
# HTTP basic and digest authentication parser.
|
|
19
20
|
class Httpauth < Base
|
|
20
21
|
def on_packet( pkt )
|
|
21
22
|
lines = pkt.to_s.split("\n")
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
1
2
|
=begin
|
|
2
3
|
|
|
3
4
|
BETTERCAP
|
|
@@ -13,7 +14,7 @@ require 'bettercap/sniffer/parsers/base'
|
|
|
13
14
|
|
|
14
15
|
module BetterCap
|
|
15
16
|
module Parsers
|
|
16
|
-
# POP/IMAP authentication parser.
|
|
17
|
+
# POP/IMAP authentication parser.
|
|
17
18
|
class Mail < Base
|
|
18
19
|
def initialize
|
|
19
20
|
@filters = [ /(\d+ )?(auth|authenticate) ([a-z\-_0-9]+)/i ]
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
|
|
3
|
+
BETTERCAP
|
|
4
|
+
|
|
5
|
+
Author : Simone 'evilsocket' Margaritelli
|
|
6
|
+
Email : evilsocket@gmail.com
|
|
7
|
+
Blog : http://www.evilsocket.net/
|
|
8
|
+
|
|
9
|
+
This project is released under the GPL 3 license.
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
require 'bettercap/sniffer/parsers/base'
|
|
13
|
+
|
|
14
|
+
module BetterCap
|
|
15
|
+
module Parsers
|
|
16
|
+
# Music Player Daemon (MPD) authentication parser.
|
|
17
|
+
class Mpd < Base
|
|
18
|
+
def initialize
|
|
19
|
+
@name = 'MPD'
|
|
20
|
+
end
|
|
21
|
+
def on_packet( pkt )
|
|
22
|
+
begin
|
|
23
|
+
if pkt.tcp_dst == 6600
|
|
24
|
+
lines = pkt.to_s.split(/\r?\n/)
|
|
25
|
+
lines.each do |line|
|
|
26
|
+
if line =~ /password\s+(.+)$/
|
|
27
|
+
pass = $1
|
|
28
|
+
StreamLogger.log_raw( pkt, @name, "password=#{pass}" )
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
rescue
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
|
|
3
|
+
BETTERCAP
|
|
4
|
+
|
|
5
|
+
Author : Simone 'evilsocket' Margaritelli
|
|
6
|
+
Email : evilsocket@gmail.com
|
|
7
|
+
Blog : http://www.evilsocket.net/
|
|
8
|
+
|
|
9
|
+
This project is released under the GPL 3 license.
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
require 'bettercap/sniffer/parsers/base'
|
|
13
|
+
|
|
14
|
+
module BetterCap
|
|
15
|
+
module Parsers
|
|
16
|
+
# Redis authentication parser.
|
|
17
|
+
class Redis < Base
|
|
18
|
+
def initialize
|
|
19
|
+
@name = 'REDIS'
|
|
20
|
+
end
|
|
21
|
+
def on_packet( pkt )
|
|
22
|
+
begin
|
|
23
|
+
if pkt.tcp_dst == 6379
|
|
24
|
+
lines = pkt.to_s.split(/\r?\n/)
|
|
25
|
+
lines.each do |line|
|
|
26
|
+
if line =~ /config\s+set\s+requirepass\s+(.+)$/i
|
|
27
|
+
pass = "#{$1}"
|
|
28
|
+
StreamLogger.log_raw( pkt, @name, "password=#{pass}" )
|
|
29
|
+
elsif line =~ /AUTH\s+(.+)$/i
|
|
30
|
+
pass = "#{$1}"
|
|
31
|
+
StreamLogger.log_raw( pkt, @name, "password=#{pass}" )
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
rescue
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
|
|
3
|
+
BETTERCAP
|
|
4
|
+
|
|
5
|
+
Author : Simone 'evilsocket' Margaritelli
|
|
6
|
+
Email : evilsocket@gmail.com
|
|
7
|
+
Blog : http://www.evilsocket.net/
|
|
8
|
+
|
|
9
|
+
This project is released under the GPL 3 license.
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
require 'bettercap/sniffer/parsers/base'
|
|
13
|
+
|
|
14
|
+
module BetterCap
|
|
15
|
+
module Parsers
|
|
16
|
+
# BSD rlogin authentication parser.
|
|
17
|
+
class Rlogin < Base
|
|
18
|
+
def initialize
|
|
19
|
+
@name = 'RLOGIN'
|
|
20
|
+
end
|
|
21
|
+
def on_packet( pkt )
|
|
22
|
+
begin
|
|
23
|
+
if pkt.tcp_dst == 513
|
|
24
|
+
# rlogin packet data = 0x00[client-username]0x00<server-username>0x00<terminal/speed>0x00
|
|
25
|
+
|
|
26
|
+
# if client username, server username and terminal/speed were supplied...
|
|
27
|
+
# regex starts at client username as the first null byte is stripped from pkt.payload.to_s
|
|
28
|
+
if pkt.payload.to_s =~ /\A([a-z0-9_-]+)\x00([a-z0-9_-]+)\x00([a-z0-9_-]+\/[0-9]+)\x00\Z/i
|
|
29
|
+
client_user = $1
|
|
30
|
+
server_user = $2
|
|
31
|
+
terminal = $3
|
|
32
|
+
StreamLogger.log_raw( pkt, @name, "client-username=#{client_user} server-username=#{server_user} terminal=#{terminal}" )
|
|
33
|
+
# else, if only server username and terminal/speed were supplied...
|
|
34
|
+
# regex starts at 0x00 as the first null byte is stripped from pkt.payload.to_s and the client username is empty
|
|
35
|
+
elsif pkt.payload.to_s =~ /\A\x00([a-z0-9_-]+)\x00([a-z0-9_-]+\/[0-9]+)\x00\Z/i
|
|
36
|
+
server_user = $1
|
|
37
|
+
terminal = $2
|
|
38
|
+
StreamLogger.log_raw( pkt, @name, "server-username=#{server_user} terminal=#{terminal}" )
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
rescue
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
|
|
3
|
+
BETTERCAP
|
|
4
|
+
|
|
5
|
+
Author : Simone 'evilsocket' Margaritelli
|
|
6
|
+
Email : evilsocket@gmail.com
|
|
7
|
+
Blog : http://www.evilsocket.net/
|
|
8
|
+
|
|
9
|
+
This project is released under the GPL 3 license.
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
require 'bettercap/sniffer/parsers/base'
|
|
13
|
+
|
|
14
|
+
module BetterCap
|
|
15
|
+
module Parsers
|
|
16
|
+
# Simple Network Paging Protocol (SNPP) authentication parser.
|
|
17
|
+
class Snpp < Base
|
|
18
|
+
def initialize
|
|
19
|
+
@name = 'SNPP'
|
|
20
|
+
end
|
|
21
|
+
def on_packet( pkt )
|
|
22
|
+
begin
|
|
23
|
+
if pkt.tcp_dst == 444
|
|
24
|
+
lines = pkt.to_s.split(/\r?\n/)
|
|
25
|
+
lines.each do |line|
|
|
26
|
+
if line =~ /LOGIn\s+(.+)\s+(.+)$/
|
|
27
|
+
user = $1
|
|
28
|
+
pass = $2
|
|
29
|
+
StreamLogger.log_raw( pkt, @name, "username=#{user} password=#{pass}" )
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
rescue
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
data/lib/bettercap/version.rb
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
1
2
|
=begin
|
|
2
3
|
|
|
3
4
|
BETTERCAP
|
|
@@ -11,7 +12,7 @@ This project is released under the GPL 3 license.
|
|
|
11
12
|
=end
|
|
12
13
|
module BetterCap
|
|
13
14
|
# Current version of bettercap.
|
|
14
|
-
VERSION = '1.3.
|
|
15
|
+
VERSION = '1.3.3'
|
|
15
16
|
# Program banner.
|
|
16
17
|
BANNER = File.read( File.dirname(__FILE__) + '/banner' ).gsub( '#VERSION#', "v#{VERSION}")
|
|
17
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.3.
|
|
4
|
+
version: 1.3.3
|
|
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-01-
|
|
11
|
+
date: 2016-01-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: colorize
|
|
@@ -143,14 +143,19 @@ files:
|
|
|
143
143
|
- lib/bettercap/shell.rb
|
|
144
144
|
- lib/bettercap/sniffer/parsers/base.rb
|
|
145
145
|
- lib/bettercap/sniffer/parsers/custom.rb
|
|
146
|
+
- lib/bettercap/sniffer/parsers/dict.rb
|
|
146
147
|
- lib/bettercap/sniffer/parsers/ftp.rb
|
|
147
148
|
- lib/bettercap/sniffer/parsers/httpauth.rb
|
|
148
149
|
- lib/bettercap/sniffer/parsers/https.rb
|
|
149
150
|
- lib/bettercap/sniffer/parsers/irc.rb
|
|
150
151
|
- lib/bettercap/sniffer/parsers/mail.rb
|
|
152
|
+
- lib/bettercap/sniffer/parsers/mpd.rb
|
|
151
153
|
- lib/bettercap/sniffer/parsers/nntp.rb
|
|
152
154
|
- lib/bettercap/sniffer/parsers/ntlmss.rb
|
|
153
155
|
- lib/bettercap/sniffer/parsers/post.rb
|
|
156
|
+
- lib/bettercap/sniffer/parsers/redis.rb
|
|
157
|
+
- lib/bettercap/sniffer/parsers/rlogin.rb
|
|
158
|
+
- lib/bettercap/sniffer/parsers/snpp.rb
|
|
154
159
|
- lib/bettercap/sniffer/parsers/url.rb
|
|
155
160
|
- lib/bettercap/sniffer/sniffer.rb
|
|
156
161
|
- lib/bettercap/spoofers/arp.rb
|