Skip to content

Commit 355dfdd

Browse files
authored
Merge pull request rapid7#20122 from bcoles/rubocop-modules-auxiliary-vsploit
modules/auxiliary/vsploit: Resolve RuboCop violations
2 parents 1071c7e + dfb82a3 commit 355dfdd

File tree

5 files changed

+165
-134
lines changed

5 files changed

+165
-134
lines changed

modules/auxiliary/vsploit/malware/dns/dns_mariposa.rb

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,38 +7,43 @@ class MetasploitModule < Msf::Auxiliary
77

88
def initialize
99
super(
10-
'Name' => 'VSploit Mariposa DNS Query Module',
11-
'Description' => 'This module queries known Mariposa Botnet DNS records.',
12-
'Author' => 'MJC',
13-
'License' => MSF_LICENSE,
14-
'References' =>
15-
[
16-
[ 'URL', 'http://www.defintel.com/docs/Mariposa_Analysis.pdf']
17-
]
10+
'Name' => 'VSploit Mariposa DNS Query Module',
11+
'Description' => 'This module queries known Mariposa Botnet DNS records.',
12+
'Author' => 'MJC',
13+
'License' => MSF_LICENSE,
14+
'References' => [
15+
[ 'URL', 'http://www.defintel.com/docs/Mariposa_Analysis.pdf']
16+
],
17+
'Notes' => {
18+
'Stability' => [CRASH_SAFE],
19+
'SideEffects' => [IOC_IN_LOGS],
20+
'Reliability' => []
21+
}
1822
)
1923
register_options(
2024
[
21-
OptString.new('DNS_SERVER',[false, "Specifies a DNS Server"]),
22-
OptInt.new('COUNT', [false, "Number of intervals to loop",1]),
23-
OptInt.new('DELAY', [false, "Delay in seconds between intervals",3])
24-
])
25+
OptString.new('DNS_SERVER', [false, 'Specifies a DNS server']),
26+
OptInt.new('COUNT', [false, 'Number of intervals to loop', 1]),
27+
OptInt.new('DELAY', [false, 'Delay in seconds between intervals', 3])
28+
]
29+
)
2530
end
2631

2732
def run
28-
@res = Net::DNS::Resolver.new()
33+
@res = Net::DNS::Resolver.new
2934

3035
domain = [
31-
"lalundelau.sinip.es","bf2back.sinip.es","thejacksonfive.mobi",
32-
"thejacksonfive.us","thejacksonfive.biz","butterfly.BigMoney.biz",
33-
"bfisback.sinip.es","bfisback.no-ip.org","qwertasdfg.sinip.es",
34-
"shv4b.getmyip.com","shv4.no-ip.biz","butterfly.sinip.es",
35-
"defintelsucks.sinip.es","defintelsucks.net","defintelsucks.com",
36-
"gusanodeseda.sinip.es","gusanodeseda.net","legion.sinip.es",
37-
"booster.estr.es","sexme.in","extraperlo.biz",
38-
"legionarios.servecounterstrike.com","thesexydude.com",
39-
"yougotissuez.com","gusanodeseda.mobi","tamiflux.org",
40-
"tamiflux.net","binaryfeed.in","youare.sexidude.com",
41-
"mierda.notengodominio.com",
36+
'lalundelau.sinip.es', 'bf2back.sinip.es', 'thejacksonfive.mobi',
37+
'thejacksonfive.us', 'thejacksonfive.biz', 'butterfly.BigMoney.biz',
38+
'bfisback.sinip.es', 'bfisback.no-ip.org', 'qwertasdfg.sinip.es',
39+
'shv4b.getmyip.com', 'shv4.no-ip.biz', 'butterfly.sinip.es',
40+
'defintelsucks.sinip.es', 'defintelsucks.net', 'defintelsucks.com',
41+
'gusanodeseda.sinip.es', 'gusanodeseda.net', 'legion.sinip.es',
42+
'booster.estr.es', 'sexme.in', 'extraperlo.biz',
43+
'legionarios.servecounterstrike.com', 'thesexydude.com',
44+
'yougotissuez.com', 'gusanodeseda.mobi', 'tamiflux.org',
45+
'tamiflux.net', 'binaryfeed.in', 'youare.sexidude.com',
46+
'mierda.notengodominio.com',
4247
]
4348

