Skip to content

Commit d72d1f0

Browse files
committed
Merge branch 'next' of https://github.com/WebGoat/WebGoat into next
2 parents 1cfbe2b + c9e6d1f commit d72d1f0

File tree

157 files changed

+750
-612
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

157 files changed

+750
-612
lines changed

newDesign/assets/css/main.css

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,16 @@ img {
7474
#header .brand {
7575
float: left;
7676
width: 240px;
77-
min-height: 80px;
78-
padding: 0 0 0 10px;
77+
height: 80px;
78+
padding: 0;
7979
position: relative;
80-
background: #e84c3d url('../img/logo.png') no-repeat 25px 26px;
80+
background: url('../img/logoBG.jpg') no-repeat 0px 0px;
8181
}
8282
#header .logo {
8383
color: #fff;
8484
font-size: 1.7em;
8585
text-transform: uppercase;
86-
padding: 23px 0 0 57px;
86+
padding: 23px 0 0 75px;
8787
display: inline-block;
8888
}
8989
#header .logo span {
@@ -696,6 +696,16 @@ fieldset[disabled] .btn-warning.active {
696696
color: #fff;
697697
border: none;
698698
}
699+
/* ==========================================================================
700+
Modal
701+
========================================================================== */
702+
.modal-footer .btn + .btn {
703+
margin-bottom: 5px;
704+
}
705+
.modal .modal-body.modal-scroll {
706+
max-height: 350px;
707+
overflow-y: auto;
708+
}
699709
/* ==========================================================================
700710
Media Queries
701711
========================================================================== */

newDesign/assets/img/logoBG.jpg

17.5 KB
Loading

newDesign/index.html

Lines changed: 99 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
<h1>Lesson Title in here</h1>
5858
</div><!--lesson title end-->
5959
<div class="user-nav pull-right">
60-
<button type="button" class="btn btn-default">
60+
<button type="button" class="btn btn-default" data-toggle="modal" data-target="#aboutModal">
6161
<i class="fa fa-info"></i>
6262
</button>
6363
<button type="button" class="btn btn-default">
@@ -72,16 +72,7 @@ <h1>Lesson Title in here</h1>
7272
<aside class="sidebar">
7373
<div id="leftside-navigation" class="nano">
7474
<ul class="nano-content">
75-
<li class="active">
76-
<a href="index.html"><i class="fa fa-home"></i><span>Home</span></a>
77-
</li>
78-
<li>
79-
<a href="about.html"><i class="fa fa-users"></i><span>About</span></a>
80-
</li>
81-
<li>
82-
<a href="contact.html"><i class="fa fa-envelope-o"></i><span>Contact</span></a>
83-
</li>
84-
<li class="sub-menu">
75+
<li class="sub-menu">
8576
<a href=""><i class="fa fa-bars"></i><span>LESSONS</span></a>
8677
</li>
8778
<li class="sub-menu">
@@ -203,9 +194,9 @@ <h1>About WebGoat</h1>
203194
<div class="panel">
204195
<div class="panel-body">
205196
<div align="left">
206-
<button type="button" class="btn btn-default">Params</button>
207-
<button type="button" class="btn btn-default">Hints</button>
208-
<button type="button" class="btn btn-default">Cookies</button>
197+
<button type="button" class="btn btn-default btn-sm">Params</button>
198+
<button type="button" class="btn btn-default btn-sm">Hints</button>
199+
<button type="button" class="btn btn-default btn-sm">Cookies</button>
209200
</div>
210201
<hr />
211202
<h3>Hints</h3>
@@ -219,6 +210,100 @@ <h3>Hints</h3>
219210
</section>
220211
<!--main content end-->
221212

