Check which services are installed in the local Linux system use systemctl list-unit-files --type service and systemctl list-dependencies service-name and systemctl get-default and systemctl set-default
tcpdump -c 5 -i eth0
ldd $(which tcpdump) | grep libpcap
dnf whatprovides /libpcap.so
dnf reinstall -y libpcap
tcpdump -c 5 -i eth0
The systemctl utility is used for so many tasks and contains such a large amount of subcommands that it can be slightly intimidating at first for those familiar with individual commands for most management tasks.
We'll get you used to using systemctl to view systemd's environment, settings, view status on services, show and set parameters that affect service function, and understand what happens when you set settings, both from a systemd daemon perspective, as well as drop-in directories and additional configuration add-ins.
systemctl list-unit-files --all list all units
Filtering logs of specific units/daemons/services.
journalctl -u unit-name
journalctl --disk-usage
Getting kernel logs.
Sometimes we need to check if the kernel is working properly or if something went wrong obtain information that help us solve the problem.
Getting kernel logs is very straight forward, we would use journalctl plus the -k option.
more /proc/cmdline and dmesg |grep "Command line" and sysctl
Write variable from command line
lsmod/modinfo/modprobe (add/remove modules to/from kernel modprobe (-r) module_name)
htop/iotop/nmon/glances (pip3 install glances)/mpstat/iostat/vmstat
[root@ip-10-42-149-184 nmonchart]# glances -w -p 8080
Glances Web User Interface started on http://0.0.0.0:8080/
nmon -f -s60 -c60 -t ( -s for collection interval and -c for the number of snapshots, including capturing of top processes -t)
curl -LO http://sourceforge.net/projects/nmon/files/nmonchart40.tar
./nmonchart /root/ip-10-42-149-184_230322_1055.nmon /var/www/html/nmon.html
https://www.redhat.com/sysadmin/monitor-linux-performance-nmon
yum group list/yum group install "group-name"/yum group info 'Development Tools' -v/yum list installed package-name/yum list available package-name/yum check-update/ yum check-update package-name/yum update (-y)
yum list available/yum list --installed/yum whatprovides [file_name]
dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm / dnf repolist/ dnf list available package-name
nmap -A -F 10.42.149.184 (nmap -sU -F ip-address for UDP ports scan)
nmap -O -sV target_ip -Pn
tcpdump -i eth0 src 10.240.9.87
ss is used to dump socket statistics. It allows showing information similar to netstat. It can display more TCP and state information than other tools.
ss -tlnp /netstat -antlp/lsof -i TCP:22/lsof -p pid
hostnamectl set-hostname new-hostname
rsyslog is a powerful, secure and high-performance log processing system which accepts data from different types of source (systems/applications) and outputs it into multiple formats.It can also used to centralize all servers logs together.
systemctl status httpd --with-dependencies
systemctl list-dependencies
ps -xawf
systemctl/systemctl -a
systemctl list-units --type service --state active
nc netcat is a computer networking utility for reading from and writing to network connections using TCP or UDP.
DIRB is a popular Linux command-line tool used to scan and bruteforce directories on web applications. It enumerates possible directories from a wordlist against a website URL.
sudo apt install dirb or sudo yum update/sudo yum install gcc make libcurl libcurl-devel/wget https://github.com/v0re/dirb/archive/master.zip/unzip master.zip/cd dirb-master
./configure ,make/sudo make install
The --technique=B option in SQLmap specifies the SQL injection technique to be used during the scanning process. Specifically, B stands for "Boolean-based blind" injection technique.
Boolean-based blind injection is a type of SQL injection where the application's response changes based on whether the injected SQL query returns true or false. SQLmap can exploit this behavior by sending SQL injection payloads and analyzing the application's responses to infer the structure and content of the database.
Here's a brief explanation of how Boolean-based blind injection works:
SQLmap sends a series of SQL injection payloads to the application. It analyzes the responses to determine if the injected query is evaluated as true or false. Based on the application's responses, SQLmap infers information about the underlying database structure, such as table and column names, and data content. Using --technique=B in SQLmap tells the tool to focus on exploiting SQL injection vulnerabilities using the Boolean-based blind technique. This can be particularly useful when other techniques like error-based or time-based blind injection are not effective or not applicable.
However, it's important to note that the effectiveness of the Boolean-based blind technique depends on various factors such as the complexity of the injected SQL query, the application's response time, and the configuration of the database server. Additionally, using SQL injection tools like SQLmap should only be done with proper authorization and on systems you own or have explicit permission to test. Unauthorized use of such tools can lead to legal consequences.
Kali Linux is a Debian-based Linux distribution specifically designed for digital forensics and penetration testing. It is developed and maintained by Offensive Security, a leading provider of security training and penetration testing services.
Kali Linux comes pre-installed with numerous penetration testing tools, including tools for:
Network scanning and reconnaissance. Web application analysis and exploitation. Wireless network analysis and exploitation. Password cracking. Forensic analysis. Reverse engineering. Social engineering. Some of the popular tools included in Kali Linux are Nmap, Wireshark, Metasploit Framework, Burp Suite, John the Ripper, Aircrack-ng, and many more.
Kali Linux is widely used by cybersecurity professionals, ethical hackers, penetration testers, and security researchers for various purposes, including security assessments, vulnerability assessments, and security training.