4449
if datastore['DNS_SERVER']
@@ -50,11 +55,11 @@ def run
5055
while count < datastore['COUNT']
5156

5257
domain.each do |name|
53-
query = @res.query(name, "A")
58+
query = @res.query(name, 'A')
5459
time = Time.new
55-
time = time.strftime("%Y-%m-%d %H:%M:%S")
60+
time = time.strftime('%Y-%m-%d %H:%M:%S')
5661
print_status("#{time} - DNS Query sent for => #{name}")
57-
if query.answer.length == 0
62+
if query.answer.empty?
5863
print_error("#{time} - #{name} => No Record Found")
5964
else
6065
a = query.answer[0].to_s.split(/[\s,]+/)
@@ -63,7 +68,7 @@ def run
6368
end
6469
unless count == (datastore['COUNT'] - 1)
6570
time = Time.new
66-
time = time.strftime("%Y-%m-%d %H:%M:%S")
71+
time = time.strftime('%Y-%m-%d %H:%M:%S')
6772
print_status("#{time} - Waiting #{datastore['DELAY']} seconds to query")
6873
select(nil, nil, nil, datastore['DELAY'])
6974
end

modules/auxiliary/vsploit/malware/dns/dns_query.rb

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,29 @@ class MetasploitModule < Msf::Auxiliary
77

88
def initialize
99
super(
10-
'Name' => 'VSploit DNS Beaconing Emulation',
11-
'Description' => 'This module takes a list and emulates malicious DNS beaconing.',
12-
'Author' => 'MJC',
13-
'License' => MSF_LICENSE
10+
'Name' => 'VSploit DNS Beaconing Emulation',
11+
'Description' => 'This module takes a list of domains and emulates malicious DNS beaconing.',
12+
'Author' => 'MJC',
13+
'License' => MSF_LICENSE,
14+
'Notes' => {
15+
'Stability' => [CRASH_SAFE],
16+
'SideEffects' => [IOC_IN_LOGS],
17+
'Reliability' => []
18+
}
1419
)
1520
register_options(
16-
[
17-
OptString.new('DOMAINS', [ true, "Separate Domains by whitespace"]),
18-
OptString.new('DNS_SERVER',[false, "Specifies a DNS Server"]),
19-
OptInt.new('COUNT', [false, "Number of intervals to loop",2]),
20-
OptInt.new('DELAY', [false, "Delay in seconds between intervals",3])
21-
])
21+
[
22+
OptString.new('DOMAINS', [ true, 'Separate domains by whitespace']),
23+
OptString.new('DNS_SERVER', [false, 'Specifies a DNS Server']),
24+
OptInt.new('COUNT', [false, 'Number of intervals to loop', 2]),
25+
OptInt.new('DELAY', [false, 'Delay in seconds between intervals', 3])
26+
]
27+
)
2228
end
2329

2430
def run
25-
@res = Net::DNS::Resolver.new()
26-
#@res.retry = 2
31+
@res = Net::DNS::Resolver.new
32+
# @res.retry = 2
2733

2834
if datastore['DNS_SERVER']
2935
@res.nameservers = datastore['DNS_SERVER']
@@ -35,11 +41,11 @@ def run
3541

3642
domain = datastore['DOMAINS'].split(/[\s,]+/)
3743
domain.each do |name|
38-
query = @res.query(name, "A")
44+
query = @res.query(name, 'A')
3945
time = Time.new
40-
time = time.strftime("%Y-%m-%d %H:%M:%S")
46+
time = time.strftime('%Y-%m-%d %H:%M:%S')
4147
print_status("#{time} - DNS Query sent for => #{name}")
42-
if query.answer.length == 0
48+
if query.answer.empty?
4349
print_error("#{time} - #{name} => No Record Found")
4450
else
4551
a = query.answer[0].to_s.split(/[\s,]+/)
@@ -48,7 +54,7 @@ def run
4854
end
4955
unless count == (datastore['COUNT'] - 1)
5056
time = Time.new
51-
time = time.strftime("%Y-%m-%d %H:%M:%S")
57+
time = time.strftime('%Y-%m-%d %H:%M:%S')
5258
print_status("#{time} - Waiting #{datastore['DELAY']} seconds to beacon")
5359
select(nil, nil, nil, datastore['DELAY'])
5460
end

