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
LVM: Managing snapshots
Viewed 8790 times since Sat, Jun 2, 2018
Linux – delete the LUN and remove traces from OS
Viewed 4916 times since Tue, May 22, 2018
Linux Screen
Viewed 2860 times since Sat, Jun 2, 2018
Linux: Disks diagnostic using smartctl
Viewed 16264 times since Wed, Jul 25, 2018
RHEL: Adding a boot entry to GRUB/GRUB2 configuration
Viewed 6241 times since Sun, May 27, 2018
KONTO SFTP Z CHROOTEM Z UŻYCIEM OPENSSH-SERVER NA CENTOS/RHEL6
Viewed 2726 times since Fri, Nov 30, 2018
How to use yum-cron to automatically update RHEL/CentOS Linux
Viewed 3678 times since Wed, Oct 17, 2018
OpenSSL – sprawdzanie czy klucz pasuje do certyfikatu
Viewed 3568 times since Thu, May 24, 2018
Use Fail2ban to Secure Your Server
Viewed 16662 times since Fri, Jul 5, 2019
Linux nslookup Command Examples for DNS Lookup
Viewed 10173 times since Sat, Sep 29, 2018