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
OEL 7 – How to disable IPv6 on Oracle Linux 7 – Follow Up
Viewed 9366 times since Wed, Jul 25, 2018
stunnel How To Set Up an SSL Tunnel Using Stunnel on Ubuntu
Viewed 1629 times since Sun, Dec 6, 2020
VMWare tools free
Viewed 8961 times since Mon, Jul 16, 2018
Get UUID of Hard Disks [Update]
Viewed 2121 times since Tue, Jul 17, 2018
Linux Cluster Tutorial
Viewed 2035 times since Sat, Sep 29, 2018
RHEL: Scan and configure new SAN (fibre channel) LUNs
Viewed 7908 times since Sun, May 27, 2018
Use Fail2ban to Secure Your Server
Viewed 14580 times since Fri, Jul 5, 2019
Linux - How to perform I/O performance test with dd command
Viewed 5918 times since Fri, Jun 8, 2018
LUKS List available methods of encryption for LUKS
Viewed 2863 times since Fri, Jul 13, 2018
SSH Essentials: Working with SSH Servers, Clients, and Keys
Viewed 4315 times since Wed, Jun 27, 2018