Added support for Gemfile.local
Changed to clearner solution proposed by @limhoff-r7.
POST module duplicate search results

Running a POST module in meterpreter was causing duplicate search
results for the executed module.  For example, running
post/windows/gather/checkvm would produce duplicate results for that
module when executing “search checkvm” in msf.

Debugging revealed that the cmd_exec function in meterpreter’s ui
command_dispatcher core was creating the specified module, and then
promptly reloading it.  The reload function was causing the duplicate
module_detail record to be written to the msg postgres database
instance.  Further analysis revealed that the “original_mod” could be
used for running the post module, so the “reloaded_mod” was removed
and the “original_mod” used in it’s place to run the post module.

SeeRM #8754
Add admin check to smb_login

The attached updates changes smb_login to detect if the newly discovered user is an administrator.  It is based on code from Brandon McCann "zeknox" submitted in PR #1373, the associated changes, and the newer PR #2656.
The changes should correct a few issues with PR #1373 and #2656 and address Redmine bug #8773.

Specifically it:

 - Fixes the admin detection code by using simple.disconnect(<share>) instead of disconnect()
 - Adds support for detecting if the remote host will allow connects using any domain name when one of the new status codes is returned
 - Dealt with the issue in PR #2656 where the username was prefixed with a '\'


Verification

Be connected to a database
Run this against a machine with a known user and admin user
See that the admin user is reported correctly
See that the non-admin user is reported correctly
Check the output of creds
Select a target that requires a domain in order to authenticate
In the stored credentials, with CHECK_ADMIN enabled, see that the domain name is, in fact, preserved in the reporting

To validate that the remote domain ignores domain value use the following command from a windows system:

net use \\<hostip>\admin$ /user:<random_value>\<username>   <password>
Remove redundant simple.connect

Remove redundant simple.connect. Thanks @jlee-r7
Revert "POST module duplicate search results"

This reverts commit 0bca3a2d54aaa63cd798cc41b4f4d97f00951708.
Search Result Uniqueness

SeeRM #8754

Cast the results of the query to an array and perform the uniq
function passing a block which provides uniqueness based
on the return value, which in this instance is ‘fullname’
This was done because the uniq function in AREL cannot take
a specific field for uniqueness, and the sophistication of the query
make grouping nearly impossible.  Initial testing showed negligible
speed difference to the user.
Add JDWP RCE for Windows and Linux
Fix msftidy
Should return the thread object
Allow x86->x64 injection
Use correct include
Return nil if fail
Change memory types from DWORD to QWORD

This was causing memory allocations to fail on x64 in cases where
the higher bits were set in addresses.
Merge remote-tracking branch 'upstream/pr/3416' into x64_injection
Add exploit for ajsif vuln in Adobe Reader.

* This refactors the logic of webview_addjavascriptinterface into a mixin (android.rb).
* Additionally, some behavior in pdf.rb had to be modified (in backwards-compatible ways).

Conflicts:
	lib/msf/core/exploit/mixins.rb
Remove extraneous method from pdf.rb
Add better interface for specifying custom #eol.
Revert change to trailer(). Kill dead method.

* I verified that changes to PDF mixin do not affect any older modules that
generate PDF. I did this by (on each branch) running  in irb, then
running the module and diffing the pdf's generated by each branch. There were
no changes.
Compress and base64 data to save bytes.

Reduced file size from 43kb to 12kb, yay.