went ahead and filled in XSS

This commit is contained in:
Ken Johnson
2013-04-25 13:40:50 -04:00
parent 726526eabf
commit db19e5d990
3 changed files with 20 additions and 4 deletions
+10
View File
@@ -10,9 +10,19 @@ class TutorialsController < ApplicationController
end end
def injection def injection
end end
def xss def xss
@code = %{
<li style="color: #FFFFFF">
<!--
I'm going to use HTML safe because we had some weird stuff
going on with funny chars and jquery, plus it says safe so I'm guessing
nothing bad will happen
-->
Welcome, <%= current_user.first_name.html_safe %>
</li>}
end end
def broken_auth def broken_auth
+1 -1
View File
@@ -3,7 +3,7 @@
<li id="tutorials_home"> <li id="tutorials_home">
<%= link_to tutorials_path, :html => {:method => "get"} do %> <%= link_to tutorials_path, :html => {:method => "get"} do %>
<div class="icon"> <div class="icon">
<span class="fs1" aria-hidden="true" data-icon="&#xe094;"></span> <span class="fs1" aria-hidden="true" data-icon="&#xe001;"></span>
</div> </div>
Tutorial Home Tutorial Home
<% end %> <% end %>
+9 -3
View File
@@ -20,7 +20,7 @@
</div> </div>
<div class="accordion-body in collapse" id="collapseOne" style="height: auto;"> <div class="accordion-body in collapse" id="collapseOne" style="height: auto;">
<div class="accordion-inner"> <div class="accordion-inner">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor XSS flaws occur whenever an application takes untrusted data and sends it to a web browser without proper validation and escaping. XSS allows attackers to execute scripts in the victims browser which can hijack user sessions, deface web sites, or redirect the user to malicious sites.
</div> </div>
</div> </div>
</div> </div>
@@ -34,7 +34,10 @@
</div> </div>
<div class="accordion-body collapse" id="collapseTwo" style="height: 0px;"> <div class="accordion-body collapse" id="collapseTwo" style="height: 0px;">
<div class="accordion-inner"> <div class="accordion-inner">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor <p><b>Stored Cross-Site Scripting - The following code was taken from app/views/layouts/shared/_header.html.erb</b></p>
<font face="Courier New" style="color: rgb(69, 126, 136)">
<p><%= @code %></p>
</font>
</div> </div>
</div> </div>
</div> </div>
@@ -48,7 +51,10 @@
</div> </div>
<div class="accordion-body collapse" id="collapseThree" style="height: 0px;"> <div class="accordion-body collapse" id="collapseThree" style="height: 0px;">
<div class="accordion-inner"> <div class="accordion-inner">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor <p><b> Stored Cross-Site Scripting ATTACK:</b></p>
<p> When registering, enter your JavaScript tag such as <%= %{<script>alert("ohai")} %> in the First Name field. Upon login the header navigation bar will echo "Welcome" + your JS code. You can have your XSS code point the victim to a <%= link_to "BeEF server", "http://beefproject.com", {:style => "color: rgb(69, 126, 136)" } %> and have some fun as well.
</p>
</div> </div>
</div> </div>
</div> </div>