Browse Source

Update documentation for fuzzer.rb and file_info.rb

See #5599
wchen-r7 4 years ago
parent
commit
1d9caeffc0
2 changed files with 54 additions and 50 deletions
  1. 50
    46
      lib/msf/core/auxiliary/fuzzer.rb
  2. 4
    4
      lib/msf/core/post/windows/file_info.rb

+ 50
- 46
lib/msf/core/auxiliary/fuzzer.rb View File

@@ -48,10 +48,12 @@ module Auxiliary::Fuzzer
48 48
     res
49 49
   end
50 50
 
51
- # Modifies each byte of the string from beginning to end, packing each element as an 8 bit character.
52
- #
53
- # @returns [Array] Returns an array of an array of strings
54
- # @see #fuzzer_string_format
51
+  # Modifies each byte of the string from beginning to end, packing each element as an 8 bit character.
52
+  #
53
+  # @param str [String] The string the mutation will be based on.
54
+  # @param max [Fixnum, NilClass] Max string size.
55
+  # @return [Array] Returns an array of an array of strings
56
+  # @see #fuzzer_string_format
55 57
 
56 58
   def fuzz_string_corrupt_byte(str,max=nil)
57 59
     res = []
@@ -68,8 +70,9 @@ module Auxiliary::Fuzzer
68 70
 
69 71
   # Modifies each byte of the string from beginning to end, packing each element as an 8 bit character.
70 72
   #
71
-  #
72
-  # @returns [Array] Returns an array of an array of strings
73
+  # @param str [String] The string the mutation will be based on.
74
+  # @param max [Fixnum, NilClass] Max string size.
75
+  # @return [Array] Returns an array of an array of strings
73 76
   # @see fuzzer_string_format
74 77
 
75 78
   def fuzz_string_corrupt_byte_reverse(str,max=nil)
@@ -87,7 +90,7 @@ module Auxiliary::Fuzzer
87 90
 
88 91
   # Useful generators (many derived from AxMan)
89 92
   #
90
-  # @returns [Array] Returns and array of strings.
93
+  # @return [Array] Returns and array of strings.
91 94
 
92 95
   def fuzzer_string_format
93 96
     res = %W{ %s %p %n %x %@ %.257d %.65537d %.2147483648d %.257f %.65537f %.2147483648f}
@@ -97,7 +100,7 @@ module Auxiliary::Fuzzer
97 100
   # Reserved filename array
98 101
   # Useful generators (many derived from AxMan)
99 102
   #
100
-  # @returns [Array] Returns and array of reserved filenames in Windows.
103
+  # @return [Array] Returns and array of reserved filenames in Windows.
101 104
 
102 105
   def fuzzer_string_filepath_dos
103 106
     res = %W{ aux con nul com1 com2 com3 com4 lpt1 lpt2 lp3 lpt4 prn }
@@ -106,7 +109,7 @@ module Auxiliary::Fuzzer
106 109
 
107 110
   # Fuzzer Numbers by Powers of Two
108 111
   #
109
-  # @returns [Array] Returns an array with pre-set values
112
+  # @return [Array] Returns an array with pre-set values
110 113
 
111 114
   def fuzzer_number_power2
