Skip to content

Commit f2f4f91

Browse files
author
Pedro Ribeiro
committed
Merge pull request #4 from rapid7/master
merge
2 parents ce8452a + 056ee4f commit f2f4f91

File tree

155 files changed

+2760
-1239
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+2760
-1239
lines changed

Gemfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ group :db do
88
gem 'activerecord', '>= 3.0.0', '< 4.0.0'
99

1010
# Metasploit::Credential database models
11-
gem 'metasploit-credential', '~> 0.10.1'
11+
gem 'metasploit-credential', '~> 0.12.0'
1212
# Database models shared between framework and Pro.
13-
gem 'metasploit_data_models', '~> 0.20.1'
13+
gem 'metasploit_data_models', '~> 0.21.1'
1414
# Needed for module caching in Mdm::ModuleDetails
1515
gem 'pg', '>= 0.11'
1616
end
@@ -39,7 +39,7 @@ group :development, :test do
3939
gem 'rspec', '>= 2.12', '< 3.0.0'
4040
# Define `rake spec`. Must be in development AND test so that its available by default as a rake test when the
4141
# environment is development
42-
gem 'rspec-rails' , '>= 2.12', '< 3.0.0'
42+
gem 'rspec-rails' , '>= 2.12', '< 3.0.0'
4343
end
4444

4545
group :pcap do

Gemfile.lock

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@ PATH
55
actionpack (< 4.0.0)
66
activesupport (>= 3.0.0, < 4.0.0)
77
bcrypt
8-
jsobfu (~> 0.1.7)
8+
jsobfu (~> 0.2.0)
99
json
10-
metasploit-concern (~> 0.2.1)
11-
metasploit-model (~> 0.27.1)
10+
metasploit-concern (~> 0.3.0)
11+
metasploit-model (~> 0.28.0)
1212
meterpreter_bins (= 0.0.7)
1313
msgpack
1414
nokogiri
1515
packetfu (= 1.1.9)
1616
railties
17+
recog (~> 1.0)
1718
robots
1819
rubyzip (~> 1.1)
1920
sqlite3
@@ -91,34 +92,35 @@ GEM
9192
hike (1.2.3)
9293
i18n (0.6.11)
9394
journey (1.0.4)
94-
jsobfu (0.1.7)
95+
jsobfu (0.2.1)
9596
rkelly-remix (= 0.0.6)
9697
json (1.8.1)
9798
mail (2.5.4)
9899
mime-types (~> 1.16)
99100
treetop (~> 1.4.8)
100-
metasploit-concern (0.2.1)
101+
metasploit-concern (0.3.0)
101102
activesupport (~> 3.0, >= 3.0.0)
102103
railties (< 4.0.0)
103-
metasploit-credential (0.10.1)
104-
metasploit-concern (~> 0.2.1)
105-
metasploit-model (~> 0.27.0)
106-
metasploit_data_models (~> 0.20.0)
104+
metasploit-credential (0.12.0)
105+
metasploit-concern (~> 0.3.0)
106+
metasploit-model (~> 0.28.0)
107+
metasploit_data_models (~> 0.21.0)
107108
pg
108109
railties (< 4.0.0)
109110
rubyntlm
110111
rubyzip (~> 1.1)
111-
metasploit-model (0.27.1)
112+
metasploit-model (0.28.0)
112113
activesupport
113114
railties (< 4.0.0)
114-
metasploit_data_models (0.20.1)
115+
metasploit_data_models (0.21.1)
115116
activerecord (>= 3.2.13, < 4.0.0)
116117
activesupport
117118
arel-helpers
118-
metasploit-concern (~> 0.2.1)
119-
metasploit-model (~> 0.27.0)
119+
metasploit-concern (~> 0.3.0)
120+
metasploit-model (~> 0.28.0)
120121
pg
121122
railties (< 4.0.0)
123+
recog (~> 1.0)
122124
meterpreter_bins (0.0.7)
123125
method_source (0.8.2)
124126
mime-types (1.25.1)
@@ -161,6 +163,8 @@ GEM
161163
rake (10.3.2)
162164
rdoc (3.12.2)
163165
json (~> 1.4)
166+
recog (1.0.0)
167+
nokogiri
164168
redcarpet (3.1.2)
165169
rkelly-remix (0.0.6)
166170
robots (0.10.1)
@@ -218,9 +222,9 @@ DEPENDENCIES
218222
factory_girl (>= 4.1.0)
219223
factory_girl_rails
220224
fivemat (= 1.2.1)
221-
metasploit-credential (~> 0.10.1)
225+
metasploit-credential (~> 0.12.0)
222226
metasploit-framework!
223-
metasploit_data_models (~> 0.20.1)
227+
metasploit_data_models (~> 0.21.1)
224228
network_interface (~> 0.0.1)
225229
pcaprub
226230
pg (>= 0.11)

