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
Setup SSL Tunnel Using Stunnel on Ubuntu
Viewed 2104 times since Fri, Sep 28, 2018
Managing temporary files with systemd-tmpfiles on Red Hat Enterprise Linux 7
Viewed 9173 times since Sun, Nov 22, 2020
How to mount software RAID1 member using mdadm
Viewed 2838 times since Wed, Oct 3, 2018
RHEL: Displaying/setting kernel parameters - ’sysctl’
Viewed 2689 times since Sat, Jun 2, 2018
RHEL: Crash kernel dumps configuration and analysis on RHEL 6
Viewed 4398 times since Sat, Jun 2, 2018
sed Delete / Remove ^M Carriage Return (Line Feed / CRLF) on Linux or Unix
Viewed 9864 times since Thu, Feb 7, 2019
15 Linux Yum Command Examples – Install, Uninstall, Update Packages
Viewed 2990 times since Thu, Oct 25, 2018
How to use yum command on CentOS/RHEL
Viewed 10656 times since Wed, Oct 17, 2018
8 Vim Tips And Tricks That Will Make You A Pro User
Viewed 2735 times since Fri, Apr 19, 2019
zabbix linux How to solve apache error No space left on device: Cannot create SSLMutex
Viewed 2097 times since Wed, Nov 11, 2020