Browse Source

Add 'coding: binary' to all msf/rex library files

This fixes a huge number of hard-to-detect runtime bugs
that occur when a default utf-8 string from one of these
libraries is passed into a method expecting ascii-8bit
HD Moore 5 years ago
parent
commit
5e123e024d
58 changed files with 58 additions and 0 deletions
  1. 1
    0
      lib/msf/base/simple/framework/module_paths.rb
  2. 1
    0
      lib/msf/core/auxiliary/web/analysis/differential.rb
  3. 1
    0
      lib/msf/core/auxiliary/web/analysis/taint.rb
  4. 1
    0
      lib/msf/core/auxiliary/web/analysis/timing.rb
  5. 1
    0
      lib/msf/core/auxiliary/web/form.rb
  6. 1
    0
      lib/msf/core/auxiliary/web/fuzzable.rb
  7. 1
    0
      lib/msf/core/auxiliary/web/http.rb
  8. 1
    0
      lib/msf/core/auxiliary/web/path.rb
  9. 1
    0
      lib/msf/core/auxiliary/web/target.rb
  10. 1
    0
      lib/msf/core/db_manager/import_msf_xml.rb
  11. 1
    0
      lib/msf/core/db_manager/migration.rb
  12. 1
    0
      lib/msf/core/exe/segment_injector.rb
  13. 1
    0
      lib/msf/core/exploit/local/compile_c.rb
  14. 1
    0
      lib/msf/core/exploit/local/linux.rb
  15. 1
    0
      lib/msf/core/exploit/local/linux_kernel.rb
  16. 1
    0
      lib/msf/core/exploit/postgres.rb
  17. 1
    0
      lib/msf/core/handler/reverse_http/uri_checksum.rb
  18. 1
    0
      lib/msf/core/handler/reverse_tcp_ssl.rb
  19. 1
    0
      lib/msf/core/module/deprecated.rb
  20. 1
    0
      lib/msf/core/module_manager/cache.rb
  21. 1
    0
      lib/msf/core/module_manager/loading.rb
  22. 1
    0
      lib/msf/core/module_manager/module_paths.rb
  23. 1
    0
      lib/msf/core/module_manager/module_sets.rb
  24. 1
    0
      lib/msf/core/module_manager/reloading.rb
  25. 1
    0
      lib/msf/core/modules.rb
  26. 1
    0
      lib/msf/core/modules/error.rb
  27. 1
    0
      lib/msf/core/modules/loader.rb
  28. 1
    0
      lib/msf/core/modules/loader/archive.rb
  29. 1
    0
      lib/msf/core/modules/loader/base.rb
  30. 1
    0
      lib/msf/core/modules/loader/directory.rb
  31. 1
    0
      lib/msf/core/modules/metasploit_class_compatibility_error.rb
  32. 1
    0
      lib/msf/core/modules/namespace.rb
  33. 1
    0
      lib/msf/core/modules/version_compatibility_error.rb
  34. 1
    0
      lib/msf/core/payload/windows/prepend_migrate.rb
  35. 1
    0
      lib/msf/core/payload_generator.rb
  36. 1
    0
      lib/msf/core/post/linux.rb
  37. 1
    0
      lib/msf/core/post/osx.rb
  38. 1
    0
      lib/msf/core/post/osx/ruby_dl.rb
  39. 1
    0
      lib/msf/core/post/solaris.rb
  40. 1
    0
      lib/msf/core/post/windows.rb
  41. 1
    0
      lib/msf/core/post/windows/error.rb
  42. 1
    0
      lib/msf/ui/logos/test.rb
  43. 1
    0
      lib/rex/encoder/bloxor/bloxor.rb
  44. 1
    0
      lib/rex/exploitation/ropdb.rb
  45. 1
    0
      lib/rex/mac_oui.rb
  46. 1
    0
      lib/rex/parser/outpost24_nokogiri.rb
  47. 1
    0
      lib/rex/poly/machine.rb
  48. 1
    0
      lib/rex/poly/machine/machine.rb
  49. 1
    0
      lib/rex/poly/machine/x86.rb
  50. 1
    0
      lib/rex/proto/ipmi/channel_auth_reply.rb
  51. 1
    0
      lib/rex/proto/ipmi/open_session_reply.rb
  52. 1
    0
      lib/rex/proto/ipmi/rakp2.rb
  53. 1
    0
      lib/rex/proto/pjl.rb
  54. 1
    0
      lib/rex/proto/pjl/client.rb
  55. 1
    0
      lib/rex/random_identifier_generator.rb
  56. 1
    0
      lib/rex/sslscan/result.rb
  57. 1
    0
      lib/rex/sslscan/scanner.rb
  58. 1
    0
      lib/rex/ui/text/output/buffer/stdout.rb

+ 1
- 0
lib/msf/base/simple/framework/module_paths.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 module Msf
2 3
   module Simple
3 4
     module Framework