data/js/detect/os.js

Lines changed: 285 additions & 267 deletions
Large diffs are not rendered by default.

data/meterpreter/ext_server_stdapi.py

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -472,10 +472,14 @@ class RTATTR(ctypes.Structure):
472472
ERROR_CONNECTION_ERROR = 10000
473473

474474
# Windows Constants
475-
GAA_FLAG_SKIP_ANYCAST = 0x0002
476-
GAA_FLAG_SKIP_MULTICAST = 0x0004
477-
GAA_FLAG_INCLUDE_PREFIX = 0x0010
478-
GAA_FLAG_SKIP_DNS_SERVER = 0x0080
475+
GAA_FLAG_SKIP_ANYCAST = 0x0002
476+
GAA_FLAG_SKIP_MULTICAST = 0x0004
477+
GAA_FLAG_INCLUDE_PREFIX = 0x0010
478+
GAA_FLAG_SKIP_DNS_SERVER = 0x0080
479+
PROCESS_TERMINATE = 0x0001
480+
PROCESS_VM_READ = 0x0010
481+
PROCESS_QUERY_INFORMATION = 0x0400
482+
PROCESS_QUERY_LIMITED_INFORMATION = 0x1000
479483

480484
WIN_AF_INET = 2
481485
WIN_AF_INET6 = 23
@@ -666,12 +670,11 @@ def stdapi_sys_config_sysinfo(request, response):
666670

667671
@meterpreter.register_function
668672
def stdapi_sys_process_close(request, response):
669-
proc_h_id = packet_get_tlv(request, TLV_TYPE_PROCESS_HANDLE)
673+
proc_h_id = packet_get_tlv(request, TLV_TYPE_HANDLE)
670674
if not proc_h_id:
671675
return ERROR_SUCCESS, response
672676
proc_h_id = proc_h_id['value']
673-
proc_h = meterpreter.channels[proc_h_id]
674-
proc_h.kill()
677+
del meterpreter.processes[proc_h_id]
675678
return ERROR_SUCCESS, response
676679

677680
@meterpreter.register_function
@@ -720,6 +723,23 @@ def stdapi_sys_process_getpid(request, response):
720723
response += tlv_pack(TLV_TYPE_PID, os.getpid())
721724
return ERROR_SUCCESS, response
722725

726+
@meterpreter.register_function
727+
def stdapi_sys_process_kill(request, response):
728+
for pid in packet_enum_tlvs(request, TLV_TYPE_PID):
729+
pid = pid['value']
730+
if has_windll:
731+
k32 = ctypes.windll.kernel32
732+
proc_h = k32.OpenProcess(PROCESS_TERMINATE, False, pid)
733+
if not proc_h:
734+
return ERROR_FAILURE, response
735+
if not k32.TerminateProcess(proc_h, 0):
736+
return ERROR_FAILURE, response
737+
elif hasattr(os, 'kill'):
738+
os.kill(pid, 9)
739+
else:
740+
return ERROR_FAILURE, response
741+
return ERROR_SUCCESS, response
742+
723743
def stdapi_sys_process_get_processes_via_proc(request, response):
724744
for pid in os.listdir('/proc'):
725745
pgroup = bytes()
@@ -772,9 +792,6 @@ def stdapi_sys_process_get_processes_via_ps(request, response):
772792

