- Enumeration
| Command | Description |
|---|---|
| pwd | Current location |
| cat *file* | Read contents of a file |
| ls | List files in current directory |
| ls -la | List files in current directory with hidden files |
| cd *dir* | Change directory to *dir* |
| rm *file* | Delete *file* |
| rm -r *dir* | Delete directory *dir* |
| cp -r dir1 dir2 | Copy dir1 to dir2 Create dir2 if it doesn’t exist (recursive) |
| mv file1 file2 | Move file1 to file2 |
| touch *file* | Create *file* in current directory |
| more *file* | Outputs the contents of *file* |
| head *file* | Outputs the first 10 lines of *file* |
| tail *file* | Outputs the last 10 lines of *file* |
2. Packages
| Command | Description |
|---|---|
| dpkg -i xxx.deb | Install a debian package |
| rpm -Uvh xxx.rpm | Install a RPM package |
3. Network
| Command | Description |
|---|---|
| ip addr add *ip*/*subnet mask* dev eth1 | Assign static IP to eth1 |
| route add default gw *ip* | Assign Gateway |
| ping *ip* | Ping host and output result |
4. File Compression
| Command | Description |
|---|---|
| tar -cf file.tar *files* | Create a tar named file.tar containing *files* |
| tar -xf file.tar | Extract the files from file.tar |
| file *file* | Find Compressed Method of *file* |
5. Encode and Decode
| Command | Description |
|---|---|
| cat encode.txt | base64 | Encode a text file with base64 |
| cat encode.txt | base64 –decode | Decode a text file with base64 |
| cat encode.txt | base32 | Encode a text file with base32 |
| cat encode.txt | base32 –decode | Decode a text file with base32 |
6. Search
| Command | Description |
|---|---|
| locate *file* | Searches for *file* |
| locate *.nse | grep ssh | Searches for nmap scripts with the string ‘ssh’ |
| grep -r pattern *dir* | Searches recursively for pattern in *dir* |
| grep pattern *file* | Searches for pattern in the *file* content |
7. Process Management
| Command | Description |
|---|---|
| ps | Display your currently active processes |
| top | Display all running processes |
| kill pid | kill process by pid |
| killall proc | kill all process named proc |
8. System Enumeration
| Command | Description |
|---|---|
| date | shows the date |
| hostname | displays hostname |
| whoami | Shows who you are logged in as |
| finger *user* | Displays info about *user* |
| uname -a | Displays kernal info |
| cat /proc/cpuinfo | Displays cpu information |
| cat /proc/meminfo | Displays memory information |
| df | shows disk usage |
| du | Shows directory space usage |

Leave a comment