+ 1
- 0
lib/msf/core/auxiliary/web/analysis/differential.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 ##
2 3
 # This file is part of the Metasploit Framework and may be subject to
3 4
 # redistribution and commercial restrictions. Please see the Metasploit

+ 1
- 0
lib/msf/core/auxiliary/web/analysis/taint.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 ##
2 3
 # This file is part of the Metasploit Framework and may be subject to
3 4
 # redistribution and commercial restrictions. Please see the Metasploit

+ 1
- 0
lib/msf/core/auxiliary/web/analysis/timing.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 ##
2 3
 # This file is part of the Metasploit Framework and may be subject to
3 4
 # redistribution and commercial restrictions. Please see the Metasploit

+ 1
- 0
lib/msf/core/auxiliary/web/form.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 # This file is part of the Metasploit Framework and may be subject to
2 3
 # redistribution and commercial restrictions. Please see the Metasploit
3 4
 # Framework web site for more information on licensing and terms of use.

+ 1
- 0
lib/msf/core/auxiliary/web/fuzzable.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 # This file is part of the Metasploit Framework and may be subject to
2 3
 # redistribution and commercial restrictions. Please see the Metasploit
3 4
 # Framework web site for more information on licensing and terms of use.

+ 1
- 0
lib/msf/core/auxiliary/web/http.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 ##
2 3
 # This file is part of the Metasploit Framework and may be subject to
3 4
 # redistribution and commercial restrictions. Please see the Metasploit

+ 1
- 0
lib/msf/core/auxiliary/web/path.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 # This file is part of the Metasploit Framework and may be subject to
2 3
 # redistribution and commercial restrictions. Please see the Metasploit
3 4
 # Framework web site for more information on licensing and terms of use.

+ 1
- 0
lib/msf/core/auxiliary/web/target.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 # This file is part of the Metasploit Framework and may be subject to
2 3
 # redistribution and commercial restrictions. Please see the Metasploit
3 4
 # Framework web site for more information on licensing and terms of use.

+ 1
- 0
lib/msf/core/db_manager/import_msf_xml.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 module Msf
2 3
   class DBManager
3 4
     # Handles importing of the xml format exported by Pro.  The methods are in a

+ 1
- 0
lib/msf/core/db_manager/migration.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 module Msf
2 3
   class DBManager
3 4
     module Migration

+ 1
- 0
lib/msf/core/exe/segment_injector.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 module Msf
2 3
 module Exe
3 4
 

+ 1
- 0
lib/msf/core/exploit/local/compile_c.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 
2 3
 module Msf
3 4
 module Exploit::Local::CompileC

+ 1
- 0
lib/msf/core/exploit/local/linux.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 require 'msf/core/exploit/local/compile_c'
2 3
 
3 4
 module Msf

+ 1
- 0
lib/msf/core/exploit/local/linux_kernel.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 require 'msf/core/exploit/local/compile_c'
2 3
 
3 4
 module Msf

+ 1
- 0
lib/msf/core/exploit/postgres.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 require 'msf/core'
2 3
 
3 4
 module Msf

+ 1
- 0
lib/msf/core/handler/reverse_http/uri_checksum.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 module Msf
2 3
   module Handler
3 4
     module ReverseHttp

+ 1
- 0
lib/msf/core/handler/reverse_tcp_ssl.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 require 'rex/socket'
2 3
 require 'thread'
3 4
 

+ 1
- 0
lib/msf/core/module/deprecated.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 
2 3
 module Msf::Module::Deprecated
3 4
 

+ 1
- 0
lib/msf/core/module_manager/cache.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 #
2 3
 # Gems
3 4
 #

+ 1
- 0
lib/msf/core/module_manager/loading.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 #
2 3
 # Gems
3 4
 #

+ 1
- 0
lib/msf/core/module_manager/module_paths.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 #
2 3
 # Gems
3 4
 #

+ 1
- 0
lib/msf/core/module_manager/module_sets.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 #
2 3
 # Gems
3 4
 #

+ 1
- 0
lib/msf/core/module_manager/reloading.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 # Concerns reloading modules
2 3
 module Msf::ModuleManager::Reloading
3 4
   # Reloads the module specified in mod.  This can either be an instance of a module or a module class.

+ 1
- 0
lib/msf/core/modules.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 # Namespace for loading Metasploit modules
2 3
 module Msf::Modules
3 4
 

+ 1
- 0
lib/msf/core/modules/error.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 # Base error class for all error under {Msf::Modules}
2 3
 class Msf::Modules::Error < StandardError
3 4
   def initialize(attributes={})

+ 1
- 0
lib/msf/core/modules/loader.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 require 'msf/core/modules'
2 3
 
3 4
 # Namespace for module loaders

+ 1
- 0
lib/msf/core/modules/loader/archive.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 require 'msf/core/modules/loader/base'
2 3
 
3 4
 # Concerns loading modules form fastlib archives

+ 1
- 0
lib/msf/core/modules/loader/base.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 #
2 3
 # Project
3 4
 #

