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
linux aix Killing a process and all of its descendants
Viewed 3590 times since Tue, May 5, 2020
Extending Linux LVM partitions script
Viewed 6263 times since Wed, Feb 6, 2019
Method 2 – Use shell scripts How to install yum cron on a CentOS/RHEL 6.x/7.x
Viewed 4002 times since Tue, Dec 4, 2018
RHEL: Allowing users to ’su’ to "root" / Allowing ’root’ to login directly to the system using ’ssh’
Viewed 2696 times since Sat, Jun 2, 2018
Red Hat 8 How to Set Up Automatic Updates for CentOS 8
Viewed 3519 times since Fri, Sep 25, 2020
List DNS records, nameservers of a domain from command line
Viewed 1839 times since Sun, Sep 30, 2018
Applescript: Run or Call a Shell Script
Viewed 4084 times since Tue, Aug 6, 2019
Managing temporary files with systemd-tmpfiles on Red Hat Enterprise Linux 7
Viewed 9398 times since Sun, Nov 22, 2020
Super Grub2 Disk
Viewed 3292 times since Wed, May 22, 2019
Setup SSL Tunnel Using Stunnel on Ubuntu
Viewed 2343 times since Fri, Sep 28, 2018