Prosty skaner portów TCP w bash

S

kanery do portów są jak śrubokręty. Nigdy nie ma ani jednego w pobliżu kiedy jest najbardziej potrzebny. Z pomocą przychodzi powłoka bash:

1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash
for a in $(yes scan | head -1024)
  do
  (( start++ ))
  if [[ -n $(echo '' > /dev/$2/$1/$start && echo "up") ]];
      then
      echo "Port $start UP!" >> scan;
  fi
done;
clear
cat scan;
rm scan;

Hack użyty w tym prostym skanerze korzysta z mało znanej metody obsługi sieci w powłoce bash. Wydając polecenie: ./skaner.sh host.com.pl tcp – przeskanujemy porty od 1 do 1024 serwera host.com.pl.

0 (0)
Article Rating (No Votes)
Rate this article
Attachments
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
debian How to check Debian CVE status using python script
Viewed 4473 times since Sun, Sep 23, 2018
How to configure an SSH proxy server with Squid
Viewed 4346 times since Sun, Dec 6, 2020
LVM: Create a new Volume Group
Viewed 2739 times since Sat, Jun 2, 2018
Jak wygenerować silne hasła jednorazowe w Linuksie?
Viewed 3002 times since Thu, May 24, 2018
stunnel How To Set Up an SSL Tunnel Using Stunnel on Ubuntu
Viewed 2668 times since Sun, Dec 6, 2020
RHEL7: How to get started with Firewalld.
Viewed 13351 times since Wed, May 22, 2019
ubuntu How to Reset Forgotten Root Password in Ubuntu
Viewed 3912 times since Tue, Dec 8, 2020
Top 4 Reasons for Node Reboot or Node Eviction in Real Application Cluster (RAC) Environment
Viewed 108087 times since Thu, Jun 21, 2018
How to clear swap memory in Linux
Viewed 2994 times since Mon, Nov 23, 2020
Using Kerberos security with Server for NFS
Viewed 11216 times since Wed, Jun 27, 2018