NETAPI x64 Fixes

NETAPI post module on x64 (Windows 8.1/Windows2k12 especially) will cause errors/crash meterpreter.

use post/windows/gather/credentials/gpp
use post/windows/gather/enum_domain_users

both have issues as a result. Possibly other enum_domain* post modules. 

We should use entriesread instead of totalentries incase we dont get all the values back! 

## Verification
- [ ] No longer crashes on x64 and doesn't crash on x86

* Get an x64 meterpreter on a Win2k12 box/Win8.1 (On a domain preferably)
* use post/windows/gather/enum_domain_users
* set SESSION 1
* set HOST 127.0.0.1
- [ ] run should return current logged in user

* use post/windows/gather/enum_domains
* set SESSION 1
- [ ] run should return a list of DCs


* Get an x86 shell on a Win2k12 box/Win8.1 (On a domain preferably)
* use post/windows/gather/enum_domain_users
* set SESSION 2
* set HOST 127.0.0.1
- [ ] run should return current logged in user

* use post/windows/gather/enum_domains
* set SESSION 2
- [ ] run should return a list of DCs







I find the & method more readable, I wonder if there's a specific reason why Rails uses the modulo version?

> On Aug 17, 2014, at 23:17, OJ Reeves <notifications@github.com> wrote:
> 
> In lib/msf/core/post/windows/netapi.rb:
> 
> > @@ -50,7 +50,10 @@ def net_server_enum(server_type=SV_TYPE_ALL, domain=nil)
> >  
> >      case result['return']
> >      when 0
> > -      hosts = read_server_structs(result['bufptr'], result['totalentries'], domain, server_type)
> > +      # Railgun assumes PDWORDS are pointers and returns 8 bytes for x64 architectures.
> > +      # Therefore we need to truncate the result value to an actual
> > +      # DWORD for entriesread or totalentries.
> > +      hosts = read_server_structs(result['bufptr'], (result['entriesread'] % 4294967296), domain, server_type)
> Not sure about you, but I prefer result['entriesread'] & 0xFFFFFFFF over result['entriesread'] % 4294967296. I think it's more analogous to truncation that using modulo. Thoughts?
> 
> —
> Reply to this email directly or view it on GitHub.