warding 0.1.0 → 0.2.4
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 +4 -4
- data/.rubocop.yml +155 -0
- data/Gemfile +3 -3
- data/README.md +14 -4
- data/Rakefile +1 -1
- data/bin/warding +1 -1
- data/lib/warding.rb +146 -118
- data/lib/warding/version.rb +1 -1
- data/warding.gemspec +16 -14
- metadata +19 -6
- data/bin/console +0 -8
- data/bin/setup +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c6e2a5ecc183e76cc17c2a4c16379223a2196b8ac65058318d8807629d0596f
|
4
|
+
data.tar.gz: d76f2e4d69c808200b9381b77ebe3e4d3f55c50952d3eb717085af8d916b0e5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b60126b88ec985713877eea1403449cce055c54ee958daf2a38b1a7a9bf77b4453373267262e2e41fc2b923d362a7e6a846181c8b53d2c7ece343b4566dd369
|
7
|
+
data.tar.gz: 16f7123ff0d1dec8da58a4e7b6cff307d5a25185fa677493f1721647cf0ff370f8e6fec33cd8c1f8c5ce0707a2bceac018ad3c66696418d2e08eed34fa81838d
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,155 @@
|
|
1
|
+
AllCops:
|
2
|
+
TargetRubyVersion: 2.4
|
3
|
+
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
|
4
|
+
# to ignore them, so only the ones explicitly set in this file are enabled.
|
5
|
+
DisabledByDefault: true
|
6
|
+
|
7
|
+
# Prefer &&/|| over and/or.
|
8
|
+
Style/AndOr:
|
9
|
+
Enabled: true
|
10
|
+
|
11
|
+
# Align `when` with `case`.
|
12
|
+
Layout/CaseIndentation:
|
13
|
+
Enabled: true
|
14
|
+
|
15
|
+
# Align comments with method definitions.
|
16
|
+
Layout/CommentIndentation:
|
17
|
+
Enabled: true
|
18
|
+
|
19
|
+
Layout/ElseAlignment:
|
20
|
+
Enabled: true
|
21
|
+
|
22
|
+
# Align `end` with the matching keyword or starting expression except for
|
23
|
+
# assignments, where it should be aligned with the LHS.
|
24
|
+
Layout/EndAlignment:
|
25
|
+
Enabled: true
|
26
|
+
EnforcedStyleAlignWith: variable
|
27
|
+
AutoCorrect: true
|
28
|
+
|
29
|
+
Layout/EmptyLineAfterMagicComment:
|
30
|
+
Enabled: true
|
31
|
+
|
32
|
+
Layout/EmptyLinesAroundBlockBody:
|
33
|
+
Enabled: true
|
34
|
+
|
35
|
+
# In a regular class definition, no empty lines around the body.
|
36
|
+
Layout/EmptyLinesAroundClassBody:
|
37
|
+
Enabled: true
|
38
|
+
|
39
|
+
# In a regular method definition, no empty lines around the body.
|
40
|
+
Layout/EmptyLinesAroundMethodBody:
|
41
|
+
Enabled: true
|
42
|
+
|
43
|
+
# In a regular module definition, no empty lines around the body.
|
44
|
+
Layout/EmptyLinesAroundModuleBody:
|
45
|
+
Enabled: true
|
46
|
+
|
47
|
+
Layout/FirstArgumentIndentation:
|
48
|
+
Enabled: true
|
49
|
+
|
50
|
+
# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
|
51
|
+
Style/HashSyntax:
|
52
|
+
Enabled: true
|
53
|
+
|
54
|
+
# Two spaces, no tabs (for indentation).
|
55
|
+
Layout/IndentationWidth:
|
56
|
+
Enabled: true
|
57
|
+
|
58
|
+
Layout/LeadingCommentSpace:
|
59
|
+
Enabled: true
|
60
|
+
|
61
|
+
Layout/SpaceAfterColon:
|
62
|
+
Enabled: true
|
63
|
+
|
64
|
+
Layout/SpaceAfterComma:
|
65
|
+
Enabled: true
|
66
|
+
|
67
|
+
Layout/SpaceAroundEqualsInParameterDefault:
|
68
|
+
Enabled: true
|
69
|
+
|
70
|
+
Layout/SpaceAroundKeyword:
|
71
|
+
Enabled: true
|
72
|
+
|
73
|
+
Layout/SpaceAroundOperators:
|
74
|
+
Enabled: true
|
75
|
+
|
76
|
+
Layout/SpaceBeforeComma:
|
77
|
+
Enabled: true
|
78
|
+
|
79
|
+
Layout/SpaceBeforeFirstArg:
|
80
|
+
Enabled: true
|
81
|
+
|
82
|
+
Style/DefWithParentheses:
|
83
|
+
Enabled: true
|
84
|
+
|
85
|
+
# Defining a method with parameters needs parentheses.
|
86
|
+
Style/MethodDefParentheses:
|
87
|
+
Enabled: true
|
88
|
+
|
89
|
+
Style/FrozenStringLiteralComment:
|
90
|
+
Enabled: true
|
91
|
+
EnforcedStyle: always
|
92
|
+
|
93
|
+
# Use `foo {}` not `foo{}`.
|
94
|
+
Layout/SpaceBeforeBlockBraces:
|
95
|
+
Enabled: true
|
96
|
+
|
97
|
+
# Use `foo { bar }` not `foo {bar}`.
|
98
|
+
Layout/SpaceInsideBlockBraces:
|
99
|
+
Enabled: true
|
100
|
+
|
101
|
+
# Use `{ a: 1 }` not `{a:1}`.
|
102
|
+
Layout/SpaceInsideHashLiteralBraces:
|
103
|
+
Enabled: true
|
104
|
+
|
105
|
+
Layout/SpaceInsideParens:
|
106
|
+
Enabled: true
|
107
|
+
|
108
|
+
# Check quotes usage according to lint rule below.
|
109
|
+
Style/StringLiterals:
|
110
|
+
Enabled: true
|
111
|
+
EnforcedStyle: double_quotes
|
112
|
+
|
113
|
+
# Detect hard tabs, no hard tabs.
|
114
|
+
Layout/IndentationStyle:
|
115
|
+
Enabled: true
|
116
|
+
|
117
|
+
# Blank lines should not have any spaces.
|
118
|
+
Layout/TrailingEmptyLines:
|
119
|
+
Enabled: true
|
120
|
+
|
121
|
+
# No trailing whitespace.
|
122
|
+
Layout/TrailingWhitespace:
|
123
|
+
Enabled: true
|
124
|
+
|
125
|
+
# Use quotes for string literals when they are enough.
|
126
|
+
Style/RedundantPercentQ:
|
127
|
+
Enabled: true
|
128
|
+
|
129
|
+
# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
|
130
|
+
Lint/RequireParentheses:
|
131
|
+
Enabled: true
|
132
|
+
|
133
|
+
Lint/RedundantStringCoercion:
|
134
|
+
Enabled: true
|
135
|
+
|
136
|
+
Lint/UriEscapeUnescape:
|
137
|
+
Enabled: true
|
138
|
+
|
139
|
+
Style/ParenthesesAroundCondition:
|
140
|
+
Enabled: true
|
141
|
+
|
142
|
+
Style/RedundantReturn:
|
143
|
+
Enabled: true
|
144
|
+
AllowMultipleReturnValues: true
|
145
|
+
|
146
|
+
Style/Semicolon:
|
147
|
+
Enabled: true
|
148
|
+
AllowAsExpressionSeparator: true
|
149
|
+
|
150
|
+
# Prefer Foo.method over Foo::method
|
151
|
+
Style/ColonMethodCall:
|
152
|
+
Enabled: true
|
153
|
+
|
154
|
+
Style/TrivialAccessors:
|
155
|
+
Enabled: true
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
# Warding
|
1
|
+
# Warding [](https://badge.fury.io/rb/warding)
|
2
2
|
|
3
|
-
> Custom Arch Linux designed for security assessments and pentesting.
|
3
|
+
> Custom Arch Linux installer designed for security assessments and pentesting.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -12,14 +12,24 @@ gem install warding
|
|
12
12
|
|
13
13
|
## Usage
|
14
14
|
|
15
|
-
|
15
|
+
1. Download Arch Linux.
|
16
|
+
2. Boot from the live ISO.
|
17
|
+
3. Install warding (Ruby may also be required).
|
18
|
+
4. Run the binary executable `warding` and fill in the prompts.
|
19
|
+
5. Enjoy.
|
16
20
|
|
17
|
-
##
|
21
|
+
## Tasklist
|
18
22
|
|
23
|
+
* Move base packages to `pacstrap`.
|
24
|
+
* Fix steps that contain pipes.
|
25
|
+
* Add `EDITOR` setting.
|
26
|
+
* Add AUR support.
|
27
|
+
* Add `NetworkManager` support.
|
19
28
|
* Code missing features.
|
20
29
|
* Add extra checks.
|
21
30
|
* Test installation.
|
22
31
|
* Add GitHub actions.
|
32
|
+
* Publish gem/package on GitHub.
|
23
33
|
|
24
34
|
## Contributing
|
25
35
|
|
data/Rakefile
CHANGED
data/bin/warding
CHANGED
data/lib/warding.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require "warding/version"
|
4
|
+
require "tty-prompt"
|
5
5
|
|
6
6
|
module Warding
|
7
7
|
class Error < StandardError; end
|
@@ -25,12 +25,14 @@ module Warding
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def check
|
28
|
-
unless `uname -a`.include?(
|
29
|
-
@@prompt.error(
|
28
|
+
unless `uname -a`.include?("archiso")
|
29
|
+
@@prompt.error("Exiting...")
|
30
|
+
@@prompt.warn("Warding can only be installed from within the live ISO context!")
|
30
31
|
exit!
|
31
32
|
end
|
32
|
-
|
33
|
-
|
33
|
+
|
34
|
+
unless `[ -d /sys/firmware/efi ] && echo true`.include?("true")
|
35
|
+
@@prompt.error("UEFI/EFI must be enabled to install warding")
|
34
36
|
exit!
|
35
37
|
end
|
36
38
|
end
|
@@ -40,181 +42,207 @@ module Warding
|
|
40
42
|
keymaps_list = %w[us uk br en fr de zh ru it es]
|
41
43
|
|
42
44
|
parsed_input = @@prompt.collect do
|
43
|
-
key(:update_mirrors).yes?(
|
44
|
-
key(:system_language).select(
|
45
|
-
key(:keyboard_keymap).select(
|
45
|
+
key(:update_mirrors).yes?("Update mirrorlist?")
|
46
|
+
key(:system_language).select("Pick the desired system language:", locales_list)
|
47
|
+
key(:keyboard_keymap).select("Pick your keyboard layout:", keymaps_list)
|
46
48
|
|
47
|
-
unless @@prompt.yes?(
|
48
|
-
key(:update_timezone).ask(
|
49
|
+
unless @@prompt.yes?("Set timezone automatically?", default: true)
|
50
|
+
key(:update_timezone).ask("Enter timezone:", required: true)
|
49
51
|
end
|
50
52
|
|
51
|
-
key(:root_password).mask(
|
53
|
+
key(:root_password).mask("Insert new root password:", required: true)
|
52
54
|
|
53
55
|
key(:system_settings) do
|
54
|
-
bootloader = key(:bootloader).select(
|
56
|
+
bootloader = key(:bootloader).select("Which bootloader to use?", %w[systemd-boot grub])
|
55
57
|
partitions = key(:partitions).select(
|
56
|
-
|
58
|
+
"Select partition scheme to use:", ["/boot and /root", "/boot, /root and /home"]
|
57
59
|
)
|
58
60
|
|
59
|
-
key(:boot_size).slider(
|
61
|
+
key(:boot_size).slider("Boot drive partition size (MiB):", min: 512, max: 4096, default: 1024, step: 128)
|
60
62
|
|
61
|
-
if partitions ==
|
62
|
-
key(:home_size).slider(
|
63
|
+
if partitions == "/boot, /root and /home"
|
64
|
+
key(:home_size).slider("Home partition size (MiB):", min: 2048, max: 8192, default: 4096, step: 256)
|
63
65
|
end
|
64
66
|
|
65
|
-
key(:swap_size).slider(
|
67
|
+
key(:swap_size).slider("Swap partition size (MiB):", min: 1024, max: 8192, default: 2048, step: 256)
|
66
68
|
|
67
|
-
if @@prompt.yes?(
|
69
|
+
if @@prompt.yes?("Enable encryption?", default: false)
|
68
70
|
key(:encryption_settings) do
|
69
|
-
key(:encryption_mode).expand(
|
70
|
-
if partitions ==
|
71
|
-
q.choice key:
|
72
|
-
q.choice key:
|
71
|
+
key(:encryption_mode).expand("Which cryptic setup to use?") do |q|
|
72
|
+
if partitions == "/boot, /root and /home"
|
73
|
+
q.choice key: "m", name: "minimal (/home only)" do :minimal end
|
74
|
+
q.choice key: "s", name: "safe (/home, /var, /tmp and swap)", value: :safe
|
73
75
|
end
|
74
|
-
q.choice key:
|
75
|
-
q.choice key:
|
76
|
+
q.choice key: "p", name: "paranoid (full disk encryption, except /boot)", value: :paranoid
|
77
|
+
q.choice key: "i", name: "insane (full disk encryption)", value: :insane if bootloader == "grub"
|
76
78
|
end
|
77
|
-
key(:encryption_key).mask(
|
79
|
+
key(:encryption_key).mask("Insert the encryption key:", required: true)
|
78
80
|
end
|
79
81
|
end
|
80
82
|
end
|
81
83
|
|
82
|
-
key(:extra_settings).multi_select(
|
84
|
+
key(:extra_settings).multi_select("Select extra options:", %w[tools themes cron])
|
83
85
|
end
|
84
86
|
|
85
87
|
parsed_input
|
86
88
|
end
|
87
89
|
|
88
90
|
def install(data)
|
89
|
-
if @@prompt.yes?(
|
90
|
-
|
91
|
+
if @@prompt.yes?("Confirm settings and continue?")
|
92
|
+
|
93
|
+
@@prompt.say("Installing, please wait...")
|
91
94
|
|
92
|
-
|
93
|
-
`pacman -Sy reflector --noconfirm`
|
95
|
+
def setup_mirrors
|
94
96
|
`reflector --latest 25 --sort rate --save /etc/pacman.d/mirrorlist`
|
95
97
|
end
|
96
98
|
|
97
|
-
|
98
|
-
|
99
|
-
`timedatectl set-ntp true`
|
99
|
+
setup_mirrors if data[:update_mirrors]
|
100
100
|
|
101
|
-
|
102
|
-
`timedatectl set-
|
103
|
-
|
104
|
-
|
101
|
+
def setup_timezone(timezone = false)
|
102
|
+
`timedatectl set-ntp true`
|
103
|
+
if timezone
|
104
|
+
`timedatectl set-timezone #{timezone}`
|
105
|
+
else
|
106
|
+
`timedatectl set-timezone "$(curl --fail https://ipapi.co/timezone)"`
|
107
|
+
end
|
105
108
|
end
|
106
109
|
|
107
|
-
|
110
|
+
data[:update_timezone] ? setup_timezone(data[:update_timezone]) : setup_timezone
|
108
111
|
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
`pvcreate /dev/sda2`
|
118
|
-
`vgcreate vg0 /dev/sda2`
|
119
|
-
`lvcreate -L #{data[:system_settings][:swap_size]}Mib vg0 -n swap`
|
120
|
-
`lvcreate -L #{data[:system_settings[:home_size]]}Mib vg0 -n home` if data[:system_settings][:partition] == '/boot, /root and /home'
|
121
|
-
`lvcreate -l 100%FREE vg0 -n root`
|
122
|
-
|
123
|
-
`mkfs.ext4 /dev/vg0/root`
|
124
|
-
`mount /dev/vg0/root /mnt`
|
125
|
-
|
126
|
-
if data[:system_settings][:partition] == '/boot, /root and /home'
|
127
|
-
`mkfs.ext4 /dev/vg0/home`
|
128
|
-
`mount /dev/vg0/home /mnt/home`
|
112
|
+
def setup_partitions(boot_size)
|
113
|
+
`parted -s -a optimal /dev/sda \
|
114
|
+
mklabel gpt \
|
115
|
+
mkpart primary fat32 0% #{boot_size}Mib \
|
116
|
+
set 1 esp on \
|
117
|
+
mkpart primary ext4 #{boot_size}Mib 100% \
|
118
|
+
set 2 lvm on
|
119
|
+
`
|
129
120
|
end
|
130
121
|
|
131
|
-
|
132
|
-
`mkdir /mnt/boot`
|
133
|
-
|
134
|
-
`mkswap /dev/vg0/swap`
|
135
|
-
`swapon /dev/vg0/swap`
|
122
|
+
setup_partitions(data[:system_settings][:boot_size])
|
136
123
|
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
`genfstab -U /mnt >> /mnt/etc/fstab`
|
146
|
-
|
147
|
-
# setup chroot
|
124
|
+
def setup_lvm(scheme, swap_size, home_size = false)
|
125
|
+
`pvcreate /dev/sda2`
|
126
|
+
`vgcreate vg0 /dev/sda2`
|
127
|
+
`lvcreate -L #{swap_size}Mib vg0 -n swap`
|
128
|
+
if scheme == "/boot, /root and /home"
|
129
|
+
`lvcreate -L #{home_size}Mib vg0 -n home`
|
130
|
+
end
|
131
|
+
`lvcreate -l 100%FREE vg0 -n root`
|
148
132
|
|
149
|
-
|
150
|
-
|
133
|
+
`mkfs.ext4 /dev/vg0/root`
|
134
|
+
`mount /dev/vg0/root /mnt`
|
151
135
|
|
152
|
-
|
153
|
-
|
154
|
-
|
136
|
+
if scheme == "/boot, /root and /home"
|
137
|
+
`mkfs.ext4 /dev/vg0/home`
|
138
|
+
`mount /dev/vg0/home /mnt/home`
|
139
|
+
end
|
155
140
|
|
156
|
-
|
141
|
+
`mkfs.fat -F32 /dev/sda1`
|
142
|
+
`mkdir /mnt/boot`
|
143
|
+
`mount /dev/sda1 /mnt/boot`
|
157
144
|
|
158
|
-
|
145
|
+
`mkswap /dev/vg0/swap`
|
146
|
+
`swapon /dev/vg0/swap`
|
147
|
+
end
|
159
148
|
|
160
|
-
|
161
|
-
|
162
|
-
|
149
|
+
if data[:system_settings][:partition] == "/boot, /root and /home"
|
150
|
+
setup_lvm(data[:system_settings][:partition], data[:system_settings][:swap_size], data[:system_settings[:home_size]])
|
151
|
+
else
|
152
|
+
setup_lvm(data[:system_settings][:partition], data[:system_settings][:swap_size])
|
153
|
+
end
|
163
154
|
|
164
|
-
|
155
|
+
# setup encryption
|
165
156
|
|
166
|
-
|
157
|
+
def setup_packages
|
158
|
+
`pacman -Sy`
|
159
|
+
`pacstrap /mnt base base-devel linux linux-firmware lvm2 mkinitcpio man-db nano fuse wget openbsd-netcat dhcpcd samba openssh openvpn unzip vim git zsh`
|
160
|
+
`genfstab -U /mnt >> /mnt/etc/fstab`
|
161
|
+
end
|
167
162
|
|
168
|
-
|
163
|
+
setup_packages
|
169
164
|
|
170
|
-
|
165
|
+
def setup_chroot(lang, keymap, password)
|
166
|
+
`arch-chroot /mnt ln -sf /usr/share/zoneinfo/"$(curl --fail https://ipapi.co/timezone)" /etc/localtime`
|
167
|
+
`arch-chroot /mnt hwclock --systohc`
|
171
168
|
|
172
|
-
|
169
|
+
`echo "#{lang}.UTF-8" > /mnt/etc/locale.gen`
|
170
|
+
`arch-chroot /mnt locale-gen`
|
171
|
+
`echo "LANG=#{lang}.UTF-8" > /mnt/etc/locale.conf`
|
172
|
+
`echo KEYMAP=#{keymap} > /mnt/etc/vconsole.conf`
|
173
|
+
`echo "warding" > /mnt/etc/hostname`
|
174
|
+
`echo "127.0.0.1 localhost\n::1 localhost\n127.0.1.1 warding.localdomain warding" > /mnt/etc/hosts`
|
173
175
|
|
174
|
-
|
176
|
+
`arch-chroot /mnt echo -e "#{password}\n#{password}" | passwd`
|
175
177
|
|
176
|
-
|
177
|
-
`arch-chroot /mnt
|
178
|
-
`
|
179
|
-
linux /vmlinuz-linux
|
180
|
-
initrd /intel-ucode.img
|
181
|
-
initrd /initramfs-linux.img
|
182
|
-
options root=/dev/vg0/root rw" > /mnt/boot/loader/entries/warding.conf`
|
183
|
-
else
|
184
|
-
# TODO: grub
|
178
|
+
`sed -i "/^HOOK/s/filesystems/lvm2 filesystems/" /mnt/etc/mkinitcpio.conf`
|
179
|
+
`arch-chroot /mnt mkinitcpio -p linux`
|
180
|
+
`arch-chroot /mnt pacman -S intel-ucode --noconfirm`
|
185
181
|
end
|
186
182
|
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
183
|
+
setup_chroot(data[:system_language], data[:keyboard_keymap], data[:root_password])
|
184
|
+
|
185
|
+
def setup_bootloader(loader)
|
186
|
+
if loader == "systemd-boot"
|
187
|
+
`arch-chroot /mnt bootctl install`
|
188
|
+
`echo "title Warding Linux
|
189
|
+
linux /vmlinuz-linux
|
190
|
+
initrd /intel-ucode.img
|
191
|
+
initrd /initramfs-linux.img
|
192
|
+
options root=/dev/vg0/root rw" > /mnt/boot/loader/entries/warding.conf`
|
193
|
+
else
|
194
|
+
# TODO: grub
|
195
|
+
end
|
196
|
+
end
|
196
197
|
|
197
|
-
|
198
|
+
setup_bootloader(data[:system_settings][:bootloader])
|
199
|
+
|
200
|
+
def setup_usability
|
201
|
+
# TODO: include gnome desktop
|
202
|
+
`arch-chroot /mnt pacman -S xorg-server xf86-video-intel plasma konsole dolphin kmix sddm kvantum-qt5 --noconfirm`
|
203
|
+
`mkdir /mnt/etc/sddm.conf.d`
|
204
|
+
`echo "[Theme]\nCurrent=breeze" > /mnt/etc/sddm.conf.d/theme.conf`
|
205
|
+
`echo "[Autologin]\nUser=root" > /mnt/etc/sddm.conf.d/login.conf`
|
206
|
+
`arch-chroot /mnt systemctl enable dhcpcd`
|
207
|
+
`arch-chroot /mnt systemctl enable sddm`
|
208
|
+
`arch-chroot /mnt wget -q https://blackarch.org/strap.sh -O /tmp/strap.sh; bash /tmp/strap.sh`
|
209
|
+
`arch-chroot /mnt wget -q https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O /tmp/zsh.sh; bash /tmp/zsh.sh`
|
210
|
+
end
|
198
211
|
|
199
|
-
|
212
|
+
setup_usability
|
200
213
|
|
201
|
-
|
202
|
-
`arch-chroot /mnt wget -
|
203
|
-
`arch-chroot /mnt wget -
|
214
|
+
def setup_visuals
|
215
|
+
`arch-chroot /mnt wget -q https://raw.githubusercontent.com/PapirusDevelopmentTeam/arc-kde/master/install.sh -O /tmp/theme.sh; bash /tmp/theme.sh`
|
216
|
+
`arch-chroot /mnt wget -q https://git.io/papirus-icon-theme-install -O /tmp/papirus.sh; bash /tmp/papirus.sh`
|
204
217
|
end
|
205
218
|
|
206
|
-
|
219
|
+
setup_visuals if data[:extra_settings].include?("themes")
|
207
220
|
|
208
|
-
|
221
|
+
def setup_extras
|
209
222
|
`arch-chroot /mnt pacman -S nmap impacket go ruby php firefox atom hashcat john jre-openjdk proxychains-ng exploitdb httpie metasploit bind-tools radare2 sqlmap wpscan xclip --noconfirm`
|
210
223
|
`arch-chroot /mnt mkdir -p /usr/share/wordlists`
|
211
224
|
`arch-chroot /mnt wget -q https://github.com/danielmiessler/SecLists/raw/master/Passwords/Leaked-Databases/rockyou.txt.tar.gz -O /usr/share/wordlists/rockyou.txt.tar.gz`
|
212
225
|
`arch-chroot /mnt wget -q https://github.com/danielmiessler/SecLists/raw/master/Discovery/Web-Content/common.txt -O /usr/share/wordlists/common.txt`
|
213
226
|
end
|
214
227
|
|
215
|
-
|
228
|
+
setup_extras if data[:extra_settings].include?("tools")
|
229
|
+
|
230
|
+
def setup_cron
|
231
|
+
`arch-chroot /mnt pacman -S cronie --noconfirm`
|
232
|
+
`systemctl enable cronie`
|
233
|
+
`#!/bin/bash\nreflector --latest 25 --sort rate --save /etc/pacman.d/mirrorlist > /etc/cron.hourly/mirrorlist`
|
234
|
+
`#!/bin/bash\npacman -Sy > /etc/cron.weekly/pacmansync`
|
235
|
+
`#!/bin/bash\npacman -Syu --noconfirm > /etc/cron.monthly/systemupgrade`
|
236
|
+
end
|
237
|
+
|
238
|
+
setup_cron if data[:extra_settings].include?("cron")
|
239
|
+
|
240
|
+
def finish
|
241
|
+
`umount -R /mnt`
|
242
|
+
`reboot`
|
243
|
+
end
|
216
244
|
|
217
|
-
|
245
|
+
finish
|
218
246
|
end
|
219
247
|
end
|
220
248
|
end
|
data/lib/warding/version.rb
CHANGED
data/warding.gemspec
CHANGED
@@ -1,28 +1,30 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "lib/warding/version"
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
|
-
spec.name =
|
6
|
+
spec.name = "warding"
|
7
7
|
spec.version = Warding::VERSION
|
8
|
-
spec.authors = [
|
9
|
-
spec.email = [
|
8
|
+
spec.authors = ["Marlos Pomin"]
|
9
|
+
spec.email = ["marlospomin@gmail.com"]
|
10
10
|
|
11
|
-
spec.summary =
|
12
|
-
spec.description =
|
13
|
-
spec.homepage =
|
14
|
-
spec.license =
|
11
|
+
spec.summary = "Warding Linux installer."
|
12
|
+
spec.description = "Custom Arch Linux installer designed for security assessments and pentesting."
|
13
|
+
spec.homepage = "https://github.com/marlospomin/warding"
|
14
|
+
spec.license = "MIT"
|
15
15
|
|
16
|
-
spec.required_ruby_version = Gem::Requirement.new(
|
16
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
17
17
|
|
18
|
-
spec.metadata[
|
19
|
-
spec.metadata[
|
20
|
-
spec.metadata[
|
18
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
19
|
+
spec.metadata["source_code_uri"] = "https://github.com/marlospomin/warding"
|
20
|
+
spec.metadata["changelog_uri"] = "https://github.com/marlospomin/warding/releases"
|
21
21
|
|
22
22
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
23
23
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
24
24
|
end
|
25
25
|
|
26
|
-
spec.executables = [
|
27
|
-
spec.require_paths = [
|
26
|
+
spec.executables = ["warding"]
|
27
|
+
spec.require_paths = ["lib"]
|
28
|
+
|
29
|
+
spec.add_runtime_dependency "tty-prompt"
|
28
30
|
end
|
metadata
CHANGED
@@ -1,16 +1,30 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: warding
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marlos Pomin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-08-
|
12
|
-
dependencies:
|
13
|
-
|
11
|
+
date: 2020-08-17 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: tty-prompt
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
description: Custom Arch Linux installer designed for security assessments and pentesting.
|
14
28
|
email:
|
15
29
|
- marlospomin@gmail.com
|
16
30
|
executables:
|
@@ -19,13 +33,12 @@ extensions: []
|
|
19
33
|
extra_rdoc_files: []
|
20
34
|
files:
|
21
35
|
- ".gitignore"
|
36
|
+
- ".rubocop.yml"
|
22
37
|
- Gemfile
|
23
38
|
- Gemfile.lock
|
24
39
|
- LICENSE
|
25
40
|
- README.md
|
26
41
|
- Rakefile
|
27
|
-
- bin/console
|
28
|
-
- bin/setup
|
29
42
|
- bin/warding
|
30
43
|
- lib/warding.rb
|
31
44
|
- lib/warding/version.rb
|
data/bin/console
DELETED