💻 27 COMANDOS LINUX para HACKERS ÉTICOS (20 principais + 7 BÔNUS!)
Table of Contents
Introduction
This tutorial provides a comprehensive overview of 27 essential Linux commands that every ethical hacker and cybersecurity professional should know. These commands help enhance your skills in penetration testing, system administration, and information security. Whether you're new to ethical hacking or looking to improve your Linux productivity, this guide will equip you with the knowledge to navigate and utilize Linux effectively.
Step 1: Mastering Recognition and Navigation Commands
Understanding how to navigate and gather information on a system is crucial for any ethical hacker. Here are some key commands:
pwd
: Displays the current working directory.ls
: Lists files and directories in the current directory. Usels -la
for detailed information.cd [directory]
: Changes the current directory to the specified one.cat [file]
: Displays the content of a file.grep [pattern] [file]
: Searches for a specific pattern in a file.
Practical Tip
Combine ls
with grep
to filter results, e.g., ls | grep txt
to list only text files.
Step 2: System Monitoring and Management
These commands help you monitor and manage system performance and processes:
top
: Displays active processes and system resource usage.htop
: An enhanced version oftop
with a more user-friendly interface (install if not available).df -h
: Shows disk space usage in a human-readable format.free -m
: Displays memory usage in megabytes.
Common Pitfalls to Avoid
- Ensure you have the necessary permissions to execute commands, especially when managing system resources.
Step 3: Pentesting and Security Commands
These commands are essential for performing penetration testing and security assessments:
nmap [target]
: Scans the target for open ports and services.netstat -tuln
: Lists all listening ports and their associated services.whois [domain]
: Retrieves the registration details of a domain.airmon-ng
: Enables monitor mode for wireless interfaces (part of Aircrack-ng suite).
Real-World Application
Use nmap
to discover vulnerabilities in network services before running a penetration test.
Step 4: File Manipulation and Bash Scripting
These commands facilitate file management and scripting in the terminal:
cp [source] [destination]
: Copies files or directories.mv [source] [destination]
: Moves or renames files or directories.rm [file]
: Deletes a file. Be cautious withrm -rf
as it can recursively delete directories.bash [script.sh]
: Executes a Bash script.
Practical Tip
Always double-check the files you are manipulating to avoid data loss.
Step 5: Special Bonus Commands
Here are 7 bonus commands to enhance your toolkit:
chmod [permissions] [file]
: Changes file permissions.chown [user]:[group] [file]
: Changes file ownership.scp [file] [user]@[host]:[destination]
: Securely copies files between hosts.curl [url]
: Transfers data from or to a server using various protocols.wget [url]
: Downloads files from the web.tar -czvf [archive.tar.gz] [directory]
: Compresses a directory into a tarball.history
: Displays the command history for your session.
Conclusion
This tutorial has covered a range of essential Linux commands beneficial for ethical hacking and cybersecurity. Mastering these commands will significantly improve your efficiency and effectiveness in security tasks. As you continue to learn, practice using these commands in real scenarios to reinforce your understanding and skills. Consider exploring more advanced topics and tools in ethical hacking to further enhance your knowledge.