Net Commands
Net Commands
This command will allow you to know if the host you pinging is alive, which means if it is up at the time of executing
the “ping” command.
ping x.x.x.x (x is the IP address). You can try pinging 8.8.8.8 which belongs to Google
or
ping www.google.com (www.google.com is the website you want to ping, but you don’t know the IP)
2) nslookup :
This command has many functionalities. One is for resolving DNS into IP. Lets say you know the website URL but you
don’t know its IP but you want to find it out.
Eg. nslookup www.google.com (www.google.com is the website for which you want to find out the IP)
Now, another really nice function of nslookup is to find out IP of specific Mail Severs
Code:
nslookup (enter)
This command will give you the mail server IP of yahoo.com. You can use whatever server you want and if it is listed
on DNS, then you get the IP. Simple, isn’t it? You can send a spoofed email to your friends using the IP address of the
mail server. You can check the tutorial here for sending a spoofed email.
3) tracert :
This command will give you the hops that a packet will travel to reach its final destination. This command is really
helpful if you know the route a packet takes before it goes to the target box.
or
tracert www.google.com (www.google.com is the website you don’t know the IP)
4) arp :
This command will show you the arp table. You can find out if anyone has done arp poisoning in your LAN using this
command.
Code:
arp -a
5) route :
This command will show you the routing table, gateway, interface and metric.
Code:
route print
6) ipconfig :
This command will show you a lot of useful things like your IP, Gateway, DNS in use, etc. This command will give all
that info but for all networks, you might have it.
Code:
ipconfig
or
Code:
ipconfig /all
Also, in case you have a dynamic IP and want to change it, then type…
Code:
ipconfig /release (this will release your IP)
7) netstat :
Code:
netstat
or
Code:
netstat -a (this will show you all the listening ports and connection with DNS names)
netstat -n (this will show you all the open connection with IP addresses)
netstat -an (this will combined both of the above)
net view x.x.x.x or computername (will list the available sharing folders on the target box)
8) netuser:
This command reset Windows User Password without Knowing Old Password.
Change yourusername with your PC user name and press Enter. Now type the new password.
9) Net View:
This command displays the whole list of resources, computers or domains that are shared by the specified computer.
code:
net view x.x.x.x or computername
10) Tasklist:
This command opens up an entire task manager on the command prompt. Users just need to enter tasklist on CMD
and they will see the list of all running process.
For eg; If you want to kill PID 1532 process then you can enter the command-
Code:
taskkill /PID 1532 /F
Bonus-
Code:
net use \ipaddressipc$ “” /user:administrator
Now if you want to connect to the target and browse the entire C drive, then use this command:
Code:
net use K: \computernameC$
(this will create a virtual drive on your “my computer” folder)
Please note that this command will only work if the target PC/laptop has not set an Administrator Password.
Quote:
whatevercommand /help
or
Quote:
whatevercommand /?
This command is very useful in finding what a particular command does, especially if you are a newbie.
The only way to hack anything is by using CMD or powershell in windows and various types of root terminals in other
linux based OS.
What I want to say is that if you can get access of someones terminal or cmd you can do whatever you like without
his permissions as CMD has the highest rights and permissions in a PC.
Every single operation done in a PC should be authorized by CMD, which says that hacking or gaining access to CMD
is called as device hacking.
One of the best windows hack that Involve CMD and shows you the Important piece of exe file in our PC is cmd.exe.
We all know about the stick keys[ press shift key 5 times] and there it popsup something like this
Now open your taskmanager and check the new program that was running because of this new popup
ie sethc.exe which is locate at c:\windows\system32\sethc.exe
Similarly while you open cmd there is a file running background and it is cmd.exe and it is located
at c:\windows\system32\cmd.exe.
Now save a copy of cmd and sethc on your desktop for safety.
Rename the sethc.exe with cmd.exe at the location c:\windows\system32\, try pressing shift 5 times now
you can see cmd popping up.
YOLO, you hacked pc :) , you still didnt get it right.
Hope you enjoyed it and you can comment some of your doubts in my following blogs which will helpful for the
people who want to learn, everyone cant comment or ask doubt online :p
Permanent folders can be created using the command prompts. You need to toe the bane of the disk in which you
wish to create this folder followed by either “md con\” or“md lpt1\” and hit enter. The final code should look
something like “D: md con\“. The new folder will be created with this same name. This permanent folder can only be
deleted using the command prompt and to do that, you need to swap “md con\” with “rd con\” or “md lpt1” with
“rd lpt1” and hit enter.
Using command prompts, you can compare two text files and check the difference. To do this, you need to type “FC”
command to enter the directories of both text files. The structure of this command prompt should look like “fc
nameoffirstfile.txt nameofsecondfile.txt” and hit enter to obtain the comparison results of both the files. If both the
files have no difference then, the command will return to the message which reads “no difference encountered”
Encrypting important data is a very useful tool in command prompt. Encryption is more like restricting your personal
data to yourself. Using command prompt, you can easily encrypt files on your PC. For this, you will first need to
change your working directory to the folder which contains your files. You can do this by using the “cd” command
and then, you’re “Ciper /E” and hit enter. One done, all the files in this folder will be encrypted. You need to make
sure that you set a password for your account or else, this encryption will be of no use. These encrypted files will
open normally from your account but, not from any other account.
Using command prompt, you can set up a WiFi hotspot on your PC and thus, be sharing your internet access with a
number of devices around you, without making use of any third party app. The steps required to setup this WiFi
hotspot are:
Step 1- Enter the text “netsh wlan set hostednetwork mode=allow ssid=HotspotName key=Password“ in the
command prompt and enter any name you wish in place of ‘HotspotName’ for your hotspot and ‘Password’ with a
unique password of your choice. Now, hit enter to save the changes.
Step 2- To broadcast your WiFi hotspot, you will have to type “netsh wlan start hostednetwork” in the command
prompt so that the devices near you can connect to your hotspot.
Step 3- To terminate the WiFi hotspot, you will have to make use of command “netsh wlan stop
hostednetwork”. This will stop the broadcasting. if you want to restart the broadcasting, you will have to apply the
step 2 once again.
Best CMD Tips, Tricks, and Hacks.You can also shut down your computer by using the command prompt. Type the
following command in command prompt.
Netstat is another best CMD Command, it is an important tool when you want to know about who is establishing a
connection with your computer. The output of this command provides you the information about all active
connection and listening ports. Check below attributes to execute this CMD:
1. Command History
Using this command, you can track down your command history. This will turn out to be useful
when you are trying to look for some command that you’ve used in the past, but can’t remember.
doskey /history
One out of the very useful CMD tricks to use function keys. There is a lot these keys can do to
improve your CMD experience.
driverquery
Very often you might have felt the need to save the output of a command? Usually, people use copy
and paste. However, using a simple command, you can send the command’s output to the clipboard.
Here’s how to send the ipconfig information:
ipconfig | clip
6. Abort a command
This handy Windows CMD trick comes to rescue when you have pressed the enter key and you
need to stop the command in its tracks? To do it, you need to do a Ctrl+C. However, it isn’t a magic
trick that can undo an undoable thing.
You can change the color of the Windows Command Prompt to make it look colorful. You can
perform this easy change by right-clicking in the top corners of the Command Prompt and select
Properties. There, find the Colors tab and look for the options to change the background and text
color.
Before opening the Command Prompt to execute the commands needed for this, you need to open
Control Panel and find Change adapter settings in the Network and Sharing option. There, click on
the connection you are using and click on Properties. Now find the sharing tab and check the option
“Allow other network users to connect through this computer’s internet connection.”
Now open the Command Prompt with administrative privileges and enter the following command:
Windows 10 comes with a built-in tool that lets users create a WiFi hotspot. You can read our
detailed post know how to enable mobile hotspot in Windows 10.