Skip to content

πŸ” A lightweight Bash script for quick Linux security auditing checks firewall, open ports, sudo users & more .

License

Notifications You must be signed in to change notification settings

hemansadeghi/FBSH

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” FBSH – Fast Basic Security Hardening

                                           ,--, 
    ,---,.     ,---,.    .--.--.          ,--.'| 
  ,'  .' |   ,'  .'  \  /  /    '.     ,--,  | : 
,---.'   | ,---.' .' | |  :  /`. /  ,---.'|  : ' 
|   |   .' |   |  |: | ;  |  |--`   |   | : _' | 
:   :  :   :   :  :  / |  :  ;_     :   : |.'  | 
:   |  |-, :   |    ;   \  \    `.  |   ' '  ; : 
|   :  ;/| |   :     \   `----.   \ '   |  .'. | 
|   |   .' |   |   . |   __ \  \  | |   | :  | ' 
'   :  '   '   :  '; |  /  /`--'  / '   : |  : ; 
|   |  |   |   |  | ;  '--'.     /  |   | '  ,/  
|   :  \   |   :   /     `--'---'   ;   : ;--'   
|   | ,'   |   | ,'                 |   ,/       
`----'     `----'                   '---'        

MIT License Shell

A simple and practical Bash script for basic Linux system security auditing.
It provides quick insights into your system’s security posture, highlighting weak spots and misconfigurations.


βœ… What It Checks

  • πŸ”₯ Firewall status via ufw, firewalld, and iptables
  • 🌐 Open ports using ss or netstat
  • βš™οΈ Running services via systemctl
  • πŸ” Users without passwords (from /etc/shadow)
  • πŸ‘‘ Users with sudo privileges
  • πŸšͺ SSH port – detects if default 22 is still in use
  • πŸ“† Vulnerable or outdated packages via apt, yum, or dnf
  • πŸ“œ Sudoers configuration – checks for overly permissive ALL rules in /etc/sudoers and /etc/sudoers.d
  • πŸ•΅οΈβ€β™‚οΈ Rootkit detection using chkrootkit and rkhunter (if installed)
  • πŸ’¬ Displays a clear colored startup notification
  • 🎨 Includes an ASCII art logo banner for better branding and UX
  • πŸ•ΉοΈ Rootkit detection commands (chkrootkit and rkhunter) are run with a spinner animation for improved user experience.
  • πŸ“ The complete security report is saved to a timestamped log file in the current working directory for review.
  • ⚠️ Run the script as root or via sudo to ensure all checks perform correctly.

πŸš€ Quick Start

🧰 Option 1: Run directly using curl

bash <(curl -s https://raw.githubusercontent.com/hemansadeghi/FBSH/main/security-check.sh)

πŸ“¦ Option 2: Clone and run manually

git clone https://github.com/hemansadeghi/FBSH.git
cd FBSH
chmod +x security-check.sh
sudo ./security-check.sh

ℹ️ Run as root or with sudo to ensure full access to system checks.


πŸ§ͺ Example Output

==> Firewall status (UFW + iptables)
UFW: Status: active
iptables is active. Sample rules:
...

==> Open ports
Netid State  Recv-Q Send-Q Local Address:Port ...

==> Users without password
All users have passwords.

==> Vulnerable/Upgradable packages
libssl1.1/bionic-updates 1.1.1-1ubuntu2.1~18.04.14 upgradable from 1.1.1-1ubuntu2.1~18.04.13

==> Custom sudoers entries
root ALL=(ALL:ALL) ALL

==> Rootkit detection
chkrootkit: Nothing found
rkhunter: [Warning] Possible suspicious file...

πŸ”§ Optional Tools

If you want full rootkit checks, install:

# Debian/Ubuntu
sudo apt install chkrootkit rkhunter.

# arch ..
sudo pacman -S  chkrootkit rkhunter.

# RHEL/CentOS/Fedora
sudo yum install chkrootkit rkhunter.

πŸ“„ License

MIT – Β© Hemansadeghi, 2025
Feel free to fork, customize, and contribute.

About

πŸ” A lightweight Bash script for quick Linux security auditing checks firewall, open ports, sudo users & more .

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages