-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathip-sum-generator.sh
executable file
·49 lines (42 loc) · 2.16 KB
/
ip-sum-generator.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
41
42
43
44
45
46
47
48
49
#!/usr/bin/env bash
################################################################################
# IP Sum Generator #
################################################################################
# #
# This script is being used for one of my upcoming projects. It essentially #
# generates a file containing a list of IP sums. #
# Thanks to @rascul for the idea of breaking down the array of IPs. #
# #
################################################################################
# TO RUN: #
# - Download #
# - Edit the 'saveLocation' line with where you want to save to and edit #
# 'sumCommands' with the commands you want it to generate the sum with. #
# - Run (It will take awhile). #
################################################################################
# Made by Zachary DuBois. Licensed under MIT. #
# https://zacharydubois.me #
# https://github.com/ZacharyDuBois/Random-Scripts/blob/master/LICENSE.md #
################################################################################
saveLocation="/home/user/ipsum.txt"
sumCommands=({sha512sum,sha384sum,sha256sum,sha224sum,sha1sum,md5sum})
echo "Creating file..."
touch $saveLocation
echo "IP" "${sumCommands[@]}" > $saveLocation
for first in {0..255}; do
for second in {0..255}; do
for third in {0..255}; do
for fourth in {0..255}; do
ip="${first}.${second}.${third}.${fourth}"
echo "Currently running: $ip"
sums=()
for command in "${sumCommands[@]}"; do
sums+=($(echo "$ip" | ${command} | cut -d ' ' -f 1))
done
echo "$ip" "${sums[@]}" >> $saveLocation
done
done
done
done
echo "Done."
exit 0