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
Nagrywanie sesji SSH do pliku
Viewed 1863 times since Thu, May 24, 2018
RHEL: Remove existing SAN LUNs
Viewed 12612 times since Sat, Jun 2, 2018
Automatic YUM Updates with Yum-cron
Viewed 9611 times since Fri, Oct 26, 2018
Transform XML to CSV Format | Unix String Pattern Manipulation The Ugly Way
Viewed 95 times since Sun, Jan 9, 2022
RHEL: Extending a multipath LUN
Viewed 2547 times since Sun, May 27, 2018
Linux - How to shutdown or reboot
Viewed 1058 times since Fri, Jun 8, 2018
ZPOOL: Create a new zpool for zfs filesystems
Viewed 1210 times since Sun, Jun 3, 2018
socat: Linux / UNIX TCP Port Forwarder
Viewed 3427 times since Tue, Aug 6, 2019
Używanie rsync poprzez Secure Shell
Viewed 38500 times since Thu, May 24, 2018
RHCS6: Extend an existing Logical Volume / GFS2 filesystem
Viewed 1793 times since Sun, Jun 3, 2018