Summary of commonly used cmd commands

Commonly used cmd commands:

#System information
CHCP 65001 Modify the font code to UTF-8
  systeminfo View system information
  hostname View hostname
  SET View environment variables
  color Change cmd color
  cls Clear screen
  runas /user:administrator cmd Switch administrator
#Network
  ipconfig /all Display complete network information
  ping -t -l 65500 ip ping of death
  ipconfig /release release ip
  ipconfig /renew regain ip
  ipconfig /flushdns refresh DNS cache
  ipconfig /displaydns display DNS resolver cache contents
  route print print routing information
  arp -a view arp cache
  net view view other computer names in the LAN
  netsh firewall show state firewall status
  netsh firewall show config firewall rules
#user
  net config workstation view current login user
  whoami view which user I am
  net user view yes Which users
  net user supermage View user supermage information
  net localgroup View group
  net localgroup administrators View group administrators information
  net user hack 123 /add Create a new user hack with a password of 123
  net user hack$ 123 /add Create a new hidden hack user with a password for 123
  net user hack /del Delete user hack
  net localgroup administrators hack /add Elevate normal user hack to administrator
  net user guest /active:yes Activate guest user
  net user guest /active:no Close guest user
  net password Change system current login User password
  net user guest password Change guest user password
#Port process service
  tasklist View process
  tasklist /svc View process, display process user name
  netstat -ano View system open port
  netstat -ano|findstr 80 View PID corresponding to port 80
  tasklist | findstr 80 View the process corresponding to port 80
  taskkill /f /t /im xx.exe kill xx.exe process
  taskkill /F -pid 520 kill the process with pid 520
  net start check which services are enabled
  net start telnet start telnet service
  net stop telnet stop telnet service
  start www.baidu.com open URL
#share
  net use check connection
  net share check locally enabled share
  net share ipc$ open ipc$ share
  net share ipc$ /del delete ipc$ share
  net share c$ /del delete C drive share
  net use \\192.168.10.15\ipc$ /u:"" "" establish ipc empty connection with 192.168.10.15
  net use \\192.168.10.15 /u:"" "" Establish an empty ipc connection with 192.168.10.15, you can remove
  net use \\192.168.10.15 from ipc$ /u:"administrator" "root" Connect with 192.168.10.15 Establish ipc connection
  net use \\192.168.10.15 /del delete ipc connection
  net use \\192.168.10.15\c$ /u:"administrator" "root" create C disk share
  dir \\192.168.10.15\c$ view 192.168.10.15C disk File
  dir \\192.168.10.15\c$\user View the user directory under the 192.168.10.15C disk file
  dir \\192.168.10.15\c$\user\test.exe View the user directory under the 192.168.10.15C disk file The test.exe file
  net use \\192.168.10.15\c$ /del deletes the C drive shared connection
  net use k: \\192.168.10.15\c$ /u:"administrator" "root" maps the target C drive to Local K disk
  net use k: /del delete the mapping
#file operation
  echo hello, word > 1.txt write hello to 1.txt, word
  echo hello, word >>1.txt append hello to 1.txt,word
  del delete a file
  deltree delete the folder and all subfolders under it and the file
  ren 1.txt 2.txt rename 1.txt to 2.txt
  type 1.txt view the contents of the 1.txt file
  md create a folder
  rd delete A folder
  move 1.txt d:/ Move the 1.txt file to the d disk
  123.txt edit Open the 123.txt file (editable)
  dir c:\ view the file under the C drive
  dir c:\ /A view All files under the C drive, including hidden files
  dir c:\ /S Check the files under the C drive and its subfolders
  dir c:\ /B Only display the file names under the C drive
  shutdown -s -t 60 -c "Your computer has been hacked" -s shutdown -r restart -a cancel
  reg save hklm\sam sam.hive
  reg save hklm\system system.hive
  These two files are the user account database of Windows, all user login names and passwords and other related information will be saved in the file, these two commands are to obtain the hash value of the Windows administrator


 

Guess you like

Origin blog.csdn.net/u013558123/article/details/131257625