Created
April 19, 2023 20:24
-
-
Save zAbuQasem/be07335929beec759866dc8d4c9a68b9 to your computer and use it in GitHub Desktop.
Revisions
-
zAbuQasem created this gist
Apr 19, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ # Written by zAbuQasem # Usage: cat /proc/net/tcp | awk '{print $2}' |grep -E '[A-F0-9]' | python3 lfi-portscan.py import sys import struct import socket addresses = [i.strip() for i in sys.stdin] for address in addresses: hex_ip,port = address.split(":")[0],address.split(":")[1] hex_ip = struct.pack("<I", int(hex_ip, 16)) ip = socket.inet_ntoa(bytes.fromhex(hex_ip.hex())) port = int(port,16) print(f"{ip}:{port}")