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 unix aix banner /etc/issue
Viewed 1678 times since Fri, Aug 3, 2018
SPRAWDZONA KONFIGURACJA RSYSLOG I LOGROTATE, JAKO ZEWNĘTRZNEGO SERWERA SYSLOG
Viewed 3449 times since Fri, Nov 30, 2018
A Quick and Practical Reference for tcpdump
Viewed 11992 times since Fri, Jul 27, 2018
SYS: Configure a local repository. local repo
Viewed 10546 times since Mon, Oct 29, 2018
Linux – delete the LUN and remove traces from OS
Viewed 2823 times since Tue, May 22, 2018
Linux – Securing your important files with XFS extendend attributes
Viewed 7282 times since Wed, Jul 25, 2018
How to retrieve and change partition’s UUID Universally Unique Identifier on linux
Viewed 2593 times since Tue, Jul 17, 2018
List usernames instead of uids with the ps command for long usernames
Viewed 1991 times since Wed, Jul 25, 2018
Lsyncd: live file syncronization across multiple Linux servers
Viewed 6411 times since Wed, Oct 31, 2018
Easily Monitor CPU Utilization in Linux Terminal With Stress Terminal UI
Viewed 3619 times since Thu, Apr 18, 2019