windows commands:
1--> ifconfig:
Purpose: Displays network configuration.
Use Case: Check IP address or renewit.
Example:
*ipconfig/all
*ipconfig/release
*ipconfig/renew
2-->ping:
Purpose: Test connectivity between systems
Use Case: Check if a website/server is reachable
It can cause DDOS(Distributed Denial of Service) which down the service of
server.
Example:
*ping google.com
*ping demo.testfire.net
To increase the size of ping type(by default is 32 bytes)
*ping (ip/website address) -l 1024
*ping 198.168.17.130 -l 1024
3-->tracert:
Purpose: Trace the route packets take to destination.
Use Case: Diagnose routing issues.
Example: tracert google.com
4-->netstat:
Purpose: Displays active network connections and listening ports.
Use Case: Check for suspicious network activity.
Example: netstat -an
5-->tasklist:
Purpose: Shows running processes.
Use Case: Identify resource-heavy or malicious processes.
Example: tasklist
6-->taskkill
Purpose: Terminates running processes.
Use Case: Kill unresponsive or malicious tasks.
Exmaple: taskkill /PID 8888 /F
7-->systeminfo:
Purpose: Displays system configuration details.
Use Case: Check OS version, RAM, patces
Example:
*systeminfo
*systeminfo > sd.txt
8-->chkdsk
Purpose: Scans and repairs disk issues
Use Case: Fix file system corruption
Example: chkdsk C: /f /r
9-->sfc
Purpose: Scans and repairs corrupted system files.
User Case: Troubleshoot system crashes.
Example: sfc /scannow
10-->shutdown
Purpose: Shuts down, restart, or logs off a system.
Use Case: Schedule shutdowns.
Example: shutdown /s /t 60
11-->whoami
Purpose: Displays the current logged-in user.
Use Case: Confirm user context.
Example: whoami
12-->net user
Purpose: Manage user accounts.
Use Case: Add, delete, or modify users.
Example: net user John password 123 /add
net user John /delete
13-->netstat -b
Purpose: Show which executables are making network connections.
Use Case: Detect malware or backdoors.
Example: netstat -b
How to stop them? just type tasklist and after getting pid use taskkill and
stop it.
14-->getmac
Purpose: Shows the MAC address of the system.
Use Case: Identify network device identity.
Example: getmac
15-->diskpart
Purpose: Manages disk partitons.
Use Case: Create or delete partitions.
Example: diskpart
16-->wmic
Purpose:WMI command-line tool for system management.
Use Case: Fetch system info, serial number, processes.
Example: wmic bios get serialnumber
wmic process list brief
17-->attrib
Purpose: Change file attributes.
Use Case: Hide/Unhide files.
Example:
*attrib +h secret.txt
*attrib -h secret.txt
18-->dir
Purpose: List files and directories.
Use Case: Navigate and explore folders.
Example: dir /s /b
19-->cls:
Purpose: Clears the screen.
Use Case: Remove clutter from command promt.
Example: cls
20-->echo:
Purpose: Display messages or turn command echoing on/off.
Use Case: Script testing, environment variable checking.
Example:
*echo hello world
*echo %USERNAME%
Purose:
Use Case:
Example:
Linux Commands
1-->ifcongfig / ip a
Purose: displays network interfaces and ip addresses
Use Case: identify system IP and network setup
Example:
ip a
ifconfig
2-->netstat / ss:
Purpose: Displays active network connections and listening ports.
Use Case: Check for suspicious network activity.
Example: netstat -tulnp
ss -tuln