Skip to content

Commit 7e53933

Browse files
author
Tod Beardsley
committed
Reverting disaster merge to 593363c with diff
There was a disaster of a merge at 6f37cf2 that is particularly difficult to untangle (it was a bad merge from a long-running local branch). What this commit does is simulate a hard reset, by doing thing: git checkout -b reset-hard-ohmu git reset --hard 593363c git checkout upstream-master git checkout -b revert-via-diff git diff --no-prefix upstream-master..reset-hard-ohmy > patch patch -p0 < patch Since there was one binary change, also did this: git checkout upstream-master data/exploits/CVE-2012-1535/Main.swf Now we have one commit that puts everything back. It screws up file-level history a little, but it's at least at a point where we can move on with our lives. Sorry.
1 parent 3007818 commit 7e53933

20 files changed

+236
-1524
lines changed

lib/msf/core/post/windows/services.rb

Lines changed: 2 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def service_change_startup(name,mode)
180180
def service_create(name, display_name, executable_on_host, startup=2, server=nil)
181181
adv = session.railgun.advapi32
182182

183-
# SC_MANAGER_CONNECT 0x01
183+
# SC_MANAGER_CONNECT 0x01
184184
# SC_MANAGER_CREATE_SERVICE 0x02
185185
# SC_MANAGER_QUERY_LOCK_STATUS 0x10
186186
open_sc_manager(:host=>server, :access=>0x13) do |manager|
@@ -292,7 +292,7 @@ def service_delete(name, server=nil)
292292
# Now to grab a handle to the service.
293293
# Thank you, Wine project for defining the DELETE constant since it,
294294
# and all its friends, are missing from the MSDN docs.
295-
# #define DELETE 0x00010000
295+
# #define DELETE 0x00010000
296296
handle = adv.OpenServiceA(manager, name, 0x10000)
297297
if (handle["return"] == 0)
298298
raise RuntimeError.new("Could not open service. OpenServiceA error: #{handle["GetLastError"]}")
@@ -306,51 +306,6 @@ def service_delete(name, server=nil)
306306
handle["GetLastError"]
307307
end
308308
end
309-
310-
#
311-
# Query Service Status
312-
#
313-
# @param (see #service_start)
314-
#
315-
# @return {} representing lpServiceStatus
316-
#
317-
# @raise (see #service_start)
318-
#
319-
#
320-
def service_status(name, server=nil)
321-
adv = session.railgun.advapi32
322-
ret = nil
323-
324-
# 0x80000000 GENERIC_READ
325-
open_sc_manager(:host=>server, :access=>0x80000000) do |manager|
326-
# Now to grab a handle to the service.
327-
handle = adv.OpenServiceA(manager, name, 0x80000000)
328-
if (handle["return"] == 0)
329-
raise RuntimeError.new("Could not open service. OpenServiceA error: #{handle["GetLastError"]}")
330-
end
331-
332-
status = adv.QueryServiceStatus(handle["return"],28)
333-
if (status["return"] == 0)
334-
raise RuntimeError.new("Could not query service. QueryServiceStatus error: #{handle["GetLastError"]}")
335-
end
336-
337-
vals = status['lpServiceStatus'].unpack('L*')
338-
339-
adv.CloseServiceHandle(handle["return"])
340-
341-
ret = { :type=> vals[0],
342-
:state=> vals[1],
343-
:controls_accepted=> vals[2],
344-
:win32_exit_code=> vals[3],
345-
:service_exit_code=> vals[4],
346-
:check_point=> vals[5],
347-
:wait_hint=> vals[6],
348-
}
349-
350-
end
351-
352-
return ret
353-
end
354309
end
355310

356311
end

lib/rex/post/meterpreter/extensions/stdapi/railgun/def/def_advapi32.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ class Def_advapi32
2727
def self.create_dll(dll_path = 'advapi32')
2828
dll = DLL.new(dll_path, ApiConstants.manager)
2929

30-
dll.add_function('QueryServiceStatus', 'DWORD', [
31-
['LPVOID', 'hService', 'in'],
32-
['PBLOB', 'lpServiceStatus', 'out']])
33-
3430
dll.add_function('CredEnumerateA', 'BOOL', [
3531
['PCHAR', 'Filter', 'in'],
3632
['DWORD', 'Flags', 'in'],

modules/auxiliary/admin/http/github_pulls_changes.rb

Lines changed: 0 additions & 113 deletions
This file was deleted.

modules/auxiliary/scanner/http/hp_sitescope_getsitescopeconfiguration.rb

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,22 @@ def run_host(ip)
7575
end
7676

7777
def access_configuration
78-
print_status("#{rhost}:#{rport} - Connecting to SiteScope SOAP Interface")
78+
79+
data = "<?xml version='1.0' encoding='UTF-8'?>" + "\r\n"
80+
data << "<wsns0:Envelope" + "\r\n"
81+
data << "xmlns:wsns1='http://www.w3.org/2001/XMLSchema-instance'" + "\r\n"
82+
data << "xmlns:xsd='http://www.w3.org/2001/XMLSchema'" + "\r\n"
83+
data << "xmlns:wsns0='http://schemas.xmlsoap.org/soap/envelope/'" + "\r\n"
84+
data << ">" + "\r\n"
85+
data << "<wsns0:Body" + "\r\n"
86+
data << "wsns0:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'" + "\r\n"
87+
data << ">" + "\r\n"
88+
data << "<impl:getSiteScopeConfiguration" + "\r\n"
89+
data << "xmlns:impl='http://Api.freshtech.COM'" + "\r\n"
90+
data << "></impl:getSiteScopeConfiguration>" + "\r\n"
91+
data << "</wsns0:Body>" + "\r\n"
92+
data << "</wsns0:Envelope>"
93+
7994
print_status("#{@peer} - Retrieving the SiteScope Configuration")
8095

8196
uri = normalize_uri(@uri, 'services/APISiteScopeImpl')
@@ -88,6 +103,7 @@ def access_configuration
88103
'headers' => {
89104
'SOAPAction' => '""',
90105
}})
106+
91107
if res and res.code == 200
92108

93109
if res.headers['Content-Type'] =~ /boundary="(.*)"/

modules/auxiliary/scanner/mysql/mysql_file_enum.rb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,26 @@ def check_dir dir
109109
:proto => 'tcp',
110110
:update => :unique_data
111111
)
112+
rescue ::RbMysql::ServerError
113+
vprint_warning("#{peer} - #{dir} does not exist")
114+
rescue ::RbMysql::Error => e
115+
vprint_error("#{peer} - MySQL Error: #{e.class} #{e.to_s}")
116+
return
117+
rescue Rex::ConnectionTimeout => e
118+
vprint_error("#{peer} - Timeout: #{e.message}")
119+
return
120+
else
121+
print_good("#{peer} - #{dir} is a file and exists")
122+
report_note(
123+
:host => rhost,
124+
:type => "filesystem.file",
125+
:data => "#{dir} is a file and exists",
126+
:port => rport,
127+
:proto => 'tcp',
128+
:update => :unique_data
129+
)
112130
end
131+
113132
return
114133
end
115134

modules/auxiliary/scanner/ntp/ntp_readvar.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,3 @@ def run_host(ip)
6767
end
6868

6969
end
70-

modules/auxiliary/scanner/sap/sap_ctc_verb_tampering_add_user_and_add_role.rb

Lines changed: 0 additions & 83 deletions
This file was deleted.

0 commit comments

Comments
 (0)