Hostname in header

bug/bundler_fix
benpturner 2015-05-08 20:07:15 +01:00
parent d64f577f9a
commit d3bb32f5fd
5 changed files with 5 additions and 9 deletions

View File

@ -24,7 +24,7 @@ class Metasploit3 < Msf::Post
# Run Method called when command run is issued
def run
print_good("Running the post module: #{name} on" + session.shell_command('$env:COMPUTERNAME'))
print_good("Running the post module: #{name} on: " + session.shell_command('$env:COMPUTERNAME').gsub!(/(\r\n)/, ''))
pscommand='$root = New-Object DirectoryServices.DirectoryEntry "LDAP://RootDSE"; $root.Properties["dnsHostName"][0].ToString()'
print(session.shell_command(pscommand))

View File

@ -24,8 +24,7 @@ class Metasploit3 < Msf::Post
# Run Method called when command run is issued
def run
print_good("Running the post module: #{name} on" + session.shell_command('$env:COMPUTERNAME'))
print_good("Running the post module: #{name} on: " + session.shell_command('$env:COMPUTERNAME').gsub!(/(\r\n)/, ''))
pscommand='net accounts /domain'
print(session.shell_command(pscommand))
end

View File

@ -24,8 +24,7 @@ class Metasploit3 < Msf::Post
# Run Method called when command run is issued
def run
print_good("Running the post module: #{name} on" + session.shell_command('$env:COMPUTERNAME'))
print_good("Running the post module: #{name} on: " + session.shell_command('$env:COMPUTERNAME').gsub!(/(\r\n)/, ''))
# Find all domain users
pscommand = '$searcher = new-object System.DirectoryServices.DirectorySearcher ; $searcher.filter = "(&(objectClass=user)(sAMAccountName=*))"; $colResults = $searcher.findall()'
print(session.shell_command(pscommand))

View File

@ -24,8 +24,7 @@ class Metasploit3 < Msf::Post
# Run Method called when command run is issued
def run
print_good("Running the post module: #{name} on" + session.shell_command('$env:COMPUTERNAME'))
print_good("Running the post module: #{name} on: " + session.shell_command('$env:COMPUTERNAME').gsub!(/(\r\n)/, ''))
# Enumerate powershell version
pscommand='$psversiontable'
print(session.shell_command(pscommand))

View File

@ -24,8 +24,7 @@ class Metasploit3 < Msf::Post
# Run Method called when command run is issued
def run
print_good("Running the post module: #{name} on" + session.shell_command('$env:COMPUTERNAME'))
print_good("Running the post module: #{name} on: " + session.shell_command('$env:COMPUTERNAME').gsub!(/(\r\n)/, ''))
# Get all the services that are not in "C:\Windows\System32\"
pscommand = '$services = Get-WmiObject win32_service | ?{$_} | where {($_.pathname -ne $null) -and ($_.pathname -notmatch ".*system32.*")} ; $servicepaths = New-Object System.Collections.ArrayList'
print(session.shell_command(pscommand))