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
How to configure an SSH proxy server with Squid
Viewed 273 times since Sun, Dec 6, 2020
RHEL: Adding a boot entry to GRUB/GRUB2 configuration
Viewed 1520 times since Sun, May 27, 2018
Linux Health Check Commands
Viewed 838 times since Fri, Jun 8, 2018
List usernames instead of uids with the ps command for long usernames
Viewed 807 times since Wed, Jul 25, 2018
Using etckeeper with git
Viewed 1492 times since Sun, Jun 3, 2018
LVM: Mount LVM Partition(s) in Rescue Mode
Viewed 1509 times since Sat, Jun 2, 2018
LVM: Reduce SWAP size by removing a Logical Volume
Viewed 903 times since Sat, Jun 2, 2018
Get UUID of Hard Disks [Update]
Viewed 1061 times since Tue, Jul 17, 2018
Enabling or disabling a repository using Red Hat Subscription Management
Viewed 1438 times since Mon, Oct 29, 2018
Linux – Securing your important files with XFS extendend attributes
Viewed 826 times since Wed, Jul 25, 2018