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
watchdog How to restart a process out of crontab on a Linux/Unix
Viewed 6049 times since Tue, Jul 31, 2018
Linux PAM configuration that allows or deny login via the sshd server
Viewed 1980 times since Wed, Oct 3, 2018
RHCS6: Luci - the cluster management console
Viewed 3246 times since Sun, Jun 3, 2018
How to Synchronize Directories Using Lsyncd in Linux
Viewed 13895 times since Wed, Oct 31, 2018
Netcat shell zabezpieczony hasłem
Viewed 2260 times since Thu, May 24, 2018
Top 20 OpenSSH Server Best Security Practices ssh linux aix
Viewed 5986 times since Fri, May 15, 2020
RHCS6: Extend an existing Logical Volume / GFS2 filesystem
Viewed 3287 times since Sun, Jun 3, 2018
LVM: Extend SWAP size by growing existing Logical Volume
Viewed 2504 times since Sat, Jun 2, 2018
How To Use the Linux Auditing System on CentOS 7
Viewed 3979 times since Fri, Apr 5, 2019
Linux: Disks diagnostic using smartctl
Viewed 15100 times since Wed, Jul 25, 2018