Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
CTF
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Grzegorz
CTF
Commits
e13d69bf
Commit
e13d69bf
authored
Apr 02, 2016
by
Antek Grzanka
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of gitlab.telemabk.pl:jifwin/CTF
parents
ee2a5221
17ce4407
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
23 deletions
+37
-23
configuration.yml
service/configuration.yml
+19
-18
Solution.java
.../java/com/telephoners/krakyournet/ctf/beans/Solution.java
+13
-0
WebTask.java
.../com/telephoners/krakyournet/ctf/beans/tasks/WebTask.java
+2
-2
TasksRepository.java
...phoners/krakyournet/ctf/repositories/TasksRepository.java
+1
-0
SolutionsResource.java
...ephoners/krakyournet/ctf/resources/SolutionsResource.java
+2
-2
TaskResource.java
...m/telephoners/krakyournet/ctf/resources/TaskResource.java
+0
-1
No files found.
service/configuration.yml
View file @
e13d69bf
...
...
@@ -89,6 +89,24 @@ textTasks:
-
value
:
"
sdfg1"
description
:
"
flaga
2"
-
name
:
"
UI"
text
:
"
Znajdz
flagi
w
jułaju"
level
:
5
flags
:
-
value
:
"
KYN2016_TervetullutKotisivuilleni"
description
:
"
Tytuł"
-
value
:
"
KYN2016_ToNieprawda"
description
:
"
Poezja"
-
value
:
"
KYN2016_EmacsemPrzezSendmaila"
description
:
"
Konsola"
-
value
:
"
KYN2016_SzukajDalejAZnajdzieszWiecej"
description
:
"
QR"
-
value
:
"
KYN2016_BROWAR"
description
:
"
Rebus"
-
value
:
"
KYN2016_RUAHACKER?"
description
:
"
Tunel"
webTasks
:
-
name
:
"
SQL
Injection"
url
:
"
http://google.pl"
...
...
@@ -110,21 +128,4 @@ webTasks:
-
value
:
"
AGH_sffdfdg1f"
description
:
"
flaga
22"
-
value
:
"
AGH_sdfassfdfgf1"
description
:
"
flaga
33"
-
name
:
"
UI"
url
:
"
..."
level
:
5
flags
:
-
value
:
"
KYN2016_TervetullutKotisivuilleni"
description
:
"
Tytuł"
-
value
:
"
KYN2016_ToNieprawda"
description
:
"
Poezja"
-
value
:
"
KYN2016_EmacsemPrzezSendmaila"
description
:
"
Konsola"
-
value
:
"
KYN2016_SzukajDalejAZnajdzieszWiecej"
description
:
"
QR"
-
value
:
"
KYN2016_BROWAR"
description
:
"
Rebus"
-
value
:
"
KYN2016_RUAHACKER?"
description
:
"
Tunel"
description
:
"
flaga
33"
\ No newline at end of file
service/src/main/java/com/telephoners/krakyournet/ctf/beans/Solution.java
View file @
e13d69bf
...
...
@@ -2,6 +2,7 @@ package com.telephoners.krakyournet.ctf.beans;
import
com.telephoners.krakyournet.ctf.beans.tasks.Task
;
import
org.bson.types.ObjectId
;
import
org.joda.time.Instant
;
import
org.mongodb.morphia.annotations.Entity
;
import
org.mongodb.morphia.annotations.Id
;
...
...
@@ -15,12 +16,14 @@ public class Solution
private
Task
task
;
private
Team
team
;
private
Flag
flag
;
private
Instant
submitionTime
;
public
Solution
(
Team
team
,
Task
task
,
Flag
flag
)
{
this
.
team
=
checkNotNull
(
team
);
this
.
task
=
checkNotNull
(
task
);
this
.
flag
=
checkNotNull
(
flag
);
this
.
submitionTime
=
Instant
.
now
();
}
public
Solution
()
...
...
@@ -56,4 +59,14 @@ public class Solution
{
this
.
flag
=
flag
;
}
public
Instant
getSubmitionTime
()
{
return
submitionTime
;
}
public
void
setSubmitionTime
(
Instant
submitionTime
)
{
this
.
submitionTime
=
submitionTime
;
}
}
service/src/main/java/com/telephoners/krakyournet/ctf/beans/tasks/WebTask.java
View file @
e13d69bf
...
...
@@ -21,7 +21,7 @@ import java.util.List;
public
class
WebTask
extends
Task
{
private
String
url
;
private
final
Joiner
urlJoiner
=
Joiner
.
on
(
"/"
);
private
static
final
Joiner
URL_JOINER
=
Joiner
.
on
(
"/"
);
public
WebTask
(
String
name
,
int
level
,
List
<
Flag
>
flags
,
String
url
)
{
...
...
@@ -35,7 +35,7 @@ public class WebTask extends Task
public
String
getTextForUser
(
User
user
,
String
path
)
throws
IOException
{
String
url
=
urlJoiner
.
join
(
getUrl
(),
path
);
String
url
=
URL_JOINER
.
join
(
getUrl
(),
path
);
return
StreamUtils
.
readStream
(
proxyRequest
(
url
,
user
));
}
...
...
service/src/main/java/com/telephoners/krakyournet/ctf/repositories/TasksRepository.java
View file @
e13d69bf
...
...
@@ -34,6 +34,7 @@ public class TasksRepository extends Repository<Task>
public
List
<
Task
>
getAllPublic
()
{
return
datastore
.
createQuery
(
Task
.
class
)
.
order
(
"level"
)
.
retrievedFields
(
true
,
DBObjectUtils
.
getPublicFields
(
Task
.
class
))
.
asList
();
}
...
...
service/src/main/java/com/telephoners/krakyournet/ctf/resources/SolutionsResource.java
View file @
e13d69bf
...
...
@@ -70,7 +70,7 @@ public class SolutionsResource
.
stream
()
.
collect
(
Collectors
.
toMap
(
Team:
:
getName
,
team
->
solutionsRepository
.
getCompletedTasks
(
team
)
solutionsRepository:
:
getCompletedTasks
));
}
...
...
@@ -82,7 +82,7 @@ public class SolutionsResource
.
stream
()
.
collect
(
Collectors
.
toMap
(
Team:
:
getName
,
team
->
solutionsRepository
.
getTeamSolutions
(
team
)
solutionsRepository:
:
getTeamSolutions
));
}
...
...
service/src/main/java/com/telephoners/krakyournet/ctf/resources/TaskResource.java
View file @
e13d69bf
package
com
.
telephoners
.
krakyournet
.
ctf
.
resources
;
import
com.google.common.base.Joiner
;
import
com.telephoners.krakyournet.ctf.beans.User
;
import
com.telephoners.krakyournet.ctf.beans.tasks.Task
;
import
com.telephoners.krakyournet.ctf.repositories.TasksRepository
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment