rapid7/metasploit-framework — pull request #985 by todb-r7 (2012-10-29 13:31:55+00:00)
Title: Msftidy checks for file loads

This has been coming up more often lately, so msftidy should just check for it and be done. In my experience, it's never correct to `load` a file in a module -- it should be required if it's a library. Here's what it looks like with a contrived example (we don't currently have a test suite for msftidy since it's all procedural):

````
mazikeen:./metasploit-framework$ tools/msftidy.rb test/modules/exploits/test/exploitme.rb
exploitme.rb - [ERROR] Exploit is missing a disclosure date
exploitme.rb:13 - [ERROR] Loading (not requiring) a file: "load 'msf/core.rb'\n"
exploitme.rb:128 - [ERROR] Writes to stdout
````

Here's the current list for all of `modules/exploits`:

````
$ tools/msftidy.rb modules/exploits/ | grep load
multi/http/glassfish_deployer.rb - [WARNING] Poorly designed argument list in 'get_upload_data()'. Try a hash.
multi/http/glassfish_deployer.rb - [WARNING] Poorly designed argument list in 'upload_exec()'. Try a hash.
multi/http/apprain_upload_exec.rb - [WARNING] Improper capitalization in module title: 'appRain...'

````

(a big fat zero hits for any module calling `load`)