-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
624 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,206 @@ | ||
--- | ||
title: "📚 Useful LINUX CMD Lines 💡" | ||
author: "c4r4nch0" | ||
date: "2023-11-20" | ||
draft: false | ||
searchHidden: false | ||
tags: ["brain", "study", "linux"] | ||
ShowToc: True | ||
ShowBreadCrumbs: True | ||
# cover: | ||
# image: "https://encrypted-tbn0.gstatic.com/images? | ||
#q=tbn:ANd9GcSQud1wlz3Fl6brRiyQMKkg8XMhI2BE9J7SazqbG4DBOcbkVorYi34k1Y6axGErJj0L9LU&#usqp=CAU" | ||
# # can also paste direct link from external site | ||
# # ex. https://i.ibb.co/K0HVPBd/paper-mod-profilemode.png | ||
# alt: "Bug Bounty Bootcamp" | ||
# caption: "Bug Bounty Bootcamp" | ||
# relative: false # To use relative path for cover image, used in hugo Page-bundles | ||
# Advanced LINUX Command Lines and System Optimization 🚀 | ||
|
||
## Introduction | ||
|
||
In the realm of advanced Linux command-line operations, mastery extends beyond basic file manipulation and system information retrieval. This guide delves into sophisticated commands, system optimization techniques, and advanced networking tools, fostering a deeper understanding of Linux system administration. | ||
|
||
## Advanced File Manipulation | ||
|
||
### 1. `rsync` - Remote File Synchronization | ||
|
||
The `rsync` command excels in efficient file synchronization and transfer. It leverages delta encoding to minimize data transfer, making it ideal for large-scale file synchronization over networks. | ||
|
||
```bash | ||
rsync -avz --progress source/ destination/ | ||
``` | ||
|
||
### 2. `find` - Search for Files and Execute Operations | ||
|
||
The `find` command is a versatile tool for searching files and directories based on various criteria. Combined with `-exec`, it allows for executing operations on the located files. | ||
|
||
```bash | ||
find /path/to/search -type f -name "*.txt" -exec rm {} \; | ||
``` | ||
|
||
## System Optimization | ||
|
||
### 3. `top` and `htop` - Real-time System Monitoring | ||
|
||
While `top` provides a basic overview of system processes, `htop` enhances this experience with a more interactive and visually appealing interface, offering real-time insights into resource usage. | ||
|
||
```bash | ||
htop | ||
``` | ||
|
||
### 4. `nice` and `renice` - Adjust Process Priority | ||
|
||
The `nice` command sets the priority of a process, influencing its CPU allocation. `renice` allows for altering the priority of an already running process. | ||
|
||
```bash | ||
nice -n 10 ./your_process | ||
renice -n -5 -p process_id | ||
``` | ||
|
||
## Networking and Security | ||
|
||
### 5. `netstat` - Network Statistics and Connections | ||
|
||
The `netstat` command provides detailed information about network statistics, open ports, and established connections, aiding in network troubleshooting. | ||
|
||
```bash | ||
netstat -tulpn | ||
``` | ||
|
||
### 6. `iptables` - IP Packet Filtering | ||
|
||
`iptables` is a powerful tool for configuring the Linux kernel's built-in firewall. It allows for precise control over packet filtering, network address translation (NAT), and port forwarding. | ||
|
||
```bash | ||
iptables -A INPUT -p tcp --dport 80 -j ACCEPT | ||
``` | ||
|
||
## Process Debugging and Analysis | ||
|
||
### 7. `strace` - System Call Tracer | ||
|
||
`strace` is a valuable tool for tracing system calls made by a process. It aids in debugging and understanding the behavior of programs at the system call level. | ||
|
||
```bash | ||
strace -p process_id | ||
``` | ||
|
||
### 8. `lsof` - List Open Files and Processes | ||
|
||
`lsof` provides a comprehensive list of open files and the processes that have them open. This is crucial for identifying file-related issues and resource utilization. | ||
|
||
```bash | ||
lsof /path/to/directory | ||
``` | ||
|
||
## Advanced Shell Scripting | ||
|
||
### 9. `awk` and `sed` - Text Processing Powerhouses | ||
|
||
`awk` and `sed` are powerful text processing tools, enabling intricate text manipulation and extraction. They are essential for advanced shell scripting and automation. | ||
|
||
```bash | ||
cat log_file | awk '{print $2}' | ||
``` | ||
|
||
### 10. `cron` and `at` - Job Scheduling | ||
|
||
`cron` and `at` facilitate automated task scheduling. `cron` executes tasks at predefined intervals, while `at` schedules one-time tasks. | ||
|
||
```bash | ||
crontab -e | ||
at now + 1 hour | ||
``` | ||
|
||
### 11. `tar` and `gzip` - Archive and Compression Mastery | ||
|
||
Combining the `tar` command for archiving and `gzip` for compression results in a potent duo for file and directory compression, storage, and transfer. | ||
|
||
```bash | ||
tar -czvf archive.tar.gz /path/to/directory | ||
``` | ||
|
||
### 12. `awk` (Advanced Usage) - Stream Editing and Pattern Scanning | ||
|
||
Building upon basic usage, `awk` offers powerful stream editing capabilities. It excels in pattern scanning, data extraction, and text transformation in complex data processing scenarios. | ||
|
||
```bash | ||
awk '/pattern/{print $2}' input_file | ||
``` | ||
|
||
## System Optimization and Performance Tuning | ||
|
||
### 13. `sysctl` - Kernel Parameter Configuration | ||
|
||
The `sysctl` command allows for dynamic configuration of kernel parameters. It's instrumental in fine-tuning networking, security, and performance-related settings. | ||
|
||
```bash | ||
sysctl -a | ||
``` | ||
|
||
### 14. `perf` - Linux Performance Analysis | ||
|
||
The `perf` tool provides a comprehensive suite for performance analysis, profiling, and tracing. It's an invaluable resource for identifying bottlenecks in the system. | ||
|
||
```bash | ||
perf top | ||
``` | ||
|
||
## Networking and Security | ||
|
||
### 15. `tcpdump` - Network Packet Analysis | ||
|
||
`tcpdump` is a packet analyzer that captures and displays network traffic. It's an essential tool for network troubleshooting, protocol analysis, and security auditing. | ||
|
||
```bash | ||
tcpdump -i eth0 -n 'tcp port 80' | ||
``` | ||
|
||
### 16. `nmap` - Network Discovery and Security Scanning | ||
|
||
`nmap` is a versatile tool for network exploration and security auditing. It can discover hosts, services, and open ports on a network. | ||
|
||
```bash | ||
nmap -p 1-100 192.168.1.1 | ||
``` | ||
|
||
## Process Debugging and Analysis | ||
|
||
### 17. `gdb` - GNU Debugger | ||
|
||
For C and C++ programmers, `gdb` is an essential tool for debugging applications at the source code level, providing a rich set of features for inspection and manipulation. | ||
|
||
```bash | ||
gdb ./your_program | ||
``` | ||
|
||
### 18. `strace` (Advanced) - System Call Analysis | ||
|
||
Expanding on basic usage, `strace` can be employed with flags and filters for more in-depth analysis, providing insights into system call behavior. | ||
|
||
```bash | ||
strace -f -e trace=network -p process_id | ||
``` | ||
|
||
## Advanced Shell Scripting | ||
|
||
### 19. `jq` - JSON Processor | ||
|
||
For handling JSON data in scripts, `jq` is a lightweight and flexible command-line JSON processor, facilitating extraction, manipulation, and transformation of JSON content. | ||
|
||
```bash | ||
curl -s https://api.example.com/data.json | jq '.key' | ||
``` | ||
|
||
### 20. `expect` - Automation with Interactivity | ||
|
||
The `expect` command automates interactive processes by scripting responses to prompts. It's particularly useful for automating tasks that require user input. | ||
|
||
```bash | ||
expect -c 'spawn ssh user@host; expect "Password:"; send "your_password\n"; interact' | ||
``` | ||
|
||
## Conclusion | ||
|
||
This extended collection of advanced Linux command lines and techniques propels users into the realm of expert system administration and scripting. From mastering file manipulation to optimizing system performance, analyzing network traffic, and automating complex tasks, these tools empower users to navigate the intricacies of Linux systems with finesse. Continued exploration and experimentation will unlock even greater possibilities in the ever-evolving landscape of Linux command-line mastery. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
--- | ||
title: "📚 Useful PENTEST LINUX CMD Lines 💡" | ||
author: "c4r4nch0" | ||
date: "2023-12-20" | ||
draft: false | ||
searchHidden: false | ||
tags: ["brain", "study", "linux"] | ||
ShowToc: True | ||
ShowBreadCrumbs: True | ||
# cover: | ||
# image: "https://encrypted-tbn0.gstatic.com/images? | ||
#q=tbn:ANd9GcSQud1wlz3Fl6brRiyQMKkg8XMhI2BE9J7SazqbG4DBOcbkVorYi34k1Y6axGErJj0L9LU&#usqp=CAU" | ||
# # can also paste direct link from external site | ||
# # ex. https://i.ibb.co/K0HVPBd/paper-mod-profilemode.png | ||
# alt: "Bug Bounty Bootcamp" | ||
# caption: "Bug Bounty Bootcamp" | ||
# relative: false # To use relative path for cover image, used in hugo Page-bundles | ||
|
||
# Advanced DNS Pentesting Techniques 🌐🔒 | ||
|
||
## Introduction | ||
|
||
DNS (Domain Name System) plays a pivotal role in network communication, and vulnerabilities in its implementation can lead to severe security breaches. This guide delves into advanced DNS penetration testing techniques, tools, and methodologies to identify and mitigate potential risks. | ||
|
||
## DNS Enumeration and Information Gathering | ||
|
||
### 1. **`dnsenum`** - DNS Enumeration Tool | ||
|
||
`dnsenum` is a powerful tool for DNS enumeration, providing information about domain names, subdomains, mail servers, and DNS records. | ||
|
||
```bash | ||
dnsenum example.com | ||
``` | ||
|
||
### 2. **`fierce`** - DNS Reconnaissance | ||
|
||
`fierce` is a DNS reconnaissance tool designed to locate non-contiguous IP space and discover subdomains. | ||
|
||
```bash | ||
fierce -dns example.com | ||
``` | ||
|
||
## DNS Zone Transfer | ||
|
||
### 3. **`dig` (Zone Transfer)** - Checking for Zone Transfers | ||
|
||
`dig` can be utilized to check for DNS zone transfers, a potential security vulnerability that may expose sensitive information. | ||
|
||
```bash | ||
dig axfr @nameserver example.com | ||
``` | ||
|
||
### 4. **`dnsrecon`** - DNS Enumeration and Zone Transfer | ||
|
||
`dnsrecon` combines DNS enumeration with the capability to attempt zone transfers, providing a comprehensive DNS assessment. | ||
|
||
```bash | ||
dnsrecon -d example.com -t axfr | ||
``` | ||
|
||
## DNS Spoofing and Cache Poisoning | ||
|
||
### 5. **`dnsspoof` (dsniff package)** - DNS Spoofing | ||
|
||
`dnsspoof` is part of the dsniff package and is used for DNS spoofing, redirecting DNS requests to malicious servers. | ||
|
||
```bash | ||
dnsspoof -i eth0 | ||
``` | ||
|
||
### 6. **`mitm6`** - IPv6 Man-in-the-Middle Attacks | ||
|
||
`mitm6` focuses on DNS-related attacks against IPv6 networks, performing Man-in-the-Middle attacks for DNS traffic. | ||
|
||
```bash | ||
mitm6 -i eth0 | ||
``` | ||
|
||
## DNS Tunneling | ||
|
||
### 7. **`iodine`** - DNS Tunneling | ||
|
||
`iodine` enables DNS tunneling, allowing data to be tunneled through DNS queries and responses, useful for bypassing firewalls. | ||
|
||
```bash | ||
iodine -f -P your_password example.com | ||
``` | ||
|
||
### 8. **`dnscat2`** - DNS Command and Control | ||
|
||
`dnscat2` facilitates DNS command and control channels, enabling covert communication through DNS channels. | ||
|
||
```bash | ||
dnscat2 -dns example.com | ||
``` | ||
|
||
## DNS Security Assessment | ||
|
||
### 9. **`DNSSEC Tools`** - DNS Security Extensions | ||
|
||
Utilize tools like `dnssec-check` and `dnssec-verify` to assess the security of DNS implementations and validate DNS Security Extensions (DNSSEC). | ||
|
||
```bash | ||
dnssec-check -a example.com | ||
``` | ||
|
||
### 10. **`NSEC3Walker`** - DNSSEC Hash Cracking | ||
|
||
`NSEC3Walker` is a tool for performing offline dictionary attacks on DNSSEC protected domains. | ||
|
||
```bash | ||
NSEC3Walker -d example.com -w wordlist.txt | ||
``` | ||
|
||
## Conclusion | ||
|
||
Advanced DNS penetration testing demands a thorough understanding of DNS protocols, vulnerabilities, and exploitation techniques. Security professionals and ethical hackers can use the mentioned tools and methodologies to uncover weaknesses in DNS implementations, ensuring robust security measures are in place to mitigate potential risks. Continuous learning and staying abreast of emerging DNS security issues are essential in maintaining a resilient network infrastructure. |
Oops, something went wrong.