+ 1
- 0
lib/msf/core/modules/loader/directory.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 # Concerns loading module from a directory
2 3
 class Msf::Modules::Loader::Directory < Msf::Modules::Loader::Base
3 4
   # Returns true if the path is a directory

+ 1
- 0
lib/msf/core/modules/metasploit_class_compatibility_error.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 require 'msf/core/modules/error'
2 3
 
3 4
 # Error raised by {Msf::Modules::Namespace#metasploit_class!} if it cannot the namespace_module does not have a constant

+ 1
- 0
lib/msf/core/modules/namespace.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 require 'metasploit/framework/api/version'
2 3
 require 'metasploit/framework/core/version'
3 4
 

+ 1
- 0
lib/msf/core/modules/version_compatibility_error.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 require 'msf/core/modules/error'
2 3
 
3 4
 # Error raised by {Msf::Modules::Namespace#version_compatible!} on {Msf::Modules::Loader::Base#create_namespace_module}

+ 1
- 0
lib/msf/core/payload/windows/prepend_migrate.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 require 'msf/core'
2 3
 
3 4
 ###

+ 1
- 0
lib/msf/core/payload_generator.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 require 'active_support/core_ext/numeric/bytes'
2 3
 module Msf
3 4
 

+ 1
- 0
lib/msf/core/post/linux.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 module Msf::Post::Linux
2 3
   require 'msf/core/post/linux/priv'
3 4
   require 'msf/core/post/linux/system'

+ 1
- 0
lib/msf/core/post/osx.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 
2 3
 module Msf::Post::OSX
3 4
   require 'msf/core/post/osx/system'

+ 1
- 0
lib/msf/core/post/osx/ruby_dl.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 module Msf
2 3
 class Post
3 4
 module OSX

+ 1
- 0
lib/msf/core/post/solaris.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 module Msf::Post::Solaris
2 3
   require 'msf/core/post/solaris/priv'
3 4
   require 'msf/core/post/solaris/system'

+ 1
- 0
lib/msf/core/post/windows.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 
2 3
 module Msf::Post::Windows
3 4
   require 'msf/core/post/windows/error'

+ 1
- 0
lib/msf/core/post/windows/error.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 
2 3
 module Msf::Post::Windows::Error
3 4
   SUCCESS = 0x0000

+ 1
- 0
lib/msf/ui/logos/test.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 
2 3
 here = File.expand_path(File.dirname(__FILE__))
3 4
 

+ 1
- 0
lib/rex/encoder/bloxor/bloxor.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 
2 3
 require 'rex/poly/machine'
3 4
 

+ 1
- 0
lib/rex/exploitation/ropdb.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 require 'rex/text'
2 3
 require 'rexml/document'
3 4
 

+ 1
- 0
lib/rex/mac_oui.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 
2 3
 module Rex
3 4
 module Oui

+ 1
- 0
lib/rex/parser/outpost24_nokogiri.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 require "rex/parser/nokogiri_doc_mixin"
2 3
 
3 4
 module Rex

+ 1
- 0
lib/rex/poly/machine.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 
2 3
 module Rex
3 4
 

+ 1
- 0
lib/rex/poly/machine/machine.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 
2 3
 module Rex
3 4
 

+ 1
- 0
lib/rex/poly/machine/x86.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 
2 3
 module Rex
3 4
 

+ 1
- 0
lib/rex/proto/ipmi/channel_auth_reply.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 
2 3
 module Rex
3 4
 module Proto

+ 1
- 0
lib/rex/proto/ipmi/open_session_reply.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 
2 3
 module Rex
3 4
 module Proto

+ 1
- 0
lib/rex/proto/ipmi/rakp2.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 
2 3
 module Rex
3 4
 module Proto

+ 1
- 0
lib/rex/proto/pjl.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 # https://en.wikipedia.org/wiki/Printer_Job_Language
2 3
 # See external links for PJL spec
3 4
 

+ 1
- 0
lib/rex/proto/pjl/client.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 # https://en.wikipedia.org/wiki/Printer_Job_Language
2 3
 # See external links for PJL spec
3 4
 

+ 1
- 0
lib/rex/random_identifier_generator.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 
2 3
 # A quick way to produce unique random strings that follow the rules of
3 4
 # identifiers, i.e., begin with a letter and contain only alphanumeric

+ 1
- 0
lib/rex/sslscan/result.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 
2 3
 require 'rex/socket'
3 4
 require 'rex/ui/text/table'

+ 1
- 0
lib/rex/sslscan/scanner.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 require 'rex/socket'
2 3
 require 'rex/sslscan/result'
3 4
 

+ 1
- 0
lib/rex/ui/text/output/buffer/stdout.rb View File

@@ -1,3 +1,4 @@
1
+# -*- coding: binary -*-
1 2
 # make sure the classes are defined before opening it to define submodule
2 3
 require 'rex/ui/text/output'
3 4
 require 'rex/ui/text/output/buffer'

Loading…
Cancel
Save