Skip to content

Commit 1194578

Browse files
committed
standalone iplist creator
1 parent 52ac85b commit 1194578

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

tools/makeiplist.rb

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env ruby
2+
#
3+
#
4+
# This script takes a list of ranges and converts it to a per line ip list
5+
#
6+
7+
msfbase = __FILE__
8+
while File.symlink?(msfbase)
9+
msfbase = File.expand_path(File.readlink(msfbase), File.dirname(msfbase))
10+
end
11+
12+
$:.unshift(File.expand_path(File.join(File.dirname(msfbase), '..', 'lib')))
13+
require 'msfenv'
14+
require 'rex'
15+
16+
17+
f = File.open('rangelist.txt', 'r')
18+
w = File.open('iplist.txt', 'a')
19+
20+
f.each_line do |range|
21+
ips = Rex::Socket::RangeWalker.new(range)
22+
ips.each do |ip|
23+
w.write("#{ip}\n")
24+
end
25+
end
26+
f.close
27+
w.close

0 commit comments

Comments
 (0)