Practical Linux Commands
Last updated
Was this helpful?
Last updated
Was this helpful?
Become VeryLazyTech ! ๐
Follow us on:
โ Twitter .
๐พ Github .
๐ Medium .
๐บ YouTube .
๐ฉ Telegram .
๐ต๏ธโโ๏ธ My Site .
Visit our for e-books and courses. ๐
Base64 Encoding for Exfiltration
Encodes a file to Base64 without line breaks. Useful for encoding data in a way that can be sent via HTTP or other text-based protocols.
Hex Dump Without New Lines
Converts a binary file into a plain hex format. Removing new lines makes the output easier to manipulate, which is helpful for crafting payloads.
Public Key Injection
Adds an attacker's public key to the target machineโs authorized SSH keys. This gives the attacker remote access via SSH.
Count Lines in a File
Counts the number of lines in a file, useful for verifying the amount of output or checking logs.
Sort and Remove Duplicates
Sorts a file and removes duplicate lines. This is helpful when processing log files and identifying unique entries.
Find Files Modified Within a Date Range
Finds files modified between specific dates, aiding in identifying files that may have been tampered with during an attack.
Set Up an HTTP Server (Quick File Serving)
Creates an HTTP server to share files with the target machine. This is useful for serving payloads or retrieving data.
Curl for Sending JSON Data
Sends JSON data to a web application, ideal for testing API endpoints or mimicking application behavior.
SSH Key Scanning
Retrieves the SSH key fingerprint from a remote machine. It helps in identifying duplicate SSH hosts, reducing security blind spots.
List Open Files of Network Processes
Lists open files related to network processes. This is particularly useful to identify suspicious connections or find the process behind an open port.
Process Monitoring with ps
Shows all processes and filters them by name (in this case, apache
). This command helps you discover running services on the system.
Finding Network Connections
Displays established network connections. Essential for spotting backdoors or open connections to attacker-controlled servers.
Generate RSA Key
Creates an RSA key, which can be used for encrypted communication, establishing secure connections, or signing data.
Decrypt SSH Key
Decrypts an encrypted SSH private key. Useful when handling compromised SSH keys that are password protected.
Create a Signed Certificate
Creates a self-signed certificate, which can be used to mimic HTTPS servers for man-in-the-middle (MITM) attacks or phishing.
Set Immutable Bit on a File
Prevents modification or deletion of a file. Setting this flag can be a persistence technique to maintain unauthorized changes.
Find SUID Binaries
Finds all files with the SUID bit set. SUID binaries are a common target for privilege escalation attacks, making this a valuable command during enumeration.
Download to RAM to Evade Detection
Downloads a file directly into the systemโs RAM, making it less detectable by antivirus and other security software.
Running a Reverse Shell with Netcat
Establishes a reverse shell from the target to the attacker's machine. This command is a cornerstone for remote code execution exploits.
Extract Emails
Extracts email addresses from files. Useful when searching for credentials or contacts during an attack.
Extract Passwords
Looks for potential password patterns in a file, an essential command for data discovery during internal network penetration tests.
Extract IP Addresses
Finds all IP addresses inside a file, helpful for network mapping and identifying potential targets.
Change Timezone
Allows the attacker to change the systemโs timezone. Useful for modifying timestamps during an attack to mislead incident responders.
Mount Virtual Hard Drives
Mounts a VHD file for investigation or exploitation. This can help access virtual machines' data without fully booting them.