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
Secure NTP with NTS
Viewed 9561 times since Sun, Dec 6, 2020
socat: Linux / UNIX TCP Port Forwarder
Viewed 10787 times since Tue, Aug 6, 2019
Linux Proxy Server Settings – Set Proxy For Command Line
Viewed 6096 times since Mon, Feb 18, 2019
How to disable SSH cipher/ MAC algorithms for Linux and Unix
Viewed 51020 times since Fri, Aug 21, 2020
LVM: Mount LVM Partition(s) in Rescue Mode
Viewed 6158 times since Sat, Jun 2, 2018
How to find the largest files and directories in Linux?
Viewed 4106 times since Sun, May 20, 2018
Linux Find Large Files
Viewed 3661 times since Mon, Oct 29, 2018
Using Official Redhat DVD as repository
Viewed 12205 times since Mon, Oct 29, 2018
www.unixarena.com
Viewed 3050 times since Fri, Jul 27, 2018
Managing temporary files with systemd-tmpfiles on Red Hat Enterprise Linux 7
Viewed 10998 times since Sun, Nov 22, 2020