Commit 2421e4d2 authored by Dominik Rosiek's avatar Dominik Rosiek

first php

parents eca16422 5eb501f3
ssh grzesiek@52.25.28.64 "cd CTF && git pull && grunt && cd service && /sbin/fuser -k 8080/tcp; bash start.sh; echo done;"
\ No newline at end of file
ssh grzesiek@52.28.244.24 "cd CTF && git pull && grunt && cd service && /sbin/fuser -k 8080/tcp; bash start.sh; echo done;"
\ No newline at end of file
......@@ -75,6 +75,7 @@ teams:
textTasks:
- name: "Szyfro1"
text: "Odszyfruj1"
description: "Opis zadania 1"
level: 1
flags:
- value: "AGH_sdfg1f1"
......@@ -86,6 +87,7 @@ textTasks:
- name: "Szyfro2"
text: "Odszyfruj2"
description: "Opis zadania 2"
level: 2
flags:
- value: "AGH_sdfg1"
......@@ -95,6 +97,7 @@ textTasks:
- name: "UI"
text: "Znajdz flagi w jułaju"
description: "Opis zadania UI"
level: 5
flags:
- value: "KYN2016_TervetullutKotisivuilleni"
......@@ -114,6 +117,7 @@ textTasks:
webTasks:
- name: "SQL Injection"
url: "http://google.pl"
description: "Opis zadania SQL INJECTION"
level: 3
flags:
- value: "AGH_sdfg1fs"
......@@ -124,6 +128,7 @@ webTasks:
description: "flaga 33"
- name: "Inna dziura"
description: "Opis zadania inna dziura"
url: "http://wikipedia.pl"
level: 4
flags:
......
......@@ -75,6 +75,7 @@ teams:
textTasks:
- name: "Szyfro1"
text: "Odszyfruj1"
description: "Opis zadania 1"
level: 1
flags:
- value: "AGH_sdfg1f1"
......@@ -86,6 +87,7 @@ textTasks:
- name: "Szyfro2"
text: "Odszyfruj2"
description: "Opis zadania 2"
level: 2
flags:
- value: "AGH_sdfg1"
......@@ -95,6 +97,7 @@ textTasks:
- name: "UI"
text: "Znajdz flagi w jułaju"
description: "Opis zadania UI"
level: 5
flags:
- value: "KYN2016_TervetullutKotisivuilleni"
......@@ -113,7 +116,7 @@ textTasks:
webTasks:
- name: "PHP taki bezpieczny"
text: "A może by tak coś z klasyki? vol. 1"
description: "A może by tak coś z klasyki? vol. 1"
url: "http://52.29.190.67"
level: 3
flags:
......@@ -123,6 +126,7 @@ webTasks:
description: "Remote File Include"
- name: "Inna dziura"
description: "Opis zadania inna dziura"
url: "http://wikipedia.pl"
level: 4
flags:
......
configuration.prod.yml
\ No newline at end of file
package com.telephoners.krakyournet.ctf.beans.tasks;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.telephoners.krakyournet.ctf.beans.Flag;
import com.telephoners.krakyournet.ctf.beans.User;
import com.telephoners.krakyournet.ctf.helpers.PublicProperty;
import com.telephoners.krakyournet.ctf.beans.Flag;
import org.bson.types.ObjectId;
import org.mongodb.morphia.annotations.Entity;
import org.mongodb.morphia.annotations.Id;
......@@ -20,13 +20,16 @@ public abstract class Task
@PublicProperty
private String name;
@PublicProperty
private String description;
@PublicProperty
private int level;
private List<Flag> flags;
public Task(String name, int level, List<Flag> flags)
public Task(String name, int level, String description, List<Flag> flags)
{
this.name = name;
this.level = level;
this.description = description;
this.flags = flags;
}
......@@ -66,6 +69,16 @@ public abstract class Task
this.flags = flags;
}
public String getDescription()
{
return description;
}
public void setDescription(String description)
{
this.description = description;
}
@Override
public boolean equals(Object o)
{
......@@ -77,6 +90,7 @@ public abstract class Task
if (level != task.level) return false;
if (id != null ? !id.equals(task.id) : task.id != null) return false;
if (name != null ? !name.equals(task.name) : task.name != null) return false;
if (description != null ? !description.equals(task.description) : task.description != null) return false;
return flags != null ? flags.equals(task.flags) : task.flags == null;
}
......@@ -86,6 +100,7 @@ public abstract class Task
{
int result = id != null ? id.hashCode() : 0;
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (description != null ? description.hashCode() : 0);
result = 31 * result + level;
result = 31 * result + (flags != null ? flags.hashCode() : 0);
return result;
......
......@@ -13,9 +13,9 @@ public class TextTask extends Task
{
private String text;
public TextTask(String name, int level, List<Flag> flags, String text)
public TextTask(String name, int level, String description, List<Flag> flags, String text)
{
super(name, level, flags);
super(name, level, description, flags);
this.text = text;
}
......
......@@ -23,9 +23,9 @@ public class WebTask extends Task
private String url;
private static final Joiner URL_JOINER = Joiner.on("/");
public WebTask(String name, int level, List<Flag> flags, String url)
public WebTask(String name, int level, String description, List<Flag> flags, String url)
{
super(name, level, flags);
super(name, level, description, flags);
this.url = url;
}
......
......@@ -33,9 +33,10 @@ public class TasksRepository extends Repository<Task>
public List<Task> getAllPublic()
{
return datastore.createQuery(Task.class)
List<Task> level = datastore.createQuery(Task.class)
.order("level")
.retrievedFields(true, DBObjectUtils.getPublicFields(Task.class))
.asList();
return level;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment