app/views/attacks/_form.html.erb
<%= simple_form_for [@campaign, @attack] do |f| %>
<%= render Railsboot::ErrorsComponent.new(@attack) %>
<%= f.input :name, hint: "A name for the attack. This will be displayed in the attack list and the activity feed." %>
<%= f.input :description, hint: "A brief description of the attack. This will be displayed in the attack details." %>
<%= f.input :attack_mode, as: :hidden %>
<%= case @attack.attack_mode
when "dictionary"
render "dictionary_form", form: f, attack: @attack
when "mask"
render "mask_form", form: f, attack: @attack
when "hybrid_dictionary"
render "hybrid_form", form: f, attack: @attack
when "hybrid_mask"
render "hybrid_form", form: f, attack: @attack
else
"Well, this is embarrassing. We don't know how to handle this attack mode."
end %>
<%= field_set_tag "Advanced Optimization", id: "optimization_attack_set" do %>
<small class="form-text text-muted">
These settings are for advanced users. They can help you optimize the attack for your specific needs.
They have been pre-configured to provide optimal performance for most attacks on dedicated hardware.
</small>
<%= f.input :optimized, hint: "Enable optimized kernels (limits password length)" %>
<%= f.input :slow_candidate_generators, hint: "Enable slower (but advanced) candidate generators" %>
<%= f.input :workload_profile, collection: 1..4, as: :range, input_html: {
min: 1,
max: 4,
step: 1
}, hint: "Determine level of resource and power consumption for attack" %>
<% end %>
<div class="row mb-0">
<div class="col-sm-9 offset-sm-3">
<%= f.button :submit, class: "btn-primary" %>
<%= render Railsboot::ButtonComponent.new(tag: "a", href: @campaign, variant: "danger", text: "Cancel") %>
</div>
</div>
<% end %>