-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtoolbox.rb
97 lines (79 loc) · 2.92 KB
/
toolbox.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
# frozen_string_literal: true
require 'colorize'
require 'tty-prompt'
# This is the main Toolbox class that contains the functinality for the rest of the program
class Toolbox
def initialize
require_relative 'toolbox_ascii_art'
ToolboxAsciiArt.new('title')
load_main_menu
end
def self.version
' v0.4.1 '
end
def load_main_menu # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
prompt = TTY::Prompt.new
choices = [
{ name: 'Open Source Intelligence', value: lambda {
require_relative '../open_source_intelligence/open_source_intelligence'
OpenSourceIntelligence.new
}, disabled: '(In Development)' },
{ name: 'Cryptography', value: lambda {
require_relative '../cryptography/cryptography'
Cryptography.new
} },
{ name: 'Password Cracking', value: lambda {
require_relative '../password_cracking/password_cracking'
PasswordCracking.new
} },
{ name: 'Forensics', value: lambda {
require_relative '../forensics/forensics'
Forensics.new
} },
{ name: 'Log Analysis', value: lambda {
require_relative '../log_analysis/log_analysis'
LogAnalysis.new
} },
{ name: 'Network Traffic Analysis', value: lambda {
require_relative '../network_traffic_analysis/network_traffic_analysis'
NetworkTrafficAnalysis.new
}, disabled: '(In Development)' },
{ name: 'Scanning & Reconnaissance', value: lambda {
require_relative '../scanning_and_reconnaissance/scanning_and_reconnaissance'
ScanningAndReconnaissance.new
}, disabled: '(In Development)' },
{ name: 'Web Application Exploitation', value: lambda {
require_relative '../web_application_exploitation/web_application_exploitation'
WebApplicationExploitation.new
} },
{ name: 'Wireless Access Exploitation', value: lambda {
require_relative '../wireless_access_exploitation/wireless_access_exploitation'
WirelessAccessExploitation.new
}, disabled: '(In Development)' },
{ name: 'Enumeration & Exploitation', value: lambda {
require_relative '../enumeration_and_exploitation/enumeration_and_exploitation'
EnumerationAndExploitation.new
}, disabled: '(In Development)' },
{ name: 'Quit Program', value: lambda {
clear_terminal
exit
} }
]
prompt.select('Please select your mode', choices, per_page: 11, cycle: true)
end
def clear_terminal
if RUBY_PLATFORM =~ /win32|win64|\.NET|windows|cygwin|mingw32/i
system('cls')
else
system('clear')
end
end
def quit_or_continue(child_class)
prompt = TTY::Prompt.new
options = [
{ name: 'Continue', value: -> { child_class.new } },
{ name: 'Quit', value: -> { clear_terminal && exit } }
]
prompt.select("\nQuit the program or continue hacking", options, per_page: 2, cycle: true)
end
end