modules/auxiliary/vsploit/malware/dns/dns_zeus.rb

Lines changed: 38 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -7,43 +7,48 @@ class MetasploitModule < Msf::Auxiliary
77

88
def initialize
99
super(
10-
'Name' => 'VSploit Zeus DNS Query Module',
11-
'Description' => 'This module queries known Zeus Botnet DNS records.',
12-
'Author' => 'MJC',
13-
'License' => MSF_LICENSE,
14-
'References' =>
15-
[
16-
[ 'URL', 'https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist']
17-
]
10+
'Name' => 'VSploit Zeus DNS Query Module',
11+
'Description' => 'This module queries known Zeus Botnet DNS records.',
12+
'Author' => 'MJC',
13+
'License' => MSF_LICENSE,
14+
'References' => [
15+
[ 'URL', 'https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist']
16+
],
17+
'Notes' => {
18+
'Stability' => [CRASH_SAFE],
19+
'SideEffects' => [IOC_IN_LOGS],
20+
'Reliability' => []
21+
}
1822
)
1923
register_options(
2024
[
21-
OptString.new('DNS_SERVER',[false, "Specifies a DNS Server"]),
22-
OptInt.new('COUNT', [false, "Number of intervals to loop",1]),
23-
OptInt.new('DELAY', [false, "Delay in seconds between intervals",3])
24-
])
25+
OptString.new('DNS_SERVER', [false, 'Specifies a DNS server']),
26+
OptInt.new('COUNT', [false, 'Number of intervals to loop', 1]),
27+
OptInt.new('DELAY', [false, 'Delay in seconds between intervals', 3])
28+
]
29+
)
2530
end
2631

2732
def run
28-
@res = Net::DNS::Resolver.new()
33+
@res = Net::DNS::Resolver.new
2934

3035
domain = [
31-
"allspring.net","antifoher.biz","asdfasdgqghgsw.cx.cc",
32-
"ashnmjjpoljfnl.info","atlaz.net","b3l.org","back.boroborogold.ru",
33-
"bandwithcheckstart.com","batmanrobinho.com","bellicbridge.ru",
34-
"bestfihteerdr.com","bestprice2you.net","billyd.com.au",
35-
"bitschoonerop.com","blackskullbg.sytes.net","botikov.eu.tf",
36-
"botnetdown.gicp.net","boutique.vcm-mode.it","brandc.name",
37-
"bxkkuskgdjskdn.com","c0re.su","cdvqvnjqqtkqhsoo.info",
38-
"christmassuper.com","ciritas.ru","citi-spb.ru","clavn.ru",
39-
"client.trackups.org","client.upsclients.net","cnewsus.ru",
40-
"cnnus.ru","concapow.in","consoleencydd.com","cqoqgzqmkpkrmlo.com",
41-
"ctllutheran.org","currencytradechat.com","cyytmmlxsthywst.com",
42-
"damaka.com","datacricketuf.ru","deimingames.com",
43-
"dfhhdkdddqjda.start.tl","djerk.info","djpeterblue.com.br",
44-
"dlmsonisfzksioqq.org","domio.pwomega.ru","favdstgssdqdsfg.start.tl",
45-
"favoritopilodjd.com","favqnornkwvkwfxv.biz","fdhjkfhskas.com",
46-
"federalreserve-report.com","federetoktyt.net"
36+
'allspring.net', 'antifoher.biz', 'asdfasdgqghgsw.cx.cc',
37+
'ashnmjjpoljfnl.info', 'atlaz.net', 'b3l.org', 'back.boroborogold.ru',
38+
'bandwithcheckstart.com', 'batmanrobinho.com', 'bellicbridge.ru',
39+
'bestfihteerdr.com', 'bestprice2you.net', 'billyd.com.au',
40+
'bitschoonerop.com', 'blackskullbg.sytes.net', 'botikov.eu.tf',
41+
'botnetdown.gicp.net', 'boutique.vcm-mode.it', 'brandc.name',
42+
'bxkkuskgdjskdn.com', 'c0re.su', 'cdvqvnjqqtkqhsoo.info',
43+
'christmassuper.com', 'ciritas.ru', 'citi-spb.ru', 'clavn.ru',
44+
'client.trackups.org', 'client.upsclients.net', 'cnewsus.ru',
45+
'cnnus.ru', 'concapow.in', 'consoleencydd.com', 'cqoqgzqmkpkrmlo.com',
46+
'ctllutheran.org', 'currencytradechat.com', 'cyytmmlxsthywst.com',
47+
'damaka.com', 'datacricketuf.ru', 'deimingames.com',
48+
'dfhhdkdddqjda.start.tl', 'djerk.info', 'djpeterblue.com.br',
49+
'dlmsonisfzksioqq.org', 'domio.pwomega.ru', 'favdstgssdqdsfg.start.tl',
50+
'favoritopilodjd.com', 'favqnornkwvkwfxv.biz', 'fdhjkfhskas.com',
51+
'federalreserve-report.com', 'federetoktyt.net'
4752
]
4853

