Skip to content

Commit

Permalink
Landing page incoming requests now look whether the referer is WebGoa…
Browse files Browse the repository at this point in the history
…t (all incoming requests from WebGoat will now be logged)
  • Loading branch information
nbaars committed Sep 12, 2017
1 parent 109fe2c commit 94caba7
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ public List<Trace> findTraceForUser(String username) {
@Override
public void add(Map<String, Object> map) {
Optional<String> host = getFromHeaders("host", map);
String path = (String) map.getOrDefault("path", "");
if (host.isPresent() && ("/".equals(path) || path.contains("challenge"))) {
Optional<String> referer = getFromHeaders("referer", map);
if (host.isPresent() && referer.orElse("").contains("WebGoat")) {
Optional<String> cookie = getFromHeaders("cookie", map);
cookie.ifPresent(c -> {
Optional<String> user = findUserBasedOnCookie(c);
Expand Down

0 comments on commit 94caba7

Please sign in to comment.