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
Inxi: Find System And Hardware Information On Linux
Viewed 1977 times since Sat, Jun 2, 2018
A Quick and Practical Reference for tcpdump
Viewed 12018 times since Fri, Jul 27, 2018
Top 25 Best Linux Performance Monitoring and Debugging Tools
Viewed 6585 times since Sun, Sep 30, 2018
Easily Monitor CPU Utilization in Linux Terminal With Stress Terminal UI
Viewed 3658 times since Thu, Apr 18, 2019
OpenSSL: Check If Private Key Matches SSL Certificate & CSR
Viewed 2672 times since Mon, Feb 18, 2019
20 Linux Command Tips and Tricks That Will Save You A Lot of Time linux
Viewed 4280 times since Thu, Apr 18, 2019
How to Synchronize Directories Using Lsyncd in Linux
Viewed 13007 times since Wed, Oct 31, 2018
Linux - How to monitor CPU usage
Viewed 6111 times since Fri, Jun 8, 2018
HowTo: Retrieve Email from a POP3 Server using the Command Line
Viewed 9136 times since Mon, Feb 18, 2019
RHEL: Displaying system info (firmware, serial numbers... )
Viewed 11472 times since Sun, May 27, 2018