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
ZPOOL: Add a mirror to a concat zpool
Viewed 1333 times since Sun, Jun 3, 2018
Using renice and taskset to manage process priority and CPU affinity with Linux OEL 6.4
Viewed 886 times since Mon, Feb 17, 2020
RHEL: How to rebuild and/or patch a RPM package
Viewed 1577 times since Sat, Jun 2, 2018
How to Synchronize Directories Using Lsyncd in Linux
Viewed 2221 times since Wed, Oct 31, 2018
Easily Find Bugs In Shell Scripts With ShellCheck
Viewed 1029 times since Thu, Apr 18, 2019
Moving SSL Certificate from IIS to Apache
Viewed 683 times since Mon, Feb 18, 2019
How to use yum-cron to automatically update RHEL/CentOS Linux
Viewed 667 times since Wed, Oct 17, 2018
RHEL: iSCSI target/initiator configuration on RHEL7
Viewed 4185 times since Sat, Jun 2, 2018
Fałszujemy rozpoznania skanerów #1
Viewed 1452 times since Mon, May 21, 2018
RHEL: Services basic management - systemd
Viewed 11461 times since Sat, Jun 2, 2018