Files

30 lines
803 B
Ruby
Raw Permalink Normal View History

2020-05-06 19:22:52 -06:00
#! /usr/bin/env ruby
2020-05-08 00:26:25 -06:00
$LOAD_PATH << "#{File.dirname(File.dirname(__FILE__))}/atomic_red_team" unless $LOAD_PATH.include? "#{File.dirname(File.dirname(__FILE__))}/atomic_red_team"
require 'yaml'
require 'atomic_red_team'
2020-05-06 19:22:52 -06:00
2020-05-08 00:26:25 -06:00
ATOMIC_RED_TEAM = AtomicRedTeam.new
USED_GUIDS_FILE = "#{File.dirname(File.dirname(__FILE__))}/atomics/used_guids.txt"
2020-05-06 19:22:52 -06:00
2020-05-08 00:26:25 -06:00
oks = []
fails = []
2020-05-06 19:22:52 -06:00
2020-05-08 00:26:25 -06:00
ATOMIC_RED_TEAM.atomic_test_paths.each do |path|
begin
print "Generating guids #{path}..."
2020-05-08 02:02:37 -06:00
ATOMIC_RED_TEAM.record_used_guids!(YAML.load_file(path), USED_GUIDS_FILE)
2020-05-08 00:26:25 -06:00
AtomicRedTeam.new.generate_guids_for_yaml!(path, USED_GUIDS_FILE)
2020-05-06 19:22:52 -06:00
2020-05-08 00:26:25 -06:00
oks << path
puts "OK"
rescue => ex
fails << path
puts "FAIL\n#{ex}\n"
end
end
2020-05-06 19:22:52 -06:00
2020-05-08 00:26:25 -06:00
puts
puts "#{oks.count + fails.count} techniques, #{fails.count} failures"
2020-05-06 19:22:52 -06:00
2020-05-08 00:26:25 -06:00
exit fails.count