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
RHEL7: Configure automatic updates.
Viewed 2083 times since Wed, Oct 17, 2018
BIND for the Small LAN
Viewed 3626 times since Sun, May 20, 2018
RHCS6: Debug and test multicast traffic between two hosts
Viewed 6936 times since Sun, Jun 3, 2018
Używanie rsync poprzez Secure Shell
Viewed 41504 times since Thu, May 24, 2018
Linux - How to get IP and MAC address of ethernet adapter in Linux
Viewed 2923 times since Fri, Jun 8, 2018
List DNS records, nameservers of a domain from command line
Viewed 2202 times since Sun, Sep 30, 2018
Terminal based "The Matrix" like implementation
Viewed 2528 times since Thu, Apr 18, 2019
Setting up encrypted tunnel using stunnel
Viewed 2789 times since Fri, Sep 28, 2018
Linux - Cannot login from remote console but can access via ssh
Viewed 5500 times since Fri, Jun 8, 2018
ZFS: Create a new zfs filesystem
Viewed 2801 times since Sun, Jun 3, 2018