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
debian How to check Debian CVE status using python script
Viewed 3795 times since Sun, Sep 23, 2018
python learning
Viewed 2106 times since Wed, Dec 18, 2019
stunnel Howto A Guide to create SSL access to a HTTP-only webserver with stunnel
Viewed 2917 times since Fri, Sep 28, 2018
A Simple Guide to Oracle Cluster File System (OCFS2) using iSCSI on Oracle Cloud Infrastructure
Viewed 8745 times since Sat, Jun 2, 2018
RHEL: Change system’s hostname
Viewed 3758 times since Sun, May 27, 2018
LVM: Managing snapshots
Viewed 7991 times since Sat, Jun 2, 2018
Tip: SSD and Linux. Enable TRIM and check if it works
Viewed 17359 times since Fri, May 15, 2020
CentOS / RHEL : How to move a Volume Group from one system to another
Viewed 3887 times since Mon, Jan 28, 2019
Nagrywanie sesji SSH do pliku
Viewed 3148 times since Thu, May 24, 2018
Using grep to find string in files
Viewed 2459 times since Fri, May 15, 2020