Roundtrip for challenge 2 done

This commit is contained in:
Nanne Baars 2017-04-08 11:08:33 +02:00
parent 931da87c2b
commit fd2bdce270
3 changed files with 66 additions and 58 deletions

View File

@ -22,8 +22,8 @@ public class Challenge2 extends AssignmentEndpoint {
@RequestMapping(method = RequestMethod.POST) @RequestMapping(method = RequestMethod.POST)
public public
@ResponseBody @ResponseBody
AttackResult completed(@RequestParam String couponCode) throws IOException { AttackResult completed(@RequestParam String checkoutCode) throws IOException {
if (SUPER_COUPON_CODE.equals(couponCode)) { if (SUPER_COUPON_CODE.equals(checkoutCode)) {
return success().feedback("challenge.solved").feedbackArgs(Flag.FLAGS.get(2)).build(); return success().feedback("challenge.solved").feedbackArgs(Flag.FLAGS.get(2)).build();
} }
return failed().build(); return failed().build();

View File

@ -61,74 +61,82 @@
<script th:src="@{/lesson_js/challenge2.js}" language="JavaScript"></script> <script th:src="@{/lesson_js/challenge2.js}" language="JavaScript"></script>
<div class="attack-container"> <div class="attack-container">
<div class="assignment-success"><i class="fa fa-2 fa-check hidden" aria-hidden="true"></i></div> <div class="assignment-success"><i class="fa fa-2 fa-check hidden" aria-hidden="true"></i></div>
<div class="container"> <form class="attack-form" accept-charset="UNKNOWN"
<div class="row"> method="POST" name="form"
<div class="col-xs-3 item-photo"> action="/WebGoat/challenge/2"
<img style="max-width:100%;" th:src="@{/images/samsung-black.jpg}"/> enctype="application/json;charset=UTF-8">
</div> <div class="container">
<div class="col-xs-5" style="border:0px solid gray">
<h3>Samsung Galaxy S8 Plus Android Phone</h3>
<h5 style="color:#337ab7"><a href="http://www.samsung.com">Samsung</a> ·
<small style="color:#337ab7">(124421 reviews)</small>
</h5>
<h6 class="title-price"> <div class="row">
<small>PRICE</small> <div class="col-xs-3 item-photo">
</h6> <img style="max-width:100%;" th:src="@{/images/samsung-black.jpg}"/>
<h3 style="margin-top:0px;"><span>US $</span><span id="price">899</span></h3> </div>
<div class="col-xs-5" style="border:0px solid gray">
<h3>Samsung Galaxy S8 Plus Android Phone</h3>
<h5 style="color:#337ab7"><a href="http://www.samsung.com">Samsung</a> ·
<small style="color:#337ab7">(124421 reviews)</small>
</h5>
<div class="section"> <h6 class="title-price">
<h6 class="title-attr" style="margin-top:15px;"> <small>PRICE</small>
<small>COLOR</small>
</h6> </h6>
<div> <h3 style="margin-top:0px;"><span>US $</span><span id="price">899</span></h3>
<div class="attr" style="width:25px;background:lightgrey;"></div>
<div class="attr" style="width:25px;background:black;"></div> <div class="section">
<h6 class="title-attr" style="margin-top:15px;">
<small>COLOR</small>
</h6>
<div>
<div class="attr" style="width:25px;background:lightgrey;"></div>
<div class="attr" style="width:25px;background:black;"></div>
</div>
</div> </div>
</div> <div class="section" style="padding-bottom:5px;">
<div class="section" style="padding-bottom:5px;"> <h6 class="title-attr">
<h6 class="title-attr"> <small>CAPACITY</small>
<small>CAPACITY</small> </h6>
</h6> <div>
<div> <div class="attr2">64 GB</div>
<div class="attr2">64 GB</div> <div class="attr2">128 GB</div>
<div class="attr2">128 GB</div> </div>
</div> </div>
</div> <div class="section" style="padding-bottom:20px;">
<div class="section" style="padding-bottom:20px;"> <h6 class="title-attr">
<h6 class="title-attr"> <small>QUANTITY</small>
<small>QUANTITY</small> </h6>
</h6> <div>
<div> <div class="btn-minus"><span class="glyphicon glyphicon-minus"></span></div>
<div class="btn-minus"><span class="glyphicon glyphicon-minus"></span></div> <input class="quantity" value="1"/>
<input class="quantity" value="1"/> <div class="btn-plus"><span class="glyphicon glyphicon-plus"></span></div>
<div class="btn-plus"><span class="glyphicon glyphicon-plus"></span></div> </div>
</div> </div>
</div>
<div class="section" style="padding-bottom:20px;"> <div class="section" style="padding-bottom:20px;">
<h6 class="title-attr"> <h6 class="title-attr">
<small>CHECKOUT CODE</small> <small>CHECKOUT CODE</small>
</h6> </h6>
<!-- <!--
Checkout code: pre-order-webgoat, pre-order-owasp, pre-order-webgoat-owasp Checkout code: pre-order-webgoat, pre-order-owasp, pre-order-webgoat-owasp
--> -->
<input class="checkoutCode" value=""/> <input name="checkoutCode" class="checkoutCode" value=""/>
</div> </div>
<div class="section" style="padding-bottom:20px;"> <div class="section" style="padding-bottom:20px;">
<button class="btn btn-success"><span style="margin-right:20px" <button type="submit" class="btn btn-success"><span style="margin-right:20px"
class="glyphicon glyphicon-shopping-cart" class="glyphicon glyphicon-shopping-cart"
aria-hidden="true"></span>Buy aria-hidden="true"></span>Buy
</button> </button>
<h6><a href="#"><span class="glyphicon glyphicon-heart-empty" style="cursor:pointer;"></span> <h6><a href="#"><span class="glyphicon glyphicon-heart-empty"
Like</a></h6> style="cursor:pointer;"></span>
Like</a></h6>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </form>
<br/> <br/>
<div> <div>
<form class="form-inline" method="POST" name="form" action="/WebGoat/challenge/flag"> <form class="form-inline" method="POST" name="form" action="/WebGoat/challenge/flag">

View File

@ -1 +1 @@
=== No need to pay... (WIP!!) === No need to pay...