773793
def stdapi_sys_process_get_processes_via_windll(request, response):
774794
TH32CS_SNAPPROCESS = 2
775-
PROCESS_QUERY_INFORMATION = 0x0400
776-
PROCESS_QUERY_LIMITED_INFORMATION = 0x1000
777-
PROCESS_VM_READ = 0x10
778795
TOKEN_QUERY = 0x0008
779796
TokenUser = 1
780797
k32 = ctypes.windll.kernel32

data/meterpreter/meterpreter.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,6 @@ def run(self):
332332
response = self.create_response(request)
333333
self.socket.send(response)
334334
else:
335-
channels_for_removal = []
336335
# iterate over the keys because self.channels could be modified if one is closed
337336
channel_ids = list(self.channels.keys())
338337
for channel_id in channel_ids:

documentation/samples/modules/exploits/ie_browser.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Metasploit4 < Msf::Exploit::Remote
2929
:ua_minver => "8.0",
3030
:ua_maxver => "10.0",
3131
:javascript => true,
32-
:os_name => OperatingSystems::WINDOWS,
32+
:os_name => OperatingSystems::Match::WINDOWS,
3333
:rank => NormalRanking
3434
})
3535

@@ -85,6 +85,8 @@ def get_target(agent)
8585
os_name = 'Windows 7'
8686
when '6.2'
8787
os_name = 'Windows 8'
88+
when '6.3'
89+
os_name = 'Windows 8.1'
8890
end
8991

9092
targets.each do |t|

external/zsh/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Metasploit completion definitions for zsh. The directory containing the
2+
completion files needs to be added to the ```$fpath``` environment variable,
3+
this is usually done in the ```~/.zshrc``` file.

external/zsh/_msfconsole

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#compdef msfconsole
2+
# ------------------------------------------------------------------------------
3+
# License
4+
# -------
5+
# This file is part of the Metasploit Framework and is released under the MSF
6+
# License, please see the COPYING file for more details.
7+
#
8+
# ------------------------------------------------------------------------------
9+
# Description
10+
# -----------
11+
#
12+
# Completion script for the Metasploit Framework's msfconsole command
13+
# (http://www.metasploit.com/).
14+
#
15+
# ------------------------------------------------------------------------------
16+
# Authors
17+
# -------
18+
#
19+
# * Spencer McIntyre
20+
#
21+
# ------------------------------------------------------------------------------
22+
23+
_arguments \
24+
{-a,--ask}"[Ask before exiting Metasploit or accept 'exit -y']" \
25+
"-c[Load the specified configuration file]:configuration file:_files" \
26+
{-d,--defanged}"[Execute the console as defanged]" \
27+
{-E,--environment}"[Specify the database environment to load from the configuration]:environment:(production development)" \
28+
{-h,--help}"[Show help text]" \
29+
{-L,--real-readline}"[Use the system Readline library instead of RbReadline]" \
30+
{-M,--migration-path}"[Specify a directory containing additional DB migrations]:directory:_files -/" \
31+
{-m,--module-path}"[Specifies an additional module search path]:search path:_files -/" \
32+
{-n,--no-database}"[Disable database support]" \
33+
{-o,--output}"[Output to the specified file]:output file" \
34+
{-p,--plugin}"[Load a plugin on startup]:plugin file:_files" \
35+
{-q,--quiet}"[Do not print the banner on start up]" \
36+
{-r,--resource}"[Execute the specified resource file]:resource file:_files" \
37+
{-v,--version}"[Show version]" \
38+
{-x,--execute-command}"[Execute the specified string as console commands]:commands" \
39+
{-y,--yaml}"[Specify a YAML file containing database settings]:yaml file:_files"

