Revert Date.parse check for DisclosureDate
An approximation of https://en.wikipedia.org/wiki/Robustness_principle.GSoC/Meterpreter_Web_Console
parent
d65ba41e31
commit
f25d7dbaa8
|
@ -441,10 +441,18 @@ class Msftidy
|
|||
|
||||
# Check disclosure date format
|
||||
if @source =~ /["']DisclosureDate["'].*\=\>[\x0d\x20]*['\"](.+?)['\"]/
|
||||
begin
|
||||
Date.parse($1) #Captured date
|
||||
d = $1 #Captured date
|
||||
# Flag if overall format is wrong
|
||||
rescue ArgumentError
|
||||
if d =~ /^... (?:\d{1,2},? )?\d{4}$/
|
||||
# Flag if month format is wrong
|
||||
m = d.split[0]
|
||||
months = [
|
||||
'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
|
||||
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
|
||||
]
|
||||
|
||||
error('Incorrect disclosure month format') if months.index(m).nil?
|
||||
else
|
||||
error('Incorrect disclosure date format')
|
||||
end
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue