<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE ctfscoredata PUBLIC "-//various.ctf//DTD ctfscoredata 1.1//EN" "TBD://TBA">
<ctfscoredata xmlns="TBD://TBA" generationtime="1219529173">
  <teams>
    <team id="1" name="t1" />
    <team id="2" name="team2" />
  </teams>
  <teamdata>
    <team id="1">
      <property key="host" value="192.168.16.230" />
      <property key="lostFlags" value="16" />
      <property key="capturedFlags" values="2" />
      <detailedStats>
        <count type="capturedFlags" subject="SMTP" value="1" />
        <count type="lostFlags" subject="SMTP" value="0" />
        <count type="capturedFlags" subject="Simple webserver" value="0" />
        <count type="lostFlags" subject="Simple webserver" value="0" />
        <count type="capturedFlags" subject="Einwohnermeldeamt" value="0" />
        <count type="lostFlags" subject="Einwohnermeldeamt" value="0" />
        <count type="capturedFlags" subject="Simple messaging service" value="0" />
        <count type="lostFlags" subject="Simple messaging service" value="16" />
        <count type="capturedFlags" subject="SK Frontend 1" value="1" />
        <count type="lostFlags" subject="SK Frontend 1" value="0" />
        <count type="capturedFlags" subject="SK Frontend 2" value="0" />
        <count type="lostFlags" subject="SK Frontend 2" value="0" />
        <count type="capturedFlags" subject="SK Backend" value="0" />
        <count type="lostFlags" subject="SK Backend" value="0" />
      </detailedStats>
    </team>
    <team id="2">
      <property key="host" value="192.168.16.253" />
      <property key="lostFlags" value="2" />
      <property key="capturedFlags" values="16" />
      <detailedStats>
        <count type="capturedFlags" subject="SMTP" value="0" />
        <count type="lostFlags" subject="SMTP" value="1" />
        <count type="capturedFlags" subject="Simple webserver" value="0" />
        <count type="lostFlags" subject="Simple webserver" value="0" />
        <count type="capturedFlags" subject="Einwohnermeldeamt" value="0" />
        <count type="lostFlags" subject="Einwohnermeldeamt" value="0" />
        <count type="capturedFlags" subject="Simple messaging service" value="16" />
        <count type="lostFlags" subject="Simple messaging service" value="0" />
        <count type="capturedFlags" subject="SK Frontend 1" value="0" />
        <count type="lostFlags" subject="SK Frontend 1" value="1" />
        <count type="capturedFlags" subject="SK Frontend 2" value="0" />
        <count type="lostFlags" subject="SK Frontend 2" value="0" />
        <count type="capturedFlags" subject="SK Backend" value="0" />
        <count type="lostFlags" subject="SK Backend" value="0" />
      </detailedStats>
    </team>
  </teamdata>
  <scoreblock>
    <team id="1">
      <points type="offensive" value="2" />
      <points type="defensive" value="3481" />
      <points type="advisory" value="11" />
      <points type="hacking" value="100" />
    </team>
    <team id="2">
      <points type="offensive" value="16" />
      <points type="defensive" value="3124" />
      <points type="advisory" value="0" />
      <points type="hacking" value="100" />
    </team>
  </scoreblock>
  <services>
    <service id="3" name="SMTP">
      <stat type="capturedFlags" value="1" />
    </service>
    <service id="4" name="Simple webserver">
      <stat type="capturedFlags" value="0" />
    </service>
    <service id="5" name="Einwohnermeldeamt">
      <stat type="capturedFlags" value="0" />
    </service>
    <service id="6" name="Simple messaging service">
      <stat type="capturedFlags" value="16" />
    </service>
    <service id="7" name="SK Frontend 1">
      <stat type="capturedFlags" value="1" />
    </service>
    <service id="8" name="SK Frontend 2">
      <stat type="capturedFlags" value="0" />
    </service>
    <service id="9" name="SK Backend">
      <stat type="capturedFlags" value="0" />
    </service>
  </services>
  <ranking order="1:2" />
  <advisories>
    <advisory id="5" team="1" status="rejected" awardedpoints="0" comment="[0] test advisory" time="1219511749" service="/192.168.16.249">(remove this and the next line)
(be sure to read ~/.ctf_advreadme before reporting advisories.)

New advisory by     :foo 
Affected service(s) : 
Severity [lmh]      : 

===== Problem =====

===== Impact =====

===== Fix =====

</advisory>
    <advisory id="6" team="1" status="rejected" awardedpoints="0" comment="[0] Mach ma neu ;-)" time="1219514469" service="/192.168.16.230">(remove this and the next line)
(be sure to read ~/.ctf_advreadme before reporting advisories.)

New advisory by     : 
Affected service(s) : 
Severity [lmh]      : 

===== Problem =====
chatserver does not close the fd after forking

===== Impact =====
service hangs after a certain number of connections

===== Fix =====

                pid = fork();
                if(pid == 0)
                        serve(c);
                else {  
                        close(c);
                        if(pid &lt; 0)
                                return -1;
                }

</advisory>
    <advisory id="7" team="1" status="accepted" awardedpoints="0" comment="[1] Correct ;-)" time="1219514829" service="/192.168.16.230">(remove this and the next line)
(be sure to read ~/.ctf_advreadme before reporting advisories.)

New advisory by     : nbd
Affected service(s) : einwohnermeldeamt
Severity [lmh]      : high

===== Problem =====
after forking, the file descriptor is not closed in the main process

===== Impact =====
service will hang after too many connections have been processed

===== Fix =====

