Skip to content

Instantly share code, notes, and snippets.

@mubix
Created August 14, 2013 17:47
Show Gist options
  • Save mubix/6233565 to your computer and use it in GitHub Desktop.
Save mubix/6233565 to your computer and use it in GitHub Desktop.
Useful meterpreter script
a = client.railgun.kernel32.GetLogicalDrives()["return"]
# Math magic to convert the binary to letters
drives = []
letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
(0..25).each do |i|
test = letters[i,1]
rem = a % (2**(i+1))
if rem > 0
drives << test
a = a - rem
end
end
print_line("Drives Available = #{drives.inspect}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment