This repository was archived by the owner on Feb 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathkml.rb
More file actions
145 lines (123 loc) · 5 KB
/
Copy pathkml.rb
File metadata and controls
145 lines (123 loc) · 5 KB
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
require 'json'
def banner()
system('clear')
puts("\e[36m
██ ▄█▀ ███▄ ▄███▓ ██▓
██▄█▒ ▓██▒▀█▀ ██▒ ▓██▒
▓███▄░ ▓██ ▓██░ ▒██░
▓██ █▄ ▒██ ▒██ ▒██░
▒██▒ █▄ ▒██▒ ░██▒ ░██████▒
▒ ▒▒ ▓▒ ░ ▒░ ░ ░ ░ ▒░▓ ░
░ ░▒ ▒░ ░ ░ ░ ░ ░ ▒ ░
░ ░░ ░ ░ ░ ░ ░
░ ░ ░ ░ ░
")
puts "\e[39mgithub: gerald0x01\n".center(50)
end
def select_option()
banner()
category_options = ["\e[36m[1]\e[39m Install repository.", "\e[36m[2]\e[39m Install tools.", "\e[36m[3]\e[39m Remove repository."]
category_options.map {|option| puts option}
print "\n\e[36m>\e[39m "; @user_option = gets; return @user_option.to_i
end
def select_distro()
banner()
category_distro = ["\e[36m[1]\e[39m Debian.", "\e[36m[2]\e[39m Ubuntu.", "\e[36m[3]\e[39m Linux Mint.", "\e[36m[4]\e[39m Arch Linux.\n", "\e[36m[5]\e[39m Manjaro.\n"]
category_distro.map {|distro| puts distro}
print "\n\e[36m>\e[39m "; @user_distro = gets; return @user_distro.to_i
end
def install(using_distro)
def debian_based
system("sudo apt-key adv --keyserver pool.sks-keyservers.net --recv-keys ED444FF07D8D0BF6 && echo '# Kali Repository (kali-my-linux)' >> /etc/apt/sources.list && echo 'deb http://http.kali.org/kali kali-rolling main contrib non-free' >> /etc/apt/sources.list && sudo apt-get update -m")
end
def arch_based
print "You don't need to install repository. You'll use AUR. (yay)"
end
using_distro == 'debian_based' ? debian_based() : arch_based()
exit
end
def tools(using_distro)
def category_install_tools(using_category, using_distro)
myHash = {}
Dir.glob('./tools/*.txt') do |category_name|
category = File.basename(category_name, '.txt')
myHash[category] = File.readlines(category_name).map(&:chomp)
end
using_distro == 'debian_based' ? myHash[using_category].map { |package| system("sudo apt-get install #{package} -y") } : myHash[using_category].map { |package| system("yay -S #{package} -y") }
end
banner()
category_tools = [
"\e[36m[1]\e[39m All.",
"\e[36m[2]\e[39m Eploration.",
"\e[36m[3]\e[39m Forensic.",
"\e[36m[4]\e[39m Hardware.\n",
"\e[36m[5]\e[39m Info Gethering.\n",
"\e[36m[6]\e[39m Maintaining Acess.\n",
"\e[36m[7]\e[39m Password Atacks.\n",
"\e[36m[8]\e[39m Reporting Tools.\n",
"\e[36m[9]\e[39m Reverse Engineering.\n",
"\e[36m[10]\e[39m Sniffing and Spoofing.\n",
"\e[36m[11]\e[39m Stress Testing.\n",
"\e[36m[12]\e[39m Vul Analysis.\n",
"\e[36m[13]\e[39m Web.\n",
"\e[36m[14]\e[39m Wireless.\n"
]
json_category = {
1 => 'all',
2 => 'exploration_tools',
3 => 'forensics_tools',
4 => 'hardware_hacking',
5 => 'info_gethering',
6 => 'maintaining_acess',
7 => 'password_atacks',
8 => 'reporting_tools',
9 => 'reverse_engineering',
10 => 'sniffing_and_spoofing',
11 => 'stress_testing',
12 => 'vul_analysis',
13 => 'web',
14 => 'wireless_atack'
}
category_tools.map {|tools| puts tools}
print "\n\e[36m>\e[39m "
category_number = gets
category_install_tools(json_category[category_number.to_i], using_distro)
exit
end
def uninstall(using_distro)
def debian_based
system("sudo clear && sed -i '/kali/d' /etc/apt/sources.list && sed -i '/Kali/d' /etc/apt/sources.list"); p("Removed.")
end
def arch_based
print "You don't need to remove repository. You're using AUR. (yay)"
end
using_distro == 'debian_based' ? debian_based() : arch_based()
exit
end
def verification(option, distro)
def actual_user_distro(distro)
case distro
when 1, 2, 3 then distro = 'debian_based'
when 4, 5 then distro = 'arch_based'
end
return distro
end
def actual_user_option(option, using_distro)
case option
when 1 then install(using_distro)
when 2 then tools(using_distro)
when 3 then uninstall(using_distro)
end
end
if [1, 2, 3, 4, 5].include?(distro)
using_distro = actual_user_distro(distro)
else
puts "Wrong option. Type the number."
end
[1, 2, 3].include?(option) ? actual_user_option(option, using_distro) : exit
end
def main()
@user_option = select_option(); @user_distro = select_distro()
verification(@user_option, @user_distro)
end
main()