in einwohnermeldeamt.c, function: main

                if(pid == 0)
                        serve(c);
                else {  
                        close(c);
                        if(pid &lt; 0)
                                return -1;
                }

</advisory>
    <advisory id="8" team="1" status="accepted" awardedpoints="0" comment="[1] ack" time="1219514927" service="/192.168.16.230">(remove this and the next line)
(be sure to read ~/.ctf_advreadme before reporting advisories.)

New advisory by     : nbd
Affected service(s) : einwohnermeldeamt
Severity [lmh]      : high

===== Problem =====
service does not install a SIGCHLD handler
===== Impact =====
zombie processes are left lying around
===== Fix =====
einwohnermeldeamt.c, add this function:

static void
sig_child(sig)
        int sig;
{
        int status;
        int pid;
        pid = wait(&amp;status);
}

call it from main:

        signal(SIGCHLD, sig_child);

</advisory>
    <advisory id="9" team="1" status="accepted" awardedpoints="0" comment="[2] good one" time="1219515295" service="/192.168.16.230">(remove this and the next line)
(be sure to read ~/.ctf_advreadme before reporting advisories.)

New advisory by     : nbd
Affected service(s) : einwohnermeldeamt
Severity [lmh]      : high

===== Problem =====
a size value from the client is used to allocate memory on the stack
===== Impact =====
this can cause a stack overflow that could lead to remote code execution
===== Fix =====
function.c: function newdb()

	recv(s, (char*)&amp;size, 4, 0);
// --- add
        if(size &lt; 0 || size &gt; 4096)
                return;
// --- end
</advisory>
    <advisory id="10" team="1" status="accepted" awardedpoints="0" comment="[1] yup" time="1219515588" service="/192.168.16.230">(remove this and the next line)
(be sure to read ~/.ctf_advreadme before reporting advisories.)

New advisory by     : nbd
Affected service(s) : einwohnermeldeamt
Severity [lmh]      : high

===== Problem =====
data received for the insert command is passed to the shell unchecked
===== Impact =====
remote shellcode execution
===== Fix =====
insert() function in function.c, add this after variable declarations:

        /* Check for ' to avoid abitrarty shell code execution */
        if(strchr(line, '\'') != NULL)
                return;

</advisory>
    <advisory id="11" team="1" status="accepted" awardedpoints="0" comment="[2] Yes, good one" time="1219518500" service="/192.168.16.230">(remove this and the next line)
(be sure to read ~/.ctf_advreadme before reporting advisories.)

new advisory by     : nbd 
Affected service(s) : stk
Severity [lmh]      : medium

===== Problem =====
cross site scripting bug in search.php (and possibly others)
===== Impact =====
might allow people to steal some data through the browser
===== Fix =====
replace original code:
        $user = $_REQUEST[&quot;user&quot;];
        $passwd = $_REQUEST[&quot;passwd&quot;];
with:
        $user = htmlspecialchars($_REQUEST[&quot;user&quot;]);
        $passwd = htmlspecialchars($_REQUEST[&quot;passwd&quot;]);

</advisory>
    <advisory id="12" team="1" status="accepted" awardedpoints="0" comment="[0] Correct, but that's not a vulnerability, but the problem of the admin ;-)" time="1219518701" service="/192.168.16.230">(remove this and the next line)
(be sure to read ~/.ctf_advreadme before reporting advisories.)

new advisory by     : nbd
Affected service(s) : stk
Severity [lmh]      : medium

===== Problem =====
script gives away the environment of the webserver
===== Impact =====
might help with other attacks
===== Fix =====
remove test.php in stk directory or comment out the code line in there
</advisory>
    <advisory id="13" team="1" status="accepted" awardedpoints="0" comment="[2] yes" time="1219520377" service="/192.168.16.230">(remove this and the next line)
(be sure to read ~/.ctf_advreadme before reporting advisories.)

New advisory by     : nbd 
Affected service(s) : mailserver/retserver
Severity [lmh]      : high 

===== Problem =====
the retserver uses a static 1024 byte buffer, but does not check for overrun on input
===== Impact =====
possible remote code execution
===== Fix =====
retserver main.c, function main(), add this in the while(rl) loop

                if ((tmp - buf) &gt; 1023)
                        break;

</advisory>
    <advisory id="14" team="1" status="accepted" awardedpoints="0" comment="[1] Strictly speaking, that's an administration problem. But, as without your fix, an administrator would be foolish to run this service, you get one point" time="1219520991" service="/192.168.16.230">(remove this and the next line)
(be sure to read ~/.ctf_advreadme before reporting advisories.)

New advisory by     : nbd
Affected service(s) : webserver/stk
Severity [lmh]      : high

===== Problem =====
accounts file is readable through http
===== Impact =====
compromises flags
===== Fix =====
go to stk/stk, mv accounts ../../
replace the fopen in index.php with:
      $fp = fopen(&quot;../../accounts&quot;, &quot;r&quot;);
</advisory>
    <advisory id="15" team="1" status="accepted" awardedpoints="0" comment="[1] Administrator problem, but, as in advisory #14, without that fix, no one should run this service, so it's a point for you..." time="1219521271" service="/192.168.16.230">(remove this and the next line)
(be sure to read ~/.ctf_advreadme before reporting advisories.)

New advisory by     : nbd
Affected service(s) : stk/backend
Severity [lmh]      : high 

===== Problem =====
kartei file is readable from the webserver

===== Impact =====
can compromise flags
===== Fix =====
stk/backend/stkd.c
replace DBNAME with

#define DBFILE &quot;../../kartei&quot;
then mv kartei to ../../
</advisory>
  </advisories>
</ctfscoredata>

