Skip to content

Latest commit

 

History

History
319 lines (232 loc) · 8.55 KB

File metadata and controls

319 lines (232 loc) · 8.55 KB

🔐 Linux Networking & Security

Bash Scripts Collection

Typing SVG



Linux Bash Networking Security Status




A collection of Bash scripts for practicing Linux networking, system administration, and cybersecurity fundamentals. Built for students, beginners, and security enthusiasts who learn by doing.


📑 Table of Contents


📂 Repository Structure

/Network$ tree -L 2
.
├── 📄 Quick_ping.sh
├── 📄 README.md
├── 📄 network_diagnostics.sh
├── 📄 new.sh
├── 📄 port.sh
├── 📄 practice.sh
├── 📄 save.sh
└── 📄 test.sh

0 directories, 8 files


📜 Scripts Overview

1. 🖥️ Basic Commands & Conditions

File: new.sh / test.sh

# What this script does:
✦  Prints user details     →  whoami, pwd, date
✦  Creates directories     →  mkdir, touch
✦  Loops & conditions      →  for loops, if-else
✦  User input handling     →  read commands

Bash Logic


2. 🌐 Networking Information Script

File: network_diagnostics.sh

# What this script does:
✦  Listening ports         →  ss -tuln
✦  Active processes        →  netstat, ip a
✦  System info             →  Hostname, Gateway, DNS, MAC
✦  ARP table               →  arp -a
✦  Connectivity tests      →  ping, traceroute, nslookup
✦  DNS cache flush         →  systemd-resolve --flush-caches

Network Network Network Network


3. 🔍 Port Monitoring Script

File: port.sh

# What this script does:
✦  TCP/UDP ports           →  ss -tuln (modern netstat)
✦  Raw socket info         →  ss -a
✦  Open port count         →  grep + wc -l
✦  Process per port        →  ss -tulnp
✦  Active connections      →  ss -s

Security Security Security


4. 🛠️ Practice & System Info Script

File: practice.sh

# What this script does:
✦  IP & Gateway            →  ip route, ip addr
✦  Open ports              →  ss -tuln
✦  Traceroute              →  traceroute 8.8.8.8
✦  IP range scanner        →  loop-based ping sweep
✦  User input              →  read name/age prompts
✦  Active connections      →  ss -s

Network Network


🚀 How to Use

Step 1 — Clone the Repository

git clone https://github.com/Unixxxxxx/linux-networking-scripts.git
cd linux-networking-scripts

Step 2 — Give Execute Permission

chmod +x script_name.sh

Step 3 — Run Any Script

./network_diagnostics.sh
./port.sh
./practice.sh
./Quick_ping.sh

Step 4 — Run with sudo (if needed)

sudo ./port.sh        # for process-level port info
sudo ./network_diagnostics.sh


⚡ Requirements

🖥️ System

✦  Linux OS (Ubuntu / Debian / Fedora)
✦  Bash shell  (v4.0+)
✦  Terminal with sudo access

🔧 Tools Required

✦  ss          →  socket statistics
✦  netstat     →  network connections
✦  ip          →  IP/route management
✦  ping        →  connectivity test
✦  traceroute  →  route tracing
✦  nslookup    →  DNS lookup

Install missing tools:

# Ubuntu / Debian
sudo apt install net-tools iproute2 iputils-ping traceroute dnsutils -y

# Fedora / CentOS
sudo dnf install net-tools iproute iputils traceroute bind-utils -y

📚 Learning Outcomes

🌐 Networking

TCP/IP Basics
Port Analysis
DNS & Routing
ARP Protocol

🔐 Security

Port Scanning
Process Recon
Active Connections
Network Hardening

🐧 Linux

Bash Scripting
System Commands
File Operations
User Input/Output

⚙️ Automation

Shell Scripting
Loop Automation
Scheduled Tasks
System Monitoring

🛠️ Author

Sudhanshu Kumar

🛡️ Cybersecurity Enthusiast  |  💻 Python & Bash Developer  |  🐧 Linux Lover


LinkedIn Gmail GitHub


"In God we trust. All others we monitor." 🔐


Made with Bash   Open Source   PRs Welcome