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
Check a Website Availability from the Linux Command Line
Viewed 7164 times since Mon, Feb 18, 2019
How to remove CTRL-M (^M) characters from a file in Linux
Viewed 3127 times since Thu, Feb 7, 2019
Monitoring bezpieczeństwa Linux: integracja auditd + OSSEC cz. I
Viewed 2897 times since Fri, Apr 5, 2019
Check Detailed CPU Information In Linux With CoreFreq [Advanced]
Viewed 2867 times since Thu, Apr 18, 2019
Fedora 32: Simple Local File-Sharing with Samba CIFS Linux
Viewed 9285 times since Sun, Dec 6, 2020
Setting up encrypted tunnel using stunnel
Viewed 3048 times since Fri, Sep 28, 2018
RHEL: Crash kernel dumps configuration and analysis on RHEL 5
Viewed 7855 times since Sat, Jun 2, 2018
Linux – delete the LUN and remove traces from OS
Viewed 4237 times since Tue, May 22, 2018
OCFS2 Cluster File System Setup Guide in Linux
Viewed 7903 times since Sat, Jun 2, 2018
LVM: Create a new Volume Group
Viewed 2484 times since Sat, Jun 2, 2018