213+
<!-- Basic Modal -->
214+
<div class="modal fade" id="aboutModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
215+
<div class="modal-dialog">
216+
<div class="modal-content">
217+
<div class="modal-header">
218+
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
219+
<h3 class="modal-title" id="myModalLabel">About WebGoat</h3>
220+
</div>
221+
<div class="modal-body modal-scroll">
222+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean quis posuere sapien, at ornare neque. Curabitur commodo efficitur ante, at finibus ex faucibus ut. Vivamus id diam blandit, convallis justo sed, vehicula sem. Cras a semper ex. Etiam dignissim tempus metus, sit amet blandit arcu pulvinar ac. Mauris dignissim rutrum ante sit amet posuere. Proin mollis sapien augue, at tempor metus iaculis eu. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Cras elementum finibus tincidunt.</p>
223+
<p>Version</p>
224+
<p>OWASP Reference - probably text and image</p>
225+
<div class="row">
226+
<div class="col-md-6">
227+
<p>WebGoat Authors
228+
<ul>
229+
<li>name...</li>
230+
<li>name...</li>
231+
<li>name...</li>
232+
</ul>
233+
</p>
234+
</div>
235+
<div class="col-md-6">
236+
<p>WebGoat Design Team
237+
<ul>
238+
<li>name...</li>
239+
<li>name...</li>
240+
<li>name...</li>
241+
</ul>
242+
</p>
243+
</div>
244+
</div>
245+
<div class="row">
246+
<div class="col-md-6">
247+
<p>Active Contributors
248+
<ul>
249+
<li>name... (Role)</li>
250+
<li>name... (Role)</li>
251+
<li>name... (Role)</li>
252+
<li>name... (Role)</li>
253+
<li>name... (Role)</li>
254+
<li>name... (Role)</li>
255+
<li>name... (Role)</li>
256+
<li>name... (Role)</li>
257+
<li>name... (Role)</li>
258+
<li>name... (Role)</li>
259+
<li>name... (Role)</li>
260+
<li>name... (Role)</li>
261+
<li>name... (Role)</li>
262+
</ul>
263+
</p>
264+
</div>
265+
<div class="col-md-6">
266+
<p>Past Contributors
267+
<ul>
268+
<li>name... (Role)</li>
269+
<li>name... (Role)</li>
270+
<li>name... (Role)</li>
271+
<li>name... (Role)</li>
272+
<li>name... (Role)</li>
273+
<li>name... (Role)</li>
274+
<li>name... (Role)</li>
275+
<li>name... (Role)</li>
276+
<li>name... (Role)</li>
277+
<li>name... (Role)</li>
278+
<li>name... (Role)</li>
279+
<li>name... (Role)</li>
280+
<li>name... (Role)</li>
281+
<li>name... (Role)</li>
282+
<li>name... (Role)</li>
283+
<li>name... (Role)</li>
284+
<li>name... (Role)</li>
285+
<li>name... (Role)</li>
286+
<li>name... (Role)</li>
287+
<li>name... (Role)</li>
288+
<li>name... (Role)</li>
289+
<li>name... (Role)</li>
290+
<li>name... (Role)</li>
291+
<li>name... (Role)</li>
292+
<li>name... (Role)</li>
293+
<li>name... (Role)</li>
294+
</ul>
295+
</p>
296+
</div>
297+
</div>
298+
</div>
299+
<div class="modal-footer">
300+
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
301+
</div>
302+
</div>
303+
</div>
304+
</div>
305+
<!-- End Basic Modal -->
306+
222307
</section>
223308
<!--Global JS-->
224309
<script src="assets/js/jquery-1.10.2.min.js"></script>

pom.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<resource>
2727
<directory>${basedir}/src/main/java</directory>
2828
</resource>
29-
<resource>
29+
<resource>
3030
<directory>${basedir}/src/main/resources</directory>
3131
</resource>
3232
</resources>
@@ -88,6 +88,11 @@
8888
<artifactId>axis-ant</artifactId>
8989
<version>1.2</version>
9090
</dependency>
91+
<dependency>
92+
<groupId>org.apache.commons</groupId>
93+
<artifactId>commons-lang3</artifactId>
94+
<version>3.3.2</version>
95+
</dependency>
9196
<dependency>
9297
<groupId>commons-fileupload</groupId>
9398
<artifactId>commons-fileupload</artifactId>

