-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathpasspal.rb
657 lines (614 loc) · 19.8 KB
/
passpal.rb
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
#!/usr/bin/env ruby
# Table of Contents
#
# 1. Load libraries
# 2. Monkey patching
# 3. AbstractInterface module
# 4. Agent class
# 5. Agents
# 5.1 WordFrequencyAgent class
# 5.2 BaseWordFrequencyAgent class
# 5.3 LengthFrequencyAgent class
# 5.4 CharsetFrequencyAgent class
# 5.5 HashcatMaskFrequencyAgent class
# 5.6 CharsetPositionAgent class
# 5.7 CharacterFrequencyAgent class
# 5.8 SymbolFrequencyAgent class
# 5.9 YourAgent class
# 6. Application class
PASSPAL_VERSION = '0.4'
#
# 1. Load libraries
#
require 'getoptlong'
begin
require 'progressbar'
rescue LoadError
puts "Could not load 'progressbar'. Install by running: gem install progressbar"
exit
end
begin
require 'ruport'
rescue LoadError
puts "Could not load 'ruport'. Install by running: gem install ruport"
exit
end
#
# 2. Monkey patching
#
class Array
def longest_word
group_by(&:size).max.last.first
end
def sum
inject(:+)
end
end
class Class
def subclasses
result = []
ObjectSpace.each_object(Class) { |klass| result << klass if klass < self }
result
end
end
#
# 3. AbstractInterface module
#
module AbstractInterface
class InterfaceNotImplementedError < NoMethodError
end
def self.included(klass)
klass.send(:include, AbstractInterface::Methods)
klass.send(:extend, AbstractInterface::Methods)
end
module Methods
def api_not_implemented(klass)
caller.first.match(/in \`(.+)\'/)
method_name = $1
raise AbstractInterface::InterfaceNotImplementedError.new("#{klass.class.name} needs to implement '#{method_name}' for interface #{self.name}!")
end
end
end
#
# 4. Extendable Agent class
# From http://www.metabates.com/2011/02/07/building-interfaces-and-abstract-classes-in-ruby/
#
class Agent
include AbstractInterface
attr_accessor :analyzeTime, :reportTime, :total
def initialize
@analyzeTime = 0
@reportTime = 0
@total = 0
end
def analyze(word)
Agent.api_not_implemented(self)
end
def super_analyze(word)
@total += 1
analyze(word)
end
def report
Agent.api_not_implemented(self)
end
def super_report
report
end
def display_time
self.class.to_s + " - Analyzing: " + @analyzeTime.round(4).to_s + "s Reporting: " + @reportTime.round(4).to_s + 's'
end
end
#
# 5. Agents
# 5.1 WordFrequencyAgent
#
class WordFrequencyAgent < Agent
attr_accessor :words
def initialize
super
@words = Hash.new(0)
end
def analyze(word)
@words[word] += 1
end
def report
unique = @words.length
output = []
while (@words.length > 0 && output.length < $top.to_i)
max_value = 0
max_key = nil
@words.each do |key, value|
if value > max_value
max_value = value
max_key = key
end
end
@words.delete(max_key)
output << [max_key.to_s, max_value]
end
@words = nil
output.each do |array|
array << (((array[1].to_f/@total)*100).round(4).to_s + ' %')
end
table = Ruport::Data::Table.new({
:data => output,
:column_names => ['Word', 'Count', 'Of total']
})
"Total words: \t" + @total.to_s +
"\nUnique words: \t" + unique.to_s + ' (' + ((unique.to_f/@total.to_f)*100).round(2).to_s + ' %)' +
"\n\nWord frequency, sorted by count, top " + $top.to_s + "\n" + table.to_s
end
end
#
# 5.2 BaseWordFrequencyAgent
#
class BaseWordFrequencyAgent < Agent
attr_accessor :words
def initialize
super
@words = Hash.new(0)
end
def analyze(word)
word = word.gsub(/^[^a-zA-Z]+/, '').gsub(/[^a-zA-Z]+$/, '')
@words[word] += 1 if word.length >= 3
end
def report
output = []
while (@words.length > 0 && output.length < $top.to_i)
max_value = 0
max_key = nil
@words.each do |key, value|
if value > max_value
max_value = value
max_key = key
end
end
@words.delete(max_key)
output << [max_key, max_value]
end
@words = nil
output.each do |array|
array << ((array[1].to_f/@total)*100).round(4).to_s + ' %'
end
table = Ruport::Data::Table.new({
:data => output,
:column_names => ['Word', 'Count', 'Of total']
})
"Base word (len>=3) frequency, sorted by count, top " + $top.to_s + "\n" + table.to_s
end
end
#
# 5.3 LengthFrequencyAgent
#
class LengthFrequencyAgent < Agent
attr_accessor :lengths
def initialize
super
@lengths = Hash.new(0)
end
def analyze(word)
@lengths[word.length] += 1
end
def report
output = Hash[@lengths.sort].to_a
@lengths = nil
output.each do |array|
array << ((array[1].to_f/@total)*100).round(4).to_s + ' %'
end
table = Ruport::Data::Table.new({
:data => output,
:column_names => ['Length', 'Count', 'Of total']
})
"Length frequency, sorted by length, full table\n" + table.to_s
end
end
#
# 5.4 CharsetFrequencyAgent
#
class CharsetFrequencyAgent < Agent
attr_accessor :charsets, :results
def initialize
super
@charsets = Hash[
:'lower' => Hash[:pattern => /^[a-z]+$/, :characters => 26],
:'upper' => Hash[:pattern => /^[A-Z]+$/, :characters => 26],
:'numeric' => Hash[:pattern => /^[0-9]+$/, :characters => 10],
:'symbolic' => Hash[:pattern => Regexp.new('^[\p{Punct} ]+$'.force_encoding("utf-8"), Regexp::FIXEDENCODING), :characters => 33],
:'lower-upper' => Hash[:pattern => /^[A-Za-z]+$/, :characters => 52],
:'lower-numeric' => Hash[:pattern => /^[a-z0-9]+$/, :characters => 36],
:'lower-symbolic' => Hash[:pattern => Regexp.new('^[a-z\p{Punct} ]+$'.force_encoding("utf-8"), Regexp::FIXEDENCODING), :characters => 59],
:'upper-numeric' => Hash[:pattern => /^[A-Z0-9]+$/, :characters => 36],
:'upper-symbolic' => Hash[:pattern => Regexp.new('^[A-Z\p{Punct} ]+$'.force_encoding("utf-8"), Regexp::FIXEDENCODING), :characters => 59],
:'numeric-symbolic' => Hash[:pattern => Regexp.new('^[0-9\p{Punct} ]+$'.force_encoding("utf-8"), Regexp::FIXEDENCODING), :characters => 43],
:'lower-upper-numeric' => Hash[:pattern => /^[A-Za-z0-9]+$/, :characters => 62],
:'lower-upper-symbolic' => Hash[:pattern => Regexp.new('^[a-zA-Z\p{Punct} ]+$'.force_encoding("utf-8"), Regexp::FIXEDENCODING), :characters => 85],
:'lower-numeric-symbolic' => Hash[:pattern => Regexp.new('^[a-z0-9\p{Punct} ]+$'.force_encoding("utf-8"), Regexp::FIXEDENCODING), :characters => 69],
:'upper-numeric-symbolic' => Hash[:pattern => Regexp.new('^[A-Z0-9\p{Punct} ]+$'.force_encoding("utf-8"), Regexp::FIXEDENCODING), :characters => 69],
:'lower-upper-numeric-symbolic' => Hash[:pattern => Regexp.new('^[A-Za-z0-9\p{Punct} ]+$'.force_encoding("utf-8"), Regexp::FIXEDENCODING), :characters => 95],
]
@results = Hash.new(0)
end
def analyze(word)
@charsets.each do |key, hash|
if hash[:pattern].match(word)
@results[key] += 1
end
end
end
def report
output = []
@results.each do |charset, count|
output << [charset, count, ((count.to_f/@total)*100).round(4).to_s + ' %', count.to_f/@charsets[charset][:characters]]
end
@results = nil
table = Ruport::Data::Table.new({
:data => output,
:column_names => ['Charset', 'Count', 'Of total', 'Count/keyspace']
})
"Charset frequency, sorted by count, full table\n" + table.sort_rows_by("Count", :order => :descending).to_s +
"\nCharset frequency, sorted by count/keyspace, full table\n" + table.sort_rows_by("Count/keyspace", :order => :descending).to_s
end
end
#
# 5.5 HashcatMaskFrequencyAgent
#
class HashcatMaskFrequencyAgent < Agent
module LUDS
ENCODE = { 'L' => 0, 'U' => 1, 'D' => 2, 'S' => 3 }
DECODE = ENCODE.invert
def self.encode(str)
bytes = str.chars.each_slice(4).map do |a, b = 'L', c = 'L', d = 'L'|
(ENCODE[a]<<6) + (ENCODE[b]<<4) + (ENCODE[c]<<2) + ENCODE[d]
end
chars_in_last = str.length % 4
if chars_in_last == 0
bytes << 0
else
bytes[bytes.length-1] = bytes.last & 0b11111100 | chars_in_last
end
bytes.pack('c*')
end
def self.decode(str)
chars = str.each_byte.flat_map do |byte|
[
DECODE[byte>>6],
DECODE[(byte>>4) & 3],
DECODE[(byte>>2) & 3],
DECODE[byte & 3]
]
end.join
chars_to_pop = 4 - str.bytes.to_a.last & 3
chars[0..-(chars_to_pop+1)]
end
end
def initialize
super
@results = Hash.new(0)
@otherCount = 0
end
def analyze(word)
if Regexp.new('^[a-zA-Z0-9\p{Punct} ]+$'.force_encoding('utf-8'), Regexp::FIXEDENCODING).match(word)
word = word.gsub(/[A-Z]/, 'U').gsub(/[a-z]/, 'L').gsub(/[0-9]/, 'D').gsub(Regexp.new('[\p{Punct} ]'.force_encoding('utf-8'), Regexp::FIXEDENCODING), 'S')
@results[LUDS::encode(word).to_sym] += 1
else
@otherCount += 1
end
end
def report
output = []
@results.each do |mask, count|
mask2 = LUDS::decode(mask.to_s)
keyspace = 1
mask2.each_char do |char|
case char
when 'L'
keyspace *= 26
when 'U'
keyspace *= 26
when 'D'
keyspace *= 10
when 'S'
keyspace *= 33
end
end
output << [mask, count, count.to_f/keyspace.to_f]
end
output_by_count = []
output_by_keyspace = []
included_count_masks = []
included_keyspace_masks = []
c = output.length
while (c > 0 && (output_by_count.length < $top.to_i || output_by_keyspace.length < $top.to_i))
max_count = 0
max_count_index = nil
max_keyspace = 0.0
max_keyspace_index = nil
included_count_mask = nil
included_keyspace_mask = nil
output.each_with_index do |row, index|
if row[1] > max_count && included_count_masks.find_index(row[0]).nil?
max_count = row[1]
max_count_index = index
included_count_mask = row[0]
end
if row[2] > max_keyspace && included_keyspace_masks.find_index(row[0]).nil?
max_keyspace = row[2]
max_keyspace_index = index
included_keyspace_mask = row[0]
end
end
row = output[max_count_index]
output_by_count << [LUDS::decode(row[0].to_s).to_s.gsub(/L/, '?l').gsub(/U/, '?u').gsub(/D/, '?d').gsub(/S/, '?s'), row[1], ((row[1].to_f/@total)*100).round(4).to_s + ' %', row[2]]
row = output[max_keyspace_index]
output_by_keyspace << [LUDS::decode(row[0].to_s).to_s.gsub(/L/, '?l').gsub(/U/, '?u').gsub(/D/, '?d').gsub(/S/, '?s'), row[1], ((row[1].to_f/@total)*100).round(4).to_s + ' %', row[2]]
included_count_masks << included_count_mask
included_keyspace_masks << included_keyspace_mask
c -= 1
end
@results = nil
table = Ruport::Data::Table.new({
:data => output_by_count,
:column_names => ['Mask', 'Count', 'Of total', 'Count/keyspace']
})
table2 = Ruport::Data::Table.new({
:data => output_by_keyspace,
:column_names => ['Mask', 'Count', 'Of total', 'Count/keyspace']
})
"Hashcat mask frequency, sorted by count, top " + $top.to_s + "\n" + table.sort_rows_by("Count", :order => :descending).to_s +
"Words that didn't match any ?l?u?d?s mask: " + @otherCount.to_s + ' (' + ((@otherCount.to_f/@total)*100).round(4).to_s + ' %)' +
"\n\nHashcat mask frequency, sorted by count/keyspace, top " + $top.to_s + "\n" + table2.sort_rows_by("Count/keyspace", :order => :descending).to_s +
"Words that didn't match any ?l?u?d?s mask: " + @otherCount.to_s + ' (' + ((@otherCount.to_f/@total)*100).round(4).to_s + ' %)' + "\n"
end
end
#
# 5.6 CharsetPositionAgent
#
class CharsetPositionAgent < Agent
attr_accessor :result
def initialize
super
@results = {
:l => Hash.new(0),
:u => Hash.new(0),
:d => Hash.new(0),
:s => Hash.new(0)
}
end
def analyze(word)
min_length = 6
length = word.length
if length >= min_length
index = 0
word.each_char do |char|
if index < 3 || index >= length-3
if index < 3
pos = index
elsif index >= length-3
pos = -(length-index)
end
case char
when /[a-z]/
@results[:l][pos] += 1
when /[A-Z]/
@results[:u][pos] += 1
when /[0-9]/
@results[:d][pos] += 1
when Regexp.new('([\p{Punct} ])'.force_encoding('utf-8'), Regexp::FIXEDENCODING)
@results[:s][pos] += 1
end
end
index += 1
end
end
end
def report
sum_0 = @results[:l][0]+@results[:u][0]+@results[:d][0]+@results[:s][0]
sum_1 = @results[:l][1]+@results[:u][1]+@results[:d][1]+@results[:s][1]
sum_2 = @results[:l][2]+@results[:u][2]+@results[:d][2]+@results[:s][2]
sum_m3 = @results[:l][-3]+@results[:u][-3]+@results[:d][-3]+@results[:s][-3]
sum_m2 = @results[:l][-2]+@results[:u][-2]+@results[:d][-2]+@results[:s][-2]
sum_m1 = @results[:l][-1]+@results[:u][-1]+@results[:d][-1]+@results[:s][-1]
table_f = Ruport::Data::Table.new({
:data => [
['lower', ((@results[:l][0].to_f/sum_0)*100).round(4).to_s+' %', ((@results[:l][1].to_f/sum_1)*100).round(4).to_s+' %', ((@results[:l][2].to_f/sum_2)*100).round(4).to_s+' %', ((@results[:l][-3].to_f/sum_m3)*100).round(4).to_s+' %', ((@results[:l][-2].to_f/sum_m2)*100).round(4).to_s+' %', ((@results[:l][-1].to_f/sum_m1)*100).round(4).to_s+' %'],
['upper', ((@results[:u][0].to_f/sum_0)*100).round(4).to_s+' %', ((@results[:u][1].to_f/sum_1)*100).round(4).to_s+' %', ((@results[:u][2].to_f/sum_2)*100).round(4).to_s+' %', ((@results[:u][-3].to_f/sum_m3)*100).round(4).to_s+' %', ((@results[:u][-2].to_f/sum_m2)*100).round(4).to_s+' %', ((@results[:u][-1].to_f/sum_m1)*100).round(4).to_s+' %'],
['digits', ((@results[:d][0].to_f/sum_0)*100).round(4).to_s+' %', ((@results[:d][1].to_f/sum_1)*100).round(4).to_s+' %', ((@results[:d][2].to_f/sum_2)*100).round(4).to_s+' %', ((@results[:d][-3].to_f/sum_m3)*100).round(4).to_s+' %', ((@results[:d][-2].to_f/sum_m2)*100).round(4).to_s+' %', ((@results[:d][-1].to_f/sum_m1)*100).round(4).to_s+' %'],
['symbols', ((@results[:s][0].to_f/sum_0)*100).round(4).to_s+' %', ((@results[:s][1].to_f/sum_1)*100).round(4).to_s+' %', ((@results[:s][2].to_f/sum_2)*100).round(4).to_s+' %', ((@results[:s][-3].to_f/sum_m3)*100).round(4).to_s+' %', ((@results[:s][-2].to_f/sum_m2)*100).round(4).to_s+' %', ((@results[:s][-1].to_f/sum_m1)*100).round(4).to_s+' %'],
],
:column_names => ['Charset\Index', '0 (first char)', 1, 2, -3, -2, '-1 (last char)']
})
@results = nil
"Charset distribution of characters in beginning and end of words (len>=6)\n" + table_f.to_s
end
end
#
# 5.7 CharacterFrequencyAgent
#
class CharacterFrequencyAgent < Agent
attr_accessor :words
def initialize
super
@chars = Hash.new(0)
@charCount = 0
end
def analyze(word)
@charCount += word.length
word.each_char do |char|
@chars[char] += 1
end
end
def report
unique = @chars.length
output = []
charset_string = ''
while (@chars.length > 0 && (output.length < $top.to_i || output.length < 50))
max_value = 0
max_key = nil
@chars.each do |key, value|
if value > max_value
max_value = value
max_key = key
end
end
@chars.delete(max_key)
charset_string += max_key
output << [max_key, max_value]
end
@chars = nil
output.each do |array|
array << (((array[1].to_f/@charCount)*100).round(4).to_s + ' %')
end
table = Ruport::Data::Table.new({
:data => output,
:column_names => ['Character', 'Count', 'Of total']
})
"Total characters: \t" + @charCount.to_s +
"\nUnique characters: \t" + unique.to_s +
"\nTop 50 characters: \t" + '' + charset_string[0..49] +
"\n\nCharacter frequency, sorted by count, top " + $top.to_s + "\n" + table.sub_table(0...$top.to_i).to_s
end
end
#
# 5.8 SymbolFrequencyAgent
#
class SymbolFrequencyAgent < Agent
attr_accessor :symbols
def initialize
super
@symbols = Hash.new(0)
end
def analyze(word)
m = word.scan(Regexp.new('([\p{Punct} ])'.force_encoding('utf-8'), Regexp::FIXEDENCODING))
if m.length > 0
m.each do |symbol|
@symbols[symbol[0]] += 1
end
end
end
def report
table = Ruport::Data::Table.new({
:data => @symbols,
:column_names => %w[Symbol Count]
})
"Symbol frequency, sorted by count, top " + $top.to_s + "\n" + table.sort_rows_by("Count", :order => :descending).sub_table(0...$top.to_i).to_s
end
end
#
# 5.9 YourAgent
#
=begin
class YourAgent < Agent
def initialize
super
end
def analyze(word)
end
def report
#puts $top
#puts @total
end
end
=end
#
# 6. Application
#
class Application
attr_accessor :agents
def initialize
@output_file = STDOUT
if RUBY_VERSION != '1.9.3'
puts 'Warning: This software has only been tested on Ruby 1.9.3'
puts
end
@possibleAgents = [
WordFrequencyAgent.new,
BaseWordFrequencyAgent.new,
LengthFrequencyAgent.new,
CharsetFrequencyAgent.new,
HashcatMaskFrequencyAgent.new,
CharsetPositionAgent.new,
CharacterFrequencyAgent.new,
SymbolFrequencyAgent.new,
#YourAgent.new,
]
@agents = @possibleAgents
opts = GetoptLong.new(
['--help', '-h', '-?', GetoptLong::NO_ARGUMENT],
['--top', '-t', GetoptLong::REQUIRED_ARGUMENT],
['--include', '-i', GetoptLong::REQUIRED_ARGUMENT],
['--exclude', '-e', GetoptLong::REQUIRED_ARGUMENT],
['--outfile', '-o', GetoptLong::REQUIRED_ARGUMENT]
)
begin
opts.each do |opt, arg|
case opt
when '--help'
display_help
exit 1
when '--top'
$top = arg
when '--include'
@agents = []
arg.split(/,/).each do |i|
@agents << @possibleAgents[i.to_i-1]
end
when '--exclude'
@agents = @possibleAgents
arg.split(/,/).each do |i|
@agents[i.to_i-1] = nil
end
when '--outfile'
@output_file = File.new(arg, "w")
end
end
$top ||= 10
rescue GetoptLong::InvalidOption => e
puts e
rescue => e
puts e
end
if ARGV.length != 1
abort "Missing file argument (try --help)"
end
end
def display_help
puts "passpal "+PASSPAL_VERSION+", T. Alexander Lystad <[email protected]> (www.thepasswordproject.com)
Usage on Windows: ruby passpal.rb [switches] filename [> outfile.txt]
Usage on Linux: ./passpal.rb [switches] filename [> outfile.txt]
--help \t\t\t Show help
--top \t\t\t Show top X results. Defaults to 10. Some reports are always shown in full. Example: --top 20
--include STRING \t Run these modules, separate with comma. Example: --include 1,3,5
--exclude STRING \t Run all modules except these, separate with comma. Example: --exclude 6
--outfile filename \t Output to this file
filename \t\t The file to analyze. Must be UTF-8 encoded.
"
puts "Available modules: "
@possibleAgents.each_with_index do |value, key|
puts (1+key).to_s + ' = ' + value.class.to_s
end
end
def run
filename = ARGV.shift
buffer = "\n\npasspal "+PASSPAL_VERSION+" report (www.thepasswordproject.com)\n\n"
@agents.each_with_index do |agent, index|
unless agent.nil?
f = File.open(filename, 'r:UTF-8')
progress = ProgressBar.new('Analysis #' + (index+1).to_s + '/' + @agents.length.to_s, f.size)
f.each_line do |line|
progress.inc(line.bytesize)
#Analyze
agent.super_analyze(line.chomp)
end
progress.finish
#Report
progress = ProgressBar.new(' Report #' + (index+1).to_s + '/' + @agents.length.to_s, 1)
string = agent.super_report
buffer += string + "\n\n" unless string.nil?
progress.finish
end
end
@output_file.puts buffer
end
end
a = Application.new()
a.run()