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 Install a newer kernel in Debian 9 (stretch) stable
Viewed 468 times since Sun, Sep 23, 2018
HowTo: Send Email from an SMTP Server using the Command Line
Viewed 421 times since Mon, Feb 18, 2019
LVM: Recovering Physical Volume Metadata
Viewed 673 times since Sat, Jun 2, 2018
HP-UX - Stunnel Configuration
Viewed 428 times since Fri, Sep 28, 2018
OpenSSL – sprawdzanie czy klucz pasuje do certyfikatu
Viewed 843 times since Thu, May 24, 2018
Cron YUM How to use yum-cron to automatically update RHEL/CentOS Linux
Viewed 420 times since Fri, Oct 26, 2018
Improve security with polyinstantiation
Viewed 102 times since Fri, May 15, 2020
RHCS6: Create a new Logical Volume / Global Filesystem 2 (GFS2)
Viewed 696 times since Sun, Jun 3, 2018
RHEL: Services basic management - systemd
Viewed 9729 times since Sat, Jun 2, 2018
Find All Large Files On A Linux System
Viewed 623 times since Mon, Oct 29, 2018