forked from X4BNet/lists_vpn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
subnet-to-ip-expansion.sh
40 lines (31 loc) · 1.09 KB
/
subnet-to-ip-expansion.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
# Variables
VPNInput="/tmp/vpn_subnets.txt"
VPNOutput="/tmp/vpn_ips.txt"
DatacenterInput="/tmp/datacenter_subnets.txt"
DatacenterOutput="/tmp/datacenter_ips.txt"
# Check if prips is Installed
if ! [ -x "$(command -v prips)" ]; then
echo && echo " [-] Error: Please install 'prips' before running this script." && echo
exit 1
fi
# Wordcount
echo && echo " [+] Converting Subnets to IPs..."
# Download List
wget -q -N https://raw.githubusercontent.com/X4BNet/lists_vpn/main/output/vpn/ipv4.txt -O $VPNInput
wget -q -N https://raw.githubusercontent.com/X4BNet/lists_vpn/main/output/datacenter/ipv4.txt -O $DatacenterInput
# Clean
echo > $VPNOutput && echo > $DatacenterOutput
# Check
while IFS= read -r subnet; do
prips "$subnet" >> $VPNOutput
done < $VPNInput
sed -i '1d' $VPNOutput
while IFS= read -r subnet; do
prips "$subnet" >> $DatacenterOutput
done < $DatacenterInput
sed -i '1d' $DatacenterOutput
# Wordcount
echo && echo " [+] VPN Subnet/IP Per File" && echo && wc -l /tmp/vpn_*
echo && echo " [+] Datacenter Subnet/IP Per File" && echo && wc -l /tmp/datacenter_* && echo
exit 0