Compare commits
10
Commits
57f2e662d1
...
10b0b68c57
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
10b0b68c57 | ||
|
|
29c2e71ea0 | ||
|
|
278e2af172 | ||
|
|
a4ec496cc1 | ||
|
|
38d87cd90a | ||
|
|
92552c0eb8 | ||
|
|
1767b25d3c | ||
|
|
766bbb8fa8 | ||
|
|
80c42066a0 | ||
|
|
a4227a7758 |
@@ -1,6 +1,6 @@
|
|||||||
# Example Dojo
|
# Example Dojo
|
||||||
|
|
||||||
This repositories features an example dojo.
|
This repository features an example dojo.
|
||||||
|
|
||||||
The dojo is defined by [dojo.yml](./dojo.yml).
|
The dojo is defined by [dojo.yml](./dojo.yml).
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ When `/bin/sh` (which is linked to `/bin/dash`) is run under this, it will immed
|
|||||||
This means that both the **effective** and **real** user will be `hacker`, and the flag will not be accessible.
|
This means that both the **effective** and **real** user will be `hacker`, and the flag will not be accessible.
|
||||||
This affects `system`, which ultimately just runs `/bin/sh`.
|
This affects `system`, which ultimately just runs `/bin/sh`.
|
||||||
|
|
||||||
The challenge can rememedy this by explicitly setting the **real** user to the **effective** user:
|
The challenge can remedy this by explicitly setting the **real** user to the **effective** user:
|
||||||
```c
|
```c
|
||||||
setreuid(geteuid(), -1)
|
setreuid(geteuid(), -1)
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -4,16 +4,25 @@ PATH="/run/dojo/bin:$PATH"
|
|||||||
USER="hacker"
|
USER="hacker"
|
||||||
|
|
||||||
xfce_env() {
|
xfce_env() {
|
||||||
local session_pid
|
local session_pid
|
||||||
session_pid=$(pgrep -u "$USER" xfce4-session | head -n1)
|
session_pid=$(pgrep -u "$USER" xfce4-session | head -n1)
|
||||||
xargs -0 -a /proc/"$session_pid"/environ
|
xargs -0 -a /proc/"$session_pid"/environ
|
||||||
}
|
}
|
||||||
|
|
||||||
xfce_run() {
|
xfce_run() {
|
||||||
setsid su "$USER" -c "env - $(xfce_env) $*"
|
id
|
||||||
|
which su
|
||||||
|
echo "$USER"
|
||||||
|
setsid runuser "$USER" -c "env - $(xfce_env) $*"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Consider using `--geometry` to set the window size and position
|
# Launch a background process that waits for xfce4-session and then runs the command.
|
||||||
# Consider using `--fullscreen` to launch the application in fullscreen mode
|
(
|
||||||
|
while ! pgrep -u "$USER" xfce4-session > /dev/null; do
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
|
||||||
xfce_run exo-open --launch TerminalEmulator
|
# Consider using `--geometry` to set the window size and position
|
||||||
|
# Consider using `--fullscreen` to launch the application in fullscreen mode
|
||||||
|
xfce_run exo-open --launch TerminalEmulator
|
||||||
|
) &
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
This challenge demonstrates how to automatically launch a desktop application after the desktop starts.
|
||||||
@@ -8,3 +8,4 @@ modules:
|
|||||||
- id: hello
|
- id: hello
|
||||||
- id: world
|
- id: world
|
||||||
- id: demo
|
- id: demo
|
||||||
|
- id: lectures
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
This module showcases two styles of embedded lectures that pwn.college supports: graded and non-graded.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
hh4XAU6XYP0 549
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
name: Lectures
|
||||||
|
resources:
|
||||||
|
- name: Ungraded Lecture
|
||||||
|
type: lecture
|
||||||
|
video: hh4XAU6XYP0
|
||||||
|
slides: 14ZJRIyf0HnoYO1N8GI5ygE-ZVgdhjJrvzkETFLz7NIo
|
||||||
|
- id: graded-lecture
|
||||||
|
type: challenge
|
||||||
|
name: Graded Lecture
|
||||||
|
description: |
|
||||||
|
Lectures can be graded by embedding them as challenges!
|
||||||
|
This is a demonstration of this capability.
|
||||||
|
|
||||||
|
Graded lectures are actually custom challenges with a custom interface.
|
||||||
|
The challenge runs a special docker container, and the way to configure it is to include a .config file containing the youtube ID for the video and the duration in seconds that must be watched before the flag is given.
|
||||||
|
image: pwncollege/challenge-lecture
|
||||||
|
interfaces:
|
||||||
|
- name: Challenge
|
||||||
|
port: 80
|
||||||
Reference in New Issue
Block a user