src/main/java/org/owasp/webgoat/Catcher.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* This file is part of WebGoat, an Open Web Application Security Project utility. For details,
1818
* please see http://www.owasp.org/
1919
*
20-
* Copyright (c) 2002 - 2007 Bruce Mayhew
20+
* Copyright (c) 2002 - 20014 Bruce Mayhew
2121
*
2222
* This program is free software; you can redistribute it and/or modify it under the terms of the
2323
* GNU General Public License as published by the Free Software Foundation; either version 2 of the
@@ -33,10 +33,10 @@
3333
*
3434
* Getting Source ==============
3535
*
36-
* Source for this application is maintained at code.google.com, a repository for free software
36+
* Source for this application is maintained at https://github.com/WebGoat/WebGoat, a repository for free software
3737
* projects.
3838
*
39-
* For details, please see http://code.google.com/p/webgoat/
39+
* For details, please see http://webgoat.github.io
4040
*
4141
* @author Bruce Mayhew <a href="http://code.google.com/p/webgoat">WebGoat</a>
4242
* @created March 13, 2007

src/main/java/org/owasp/webgoat/HammerHead.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* This file is part of WebGoat, an Open Web Application Security Project
3232
* utility. For details, please see http://www.owasp.org/
3333
*
34-
* Copyright (c) 2002 - 2007 Bruce Mayhew
34+
* Copyright (c) 2002 - 20014 Bruce Mayhew
3535
*
3636
* This program is free software; you can redistribute it and/or modify it under
3737
* the terms of the GNU General Public License as published by the Free Software
@@ -49,10 +49,10 @@
4949
*
5050
* Getting Source ==============
5151
*
52-
* Source for this application is maintained at code.google.com, a repository
52+
* Source for this application is maintained at https://github.com/WebGoat/WebGoat, a repository
5353
* for free software projects.
5454
*
55-
* For details, please see http://code.google.com/p/webgoat/
55+
* For details, please see http://webgoat.github.io
5656
*
5757
*
5858
* @author Jeff Williams <a href="http://www.aspectsecurity.com">Aspect

src/main/java/org/owasp/webgoat/LessonSource.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* This file is part of WebGoat, an Open Web Application Security Project
1717
* utility. For details, please see http://www.owasp.org/
1818
*
19-
* Copyright (c) 2002 - 2007 Bruce Mayhew
19+
* Copyright (c) 2002 - 20014 Bruce Mayhew
2020
*
2121
* This program is free software; you can redistribute it and/or modify it under
2222
* the terms of the GNU General Public License as published by the Free Software
@@ -34,10 +34,10 @@
3434
*
3535
* Getting Source ==============
3636
*
37-
* Source for this application is maintained at code.google.com, a repository
37+
* Source for this application is maintained at https://github.com/WebGoat/WebGoat, a repository
3838
* for free software projects.
3939
*
40-
* For details, please see http://code.google.com/p/webgoat/
40+
* For details, please see http://webgoat.github.io
4141
*
4242
* @author Bruce Mayhew <a href="http://code.google.com/p/webgoat">WebGoat</a>
4343
* @created October 28, 2003

src/main/java/org/owasp/webgoat/controller/Start.java

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,17 @@
55
*/
66
package org.owasp.webgoat.controller;
77