112 115
     res = [
@@ -128,7 +131,7 @@ module Auxiliary::Fuzzer
128 131
 
129 132
   # Powers of two by some fuzzing factor.
130 133
   #
131
-  # @returns [Array] Returns and array of integers.
134
+  # @return [Array] Returns and array of integers.
132 135
 
133 136
   def fuzzer_number_power2_plus
134 137
     res = []
@@ -144,9 +147,10 @@ module Auxiliary::Fuzzer
144 147
     block_given? ? res.each { |n| yield(n) } : res
145 148
   end
146 149
 
147
-  # Generates a fuzz string
148
-  # If no block set, will retrive characters from the FuzzChar datastore option
150
+  # Generates a fuzz string If no block is set, it will retrive characters from the
151
+  # FuzzChar datastore option.
149 152
   #
153
+  # @param len [Fixnum] String size.
150 154
   # @return [String] Returns a string of size 1024 * 512 specified by the user
151 155
 
152 156
   def fuzzer_gen_string(len)
@@ -198,7 +202,7 @@ module Auxiliary::Fuzzer
198 202
 
199 203
   # Various URI types
200 204
   #
201
-  # @returns [Array] Returns an array of strings
205
+  # @return [Array] Returns an array of strings
202 206
   def fuzzer_string_uri_types
203 207
     res = %W{
204 208
       aaa  aaas  about  acap  adiumxtra  afp  aim  apt  aw  bolo  callto  cap  chrome  cid
@@ -216,27 +220,27 @@ module Auxiliary::Fuzzer
216 220
     block_given? ? res.each { |n| yield(n) } : res
217 221
   end
218 222
 
219
-# Generator for common URI dividers
220
-#
221
-# @return [Array] Returns an array of strings
223
+  # Generator for common URI dividers
224
+  #
225
+  # @return [Array] Returns an array of strings
222 226
 
223 227
   def fuzzer_string_uri_dividers
224 228
     res = %W{ : :// }
225 229
     block_given? ? res.each { |n| yield(n) } : res
226 230
   end
227 231
 
228
-# Generator for common path prefixes
229
-#
230
-# @return [Array] Returns an array of strings
232
+  # Generator for common path prefixes
233
+  #
234
+  # @return [Array] Returns an array of strings
231 235
 
232 236
   def fuzzer_string_path_prefixes
233 237
     res = %W{ C:\\ \\\\localhost\\ / }
234 238
     block_given? ? res.each { |n| yield(n) } : res
235 239
   end
236 240
 
237
-# Generates various small URI string types
238
-#
239
-# @return [Array] Returns an array of stings
241
+  # Generates various small URI string types
242
+  #
243
+  # @return [Array] Returns an array of stings
240 244
 
241 245
   def fuzzer_string_uris_small
242 246
     res = []
@@ -268,9 +272,9 @@ module Auxiliary::Fuzzer
268 272
     res
269 273
   end
270 274
 
271
-# Generates various giant URI string types
272
-#
273
-# @return [Array] Returns an array of stings
275
+  # Generates various giant URI string types
276
+  #
277
+  # @return [Array] Returns an array of stings
274 278
 
275 279
   def fuzzer_string_uris_giant
276 280
     res = []
@@ -285,9 +289,9 @@ module Auxiliary::Fuzzer
285 289
     res
286 290
   end
287 291
 
288
-# Format for the URI string generator
289
-#
290
-# @return [Array] Returns an array of stings
292
+  # Format for the URI string generator
293
+  #
294
+  # @return [Array] Returns an array of stings
291 295
 
292 296
   def fuzzer_string_uris_format
293 297
     res = []
@@ -303,9 +307,9 @@ module Auxiliary::Fuzzer
303 307
   end
304 308
 
305 309
 
306
-# Generates various small strings
307
-#
308
-# @return [Array] Returns an array of stings
310
+  # Generates various small strings
311
+  #
312
+  # @return [Array] Returns an array of stings
309 313
 
310 314
   def fuzzer_string_uris_dos
311 315
     res = []
@@ -321,9 +325,9 @@ module Auxiliary::Fuzzer
321 325
   end
322 326
 
323 327
 
324
-# Generates various small strings
325
-#
326
-# @return [Array] Returns an array of stings
328
+  # Generates various small strings
329
+  #
330
+  # @return [Array] Returns an array of stings
327 331
 
328 332
   def fuzzer_string_paths_small
329 333
     res = []
@@ -337,9 +341,9 @@ module Auxiliary::Fuzzer
337 341
   end
338 342
 
339 343
 
340
-# Generates various small strings
341
-#
342
-# @return [Array] Returns an array of stings
344
+  # Generates various small strings
345
+  #
346
+  # @return [Array] Returns an array of stings
343 347
 
344 348
   def fuzzer_string_paths_long
345 349
     res = []
@@ -353,9 +357,9 @@ module Auxiliary::Fuzzer
353 357
   end
354 358
 
355 359
 
356
-# Generates various giant strings
357
-#
358
-# @return [Array] Returns an array of stings
360
+  # Generates various giant strings
361
+  #
362
+  # @return [Array] Returns an array of stings
359 363
 
360 364
   def fuzzer_string_paths_giant
361 365
     res = []
@@ -369,9 +373,9 @@ module Auxiliary::Fuzzer
369 373
   end
370 374
 
371 375
 
372
-# Format for the path generator
373
-#
374
-# @return [Array] Returns an array of stings
376
+  # Format for the path generator
377
+  #
378
+  # @return [Array] Returns an array of stings
375 379
 
376 380
   def fuzzer_string_paths_format
377 381
     res = []
@@ -385,9 +389,9 @@ module Auxiliary::Fuzzer
385 389
   end
386 390
 
387 391
 
388
-# Generates fuzzer strings using path prefixes
389
-#
390
-# @return [Array] Returns an array of stings
392
+  # Generates fuzzer strings using path prefixes
393
+  #
394
+  # @return [Array] Returns an array of stings
391 395
 
392 396
   def fuzzer_string_paths_dos
393 397
     res = []

+ 4
- 4
lib/msf/core/post/windows/file_info.rb View File

@@ -13,10 +13,10 @@ module FileInfo
13 13
     num & 0xffff
14 14
   end
15 15
 
16
-# File Version
17
-# @param [String]  filepath The path of the file you are targeting
18
-#
19
-# @return [String] Returns the file version of target
16
+  # Returns the file version information such as: major, minor, build, revision, branch.
17
+  #
18
+  # @param filepath [String] The path of the file you are targeting.
19
+  # @return [String] Returns the file version information of the file.
20 20
 
21 21
   def file_version(filepath)
22 22
     file_version_info_size = client.railgun.version.GetFileVersionInfoSizeA(

Loading…
Cancel
Save