external/zsh/_msfencode

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#compdef msfencode
2+
# ------------------------------------------------------------------------------
3+
# License
4+
# -------
5+
# This file is part of the Metasploit Framework and is released under the MSF
6+
# License, please see the COPYING file for more details.
7+
#
8+
# ------------------------------------------------------------------------------
9+
# Description
10+
# -----------
11+
#
12+
# Completion script for the Metasploit Framework's msfencode command
13+
# (http://www.metasploit.com/).
14+
#
15+
# ------------------------------------------------------------------------------
16+
# Authors
17+
# -------
18+
#
19+
# * Spencer McIntyre
20+
#
21+
# ------------------------------------------------------------------------------
22+
23+
_msfencode_encoders_list=(
24+
'cmd/generic_sh'
25+
'cmd/ifs'
26+
'cmd/powershell_base64'
27+
'cmd/printf_php_mq'
28+
'generic/eicar'
29+
'generic/none'
30+
'mipsbe/byte_xori'
31+
'mipsbe/longxor'
32+
'mipsle/byte_xori'
33+
'mipsle/longxor'
34+
'php/base64'
35+
'ppc/longxor'
36+
'ppc/longxor_tag'
37+
'sparc/longxor_tag'
38+
'x64/xor'
39+
'x86/add_sub'
40+
'x86/alpha_mixed'
41+
'x86/alpha_upper'
42+
'x86/avoid_underscore_tolower'
43+
'x86/avoid_utf8_tolower'
44+
'x86/bloxor'
45+
'x86/call4_dword_xor'
46+
'x86/context_cpuid'
47+
'x86/context_stat'
48+
'x86/context_time'
49+
'x86/countdown'
50+
'x86/fnstenv_mov'
51+
'x86/jmp_call_additive'
52+
'x86/nonalpha'
53+
'x86/nonupper'
54+
'x86/opt_sub'
55+
'x86/shikata_ga_nai'
56+
'x86/single_static_bit'
57+
'x86/unicode_mixed'
58+
'x86/unicode_upper'
59+
)
60+
61+
_msfencode_encoder() {
62+
_describe -t encoders 'available encoders' _msfencode_encoders_list || compadd "$@"
63+
}
64+
65+
_arguments \
66+
"-a[The architecture to encode as]:architecture:(cmd generic mipsbe mipsle php ppc sparc x64 x86)" \
67+
"-b[The list of characters to avoid, example: '\x00\xff']:bad characters" \
68+
"-c[The number of times to encode the data]:times" \
69+
"-d[Specify the directory in which to look for EXE templates]:template file:_files -/" \
70+
"-e[The encoder to use]:encoder:_msfencode_encoder" \
71+
"-h[Help banner]" \
72+
"-i[Encode the contents of the supplied file path]:input file:_files" \
73+
"-k[Keep template working; run payload in new thread (use with -x)]" \
74+
"-l[List available encoders]" \
75+
"-m[Specifies an additional module search path]:module path:_files -/" \
76+
"-n[Dump encoder information]" \
77+
"-o[The output file]:output file" \
78+
"-p[The platform to encode for]:target platform:(android bsd bsdi java linux netware nodejs osx php python ruby solaris unix win)" \
79+
"-s[The maximum size of the encoded data]:maximum size" \
80+
"-t[The output format]:output format:(bash c csharp dw dword java js_be js_le num perl pl powershell ps1 py python raw rb ruby sh vbapplication vbscript asp aspx aspx-exe dll elf exe exe-only exe-service exe-small loop-vbs macho msi msi-nouac osx-app psh psh-net psh-reflection vba vba-exe vbs war)" \
81+
"-v[Increase verbosity]" \
82+
"-x[Specify an alternate executable template]:template file:_files"

0 commit comments

Comments
 (0)