4954
if datastore['DNS_SERVER']
@@ -55,11 +60,11 @@ def run
5560
while count < datastore['COUNT']
5661

5762
domain.each do |name|
58-
query = @res.query(name, "A")
63+
query = @res.query(name, 'A')
5964
time = Time.new
60-
time = time.strftime("%Y-%m-%d %H:%M:%S")
65+
time = time.strftime('%Y-%m-%d %H:%M:%S')
6166
print_status("#{time} - DNS Query sent for => #{name}")
62-
if query.answer.length == 0
67+
if query.answer.empty?
6368
print_error("#{time} - #{name} => No Record Found")
6469
else
6570
a = query.answer[0].to_s.split(/[\s,]+/)
@@ -68,7 +73,7 @@ def run
6873
end
6974
unless count == (datastore['COUNT'] - 1)
7075
time = Time.new
71-
time = time.strftime("%Y-%m-%d %H:%M:%S")
76+
time = time.strftime('%Y-%m-%d %H:%M:%S')
7277
print_status("#{time} - Waiting #{datastore['DELAY']} seconds to query")
7378
select(nil, nil, nil, datastore['DELAY'])
7479
end

modules/auxiliary/vsploit/pii/email_pii.rb

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,32 @@ class MetasploitModule < Msf::Auxiliary
1212
include Msf::Auxiliary::PII
1313

1414
def initialize(info = {})
15-
super(update_info(info,
16-
'Name' => 'VSploit Email PII',
17-
'Description' => %q{
15+
super(
16+
update_info(
17+
info,
18+
'Name' => 'VSploit Email PII',
19+
'Description' => %q{
1820
This auxiliary reads from a file and sends data which
19-
should be flagged via an internal or external SMTP server.
20-
},
21-
'License' => MSF_LICENSE,
22-
'Author' => ['willis']
23-
))
24-
register_options(
25-
[
26-
OptString.new('RHOST', [true, "SMTP server address",'127.0.0.1']),
27-
OptPort.new('RPORT', [true, "SMTP server port", 25])
28-
])
21+
should be flagged via an internal or external SMTP server.
22+
},
23+
'License' => MSF_LICENSE,
24+
'Author' => ['willis'],
25+
'Notes' => {
26+
'Stability' => [CRASH_SAFE],
27+
'SideEffects' => [IOC_IN_LOGS],
28+
'Reliability' => []
29+
}
30+
)
31+
)
32+
register_options(
33+
[
34+
OptString.new('RHOST', [true, 'SMTP server address', '127.0.0.1']),
35+
OptPort.new('RPORT', [true, 'SMTP server port', 25])
36+
]
37+
)
2938
end
3039

3140
def run
32-
3341
msg = Rex::MIME::Message.new
3442
msg.mime_defaults
3543
msg.subject = datastore['SUBJECT']
@@ -38,9 +46,9 @@ def run
3846

3947
data = create_pii
4048

41-
msg.add_part(data, "text/plain")
49+
msg.add_part(data, 'text/plain')
4250
msg.add_part_attachment(data, rand_text_english(10))
4351

44-
resp = send_message(msg.to_s)
52+
send_message(msg.to_s)
4553
end
4654
end

0 commit comments

Comments
 (0)