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 Find Large Files
Viewed 564 times since Mon, Oct 29, 2018
Improve security with polyinstantiation
Viewed 100 times since Fri, May 15, 2020
KONTO SFTP Z CHROOTEM Z UŻYCIEM OPENSSH-SERVER NA CENTOS/RHEL6
Viewed 402 times since Fri, Nov 30, 2018
RHEL: Building a custom kernel on RHEL 6
Viewed 901 times since Sat, Jun 2, 2018
Using etckeeper with git
Viewed 931 times since Sun, Jun 3, 2018
O’Reilly’s CD bookshelf
Viewed 4566 times since Wed, Jun 27, 2018
stunnel Howto A Guide to create SSL access to a HTTP-only webserver with stunnel
Viewed 458 times since Fri, Sep 28, 2018
RHEL: Remove existing SAN LUNs
Viewed 938 times since Sat, Jun 2, 2018
Linux Chage Command to Set Password Aging for User
Viewed 446 times since Tue, Sep 11, 2018
Linux An introduction to swap space on Linux systems
Viewed 321 times since Thu, Jan 23, 2020