wibrfake-brk 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.dockerignore +48 -0
- data/.gitattributes +19 -0
- data/.github/dependabot.yml +12 -0
- data/.github/workflows/ci.yml +90 -0
- data/.rubocop.yml +8 -0
- data/.ruby-version +1 -0
- data/Dockerfile +69 -0
- data/Gemfile +68 -0
- data/README.md +188 -0
- data/Rakefile +6 -0
- data/app/assets/config/manifest.js +5 -0
- data/app/assets/images/.keep +0 -0
- data/app/assets/images/2024-12-30-07:58:34-screenshot.png +0 -0
- data/app/assets/images/facebook/facebook-logo.svg +3 -0
- data/app/assets/images/google/googlelogo_color_272x92dp.png +0 -0
- data/app/assets/images/instagram/app-store.png +0 -0
- data/app/assets/images/instagram/google-play.png +0 -0
- data/app/assets/images/instagram/instagram-logo.png +0 -0
- data/app/assets/images/instagram/screenshot1.png +0 -0
- data/app/assets/images/instagram/screenshot2.png +0 -0
- data/app/assets/images/instagram/screenshot3.png +0 -0
- data/app/assets/images/instagram/screenshot4.png +0 -0
- data/app/assets/images/nauta_etecsa/CUBADEBATE.jpg +0 -0
- data/app/assets/images/nauta_etecsa/CUBAEDUCA.jpg +0 -0
- data/app/assets/images/nauta_etecsa/CUBARTE.jpg +0 -0
- data/app/assets/images/nauta_etecsa/CUBASI.jpg +0 -0
- data/app/assets/images/nauta_etecsa/ECURED.jpg +0 -0
- data/app/assets/images/nauta_etecsa/OFERTAS.jpg +0 -0
- data/app/assets/images/nauta_etecsa/PAPELETA.jpg +0 -0
- data/app/assets/images/nauta_etecsa/contenedor_bg.jpg +0 -0
- data/app/assets/images/nauta_etecsa/etecsa.jpg +0 -0
- data/app/assets/images/nauta_etecsa/nauta_wifi.jpg +0 -0
- data/app/assets/images/nauta_hogar/CUBADEBATE.jpg +0 -0
- data/app/assets/images/nauta_hogar/CUBAEDUCA.jpg +0 -0
- data/app/assets/images/nauta_hogar/CUBARTE.jpg +0 -0
- data/app/assets/images/nauta_hogar/CUBASI.jpg +0 -0
- data/app/assets/images/nauta_hogar/ECURED.jpg +0 -0
- data/app/assets/images/nauta_hogar/OFERTAS.jpg +0 -0
- data/app/assets/images/nauta_hogar/PAPELETA.jpg +0 -0
- data/app/assets/images/nauta_hogar/banner_hogar.png +0 -0
- data/app/assets/images/wibrfake/Breaker-Wallpaper1.jpg +0 -0
- data/app/assets/images/wibrfake/mac-list-parameter.png +0 -0
- data/app/assets/images/wibrfake/wibrfake-100x100.png +0 -0
- data/app/assets/images/wibrfake/wibrfake-32x32.png +0 -0
- data/app/assets/images/wibrfake/wibrfake-48x48.png +0 -0
- data/app/assets/images/wibrfake/wibrfake-apfake-on.png +0 -0
- data/app/assets/images/wibrfake/wibrfake-apfake-set-basic.png +0 -0
- data/app/assets/images/wibrfake/wibrfake-apfake-show.png +0 -0
- data/app/assets/images/wibrfake/wibrfake-help.png +0 -0
- data/app/assets/images/wibrfake/wibrfake-hostpot.png +0 -0
- data/app/assets/images/wibrfake/wibrfake-init.png +0 -0
- data/app/assets/images/wibrfake/wibrfake-init2.png +0 -0
- data/app/assets/images/wibrfake/wibrfake-login-basic.jpg +0 -0
- data/app/assets/images/wibrfake/wibrfake-mac-list.png +0 -0
- data/app/assets/images/wibrfake/wibrfake-mac-ramset-oui.png +0 -0
- data/app/assets/images/wibrfake/wibrfake-mac-ramset.png +0 -0
- data/app/assets/images/wibrfake/wibrfake-mac-set.png +0 -0
- data/app/assets/images/wibrfake/wibrfake-mac-show.png +0 -0
- data/app/assets/images/wibrfake/wibrfake-need-signin.jpg +0 -0
- data/app/assets/images/wibrfake/wibrfake-session-active.png +0 -0
- data/app/assets/images/wibrfake/wibrfake-session-init.png +0 -0
- data/app/assets/images/wibrfake/wibrfake-session-list.png +0 -0
- data/app/assets/images/wibrfake/wibrfake-session-new.png +0 -0
- data/app/assets/images/wibrfake/wibrfake-session-rename.png +0 -0
- data/app/assets/images/wibrfake/wibrfake-session-save.png +0 -0
- data/app/assets/images/wibrfake/wibrfake-web-server-apfake.png +0 -0
- data/app/assets/images/wibrfake/wibrfake-web-server-on.png +0 -0
- data/app/assets/images/wibrfake/wibrfake-web-server-show.png +0 -0
- data/app/assets/images/wibrfake/wibrfake-wkdump-loaded.png +0 -0
- data/app/assets/images/wibrfake/wibrfake-wkdump.png +0 -0
- data/app/assets/images/wibrfake/wibrfake.png +0 -0
- data/app/assets/stylesheets/application.css +15 -0
- data/app/assets/stylesheets/basic/page_basic.css +0 -0
- data/app/assets/stylesheets/facebook/page_facebook.css +93 -0
- data/app/assets/stylesheets/google/page_google.css +137 -0
- data/app/assets/stylesheets/instagram/page_instagram.css +94 -0
- data/app/assets/stylesheets/nauta_etecsa/page_nauta.css +325 -0
- data/app/assets/stylesheets/nauta_hogar/page_nauta.css +469 -0
- data/app/assets/stylesheets/wibrfake/page_wibrfake.css +1181 -0
- data/app/assets/stylesheets/wibrfake/page_wibrfake_about.css +486 -0
- data/app/channels/application_cable/channel.rb +4 -0
- data/app/channels/application_cable/connection.rb +4 -0
- data/app/controllers/application_controller.rb +15 -0
- data/app/controllers/concerns/.keep +0 -0
- data/app/controllers/sessions_controller.rb +111 -0
- data/app/helpers/application_helper.rb +2 -0
- data/app/helpers/sessions_helper.rb +2 -0
- data/app/javascript/application.js +3 -0
- data/app/javascript/bootstrap.bundle.min.js +7 -0
- data/app/javascript/controllers/application.js +9 -0
- data/app/javascript/controllers/hello_controller.js +7 -0
- data/app/javascript/controllers/index.js +4 -0
- data/app/javascript/google/page_google.js +50 -0
- data/app/javascript/incorrect3.js +29 -0
- data/app/javascript/page_wibrfake.js +50 -0
- data/app/javascript/page_wibrfake_about.js +147 -0
- data/app/jobs/application_job.rb +7 -0
- data/app/mailers/application_mailer.rb +4 -0
- data/app/models/application_record.rb +3 -0
- data/app/models/concerns/.keep +0 -0
- data/app/models/user.rb +6 -0
- data/app/views/layouts/application.html.erb +33 -0
- data/app/views/layouts/mailer.html.erb +13 -0
- data/app/views/layouts/mailer.text.erb +1 -0
- data/app/views/pwa/manifest.json.erb +22 -0
- data/app/views/pwa/service-worker.js +26 -0
- data/app/views/sessions/basic/basic.html.erb +21 -0
- data/app/views/sessions/facebook/facebook.html.erb +132 -0
- data/app/views/sessions/google/google.html.erb +72 -0
- data/app/views/sessions/index.html.erb +11 -0
- data/app/views/sessions/instagram/instagram.html.erb +69 -0
- data/app/views/sessions/nauta_etecsa/nauta_etecsa.html.erb +97 -0
- data/app/views/sessions/nauta_hogar/nauta_hogar.html.erb +135 -0
- data/app/views/sessions/wibrfake/about/about.html.erb +164 -0
- data/app/views/sessions/wibrfake/wibrfake.html.erb +417 -0
- data/bin/.names.rb.swp +0 -0
- data/bin/brakeman +7 -0
- data/bin/bundle +114 -0
- data/bin/docker-entrypoint +13 -0
- data/bin/google.wkdump +3 -0
- data/bin/importmap +4 -0
- data/bin/rails +4 -0
- data/bin/rake +4 -0
- data/bin/rubocop +8 -0
- data/bin/setup +37 -0
- data/bin/wibrfake +20 -0
- data/config/application.rb +26 -0
- data/config/boot.rb +4 -0
- data/config/cable.yml +10 -0
- data/config/credentials.yml.enc +1 -0
- data/config/database.yml +16 -0
- data/config/environment.rb +5 -0
- data/config/environments/development.rb +85 -0
- data/config/environments/production.rb +105 -0
- data/config/environments/test.rb +67 -0
- data/config/icons/application-x-wkdump.xml +13 -0
- data/config/icons/hicolor/16x16/mimetypes/application-x-wkdump.png +0 -0
- data/config/icons/hicolor/32x32/mimetypes/application-x-wkdump.png +0 -0
- data/config/icons/hicolor/48x48/mimetypes/application-x-wkdump.png +0 -0
- data/config/icons/hicolor/icon-theme.cache +0 -0
- data/config/icons/hicolor/index.theme +20 -0
- data/config/icons/wkdump.desktop +5 -0
- data/config/importmap.rb +7 -0
- data/config/initializers/assets.rb +12 -0
- data/config/initializers/content_security_policy.rb +25 -0
- data/config/initializers/devise.rb +313 -0
- data/config/initializers/filter_parameter_logging.rb +8 -0
- data/config/initializers/inflections.rb +16 -0
- data/config/initializers/permissions_policy.rb +13 -0
- data/config/locales/devise.en.yml +65 -0
- data/config/locales/en.yml +31 -0
- data/config/puma.rb +35 -0
- data/config/routes.rb +12 -0
- data/config/storage.yml +34 -0
- data/config.ru +6 -0
- data/db/development.sqlite3 +0 -0
- data/db/schema.rb +14 -0
- data/ext/wibrfake/extconf.rb +3 -0
- data/ext/wibrfake/wibrfake.h +0 -0
- data/images/ouilist.png +0 -0
- data/images/wibrfakehelp.png +0 -0
- data/images/wibrfakeinit.png +0 -0
- data/lib/assets/.keep +0 -0
- data/lib/tasks/.keep +0 -0
- data/lib/wibrfake/Config/ipaddr.rb +71 -0
- data/lib/wibrfake/Config/options.rb +98 -0
- data/lib/wibrfake/Config/security_wpa.rb +43 -0
- data/lib/wibrfake/DataBase/howuis.db +0 -0
- data/lib/wibrfake/DataBase/ouis.db +0 -0
- data/lib/wibrfake/DataBase/ouis.rb +24 -0
- data/lib/wibrfake/DataBase/rename.rb +15 -0
- data/lib/wibrfake/DataBase/show.rb +18 -0
- data/lib/wibrfake/Dnsmasq/dhcp.rb +149 -0
- data/lib/wibrfake/Dnsmasq/dhcp_prueba.rb +135 -0
- data/lib/wibrfake/Dnsmasq/dns.rb +34 -0
- data/lib/wibrfake/Dnsmasq/dns_prueba.rb +36 -0
- data/lib/wibrfake/Dnsmasq/dnsmasq.rb +33 -0
- data/lib/wibrfake/Listing/apfake.rb +28 -0
- data/lib/wibrfake/Listing/clients.rb +76 -0
- data/lib/wibrfake/Listing/ouis.rb +53 -0
- data/lib/wibrfake/Listing/process.rb +14 -0
- data/lib/wibrfake/Listing/sessions.rb +47 -0
- data/lib/wibrfake/Listing/web_server.rb +17 -0
- data/lib/wibrfake/Listing/wireless.rb +30 -0
- data/lib/wibrfake/Logs/credentials.log +59 -0
- data/lib/wibrfake/NetworkInterface/ip-routing.rb +99 -0
- data/lib/wibrfake/NetworkInterface/mac.rb +114 -0
- data/lib/wibrfake/NetworkInterface/monitor.rb +44 -0
- data/lib/wibrfake/NetworkInterface/ouis.db +0 -0
- data/lib/wibrfake/Process/id.rb +11 -0
- data/lib/wibrfake/Process/pids.log +5 -0
- data/lib/wibrfake/Process/pkill.rb +124 -0
- data/lib/wibrfake/Process/processes.rb +76 -0
- data/lib/wibrfake/Rails/login.rb +20 -0
- data/lib/wibrfake/Rails/routes.rb +76 -0
- data/lib/wibrfake/Rails/service.rb +58 -0
- data/lib/wibrfake/Rails/service_usage.rb +46 -0
- data/lib/wibrfake/Sessions/session.rb +188 -0
- data/lib/wibrfake/String/string.rb +109 -0
- data/lib/wibrfake/Tmp/config.yml +1 -0
- data/lib/wibrfake/config.rb +24 -0
- data/lib/wibrfake/help.rb +107 -0
- data/lib/wibrfake/optionpr.rb +68 -0
- data/lib/wibrfake/run.rb +9 -0
- data/lib/wibrfake/ty/apld.rb +110 -0
- data/lib/wibrfake/ty/prompt/answers_collector.rb +78 -0
- data/lib/wibrfake/ty/prompt/block_paginator.rb +59 -0
- data/lib/wibrfake/ty/prompt/choice.rb +147 -0
- data/lib/wibrfake/ty/prompt/choices.rb +129 -0
- data/lib/wibrfake/ty/prompt/confirm_question.rb +158 -0
- data/lib/wibrfake/ty/prompt/const.rb +17 -0
- data/lib/wibrfake/ty/prompt/converter_dsl.rb +21 -0
- data/lib/wibrfake/ty/prompt/converter_registry.rb +69 -0
- data/lib/wibrfake/ty/prompt/converters.rb +182 -0
- data/lib/wibrfake/ty/prompt/distance.rb +49 -0
- data/lib/wibrfake/ty/prompt/enum_list.rb +433 -0
- data/lib/wibrfake/ty/prompt/errors.rb +31 -0
- data/lib/wibrfake/ty/prompt/evaluator.rb +29 -0
- data/lib/wibrfake/ty/prompt/expander.rb +321 -0
- data/lib/wibrfake/ty/prompt/keypress.rb +98 -0
- data/lib/wibrfake/ty/prompt/list.rb +589 -0
- data/lib/wibrfake/ty/prompt/mask_question.rb +96 -0
- data/lib/wibrfake/ty/prompt/multi_list.rb +224 -0
- data/lib/wibrfake/ty/prompt/multiline.rb +72 -0
- data/lib/wibrfake/ty/prompt/paginator.rb +111 -0
- data/lib/wibrfake/ty/prompt/question/checks.rb +105 -0
- data/lib/wibrfake/ty/prompt/question/modifier.rb +96 -0
- data/lib/wibrfake/ty/prompt/question/validation.rb +72 -0
- data/lib/wibrfake/ty/prompt/question.rb +391 -0
- data/lib/wibrfake/ty/prompt/result.rb +42 -0
- data/lib/wibrfake/ty/prompt/selected_choices.rb +77 -0
- data/lib/wibrfake/ty/prompt/slider.rb +286 -0
- data/lib/wibrfake/ty/prompt/statement.rb +55 -0
- data/lib/wibrfake/ty/prompt/suggestion.rb +113 -0
- data/lib/wibrfake/ty/prompt/symbols.rb +89 -0
- data/lib/wibrfake/ty/prompt/test.rb +36 -0
- data/lib/wibrfake/ty/prompt/timer.rb +75 -0
- data/lib/wibrfake/ty/prompt/utils.rb +42 -0
- data/lib/wibrfake/ty/prompt/version.rb +7 -0
- data/lib/wibrfake/ty/prompt.rb +589 -0
- data/lib/wibrfake/version.rb +5 -0
- data/lib/wibrfake/wibrfake_cli.rb +683 -0
- data/log/.keep +0 -0
- data/pruebas/daemon1.pid +1 -0
- data/pruebas/daemon2.pid +1 -0
- data/pruebas/daemons.rb +44 -0
- data/public/404.html +67 -0
- data/public/406-unsupported-browser.html +66 -0
- data/public/422.html +67 -0
- data/public/500.html +66 -0
- data/public/icon.png +0 -0
- data/public/icon.svg +3 -0
- data/public/robots.txt +1 -0
- data/storage/.keep +0 -0
- data/test/application_system_test_case.rb +5 -0
- data/test/channels/application_cable/connection_test.rb +13 -0
- data/test/controllers/.keep +0 -0
- data/test/controllers/sessions_controller_test.rb +7 -0
- data/test/fixtures/files/.keep +0 -0
- data/test/fixtures/users.yml +11 -0
- data/test/helpers/.keep +0 -0
- data/test/integration/.keep +0 -0
- data/test/mailers/.keep +0 -0
- data/test/models/.keep +0 -0
- data/test/models/user_test.rb +7 -0
- data/test/system/.keep +0 -0
- data/test/test_helper.rb +15 -0
- data/tmp/.keep +0 -0
- data/tmp/pids/.keep +0 -0
- data/tmp/storage/.keep +0 -0
- data/vendor/.keep +0 -0
- data/vendor/javascript/.keep +0 -0
- data/wibrfake.gemspec +49 -0
- metadata +743 -0
@@ -0,0 +1,109 @@
|
|
1
|
+
class String
|
2
|
+
#Puts text string
|
3
|
+
def puts_white(input, show = 0)
|
4
|
+
return "\e[1;37m#{input}\e[0m" if show == 0
|
5
|
+
puts "\e[1;37m#{input}\e[0m"
|
6
|
+
end
|
7
|
+
|
8
|
+
def puts_black(input, show = 0)
|
9
|
+
return "\e[0m\033[38;5;236m#{input}\e[0m" if show == 0
|
10
|
+
puts "\e[0m\033[38;5;236m#{input}\e[0m"
|
11
|
+
end
|
12
|
+
|
13
|
+
def puts_red(input, show = 0)
|
14
|
+
return "\033[38;5;196m#{input}\e[0m" if show == 0
|
15
|
+
puts "\033[38;5;196m#{input}\e[0m"
|
16
|
+
end
|
17
|
+
|
18
|
+
def puts_green(input, show = 0)
|
19
|
+
return "\033[38;5;46m#{input}\e[0m" if show == 0
|
20
|
+
puts "\033[38;5;46m#{input}\e[0m"
|
21
|
+
end
|
22
|
+
|
23
|
+
def puts_yellow(input, show = 0)
|
24
|
+
return "\e[1;33m#{input}\e[0m" if show == 0
|
25
|
+
puts "\e[1;33m#{input}\e[0m"
|
26
|
+
end
|
27
|
+
|
28
|
+
def puts_blue(input, show = 0)
|
29
|
+
return "\e[1;34m#{input}\e[0m" if show == 0
|
30
|
+
puts "\e[1;34m#{input}\e[0m"
|
31
|
+
end
|
32
|
+
|
33
|
+
def puts_blue_suave(input, show = 0)
|
34
|
+
return "\e[1;36m#{input}\e[0m" if show == 0
|
35
|
+
puts "\e[1;36m#{input}\e[0m"
|
36
|
+
end
|
37
|
+
|
38
|
+
def puts_morado(input, show = 0)
|
39
|
+
return "\e[1;35m#{input}\e[0m" if show == 0
|
40
|
+
puts "\e[1;35m#{input}\e[0m"
|
41
|
+
end
|
42
|
+
|
43
|
+
#Print text string
|
44
|
+
def print_white(input, show = 0)
|
45
|
+
return "\e[1;37m#{input}\e[0m" if show == 0
|
46
|
+
print "\e[1;37m#{input}\e[0m"
|
47
|
+
end
|
48
|
+
|
49
|
+
def print_red(input, show = 0)
|
50
|
+
return "\033[38;5;196m#{input}\e[0m" if show == 0
|
51
|
+
print "\033[38;5;196m#{input}\e[0m"
|
52
|
+
end
|
53
|
+
|
54
|
+
def print_green(input, show = 0)
|
55
|
+
return "\033[38;5;46m#{input}\e[0m" if show == 0
|
56
|
+
print "\033[38;5;46m#{input}\e[0m"
|
57
|
+
end
|
58
|
+
|
59
|
+
def print_yellow(input, show = 0)
|
60
|
+
return "\e[1;33m#{input}\e[0m" if show == 0
|
61
|
+
print "\e[1;33m#{input}\e[0m"
|
62
|
+
end
|
63
|
+
|
64
|
+
def print_blue(input, show = 0)
|
65
|
+
return "\e[1;34m#{input}\e[0m" if show == 0
|
66
|
+
print "\e[1;34m#{input}\e[0m"
|
67
|
+
end
|
68
|
+
|
69
|
+
def print_blue_suave(input, show = 0)
|
70
|
+
return "\e[1;36m#{input}\e[0m" if show == 0
|
71
|
+
print "\e[1;36m#{input}\e[0m"
|
72
|
+
end
|
73
|
+
|
74
|
+
def print_morado(input, show = 0)
|
75
|
+
return "\e[1;35m#{input}\e[0m" if show == 0
|
76
|
+
print "\e[1;35m#{input}\e[0m"
|
77
|
+
end
|
78
|
+
|
79
|
+
def br_colorize(input)
|
80
|
+
for i in input.chars
|
81
|
+
if i == "░"
|
82
|
+
i = "\033[38;5;196m#{i}\e[0m"
|
83
|
+
elsif i == "▒"
|
84
|
+
i = "\033[38;5;124m#{i}\e[0m"
|
85
|
+
elsif i == "▓"
|
86
|
+
i = "\033[38;5;124m#{i}\e[0m"
|
87
|
+
else
|
88
|
+
i = "\033[38;5;236m#{i}\e[0m"
|
89
|
+
end
|
90
|
+
print i
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
#Define animations
|
95
|
+
def puts_spin(input)
|
96
|
+
spin = %w[\\ | / -]
|
97
|
+
count = 0
|
98
|
+
while true
|
99
|
+
if count <= 40
|
100
|
+
spin.each {|line|
|
101
|
+
print " #{input} [#{line}]\r"
|
102
|
+
sleep(0.13)
|
103
|
+
count += 1
|
104
|
+
}
|
105
|
+
break if count >= 39
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
require 'thread'
|
3
|
+
require_relative "#{File.join(File.dirname(__FILE__), 'String', 'string')}"
|
4
|
+
animation = Thread.new do
|
5
|
+
String.new.puts_spin "Setting WibrFake"
|
6
|
+
end
|
7
|
+
|
8
|
+
FileUtils.mkdir_p(File.expand_path("~/.local/share/icons/"))
|
9
|
+
FileUtils.mkdir_p(File.expand_path("~/.local/share/mime/packages/"))
|
10
|
+
FileUtils.mkdir_p(File.expand_path("~/.local/share/mime/application"))
|
11
|
+
FileUtils.cp_r("#{File.join(File.dirname(__FILE__), '..', '..', 'config', 'icons', 'hicolor')}", File.expand_path("~/.local/share/icons/"))
|
12
|
+
FileUtils.cp("#{File.join(File.dirname(__FILE__), '..', '..', 'config', 'icons', 'application-x-wkdump.xml')}", File.expand_path("~/.local/share/mime/packages/"))
|
13
|
+
FileUtils.cp("#{File.join(File.dirname(__FILE__), '..', '..', 'config', 'icons', 'wkdump.desktop')}", File.expand_path("~/.local/share/applications/"))
|
14
|
+
deskdb = Open3.capture3("update-desktop-database #{File.expand_path("~/.local/share/applications")}")
|
15
|
+
mimedb = Open3.capture3("update-mime-database #{File.expand_path("~/.local/share/mime")}")
|
16
|
+
mimedb = Open3.capture3("gtk-update-icon-cache -f #{File.expand_path("~/.local/share/icons/hicolor/")}")
|
17
|
+
|
18
|
+
animation.join
|
19
|
+
puts "configuration terminated, execute \"wibrfake --help\" for more information"
|
20
|
+
begin
|
21
|
+
FileUtils.rm(File.join(File.dirname(__FILE__), 'config.rb'))
|
22
|
+
FileUtils.touch(File.join(File.dirname(__FILE__), 'config.rb'))
|
23
|
+
rescue Errno::EACCES
|
24
|
+
end
|
@@ -0,0 +1,107 @@
|
|
1
|
+
module WibrFake
|
2
|
+
class Help
|
3
|
+
def self.help
|
4
|
+
puts "\n" + "=" * 70
|
5
|
+
puts " " * 20 + "COMMAND REFERENCE"
|
6
|
+
puts "=" * 70
|
7
|
+
puts "\n"
|
8
|
+
|
9
|
+
basic_commands = {
|
10
|
+
" help" => "Display this help panel",
|
11
|
+
" set" => "Configure access point parameters",
|
12
|
+
" clear" => "Clear the terminal screen",
|
13
|
+
" exit" => "Exit the program",
|
14
|
+
" banner" => "Redisplay the banner"
|
15
|
+
}
|
16
|
+
|
17
|
+
show_commands = {
|
18
|
+
" options" => "Show current configuration options and their status",
|
19
|
+
" process" => "List running processes",
|
20
|
+
" login" => "View available login templates"
|
21
|
+
}
|
22
|
+
|
23
|
+
session_commands = {
|
24
|
+
" list" => "List all sessions",
|
25
|
+
" new" => "Create new session",
|
26
|
+
" rename" => "Rename existing session",
|
27
|
+
" remove" => "Delete session",
|
28
|
+
" save" => "Save current session",
|
29
|
+
" activate" => "Mark session as persistent",
|
30
|
+
" init" => "Load saved session"
|
31
|
+
}
|
32
|
+
|
33
|
+
monitor_commands = {
|
34
|
+
" on" => "Enable monitor mode",
|
35
|
+
" off" => "Disable monitor mode",
|
36
|
+
" status" => "Check monitor status"
|
37
|
+
}
|
38
|
+
|
39
|
+
client_commands = {
|
40
|
+
" connected" => "Show connected devices",
|
41
|
+
" disconnected" => "List disconnected devices",
|
42
|
+
" logs" => "View connection history"
|
43
|
+
}
|
44
|
+
|
45
|
+
mac_commands = {
|
46
|
+
" show" => "Display current MAC address",
|
47
|
+
" set [MAC]" => "Set custom MAC address",
|
48
|
+
" ramset" => "Generate random MAC address",
|
49
|
+
" └ [OUI]" => "Use specific OUI prefix",
|
50
|
+
" list" => "Browse valid OUI prefixes",
|
51
|
+
" reset" => "Restore original MAC address"
|
52
|
+
}
|
53
|
+
|
54
|
+
apfake_commands = {
|
55
|
+
" show" => "View AP configuration",
|
56
|
+
" on" => "Enable rogue AP mode",
|
57
|
+
" off" => "Disable rogue AP mode"
|
58
|
+
}
|
59
|
+
|
60
|
+
clients_commands = {
|
61
|
+
" connected" => "list of currently connected clients",
|
62
|
+
" disconnected" => "recently disconnected clients",
|
63
|
+
" logs" => "full interaction history with access point"
|
64
|
+
}
|
65
|
+
|
66
|
+
webserver_commands = {
|
67
|
+
" show" => "Display server settings",
|
68
|
+
" on" => "Start web server",
|
69
|
+
" off" => "Stop web server",
|
70
|
+
" status" => "Check server status"
|
71
|
+
}
|
72
|
+
|
73
|
+
# Formatting
|
74
|
+
puts "Basic Commands".ljust(30) + "Description"
|
75
|
+
puts "-" * 70
|
76
|
+
basic_commands.each { |cmd, desc| puts "#{cmd.ljust(30)} - #{desc}" }
|
77
|
+
|
78
|
+
puts "\n" + "-" * 70
|
79
|
+
puts "show [option]"
|
80
|
+
show_commands.each { |cmd, desc| puts "#{cmd.ljust(30)} - #{desc}" }
|
81
|
+
|
82
|
+
puts "\n" + "=" * 70
|
83
|
+
puts "\nCore Commands:"
|
84
|
+
puts "-" * 70
|
85
|
+
puts "monitor [option]"
|
86
|
+
monitor_commands.each { |cmd, desc| puts "#{cmd.ljust(30)} - #{desc}" }
|
87
|
+
|
88
|
+
puts "\n" + "-" * 70
|
89
|
+
puts "apfake [option]"
|
90
|
+
apfake_commands.each { |cmd, desc| puts "#{cmd.ljust(30)} - #{desc}" }
|
91
|
+
|
92
|
+
puts "\n" + "-" * 70
|
93
|
+
puts "clients [option]"
|
94
|
+
clients_commands.each { |cmd, desc| puts "#{cmd.ljust(30)} - #{desc}" }
|
95
|
+
|
96
|
+
puts "\n" + "-" * 70
|
97
|
+
puts "web_server [option]"
|
98
|
+
webserver_commands.each { |cmd, desc| puts "#{cmd.ljust(30)} - #{desc}" }
|
99
|
+
|
100
|
+
puts "\n" + "-" * 70
|
101
|
+
puts "mac [option]"
|
102
|
+
mac_commands.each { |cmd, desc| puts "#{cmd.ljust(30)} - #{desc}" }
|
103
|
+
|
104
|
+
puts "\n" + "=" * 70
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
require_relative 'version'
|
2
|
+
module WibrFake
|
3
|
+
class ParseOPT
|
4
|
+
def initialize(options)
|
5
|
+
begin
|
6
|
+
require_relative 'Listing/wireless'
|
7
|
+
require_relative 'wibrfake_cli'
|
8
|
+
rescue LoadError => e
|
9
|
+
puts e.message
|
10
|
+
exit 1
|
11
|
+
ensure
|
12
|
+
wibrfake_cli = WibrFake::CLI.new
|
13
|
+
end
|
14
|
+
begin
|
15
|
+
OptionParser.new do|param|
|
16
|
+
param.banner = "Usage: wibrfake --mode [MODE] --iface [INTERFACE]"
|
17
|
+
param.separator ''
|
18
|
+
param.on('-m', '--mode MODE', String, 'mode to init program in gui or cli'){|mode|options.mode=mode}
|
19
|
+
param.on('-i', '--iface INTERFACE', String, 'Assign to Network Interface to operate'){|iface|options.iface=iface}
|
20
|
+
param.on('-w', '--wkdump FILE', String, 'Map to wibrfake dump file'){|wkdump|options.file_wkdump=wkdump}
|
21
|
+
param.on('-l', '--list-interfaces', 'List the types of Wi-Fi network interfaces available'){WibrFake::Listing.wireless; exit 0}
|
22
|
+
param.on('-s', '--sessions', 'List the sessions actived'){
|
23
|
+
sessions = Array.new
|
24
|
+
Dir.each_child(File.join(File.dirname(__FILE__), 'Tmp')){|directory|
|
25
|
+
if(Dir.exist?(File.join(File.dirname(__FILE__), 'Tmp', directory)))
|
26
|
+
sessions << directory
|
27
|
+
end
|
28
|
+
}
|
29
|
+
if(sessions.empty?)
|
30
|
+
puts "Ninguna sesion de wibrfake esta activa"
|
31
|
+
else
|
32
|
+
puts "Sesiones activas:\n"
|
33
|
+
sessions.each_with_index{|session, index|
|
34
|
+
puts "\t#{index+1}: #{session}"
|
35
|
+
}
|
36
|
+
end
|
37
|
+
}
|
38
|
+
param.separator ''
|
39
|
+
param.on_tail('-u', '--usage', 'Launch usage server for wibrfake'){options.usage_server=true}
|
40
|
+
param.on_tail('-h', '--help', 'command to view help parameters'){puts param; exit}
|
41
|
+
param.on_tail('-V', '--version', 'show version'){puts "WibrFake version #{WibrFake.version}"; exit}
|
42
|
+
end.parse!
|
43
|
+
rescue OptionParser::MissingArgument => missing
|
44
|
+
puts missing.message
|
45
|
+
exit 1
|
46
|
+
end
|
47
|
+
|
48
|
+
#Validate Interface
|
49
|
+
#Enter wibrfake mode
|
50
|
+
if(Process.uid==0)
|
51
|
+
if(!options.mode.nil?)
|
52
|
+
if options.mode == 'cli'
|
53
|
+
wibrfake_cli.start(options)
|
54
|
+
elsif options.mode == 'gui'
|
55
|
+
WibrFake::GUI.start(options)
|
56
|
+
else
|
57
|
+
abort "\e[31m[\e[37m✘\e[31m]\e[37m Invalid mode"
|
58
|
+
end
|
59
|
+
elsif (!options.usage_server.nil?)
|
60
|
+
wibrfake_cli.start(options)
|
61
|
+
end
|
62
|
+
else
|
63
|
+
puts "\033[38;5;196m[\e[1;37m✘\033[38;5;196m]\e[1;37m Access Denied"
|
64
|
+
puts "\033[38;5;196m[\e[1;37m✘\033[38;5;196m]\e[1;37m root privileges needed (Process UID 0)"
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
data/lib/wibrfake/run.rb
ADDED
@@ -0,0 +1,110 @@
|
|
1
|
+
module WibrFake
|
2
|
+
class Apld
|
3
|
+
def initialize(iface, ipaddr, id)
|
4
|
+
begin
|
5
|
+
require 'pty'
|
6
|
+
require 'packetfu'
|
7
|
+
require 'concurrent'
|
8
|
+
require 'thread'
|
9
|
+
require_relative '../NetworkInterface/ip-routing'
|
10
|
+
require_relative '../Dnsmasq/dnsmasq'
|
11
|
+
require_relative '../Process/pkill'
|
12
|
+
rescue LoadError => e
|
13
|
+
puts "Error al incluir librerías: #{e.message}"
|
14
|
+
exit(1)
|
15
|
+
end
|
16
|
+
@iface = iface
|
17
|
+
@ipaddr = ipaddr
|
18
|
+
@id = id
|
19
|
+
server = WibrFake::Dnsmasq.new(ipaddr, id, iface)
|
20
|
+
#WibrFake::Processes.status_proc("wpa_supplicant").each{|pid|
|
21
|
+
# WibrFake::Processes.set("wpa_supplicant", pid)
|
22
|
+
# WibrFake::Pkill.kill_silence("wpa_supplicant")
|
23
|
+
#}
|
24
|
+
|
25
|
+
#Run dnsmasq with PTY spawn
|
26
|
+
begin
|
27
|
+
raise Errno::EADDRINUSE if WibrFake::Processes.status_all.join.include?('dns') or WibrFake::Processes.status_all.join.include?('dhcp') or WibrFake::Processes.status_all.join.include?('hostapd')
|
28
|
+
|
29
|
+
#Initiating IPRouting
|
30
|
+
WibrFake::IPRouting.new(ipaddr, iface).set
|
31
|
+
|
32
|
+
pid_hostapd = fork {
|
33
|
+
$0 = 'wibrfake_hostapd'
|
34
|
+
hostapd
|
35
|
+
}
|
36
|
+
pid_dns_server = fork {
|
37
|
+
$0 = 'wibrfake_dns'
|
38
|
+
server.dns
|
39
|
+
}
|
40
|
+
pid_dhcp_server = fork {
|
41
|
+
$0 = 'wibrfake_dhcp'
|
42
|
+
server.dhcp
|
43
|
+
}
|
44
|
+
rescue Errno::EADDRINUSE
|
45
|
+
warn "An access point is running. View active processes with 'show process' and terminate the involved ones (dns, dhcp, hostapd) using 'pkill [PROCESS]'."
|
46
|
+
return 0
|
47
|
+
end
|
48
|
+
|
49
|
+
#Set PID for process
|
50
|
+
WibrFake::Processes.set("dns", String(pid_dns_server.to_i))
|
51
|
+
WibrFake::Processes.set("dhcp", String(pid_dhcp_server.to_i))
|
52
|
+
WibrFake::Processes.status_proc("hostapd").each{|pid|
|
53
|
+
WibrFake::Processes.set("hostapd", pid)
|
54
|
+
}
|
55
|
+
|
56
|
+
end
|
57
|
+
|
58
|
+
def hostapd
|
59
|
+
begin
|
60
|
+
status = 0
|
61
|
+
PTY.spawn("hostapd #{File.join(File.dirname(__FILE__), '..', 'Tmp', @id, 'hostapd', 'hostapd.conf')}") do |r, w, pid|
|
62
|
+
r.each_line { |line|
|
63
|
+
if line =~ /ENABLE/
|
64
|
+
if(status==1)
|
65
|
+
puts "\n\r\033[38;5;46m[\e[1;37m+\033[38;5;46m]\e[1;37m Point access established"
|
66
|
+
puts "\n"
|
67
|
+
print "\r\033[38;5;236m\e[0m\033[48;5;236m \033[38;5;196mwibrfake #{@iface} \e[0m\033[38;5;236m\e[0m "
|
68
|
+
end
|
69
|
+
status += 1
|
70
|
+
elsif line =~ /DISABLED/
|
71
|
+
warn "\n\r\e[1;33m[\e[1;37m!\e[1;33m]\e[1;37m Fake access point was not launched correctly"
|
72
|
+
puts "\n"
|
73
|
+
print "\r\033[38;5;236m\e[0m\033[48;5;236m \033[38;5;196mwibrfake #{@iface} \e[0m\033[38;5;236m\e[0m "
|
74
|
+
break
|
75
|
+
elsif line =~ /DISCONNECTED/
|
76
|
+
File.open(File.join(File.dirname(__FILE__), '..', 'Tmp', @id, 'clients', 'clients_connected.log'), 'r+') do |file|
|
77
|
+
lines = file.readlines
|
78
|
+
target = line.split.last
|
79
|
+
lines.each{|client|
|
80
|
+
if client.include?(target)
|
81
|
+
File.open(File.join(File.dirname(__FILE__), '..', 'Tmp', @id, 'clients', 'clients.log'), 'a'){|log|
|
82
|
+
log.write "#{Time.now}, Hostname: #{client.split(', ')[0]}, IP: #{client.split(', ')[1]}, Mac: #{client.split(', ')[2].chomp}, disconnect\n"
|
83
|
+
}
|
84
|
+
File.open(File.join(File.dirname(__FILE__), '..', 'Tmp', @id, 'clients', 'clients_disconnected.log'), 'a'){|log|
|
85
|
+
log.write "#{client.split(', ')[0]}, #{client.split(', ')[1]}, #{client.split(', ')[2].chomp}\n"
|
86
|
+
}
|
87
|
+
warn "\n\n\r\033[38;5;196m[\e[1;37m✘\033[38;5;196m]\e[1;37m" + ' ' + "Dispositive: \033[38;5;51m#{client.split(', ')[0]}\e[1;37m | " + "IP: \033[38;5;118m#{client.split(', ')[1]}\e[1;37m | " + "MAC: \033[38;5;214m#{client.split(', ')[2].chomp}\e[1;37m" + ' ' + "disconnected"
|
88
|
+
puts "\n"
|
89
|
+
print "\r\033[38;5;236m\e[0m\033[48;5;236m \033[38;5;196mwibrfake #{@iface} \e[0m\033[38;5;236m\e[0m "
|
90
|
+
lines.reject! { |linefile| linefile.include?(target) }
|
91
|
+
end
|
92
|
+
file.rewind
|
93
|
+
file.write(lines.join)
|
94
|
+
file.truncate(file.pos)
|
95
|
+
}
|
96
|
+
end
|
97
|
+
|
98
|
+
elsif(line=~/already configured/)
|
99
|
+
warn "\n\r\e[1;33m[\e[1;37m!\e[1;33m]\e[1;37m hostapd process is already being used. Kill the process with the `pkill hostapd` command"
|
100
|
+
puts "\n"
|
101
|
+
print "\r\033[38;5;236m\e[0m\033[48;5;236m \033[38;5;196mwibrfake #{@iface} \e[0m\033[38;5;236m\e[0m "
|
102
|
+
break
|
103
|
+
end
|
104
|
+
}
|
105
|
+
rescue
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module TTY
|
4
|
+
class Prompt
|
5
|
+
class AnswersCollector
|
6
|
+
# Initialize answer collector
|
7
|
+
#
|
8
|
+
# @api public
|
9
|
+
def initialize(prompt, **options)
|
10
|
+
@prompt = prompt
|
11
|
+
@answers = options.fetch(:answers) { {} }
|
12
|
+
end
|
13
|
+
|
14
|
+
# Start gathering answers
|
15
|
+
#
|
16
|
+
# @return [Hash]
|
17
|
+
# the collection of all answers
|
18
|
+
#
|
19
|
+
# @api public
|
20
|
+
def call(&block)
|
21
|
+
instance_eval(&block)
|
22
|
+
@answers
|
23
|
+
end
|
24
|
+
|
25
|
+
# Create answer entry
|
26
|
+
#
|
27
|
+
# @example
|
28
|
+
# key(:name).ask("Name?")
|
29
|
+
#
|
30
|
+
# @api public
|
31
|
+
def key(name, &block)
|
32
|
+
@name = name
|
33
|
+
if block
|
34
|
+
answer = create_collector.call(&block)
|
35
|
+
add_answer(answer)
|
36
|
+
end
|
37
|
+
self
|
38
|
+
end
|
39
|
+
|
40
|
+
# Change to collect all values for a key
|
41
|
+
#
|
42
|
+
# @example
|
43
|
+
# key(:colors).values.ask("Color?")
|
44
|
+
#
|
45
|
+
# @api public
|
46
|
+
def values(&block)
|
47
|
+
@answers[@name] = Array(@answers[@name])
|
48
|
+
if block
|
49
|
+
answer = create_collector.call(&block)
|
50
|
+
add_answer(answer)
|
51
|
+
end
|
52
|
+
self
|
53
|
+
end
|
54
|
+
|
55
|
+
# @api public
|
56
|
+
def create_collector
|
57
|
+
self.class.new(@prompt)
|
58
|
+
end
|
59
|
+
|
60
|
+
# @api public
|
61
|
+
def add_answer(answer)
|
62
|
+
if @answers[@name].is_a?(Array)
|
63
|
+
@answers[@name] << answer
|
64
|
+
else
|
65
|
+
@answers[@name] = answer
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
private
|
70
|
+
|
71
|
+
# @api private
|
72
|
+
def method_missing(method, *args, **options, &block)
|
73
|
+
answer = @prompt.public_send(method, *args, **options, &block)
|
74
|
+
add_answer(answer)
|
75
|
+
end
|
76
|
+
end # AnswersCollector
|
77
|
+
end # Prompt
|
78
|
+
end # TTY
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "paginator"
|
4
|
+
|
5
|
+
module TTY
|
6
|
+
class Prompt
|
7
|
+
class BlockPaginator < Paginator
|
8
|
+
# Paginate list of choices based on current active choice.
|
9
|
+
# Move entire pages.
|
10
|
+
#
|
11
|
+
# @api public
|
12
|
+
def paginate(list, active, per_page = nil, &block)
|
13
|
+
default_size = (list.size <= DEFAULT_PAGE_SIZE ? list.size : DEFAULT_PAGE_SIZE)
|
14
|
+
@per_page = @per_page || per_page || default_size
|
15
|
+
|
16
|
+
check_page_size!
|
17
|
+
|
18
|
+
# Don't paginate short lists
|
19
|
+
if list.size <= @per_page
|
20
|
+
@start_index = 0
|
21
|
+
@end_index = list.size - 1
|
22
|
+
if block
|
23
|
+
return list.each_with_index(&block)
|
24
|
+
else
|
25
|
+
return list.each_with_index.to_enum
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
unless active.nil? # User may input index out of range
|
30
|
+
@last_index = active
|
31
|
+
end
|
32
|
+
page = (@last_index / @per_page.to_f).ceil
|
33
|
+
pages = (list.size / @per_page.to_f).ceil
|
34
|
+
if page == 0
|
35
|
+
@start_index = 0
|
36
|
+
@end_index = @start_index + @per_page - 1
|
37
|
+
elsif page > 0 && page < pages
|
38
|
+
@start_index = (page - 1) * @per_page
|
39
|
+
@end_index = @start_index + @per_page - 1
|
40
|
+
elsif page == pages
|
41
|
+
@start_index = (page - 1) * @per_page
|
42
|
+
@end_index = list.size - 1
|
43
|
+
else
|
44
|
+
@end_index = list.size - 1
|
45
|
+
@start_index = @end_index - @per_page + 1
|
46
|
+
end
|
47
|
+
|
48
|
+
sliced_list = list[@start_index..@end_index]
|
49
|
+
page_range = (@start_index..@end_index)
|
50
|
+
|
51
|
+
return sliced_list.zip(page_range).to_enum unless block_given?
|
52
|
+
|
53
|
+
sliced_list.each_with_index do |item, index|
|
54
|
+
block[item, @start_index + index]
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end # EnumPaginator
|
58
|
+
end # Prompt
|
59
|
+
end # TTY
|