8+
import java.util.Collection;
9+
import javax.servlet.ServletContext;
810
import javax.servlet.http.HttpServletRequest;
911
import javax.servlet.http.HttpSession;
10-
import org.owasp.webgoat.session.Course;
12+
import org.apache.commons.lang3.StringUtils;
1113
import org.owasp.webgoat.session.WebSession;
1214
import org.slf4j.Logger;
1315
import org.slf4j.LoggerFactory;
16+
import org.springframework.beans.factory.annotation.Autowired;
17+
import org.springframework.security.core.GrantedAuthority;
18+
import org.springframework.security.core.context.SecurityContextHolder;
1419
import org.springframework.stereotype.Controller;
1520
import org.springframework.web.bind.annotation.RequestMapping;
1621
import org.springframework.web.bind.annotation.RequestMethod;
@@ -28,6 +33,9 @@ public class Start {
2833

2934
private static final String WELCOMED = "welcomed";
3035

36+
@Autowired
37+
private ServletContext servletContext;
38+
3139
@RequestMapping(value = "start.mvc", method = {RequestMethod.GET, RequestMethod.POST})
3240
public ModelAndView start(HttpServletRequest request,
3341
@RequestParam(value = "error", required = false) String error,
@@ -40,12 +48,32 @@ public ModelAndView start(HttpServletRequest request,
4048
model.setViewName("redirect:/login.mvc");
4149
return model;
4250
}
51+
String role = getRole();
52+
String user = request.getUserPrincipal().getName();
53+
model.addObject("role", role);
54+
model.addObject("user", user);
55+
56+
String contactEmail = servletContext.getInitParameter("email");
57+
model.addObject("contactEmail", contactEmail);
4358

4459
// if everything ok then go to webgoat UI
4560
model.setViewName("main_new");
4661
return model;
4762
}
4863

64+
private String getRole() {
65+
Collection<GrantedAuthority> authorities = (Collection<GrantedAuthority>) SecurityContextHolder.getContext().getAuthentication().getAuthorities();
66+
String role = "N/A";
67+
for (GrantedAuthority authority : authorities) {
68+
authority.getAuthority();
69+
role = authority.getAuthority();
70+
role = StringUtils.lowerCase(role);
71+
role = StringUtils.remove(role, "role_");
72+
break;
73+
}
74+
return role;
75+
}
76+
4977
public boolean checkWebSession(HttpSession session) {
5078
Object o = session.getAttribute(WebSession.SESSION);
5179
if (o == null) {

src/main/java/org/owasp/webgoat/lessons/AbstractLesson.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
* This file is part of WebGoat, an Open Web Application Security Project
4343
* utility. For details, please see http://www.owasp.org/
4444
*
45-
* Copyright (c) 2002 - 2007 Bruce Mayhew
45+
* Copyright (c) 2002 - 20014 Bruce Mayhew
4646
*
4747
* This program is free software; you can redistribute it and/or modify it under
4848
* the terms of the GNU General Public License as published by the Free Software
@@ -60,10 +60,10 @@
6060
*
6161
* Getting Source ==============
6262
*
63-
* Source for this application is maintained at code.google.com, a repository
63+
* Source for this application is maintained at https://github.com/WebGoat/WebGoat, a repository
6464
* for free software projects.
6565
*
66-
* For details, please see http://code.google.com/p/webgoat/
66+
* For details, please see http://webgoat.github.io
6767
*
6868
* @author Bruce Mayhew <a href="http://code.google.com/p/webgoat">WebGoat</a>
6969
* @created October 28, 2003

src/main/java/org/owasp/webgoat/lessons/AccessControlMatrix.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* This file is part of WebGoat, an Open Web Application Security Project utility. For details,
2121
* please see http://www.owasp.org/
2222
*
23-
* Copyright (c) 2002 - 2007 Bruce Mayhew
23+
* Copyright (c) 2002 - 20014 Bruce Mayhew
2424
*
2525
* This program is free software; you can redistribute it and/or modify it under the terms of the
2626
* GNU General Public License as published by the Free Software Foundation; either version 2 of the
@@ -36,10 +36,10 @@
3636
*
3737
* Getting Source ==============
3838
*
39-
* Source for this application is maintained at code.google.com, a repository for free software
39+
* Source for this application is maintained at https://github.com/WebGoat/WebGoat, a repository for free software
4040
* projects.
4141
*
42-
* For details, please see http://code.google.com/p/webgoat/
42+
* For details, please see http://webgoat.github.io
4343
*
4444
* @author Jeff Williams <a href="http://www.aspectsecurity.com">Aspect Security</a>
4545
* @created October 28, 2003

0 commit comments

Comments
 (0)