Codebox Software

Windows NetView Script

Published:

This script establishes a null session with a Windows host, before running the standard net view command to list out the available shares. This technique will sometimes yield information that would normally be denied without authentication.

@echo off
set USAGE="Usage: %0 <hostname>"
if {%1}=={} (
  echo %USAGE% 
  goto EXIT
)
set HOSTNME=%1
net use \\\%HOSTNME%\ipc$ /u:"" ""
net view \\\%HOSTNME% 
net use \\\%HOSTNME% /DELETE

:EXIT

Notes

This is fairly self-explanatory - to run the script just supply the host name that you are interested in as a command-line parameter, for example:

NetView.bat myhost