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
chrt command: Set / Manipulate Real Time Attributes of a Linux Process
Viewed 11272 times since Mon, Feb 17, 2020
LVM: Reduce an existing Logical Volume / Filesystem
Viewed 3696 times since Sat, Jun 2, 2018
Epoch & Unix Timestamp Conversion Tools
Viewed 63262 times since Fri, Jun 22, 2018
How To: Create Self-Signed Certificate – OpenSSL
Viewed 3156 times since Mon, Feb 18, 2019
20 Linux YUM (Yellowdog Updater, Modified) Commands for Package Management YUM
Viewed 11462 times since Thu, Oct 25, 2018
Set Up SSH Tunneling on a Linux / Unix / BSD Server To Bypass NAT
Viewed 11436 times since Fri, May 15, 2020
LVM: Create a new Volume Group
Viewed 2208 times since Sat, Jun 2, 2018
SSL HowTo: Decode CSR
Viewed 5177 times since Mon, Feb 18, 2019
How to Synchronize Directories Using Lsyncd in Linux
Viewed 14121 times since Wed, Oct 31, 2018
RHEL: udev rules basics
Viewed 9118 times since Sat, Jun 2, 2018
Recently Viewed
LVM: Managing snapshots