Windows useful commands

Generic useful Windows commands

Modify the Hosts File, access the Windows hosts file to modify hostname mappings:


echo 10.10.187.117 xx.local >> C:\Windows\System32\drivers\etc\hosts

Check User Privileges, display the privileges of the currently logged-in user:

whoami /priv

Check File Access Permissions, list the access control details for a specified file:

icacls

Download a File from an HTTP Server

  • Use wget to download a file from a specified HTTP server in Windows:

wget http://xxxxx/xxx -outfile xx

Transfer Files between Virtual Machines

  • Download a file from a Windows machine to another VM. Start an HTTP server on the destination and use wget to retrieve the file:

wget http://10.10.134.86:4444/exploit_me

Note: Ensure the HTTP server is running on the destination system before executing this command.

Add a Local Windows User and Assign to Administrators

  • Create a Windows user named "htb" with the password "abc123!" and add it to the administrators group:

Convert VHDX to VDI using VirtualBox

  • Use VirtualBox's VBoxManage tool to convert a VHDX file to the VDI format:

File shredding

Deleting files by simply removing them from your hard disk and recycle bin is not enough because the files are not permanently deleted and they can still be restored. There are different technics to remove them permanently from your fille system. You can overwrite the deleted data or by using a shredding tool that destroy the data.

Use the Windows built-in Cipher security tool to overwrite deleted data.

For example, the cipher /w:E command causes all deallocated space on drive E to be overwritten

Darik's Boot and Nuke ("DBAN") is a self-contained boot image that securely wipes hard disk drives (HDDs). DBAN is appropriate for personal use, bulk data destruction, or emergency data destruction for HDDs, but is not recommended for solid-state drives (SSDs), sanitization that requires auditable compliance documentation, or technical support.

Download link:

Powershell useful command's

Create malicious service

Last updated