forked from mgeide/poortego
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpoortego_cli.rb
38 lines (34 loc) · 1015 Bytes
/
poortego_cli.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
#!/usr/bin/env ruby
###
#
# Poortego Command Line Interface
# - leverages REX UI classes compliments of Metasploit
#
###
#
# Define Requirement Paths
# do this for any Poortego launch script
#
poortego_base = __FILE__
while File.symlink?(poortego_base)
poortego_base = File.expand_path(File.readlink(poortego_base), File.dirname(poortego_base))
end
poortego_base_path = File.expand_path(File.dirname(poortego_base))
poortego_base_path = "#{poortego_base_path}/../"
# Store the Poortego base dir as an environment variable
if ENV['POORTEGO_LOCAL_BASE']
$:.unshift(ENV['POORTEGO_LOCAL_BASE'])
else
ENV['POORTEGO_LOCAL_BASE'] = poortego_base_path
$:.unshift(poortego_base_path)
end
require "poortego/ui/rexui/console/shell"
#
# Launch Console Shell
#
begin
FileUtils.mkdir_p(File.expand_path('~/.poortego'))
Poortego::Console::Shell.new(Poortego::Console::Shell::DefaultPrompt,
Poortego::Console::Shell::DefaultPromptChar,{'config' => nil}).run
rescue Interrupt
end