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;" 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 \ No newline at end of file
...@@ -75,6 +75,7 @@ teams: ...@@ -75,6 +75,7 @@ teams:
textTasks: textTasks:
- name: "Szyfro1" - name: "Szyfro1"
text: "Odszyfruj1" text: "Odszyfruj1"
description: "Opis zadania 1"
level: 1 level: 1
flags: flags:
- value: "AGH_sdfg1f1" - value: "AGH_sdfg1f1"
...@@ -86,6 +87,7 @@ textTasks: ...@@ -86,6 +87,7 @@ textTasks:
- name: "Szyfro2" - name: "Szyfro2"
text: "Odszyfruj2" text: "Odszyfruj2"
description: "Opis zadania 2"
level: 2 level: 2
flags: flags:
- value: "AGH_sdfg1" - value: "AGH_sdfg1"
...@@ -95,6 +97,7 @@ textTasks: ...@@ -95,6 +97,7 @@ textTasks:
- name: "UI" - name: "UI"
text: "Znajdz flagi w jułaju" text: "Znajdz flagi w jułaju"
description: "Opis zadania UI"
level: 5 level: 5
flags: flags:
- value: "KYN2016_TervetullutKotisivuilleni" - value: "KYN2016_TervetullutKotisivuilleni"
...@@ -114,6 +117,7 @@ textTasks: ...@@ -114,6 +117,7 @@ textTasks:
webTasks: webTasks:
- name: "SQL Injection" - name: "SQL Injection"
url: "http://google.pl" url: "http://google.pl"
description: "Opis zadania SQL INJECTION"
level: 3 level: 3
flags: flags:
- value: "AGH_sdfg1fs" - value: "AGH_sdfg1fs"
...@@ -124,6 +128,7 @@ webTasks: ...@@ -124,6 +128,7 @@ webTasks:
description: "flaga 33" description: "flaga 33"
- name: "Inna dziura" - name: "Inna dziura"
description: "Opis zadania inna dziura"
url: "http://wikipedia.pl" url: "http://wikipedia.pl"
level: 4 level: 4
flags: flags:
......
...@@ -75,6 +75,7 @@ teams: ...@@ -75,6 +75,7 @@ teams:
textTasks: textTasks:
- name: "Szyfro1" - name: "Szyfro1"
text: "Odszyfruj1" text: "Odszyfruj1"
description: "Opis zadania 1"
level: 1 level: 1
flags: flags:
- value: "AGH_sdfg1f1" - value: "AGH_sdfg1f1"
...@@ -86,6 +87,7 @@ textTasks: ...@@ -86,6 +87,7 @@ textTasks:
- name: "Szyfro2" - name: "Szyfro2"
text: "Odszyfruj2" text: "Odszyfruj2"
description: "Opis zadania 2"
level: 2 level: 2
flags: flags:
- value: "AGH_sdfg1" - value: "AGH_sdfg1"
...@@ -95,6 +97,7 @@ textTasks: ...@@ -95,6 +97,7 @@ textTasks:
- name: "UI" - name: "UI"
text: "Znajdz flagi w jułaju" text: "Znajdz flagi w jułaju"
description: "Opis zadania UI"
level: 5 level: 5
flags: flags:
- value: "KYN2016_TervetullutKotisivuilleni" - value: "KYN2016_TervetullutKotisivuilleni"
...@@ -113,7 +116,7 @@ textTasks: ...@@ -113,7 +116,7 @@ textTasks:
webTasks: webTasks:
- name: "PHP taki bezpieczny" - 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" url: "http://52.29.190.67"
level: 3 level: 3
flags: flags:
...@@ -123,6 +126,7 @@ webTasks: ...@@ -123,6 +126,7 @@ webTasks:
description: "Remote File Include" description: "Remote File Include"
- name: "Inna dziura" - name: "Inna dziura"
description: "Opis zadania inna dziura"
url: "http://wikipedia.pl" url: "http://wikipedia.pl"
level: 4 level: 4
flags: flags:
......
configuration.prod.yml
\ No newline at end of file
package com.telephoners.krakyournet.ctf.beans.tasks; package com.telephoners.krakyournet.ctf.beans.tasks;
import com.fasterxml.jackson.annotation.JsonInclude; 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.beans.User;
import com.telephoners.krakyournet.ctf.helpers.PublicProperty; import com.telephoners.krakyournet.ctf.helpers.PublicProperty;
import com.telephoners.krakyournet.ctf.beans.Flag;
import org.bson.types.ObjectId; import org.bson.types.ObjectId;
import org.mongodb.morphia.annotations.Entity; import org.mongodb.morphia.annotations.Entity;
import org.mongodb.morphia.annotations.Id; import org.mongodb.morphia.annotations.Id;
...@@ -20,13 +20,16 @@ public abstract class Task ...@@ -20,13 +20,16 @@ public abstract class Task
@PublicProperty @PublicProperty
private String name; private String name;
@PublicProperty @PublicProperty
private String description;
@PublicProperty
private int level; private int level;
private List<Flag> flags; 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.name = name;
this.level = level; this.level = level;
this.description = description;
this.flags = flags; this.flags = flags;
} }
...@@ -66,6 +69,16 @@ public abstract class Task ...@@ -66,6 +69,16 @@ public abstract class Task
this.flags = flags; this.flags = flags;
} }
public String getDescription()
{
return description;
}
public void setDescription(String description)
{
this.description = description;
}
@Override @Override
public boolean equals(Object o) public boolean equals(Object o)
{ {
...@@ -77,6 +90,7 @@ public abstract class Task ...@@ -77,6 +90,7 @@ public abstract class Task
if (level != task.level) return false; if (level != task.level) return false;
if (id != null ? !id.equals(task.id) : task.id != null) 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 (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; return flags != null ? flags.equals(task.flags) : task.flags == null;
} }
...@@ -86,6 +100,7 @@ public abstract class Task ...@@ -86,6 +100,7 @@ public abstract class Task
{ {
int result = id != null ? id.hashCode() : 0; int result = id != null ? id.hashCode() : 0;
result = 31 * result + (name != null ? name.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 + level;
result = 31 * result + (flags != null ? flags.hashCode() : 0); result = 31 * result + (flags != null ? flags.hashCode() : 0);
return result; return result;
......
...@@ -13,9 +13,9 @@ public class TextTask extends Task ...@@ -13,9 +13,9 @@ public class TextTask extends Task
{ {
private String text; 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; this.text = text;
} }
......
...@@ -23,9 +23,9 @@ public class WebTask extends Task ...@@ -23,9 +23,9 @@ public class WebTask extends Task
private String url; private String url;
private static final Joiner URL_JOINER = Joiner.on("/"); 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; this.url = url;
} }
......
...@@ -33,9 +33,10 @@ public class TasksRepository extends Repository<Task> ...@@ -33,9 +33,10 @@ public class TasksRepository extends Repository<Task>
public List<Task> getAllPublic() public List<Task> getAllPublic()
{ {
return datastore.createQuery(Task.class) List<Task> level = datastore.createQuery(Task.class)
.order("level") .order("level")
.retrievedFields(true, DBObjectUtils.getPublicFields(Task.class)) .retrievedFields(true, DBObjectUtils.getPublicFields(Task.class))
.asList(); .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