Core NetWars 6 - Game
Core NetWars 6 - Game
GOLDEN TICKET
Greetings to you, the lucky ;nder of this golden
ticket, from Mr. Willy Wonka!
I shake you warmly by the hand! Tremendous things are in store for you! Many wonderful
surprises await you! For now, I do invite you to come to my factory and be my guest for two
evenings - you and all others who are lucky enough to find my Golden Tickets. I, Willy
Wonka, will conduct you around the factory myself, showing you everything that there is to
see.
I am preparing other surprises that are even more marvelous and more fantastic for you and
for all my beloved Golden Ticket holders - mystic and marvelous surprises that will entrance,
delight, intrigue, astonish, and perplex you beyond measure!
Present this ticket at the factory gates at six thirty in the evening of the first day of NetWars.
Don't be late! And you are allowed to bring with you members of your team to look after
each other and to ensure that you don't get into mischief. One more thing - be certain to
have your conference badge with you, otherwise you will not be admitted.
...
Strike that. Reverse it.
[Installed Software]
aircrack-ng /pentest/wireless/aircrack-ng
bless
burp /pentest/exploitation/burp
cewl
crackmapexec /pentest/post-
exploitation/crackmapexec
creddump7 /pentest/post-
exploitation/creddump7
curl
delorean /pentest/exploitation/delorean
docker
gimp
hydra /pentest/vulnerability-
analysis/hydra
impacket and psexec.py /pentest/exploitation/impacket
john
lazagne /pentest/post-
exploitation/LaZagne
libreoffice
metasploit /opt/metasploit-framework
netcat
nikto /pentest/vulnerability-
analysis/nikto
nmap
openssl
proxychains
python3
scapy
smbclient
socat
sqlmap /pentest/exploitation/sqlmap
tcpdump
ufw
volatility
wireshark
wpscan
wxhexeditor
zap
/pentest/exploitation/ZAP_2.8.0/zap.sh
Replay Scene
Q1 - I GOT A GOLDEN TICKET - ANSWERED BY YOU AN HOUR AGO 1 POINT
What user account are you automatically logged into in the provided virtual machine?
bucket
charlie
contestwinner
roald
Hints:
1 The name in the upper-right of the desktop of the provided Linux virtual machine is
very close to the right answer, but the complete answer can be found inside a terminal
window. Click the black and white icon that looks like >_ in the bottom center of the
screen to open a new terminal window.
2 Once you're inside a termianl, the whoami command will tell you what account
you're logged into.
3 You can also see what user you're running as by looking to the left of the @ sign in
your terminal window prompt:
contestwinner@oompa-loompa:~$
Wonkatania
artoo
netwars
oompa-loompa
Hints:
1 The hostname command will tell you what your computer's host name is.
When a user enters a command into a Windows command prompt or a Linux terminal, the
operating system checks for commands and programs of that name in the environment “path”. The
$PATH / %PATH% variable tells the OS where to look for the command entered.
/bin/glasselevator
/usr/bin/wonkafactory
/usr/local/chocolateroom
/usr/sbin/slugworth
Hints:
1 From the terminal, there are ways to echo the list of paths your computer searches
for binaries.
2 Open up a new terminal window. You can show environment variables by prefixing
them with a dollar sign. For example, to show the currently-running shell, you could
run echo $SHELL .
3 The variable you're looking for is the $PATH variable. It contains a list of folders,
separated by colons. Once you've echoed the variable, look for a matching folder
compared to the multiple choices presented by this question.
Q4 - IMPROVED! - ANSWERED BY YOU AN HOUR AGO 2 POINTS
What version of Vi IMproved is available on your workstation? Please answer in the form of
<major version>.<minor version> , e.g. 1.2
Hints:
1 You can access the program by running vi or vim . However, vim is an interactive
program, so you'll need to exit when you've found the answer to this question.
2 You can get the version number without interacting with vim by running vim --
version .
3 You can also see what version of a package is installed by running dpkg -l
software-name .
vim is a bit of a special case, though, since it has a number of wrappers and so-called
metapackages. Running dpkg -l vim-* will show the answer on screen, though.
Q5 - EDIBLE SIT-ABLES - ANSWERED BY YOU AN HOUR AGO 2 POINTS
Hints:
1 Basic Linux file permissions are shown with ls -l . In Linux, the first string of
characters shows who can Read, Write, and eXecute a given object. The next two
entries are the associated owner and group.
In this case, the user contestwinner has r-- permissions - that user can read,
but not write or execute that file.
The group teavee has rw- permissions, so any members of that group can both
read and write (but not execute) that file. Who is a member of that group?
2 The /etc/group file controls group memberships. It's a plain text file, much like
/etc/passwd , that anybody on the system can read. Its format is as follows: The
/etc/group file is a text file that defines the groups on the system. There is one entry
per line, with the following format (excerpted from from man 5 passwd ):
group_name:password:GID:user_list
group_name: the name of the group.
password: the (encrypted) group password. If this field is empty, no password is
needed.
GID: the numeric group ID.
user_list: a list of the usernames that are members of this group, separated by
commas.
In practice, the password field is extremely rarely utilized on modern Linux or Unix
systems.
3 You could just cat /etc/group and visually search for the line beginning with
teavee: , but you could also search the output of the cat command with the
following syntax:
cat /etc/group | grep teavee
In this case, grep can also accept a filename, so the following syntax can also work:
grep teavee /etc/group
Q6 - LOOMPA DAY - ANSWERED BY YOU AN HOUR AGO 2 POINTS 1 INCORRECT ATTEMPT
When was your Oompa Loompa born? That is, on what date was your default shell/command
line/terminal last modified? Answer with a date in the format YYYYMMDD.
Hints:
1 In Linux, your shell is often the Bourne Again SHell, or bash , but you should verify
with echo $0 or echo $SHELL .
2 To see many of a file's attributes, including last modify date, you can use ls -l
/path/to/file . If you don't see a year, assume it's the present year.
3 Try ls -l /bin/bash
Q7 - CLASSY CHOCOLATE - ANSWERED BY YOU AN HOUR AGO 3 POINTS 1 INCORRECT ATTEMPT
Someone is trying to sully the name of our chocolate! Inside your Oompa Loompa workstation, an
image file as part of an installed package has been modified. What’s the sha1sum of the
maliciously inserted file?
Hints:
1 Debian and its derived Linux distributions, like Ubuntu and Mint Linux, have a built-in
tool that compares installed package components to their original file hashes.
The utility is called debsums . Take a look at its usage using its man page: man
debsums
2 debsums -c will show changed files, which matches our goal. debsums will also
report some files it can't open as a limited user.
These status messages will be written to STDERR ("Standard Error"), a separate file
handle, which you can redirect. For example, compare running the following
commands:
ls -l /nonexistent /etc/passwd
That second command doesn't show "/bin/ls: cannot access '/nonexistent': No such file
or directory" on the terminal window - it'll instead save that output to
/tmp/errors.txt . Note that they'll still both show the line for /etc/passwd ,
since that's being sent to STDOUT ("Standard Output"), which also defaults to the
screen.
File handle 1 is STDOUT, and you can redirect it with >filename or 1>filename
with any arbitrary filename.
File handle 2 is STDERR, and you can redirect it with 2>filename with any
arbitrary filename.
/dev/null is a special built-in file that throws away all input - sometimes jokingly
referred to as the "bit bucket." Linux administrators will commonly run a command
with 2>/dev/null to throw away all STDERR output (usually errors or status
messages).
3 Once you've tried something like debsums -c 2>/dev/null , you should try to
examine the filename that debsums -c shows on STDOUT.
If you want to look at the file, the gnome-open utility will open whatever program
would open a file that you double-clicked on it in a file browser.
Q8 - EXPRESS YOURSELF, REGULARLY - ANSWERED BY YOU AN HOUR AGO 2 POINTS
Regular expressions can be powerful tools in everything from sed to perl to powershell .
Which of these regular expressions would match these whole strings:
Fickelgruber is 2 smelly
Prodnose is not number 1 in our books
Slugworth is more lame than 87 percent of society
(\d|\d\d)
.*is.*
[A-Za-z\s]+\d+[a-z\s]*
[\D]+\d{1,2}[a-z ]+
Hints:
\d Any Digit
\D Any Non-digit character
. Any Character
\. Period
[abc] Only a, b, or c
[^abc] Not a, b, nor c
[a-z] Characters a to z
[0-9] Numbers 0 to 9
\w Any Alphanumeric character
\W Any Non-alphanumeric character
{m} m Repetitions
{m,n} m to n Repetitions
* Zero or more repetitions
+ One or more repetitions
? Optional character
\s Any Whitespace
\S Any Non-whitespace character
^…$ Starts and ends
(…) Capture Group
(a(bc)) Capture Sub-group
(.*) Capture all
(abc|def) Matches abc or def
3 The solution requires is the expression that matches one or more non-digits
one or two digits lowercase letters and spaces
Five Golden Tickets were found, and they’re in the tickets subdirectory of your home folder!
But wait - one of them is SLIGHTLY different… Which one is the fake?
ticket1.gif
ticket2.gif
ticket3.gif
ticket4.gif
ticket5.gif
Hints:
1 The images may look the same to humans, but computers will see that one is different.
2 The false ticket is only off by one bit. What functions will look at two similar files and
give drastically different output?
Come with me
USB
To a world of virtualization
Look around
Use cd
Into your own file location
We'll login
/usr/bin/
Has some nifty tools of my creation
What will run
Will defy
Explanation
There is no
Steel I know
To compare with virtualization
Debian
BSD
Grab a torrent and be free
Just like pipes hauling chocolate out of our river, you can redirect the standard output of a
command to the standard input of another. For example, if you want BEAUTIFUL file listings, try
ls -l | lolcat to see what happens! You can also direct output to a file by typing something
like ls -l > /tmp/listing.txt . This will write your directory listing to a file in /tmp/
instead of showing it in your terminal. How can you have both?
Specifically, which command will append the output of ls -l to /tmp/listing.txt AND print it to
the terminal (standard out)?
Hints:
1 There are useful commands that can take “piped” output as their input. For example, if
you want to list every file in your current directory EXCEPT the one called
"licorice.txt", you can use ls -l | grep -v "licorice.txt" . This uses
grep inversely (find all BUT) to get a final output similar to ls -l but lacking that
one line.
2 There is probably a command in Linux that can direct output to the terminal AND a
file at the same time. I think it starts with the 20th letter of the English alphabet.
Oh, there’s a buttercup flower that’s gone bad. Please rename the one in
$HOME/chocolateroom/buttercups/ with a - in the file name to match the others. Once
you're done, please run $ ./bc-sniff in that folder to get the flag we've tucked away for you!
Hints:
1 The mv command is great for renaming files, but anything coming after it that begins
with a “-” will be interpreted as an option.
2 Linux commands typically take options that begin with “-”. How can you let mv know
that a file starting with “-” is NOT an option? Can you be more specific about the file
and its location?
3 Try specifying the full path to the file, or use “./filename” so that you’re starting with a
“.” instead of a “-”, e.g. mv ./-sillyfile.txt
One of these lollipops is actually a lever that turns some of the pipes on and off or whatever. Can
you find which lollipop in your $HOME/chocolateroom/ folder tree is an executable program?
The answer is a file name beginning with lollipop-. Enter just the file name, not the full path.
Hints:
1 The file command will tell you what a given object looks like
2 There’s a way to find files in a directory structure and then exec ute commands
against each file found
It seems someone used your terminal to do a bit of Android app reversing. What’s the name of the
file they examined?
Hints:
Parts of the factory can operate with command line redirectors. For example, the filter that looks
for gloop-y substances in the chocolate river can be tested at the terminal; there’s a version of it in
the ~/chocolateroom/ folder. If you cat effluent.txt and redirect its output to
./filter , it’ll give you 100+ lines of output. Some of the lines will show as dropped by the filter.
What’s wrong with those lines?
What type of attack do lines 10, 20, 30, etc. in effluent.txt resemble?
Hints:
1 Try
contestwinner@oompa-loompa:~/chocolateroom$ cat effluent.txt
| ./filter
2 Notice how some of the output lines are being dropped by the filter? Why would they
look suspicious to a web app defender?
Here in our factory, we have a WWAF - Wonka Web Application Firewall! It works similarly to
other modern WAF technologies. We use JSON rule sets to filter out good input with positive
values from bad input using negative values. For example:
{
"\\d":-50,
"[a-z]":1
}
These rules would filter out lines with digits while keeping lines with lowercase alpha
characters.
Let's practice by creating a JSON rule set file named my-rules.json that will allow every
line through that doesn't have an @ symbol.
Then run ./filter -r my-rules.json < effluent.txt and (if correct) submit the
hash provided.
Note
Note: ./filter -h will show you filter options.
Note
Note: In the example, any backslashes ( \ ) we use are doubled ( \\ ). This is necessary for our
filter to recognize that character correctly.
Hints:
2 How can we make filter take away lots of points for @ symbols? What could
we assign positive points for?
3 This can all be done by deleting the first rule and modifying the second of the
original scoring.json . Have you stomped that already? Here's what the
original looked like:
{
"'":-5,
"1=1":-50,
"[a-zA-Z]":1,
"\\w{5}":5
}
Q5.2 - FILTER THE GLOOP - ANSWERED BY YOU 19 MINUTES AGO 5 POINTS
That filter we have on the chocolate river does a great job keeping junk out and letting
good stuff in - when it’s configured correctly. For example, effluent.txt has some valid
strings in it, but every 10th line needs to be filtered out. (You're kidding! What a crazy, pseudo-
random happenstance!) Using scoring.json as an example, configure your own rule set of
10 rules or fewer to block those bad lines - and nothing else.
Once you’ve achieved this, what’s the SHA1 hash of the filtered output? This hash will be
printed to the console by filter .
Hint: You can test your regular expressions using sites such as https://regex101.com/
(https://regex101.com/).
Hints:
1 What characters and strings are most common to the bad entries? You could print
every 5th line using awk as follows: awk 'NR % 5 == 0' effluent.txt
Just change 5 to 10, since every 10th entry is bad in this case.
As you surely have gathered, secrecy is something we take quite seriously here! As such, it is
important that you understand some of the essentials of cryptography. Let's start with some AES
encryption.
Use openssl enc -aes-256-cbc to encrypt anything. Then look at the contents with xxd
or hexdump -C . What are the first six characters in the file?
Hints:
1 openssl , when used this way, expects data to come from standard in (stdin).
Consider putting echo Hello | before your openssl command.
2 To catch the output, consider writing to a file with > output.file after your
openssl command, or pipe directly to another program, e.g. | xxd .
Q6.1 - SWEET INITIALIZATION VECTORS! - ANSWERED BY YOU AN HOUR AGO 3 POINTS
3 INCORRECT ATTEMPTS - 2 POINTS LOST
If you add -p or -P to the prior openssl command, you'll notice certain values are output:
Salt
Salt: A pseudo-random value that makes brute force decryption more difficult.
Key
Key: The secret, shared value that is used to encrypt and decrypt the message.
IV
IV: Ciphers like AES-CBC uses a rolling encryption scheme. You can think of an
initialization vector as the starting point in that roll.
openssl creates a pseudo-random salt each time it's run. The key and IV are derived from
the password the user supplies. If you run the command multiple times, the values change
because of the salt
salt.
Hints:
2 Getting a different answer every time? Try using the -nosalt option.
3 You can even specify the password right in your command with something like:
$ echo I love crypto | openssl enc -aes-256-cbc -nosalt -P
-k 'Hunter2'
(It may appear as all asterisks.)
Q6.2 - THE WONKATANIA - ANSWERED BY YOU 42 MINUTES AGO 6 POINTS
We have a special way of summoning the Wonkatania when we want to float down the
chocolate river. The instructions are encrypted and sitting in the chocolateroom folder. We
used aes-256-cbc
aes-256-cbc, didn’t use any padding or salt salt, and the encryption passphrase is Pure
Imagination . It could be accomplished with openssl or any one of many scripting
languages.
Hints:
2 Would you rather use another tool? You can get the key and IV that openssl would
use by entering this command:
openssl enc -aes-256-cbc -nosalt -P -k 'Pure Imagination'
3 If you're using openssl , make sure you use -nosalt and -nopad .
You may be interested in trying our new Vegetable Gum. Oh no, it's not what you think. It
tastes like ordinary chewing gum, but it smells like cauliflower and asparagus to anybody
else. This way, if you chew a piece after dinner, your parents will think you ate your
vegetables!
It seems that a rogue system on our network was attempting to access SMB shares on the mail
server. We're concerned that the activity may have been successful. You can use evtx_dump.py
to parse the .evtx file into XML. Alternately, if you have a Windows host or VM, feel free to use
PowerShell or Event Viewer to analyze the evidence.
First, please examine the file and let us know how many events were captured.
Hints:
2 Every event has an EventID field. Maybe there's a way to count those with grep
and wc ...
Q1.1 - SPLITTING WOOD - ANSWERED BY YOU 13 MINUTES AGO 5 POINTS 2 INCORRECT ATTEMPTS - 1 POINT LOST
Please, analyze the log file and let us know which account was successfully leveraged to access
the server! Time for a password reset...
Hints:
1 Windows events have EventID values that identify what has happened. What
EventIDs are found in this log?
2 Events like logon attempts that involve users include a TargetUserName data
point. The user listed after the failed logon EventID should be our victim.
3 Windows EventID 4624 indicates a successful logon attempt. Try finding that
EventID and looking 20 or so lines after it.
There's an encrypted note.enc in $HOME/inventingroom , but we've lost the key. Here's
what we remember:
The answer should be a string of characters, starting with a capital letter, and ending with
punctuation.
SECRET MESSAGE!
Submit Answer
Hints:
#!/usr/bin/python3
from Crypto.Cipher import AES # import the crypto functionality
needed
3 Want to use bash and openssl ? Here's a brute force implementation for a single-
byte key. That is, this would work for any key that started with an unknown byte value
followed by 31 null ( \x00 ) bytes:
#!/bin/bash
for i in $( seq 0 255 )
do
OUTPUT=$( openssl enc -d -aes-256-cbc -nosalt -nopad -in
note.enc -iv 00 -K `printf "%02x" $i` )
if [[ $OUTPUT == *"stop"* ]]; then # check for "stop" in
output
echo 'Decrypted message is: '$OUTPUT
echo 'Key started with '`printf "%02x" $i`
fi
done
#!/usr/bin/python3
from Crypto.Cipher import AES # import the crypto functionality
needed
NOTE: For either of these to work with this challenge, they will need to be altered to
brute force the two unknown bytes.
Q3 - EVERLASTING CONFIG FILE - ANSWERED BY YOU 33 MINUTES AGO 4 POINTS
The prototype Everlasting Gobstopper Machine is currently turned off - and has been since that
candy was moved to the general production line. Just to see if it works, please edit its config and
try to start it up. Oh, just to warn you, it might be picky about the time stamp on that config file.
Adjust gs-config.txt to turn the machine on, and make sure its timestamp is before noon on
30 June, 1971. Next, run the gobstopper binary and submit the flag in its output.
Hints:
3 Try touch -t YYYYMMDDHHMM , and use a time before noon on 30 June, 1971.
I've dropped parts of a flag into the Dinner Gum machine. Can you examine bygumitsgum and
find the original string?
Flag - NetWars{SomeTextGoesHere}
Submit Answer
Hints:
1 One of the most common way of encoding binary data is Base 64. HTTP tools often
use URL encoding to pass characters that have special meaning in a URL.
2 The file command does a great job examining the so-called magic bytes of a file to
guess the file format.
3 If you have trouble decompressing a given level of the message, man and internet
search engines are both excellent resources.
Q5 - OFF WE GO - ANSWERED BY YOU A FEW SECONDS AGO 6 POINTS
We've sewn a secret path to root privileges in your workstation with a SUID 0 setting on an
executable.
Exploit this escalation path and cat the file located at /root/rules.txt .
Hints:
1 One quick way to search a filesystem for programs with SUID 0 set is: find / -
perm -u=s or find / -perm -4000 (and it helps to append 2>/dev/null to
drop the errors for this one). This asks find to start in / and look for files with
permissions set such that the SUID bit is turned on. This is expected for certain
programs like ping , passwd , and sudo . See if any of the programs listed seem
odd in that list.
2 ne should not have SUID set. What sensitive files can we edit with this privilege?
More about ne. (http://ne.di.unimi.it/docs/index.html)
3 The /etc/sudoers file determines who, on a Linux system, is allowed to use the
sudo command.
Since this file does not have write permissions set, we'll have to tell our editor to flip
that permission, temporarily. ne 's Exec command in the Extras menu lets us do
this.
4 The quick way to take care of "read only" permissions in ne is to press <Ctrl> - k ,
type RO and press <Enter> .
5 If a user named bob wants to be able to sudo all the things without being bothered
for a password, he could insert a line like this into /etc/sudoers :
bob ALL=(ALL) NOPASSWD:ALL
6 Once privileges are escalated, bob could sudo cat /root/secrets.txt . You
know, if he wanted to.
Q6 - FIXING A HOLE 5 POINTS
There's a hole in the lickable - I mean uncomplicated - firewall, and we're concerned about our
snozzberries!
With UID 0 privileges (as root), please use ufw to fix the hole - delete the rule that allows
TCP/50413 in. Once it's patched up, look in /root/ for the flag we'll drop.
Flag - NetWars{SomeTextGoesHere}
There are our Fizzy Lifting Drinks. They fill you with gas, and the gas is so terrifically lifting
that it lifts you right off the ground like a balloon. But I daren't sell it yet. It's still too
powerful.
Come along now; don't hang about. You're going to be wild about this next room.
For some reason, this room reminds me of the windows in my dentist's office. Maybe it's the smell...
Let's cd into the pswinner directory. What message is on the warning label?
Flag - NetWars{SomeTextGoesHere}
As long as we're reading things, what's the value of the WallSign environment variable?
Flag - NetWars{SomeTextGoesHere}
Q4 - COUNTING 3 POINTS
In PowerShell, there's an easy way to generate a range of numbers. How could you generate a list
of numbers from 1 to 255?
(1...256)
1..255
New-Range -Start 1 -End 255
range(1,256)
In PowerShell, we can iterate over a list of items (like in the previous question) to use each as a
component of another command. For example, if we want to add a few numbers to an existing
variable, we can use ForEach-Object to do so in a one-liner.
Interesting! There's a cabinet labeled "FLD" with an odd lock on it. It's a dial marked "Passcode"
with the numbers 0 through 99 on it. Let's try every valid value of Passcode as an input to the
cabinet.
What flag does FizzyLiftingDrink.ps1 return when fed the right Passcode?
Flag - NetWars{SomeTextGoesHere}
A process running on your system is bound to a specific TCP port. When you run
/home/contestwinner/eggsortingroom/egg-presenter , an egg is chosen at random,
sent through that port, and evaluated by the sorter.
Number >= 0
It seems a rotten child has fallen down the bad egg chute. Unfortunately, she was holding a pack of
our new Vegetable Gum, and we really can't afford to have it burnt up - not today. Could you please
shut it down? It's rigged with a back door that shuts it off when a single packet hits 127.0.0.127 on
UDP port 123. Oh, and it expects that packet to come from 10.99.99.99, port 321 - I hope that's
not a problem. Once it's off, it'll throw a special NetWars flag in /tmp/ . Your answer will be the
name of that file, minus any file extension. Grab it before your /tmp/ incinerator runs!
Target: 127.0.0.127
Flag - NetWars{SomeTextGoesHere}
As you well know, we are most concerned with the prospect of spies in our factory. As such, we
routinely send covert messages across the network to see if they are detected.
Flag - NetWars{SomeTextGoesHere}
Oh dear me - a 64-bit Windows 8.1 workstation in our Egg Sorting Room has been compromised!
We'll have to take a look and see what happened to it.
What egg-named program file was running on the system at the time of the memory snapshot,
/home/contestwinner/eggsortingroom/OL4.raw ? Answer in the form of file.ext .
file.ext
Messages 1
1:25:24 Remaining