10
2
Fork 0
This commit is contained in:
xenia 2020-05-26 22:00:32 -04:00
parent 3015cf7ef1
commit 1d4e3c29eb
14 changed files with 116 additions and 2 deletions

View File

@ -6,7 +6,8 @@
- [aaaa/seeing-stars](aaaa/seeing-stars) - [aaaa/seeing-stars](aaaa/seeing-stars)
- [aaaa/spacebook](aaaa/spacebook) - [aaaa/spacebook](aaaa/spacebook)
- [comms/56k](comms/56k) - [comms/56k](comms/56k)
- [ground-segment/phasors-to-stun](ground-segment/phasors-to-stun) - [comms/phasors-to-stun](comms/phasors-to-stun)
- [payload/calendar](payload/calendar)
- [payload/leakycrypto](payload/leakycrypto) - [payload/leakycrypto](payload/leakycrypto)
- [satellite-bus/bytes-away](satellite-bus/bytes-away) - [satellite-bus/bytes-away](satellite-bus/bytes-away)
- [satellite-bus/magic-bus](satellite-bus/magic-bus) - [satellite-bus/magic-bus](satellite-bus/magic-bus)

View File

@ -1,6 +1,6 @@
# Phasors to Stun # Phasors to Stun
**Category:** Ground Segment **Category:** Communication Systems
**Points (final):** 62 **Points (final):** 62
**Solves:** 71 **Solves:** 71

View File

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 96 KiB

View File

Before

Width:  |  Height:  |  Size: 240 KiB

After

Width:  |  Height:  |  Size: 240 KiB

View File

Before

Width:  |  Height:  |  Size: 113 KiB

After

Width:  |  Height:  |  Size: 113 KiB

0
ground-segment/.gitkeep Normal file
View File

View File

@ -0,0 +1,32 @@
FROM ubuntu:18.04
RUN apt-get update -y && apt-get install -y \
cmake \
freeglut3 \
freeglut3-dev \
gcc \
g++ \
git \
iproute2 \
libffi-dev \
libgdbm-dev \
libgdbm5 \
libgstreamer-plugins-base1.0-dev \
libgstreamer1.0-dev \
libncurses5-dev \
libreadline6-dev \
libsmokeqt4-dev \
libssl-dev \
libyaml-dev \
net-tools \
qt4-default \
qt4-dev-tools \
ruby2.5 \
ruby2.5-dev \
vim \
zlib1g-dev
RUN apt-get install -y bundler
WORKDIR /cosmos
CMD /bin/bash

View File

@ -0,0 +1,78 @@
# That's not on my calendar
**Category:** Payload Modules
**Points (final):** 80
**Solves:** 52
>Time for a really gentle introduction to cFS and Cosmos, hopefully you can schedule time to learn
>it!
>
>Build instructions:
>
>$ ./setup.sh $ source ~/.bashrc $ rm Gemfile.lock $ bundle install
>
>Hint: You will need to enable telemetry locally on the satellite, the udp forwarder will provide it
>to you as TCP from there
## Write-up
by [haskal](https://awoo.systems)
Two files are provided, one is a [COSMOS](https://cosmosrb.com/) directory tree for accessing a
virtual satellite running [NASA's Core Flight System](https://cfs.gsfc.nasa.gov/) that can be booted
up using the provided netcat endpoint. COSMOS is an open-source command and control framework for
satellites using cFS. Booting up COSMOS is enormously complicated, so Docker can be used to automate
the setup. We adapted the Ball Aerospace COSMOS Docker image, and created a script to configure
COSMOS to connect to the CTF's satellite instance automatically by writing the configuration file at
`cosmos/config/tools/cmd_tlm_server/cmd_tlm_server.txt`. When COSMOS is successfully connected to
the CTF instance it looks like this (no themes were installed in the Docker container so it looks
like Windows 95, I'm so sorry,)
![Main COSMOS screen](cosmos1.png)
The second file is an archive of some JSON configuration for the satellite operating system.
Importantly, it contains the types of telemetry messages the satellite can send, and the default
scheduler table that configures when the satellite sends the messages. There is a telemetry packet
that sends us the flag configured here
```json
{"message": {
"name": "KIT_TO_SEND_FLAG_MID",
"descr": "Super Secret Flag Sending Telemetry Message",
"id": 42,
"stream-id": 33304,
"seq-seg": 192,
"length": 256
}},
```
As hinted in the description, we can send a KIT_TO ENABLE_TELEMETRY command using the COSMOS command
sender. KIT_TO is the subsystem for Telemetry Output, and it has commands available to control the
telemetry sending.
![COSMOS sending an ENABLE_TELEMETRY command](cosmos2.png)
However we find that even after telemetry is enabled, we're not getting the flag telemetry even
though we start to receive other types of telemetry messages.
![COSMOS telemetry viewer, we have 0 flag packets](cosmos3.png)
This is because, if we look back at the JSON config we find that the scheduler doesn't have any
slots where it sends flag telemetry packets. The key part of this challenge is that the scheduler
can be configured at runtime using commands for KIT_SCH (the scheduler subsystem), as we found out
by exploring the available commands in COSMOS. Particularly there is a command LOAD_SCH_ENTRY that
allows us to overwrite one of the scheduler entries. We can use the command sender to send this
command and load slot 0, activity 0 (or any slot, it doesn't matter) to be for message ID 42 (the
flag packet ID), and to be enabled (1).
![COSMOS sending this LOAD_SCH_ENTRY command](cosmos4.png)
Once we write the scheduler entry, the satellite will start sending COSMOS flags, which can be seen
in the Packet Viewer.
![COSMOS packet viewer showing the flag](cosmos5.png)
## Resources and other writeups
* <https://cosmosrb.com/>
* <https://cfs.gsfc.nasa.gov/>

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

View File

@ -0,0 +1,3 @@
#!/bin/bash
docker run -it -e DISPLAY -e QT_X11_NO_MITSHM=1 --net=host -v $PWD/cosmos:/cosmos cosmos2 bash