# Certificates {% hint style="success" %} Learn & practice AWS Hacking:[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)\ Learn & practice GCP Hacking: [**HackTricks Training GCP Red Team Expert (GRTE)**](https://training.hacktricks.xyz/courses/grte)
Support HackTricks * Check the [**subscription plans**](https://github.com/sponsors/carlospolop)! * **Join the** ๐Ÿ’ฌ [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** ๐Ÿฆ [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.** * **Share hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos.
{% endhint %}
\ Use [**Trickest**](https://trickest.com/?utm_source=hacktricks&utm_medium=text&utm_campaign=ppc&utm_term=trickest&utm_content=certificates) to easily build and **automate workflows** powered by the world's **most advanced** community tools.\ Get Access Today: {% embed url="https://trickest.com/?utm_source=hacktricks&utm_medium=banner&utm_campaign=ppc&utm_content=certificates" %} ## What is a Certificate A **public key certificate**๋Š” ์•”ํ˜ธํ•™์—์„œ ๋ˆ„๊ตฐ๊ฐ€๊ฐ€ ๊ณต๊ฐœ ํ‚ค๋ฅผ ์†Œ์œ ํ•˜๊ณ  ์žˆ์Œ์„ ์ฆ๋ช…ํ•˜๋Š” ๋””์ง€ํ„ธ ID์ž…๋‹ˆ๋‹ค. ์—ฌ๊ธฐ์—๋Š” ํ‚ค์˜ ์„ธ๋ถ€์ •๋ณด, ์†Œ์œ ์ž์˜ ์‹ ์›(์ฃผ์ฒด), ๊ทธ๋ฆฌ๊ณ  ์‹ ๋ขฐํ•  ์ˆ˜ ์žˆ๋Š” ๊ธฐ๊ด€(๋ฐœ๊ธ‰์ž)์˜ ๋””์ง€ํ„ธ ์„œ๋ช…์ด ํฌํ•จ๋ฉ๋‹ˆ๋‹ค. ์†Œํ”„ํŠธ์›จ์–ด๊ฐ€ ๋ฐœ๊ธ‰์ž๋ฅผ ์‹ ๋ขฐํ•˜๊ณ  ์„œ๋ช…์ด ์œ ํšจํ•˜๋ฉด ํ‚ค ์†Œ์œ ์ž์™€์˜ ์•ˆ์ „ํ•œ ํ†ต์‹ ์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค. ์ธ์ฆ์„œ๋Š” ์ฃผ๋กœ [์ธ์ฆ ๊ธฐ๊ด€](https://en.wikipedia.org/wiki/Certificate\_authority) (CAs)์— ์˜ํ•ด [๊ณต๊ฐœ ํ‚ค ์ธํ”„๋ผ](https://en.wikipedia.org/wiki/Public-key\_infrastructure) (PKI) ์„ค์ •์—์„œ ๋ฐœ๊ธ‰๋ฉ๋‹ˆ๋‹ค. ๋˜ ๋‹ค๋ฅธ ๋ฐฉ๋ฒ•์€ [์‹ ๋ขฐ์˜ ์›น](https://en.wikipedia.org/wiki/Web\_of\_trust)์œผ๋กœ, ์‚ฌ์šฉ์ž๊ฐ€ ์„œ๋กœ์˜ ํ‚ค๋ฅผ ์ง์ ‘ ๊ฒ€์ฆํ•˜๋Š” ๋ฐฉ์‹์ž…๋‹ˆ๋‹ค. ์ธ์ฆ์„œ์˜ ์ผ๋ฐ˜์ ์ธ ํ˜•์‹์€ [X.509](https://en.wikipedia.org/wiki/X.509)์ด๋ฉฐ, RFC 5280์— ์„ค๋ช…๋œ ๋Œ€๋กœ ํŠน์ • ์š”๊ตฌ์— ๋งž๊ฒŒ ์กฐ์ •๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ## x509 Common Fields ### **Common Fields in x509 Certificates** x509 ์ธ์ฆ์„œ์—์„œ ์—ฌ๋Ÿฌ **ํ•„๋“œ**๋Š” ์ธ์ฆ์„œ์˜ ์œ ํšจ์„ฑ๊ณผ ๋ณด์•ˆ์„ ๋ณด์žฅํ•˜๋Š” ๋ฐ ์ค‘์š”ํ•œ ์—ญํ• ์„ ํ•ฉ๋‹ˆ๋‹ค. ๋‹ค์Œ์€ ์ด๋Ÿฌํ•œ ํ•„๋“œ์˜ ๋ถ„๋ฅ˜์ž…๋‹ˆ๋‹ค: * **Version Number**๋Š” x509 ํ˜•์‹์˜ ๋ฒ„์ „์„ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค. * **Serial Number**๋Š” ์ธ์ฆ์„œ๋ฅผ ์ธ์ฆ ๊ธฐ๊ด€(CA) ์‹œ์Šคํ…œ ๋‚ด์—์„œ ๊ณ ์œ ํ•˜๊ฒŒ ์‹๋ณ„ํ•˜๋ฉฐ, ์ฃผ๋กœ ํ๊ธฐ ์ถ”์ ์„ ์œ„ํ•ด ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. * **Subject** ํ•„๋“œ๋Š” ์ธ์ฆ์„œ์˜ ์†Œ์œ ์ž๋ฅผ ๋‚˜ํƒ€๋‚ด๋ฉฐ, ์ด๋Š” ๊ธฐ๊ณ„, ๊ฐœ์ธ ๋˜๋Š” ์กฐ์ง์ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์—ฌ๊ธฐ์—๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์„ธ๋ถ€ ์‹๋ณ„ ์ •๋ณด๊ฐ€ ํฌํ•จ๋ฉ๋‹ˆ๋‹ค: * **Common Name (CN)**: ์ธ์ฆ์„œ๊ฐ€ ์ ์šฉ๋˜๋Š” ๋„๋ฉ”์ธ. * **Country (C)**, **Locality (L)**, **State or Province (ST, S, ๋˜๋Š” P)**, **Organization (O)**, ๋ฐ **Organizational Unit (OU)**๋Š” ์ง€๋ฆฌ์  ๋ฐ ์กฐ์ง์  ์„ธ๋ถ€์ •๋ณด๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. * **Distinguished Name (DN)**๋Š” ์ „์ฒด ์ฃผ์ฒด ์‹๋ณ„์„ ์š”์•ฝํ•ฉ๋‹ˆ๋‹ค. * **Issuer**๋Š” ์ธ์ฆ์„œ๋ฅผ ๊ฒ€์ฆํ•˜๊ณ  ์„œ๋ช…ํ•œ ์‚ฌ๋žŒ์„ ๋‚˜ํƒ€๋‚ด๋ฉฐ, CA์— ๋Œ€ํ•œ ์ฃผ์ฒด์™€ ์œ ์‚ฌํ•œ ํ•˜์œ„ ํ•„๋“œ๋ฅผ ํฌํ•จํ•ฉ๋‹ˆ๋‹ค. * **Validity Period**๋Š” **Not Before** ๋ฐ **Not After** ํƒ€์ž„์Šคํƒฌํ”„๋กœ ํ‘œ์‹œ๋˜์–ด ์ธ์ฆ์„œ๊ฐ€ ํŠน์ • ๋‚ ์งœ ์ด์ „์ด๋‚˜ ์ดํ›„์— ์‚ฌ์šฉ๋˜์ง€ ์•Š๋„๋ก ๋ณด์žฅํ•ฉ๋‹ˆ๋‹ค. * **Public Key** ์„น์…˜์€ ์ธ์ฆ์„œ์˜ ๋ณด์•ˆ์— ์ค‘์š”ํ•œ ๋ถ€๋ถ„์œผ๋กœ, ๊ณต๊ฐœ ํ‚ค์˜ ์•Œ๊ณ ๋ฆฌ์ฆ˜, ํฌ๊ธฐ ๋ฐ ๊ธฐํƒ€ ๊ธฐ์ˆ ์  ์„ธ๋ถ€์ •๋ณด๋ฅผ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. * **x509v3 extensions**๋Š” ์ธ์ฆ์„œ์˜ ๊ธฐ๋Šฅ์„ ํ–ฅ์ƒ์‹œํ‚ค๋ฉฐ, **Key Usage**, **Extended Key Usage**, **Subject Alternative Name** ๋ฐ ๊ธฐํƒ€ ์†์„ฑ์„ ์ง€์ •ํ•˜์—ฌ ์ธ์ฆ์„œ์˜ ์ ์šฉ์„ ์„ธ๋ฐ€ํ•˜๊ฒŒ ์กฐ์ •ํ•ฉ๋‹ˆ๋‹ค. #### **Key Usage and Extensions** * **Key Usage**๋Š” ๊ณต๊ฐœ ํ‚ค์˜ ์•”ํ˜ธํ™” ์‘์šฉ ํ”„๋กœ๊ทธ๋žจ์„ ์‹๋ณ„ํ•˜๋ฉฐ, ๋””์ง€ํ„ธ ์„œ๋ช… ๋˜๋Š” ํ‚ค ์•”ํ˜ธํ™”์™€ ๊ฐ™์€ ์šฉ๋„๋กœ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. * **Extended Key Usage**๋Š” ์ธ์ฆ์„œ์˜ ์‚ฌ์šฉ ์‚ฌ๋ก€๋ฅผ ๋”์šฑ ์ขํžˆ๋ฉฐ, ์˜ˆ๋ฅผ ๋“ค์–ด TLS ์„œ๋ฒ„ ์ธ์ฆ์„ ์œ„ํ•œ ๊ฒƒ์ž…๋‹ˆ๋‹ค. * **Subject Alternative Name** ๋ฐ **Basic Constraint**๋Š” ์ธ์ฆ์„œ๊ฐ€ ์ ์šฉ๋˜๋Š” ์ถ”๊ฐ€ ํ˜ธ์ŠคํŠธ ์ด๋ฆ„๊ณผ ์ธ์ฆ์„œ๊ฐ€ CA์ธ์ง€ ์ตœ์ข… ์—”ํ‹ฐํ‹ฐ ์ธ์ฆ์„œ์ธ์ง€๋ฅผ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค. * **Subject Key Identifier** ๋ฐ **Authority Key Identifier**์™€ ๊ฐ™์€ ์‹๋ณ„์ž๋Š” ํ‚ค์˜ ๊ณ ์œ ์„ฑ๊ณผ ์ถ”์  ๊ฐ€๋Šฅ์„ฑ์„ ๋ณด์žฅํ•ฉ๋‹ˆ๋‹ค. * **Authority Information Access** ๋ฐ **CRL Distribution Points**๋Š” ๋ฐœ๊ธ‰ CA๋ฅผ ๊ฒ€์ฆํ•˜๊ณ  ์ธ์ฆ์„œ ํ๊ธฐ ์ƒํƒœ๋ฅผ ํ™•์ธํ•˜๋Š” ๊ฒฝ๋กœ๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. * **CT Precertificate SCTs**๋Š” ์ธ์ฆ์„œ์— ๋Œ€ํ•œ ๊ณต๊ณต ์‹ ๋ขฐ๋ฅผ ์œ„ํ•ด ์ค‘์š”ํ•œ ํˆฌ๋ช…์„ฑ ๋กœ๊ทธ๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ```python # Example of accessing and using x509 certificate fields programmatically: from cryptography import x509 from cryptography.hazmat.backends import default_backend # Load an x509 certificate (assuming cert.pem is a certificate file) with open("cert.pem", "rb") as file: cert_data = file.read() certificate = x509.load_pem_x509_certificate(cert_data, default_backend()) # Accessing fields serial_number = certificate.serial_number issuer = certificate.issuer subject = certificate.subject public_key = certificate.public_key() print(f"Serial Number: {serial_number}") print(f"Issuer: {issuer}") print(f"Subject: {subject}") print(f"Public Key: {public_key}") ``` ### **OCSP์™€ CRL ๋ฐฐํฌ ์ง€์ ์˜ ์ฐจ์ด** **OCSP** (**RFC 2560**)๋Š” ํด๋ผ์ด์–ธํŠธ์™€ ์‘๋‹ต์ž๊ฐ€ ํ˜‘๋ ฅํ•˜์—ฌ ๋””์ง€ํ„ธ ๊ณต๊ฐœ ํ‚ค ์ธ์ฆ์„œ๊ฐ€ ์ทจ์†Œ๋˜์—ˆ๋Š”์ง€ ํ™•์ธํ•˜๋Š” ๋ฐฉ๋ฒ•์œผ๋กœ, ์ „์ฒด **CRL**์„ ๋‹ค์šด๋กœ๋“œํ•  ํ•„์š”๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค. ์ด ๋ฐฉ๋ฒ•์€ ์ทจ์†Œ๋œ ์ธ์ฆ์„œ ์ผ๋ จ ๋ฒˆํ˜ธ ๋ชฉ๋ก์„ ์ œ๊ณตํ•˜์ง€๋งŒ ์ž ์žฌ์ ์œผ๋กœ ํฐ ํŒŒ์ผ์„ ๋‹ค์šด๋กœ๋“œํ•ด์•ผ ํ•˜๋Š” ์ „ํ†ต์ ์ธ **CRL**๋ณด๋‹ค ๋” ํšจ์œจ์ ์ž…๋‹ˆ๋‹ค. CRL์€ ์ตœ๋Œ€ 512๊ฐœ์˜ ํ•ญ๋ชฉ์„ ํฌํ•จํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋” ๋งŽ์€ ์„ธ๋ถ€์ •๋ณด๋Š” [์—ฌ๊ธฐ](https://www.arubanetworks.com/techdocs/ArubaOS%206\_3\_1\_Web\_Help/Content/ArubaFrameStyles/CertRevocation/About\_OCSP\_and\_CRL.htm)์—์„œ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ### **์ธ์ฆ์„œ ํˆฌ๋ช…์„ฑ์ด๋ž€** ์ธ์ฆ์„œ ํˆฌ๋ช…์„ฑ์€ SSL ์ธ์ฆ์„œ์˜ ๋ฐœ๊ธ‰ ๋ฐ ์กด์žฌ๊ฐ€ ๋„๋ฉ”์ธ ์†Œ์œ ์ž, CA ๋ฐ ์‚ฌ์šฉ์ž์—๊ฒŒ ๋ณด์ด๋„๋ก ํ•˜์—ฌ ์ธ์ฆ์„œ ๊ด€๋ จ ์œ„ํ˜‘์— ๋Œ€์‘ํ•˜๋Š” ๋ฐ ๋„์›€์„ ์ค๋‹ˆ๋‹ค. ๊ทธ ๋ชฉํ‘œ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค: * ๋„๋ฉ”์ธ ์†Œ์œ ์ž์˜ ์ง€์‹ ์—†์ด CA๊ฐ€ ๋„๋ฉ”์ธ์— ๋Œ€ํ•œ SSL ์ธ์ฆ์„œ๋ฅผ ๋ฐœ๊ธ‰ํ•˜๋Š” ๊ฒƒ์„ ๋ฐฉ์ง€ํ•ฉ๋‹ˆ๋‹ค. * ์‹ค์ˆ˜๋กœ ๋˜๋Š” ์•…์˜์ ์œผ๋กœ ๋ฐœ๊ธ‰๋œ ์ธ์ฆ์„œ๋ฅผ ์ถ”์ ํ•˜๊ธฐ ์œ„ํ•œ ๊ณต๊ฐœ ๊ฐ์‚ฌ ์‹œ์Šคํ…œ์„ ๊ตฌ์ถ•ํ•ฉ๋‹ˆ๋‹ค. * ์‚ฌ์šฉ์ž๋“ค์„ ์‚ฌ๊ธฐ์„ฑ ์ธ์ฆ์„œ๋กœ๋ถ€ํ„ฐ ๋ณดํ˜ธํ•ฉ๋‹ˆ๋‹ค. #### **์ธ์ฆ์„œ ๋กœ๊ทธ** ์ธ์ฆ์„œ ๋กœ๊ทธ๋Š” ๋„คํŠธ์›Œํฌ ์„œ๋น„์Šค์— ์˜ํ•ด ์œ ์ง€๋˜๋Š” ๊ณต๊ฐœ ๊ฐ์‚ฌ ๊ฐ€๋Šฅํ•˜๊ณ  ์ถ”๊ฐ€ ์ „์šฉ ๊ธฐ๋ก์ž…๋‹ˆ๋‹ค. ์ด๋Ÿฌํ•œ ๋กœ๊ทธ๋Š” ๊ฐ์‚ฌ ๋ชฉ์ ์œผ๋กœ ์•”ํ˜ธํ•™์  ์ฆ๊ฑฐ๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ๋ฐœ๊ธ‰ ๊ธฐ๊ด€๊ณผ ๋Œ€์ค‘ ๋ชจ๋‘ ์ด๋Ÿฌํ•œ ๋กœ๊ทธ์— ์ธ์ฆ์„œ๋ฅผ ์ œ์ถœํ•˜๊ฑฐ๋‚˜ ๊ฒ€์ฆ์„ ์œ„ํ•ด ์ฟผ๋ฆฌํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋กœ๊ทธ ์„œ๋ฒ„์˜ ์ •ํ™•ํ•œ ์ˆ˜๋Š” ๊ณ ์ •๋˜์–ด ์žˆ์ง€ ์•Š์ง€๋งŒ, ์ „ ์„ธ๊ณ„์ ์œผ๋กœ ์ฒœ ๊ฐœ ๋ฏธ๋งŒ์ผ ๊ฒƒ์œผ๋กœ ์˜ˆ์ƒ๋ฉ๋‹ˆ๋‹ค. ์ด๋Ÿฌํ•œ ์„œ๋ฒ„๋Š” CA, ISP ๋˜๋Š” ๊ด€์‹ฌ ์žˆ๋Š” ์–ด๋–ค ์ฃผ์ฒด์— ์˜ํ•ด ๋…๋ฆฝ์ ์œผ๋กœ ๊ด€๋ฆฌ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. #### **์ฟผ๋ฆฌ** ์–ด๋–ค ๋„๋ฉ”์ธ์— ๋Œ€ํ•œ ์ธ์ฆ์„œ ํˆฌ๋ช…์„ฑ ๋กœ๊ทธ๋ฅผ ํƒ์ƒ‰ํ•˜๋ ค๋ฉด [https://crt.sh/](https://crt.sh) ๋ฅผ ๋ฐฉ๋ฌธํ•˜์„ธ์š”. ์ธ์ฆ์„œ๋ฅผ ์ €์žฅํ•˜๋Š” ๋‹ค์–‘ํ•œ ํ˜•์‹์ด ์žˆ์œผ๋ฉฐ, ๊ฐ ํ˜•์‹์€ ๊ณ ์œ ํ•œ ์‚ฌ์šฉ ์‚ฌ๋ก€์™€ ํ˜ธํ™˜์„ฑ์„ ๊ฐ€์ง€๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์ด ์š”์•ฝ์—์„œ๋Š” ์ฃผ์š” ํ˜•์‹์„ ๋‹ค๋ฃจ๊ณ  ์ด๋“ค ๊ฐ„์˜ ๋ณ€ํ™˜์— ๋Œ€ํ•œ ์ง€์นจ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ## **ํ˜•์‹** ### **PEM ํ˜•์‹** * ์ธ์ฆ์„œ์— ๊ฐ€์žฅ ๋„๋ฆฌ ์‚ฌ์šฉ๋˜๋Š” ํ˜•์‹์ž…๋‹ˆ๋‹ค. * ์ธ์ฆ์„œ์™€ ๊ฐœ์ธ ํ‚ค๋ฅผ ์œ„ํ•ด ๋ณ„๋„์˜ ํŒŒ์ผ์ด ํ•„์š”ํ•˜๋ฉฐ, Base64 ASCII๋กœ ์ธ์ฝ”๋”ฉ๋ฉ๋‹ˆ๋‹ค. * ์ผ๋ฐ˜์ ์ธ ํ™•์žฅ์ž: .cer, .crt, .pem, .key. * ์ฃผ๋กœ Apache ๋ฐ ์œ ์‚ฌํ•œ ์„œ๋ฒ„์—์„œ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. ### **DER ํ˜•์‹** * ์ธ์ฆ์„œ์˜ ์ด์ง„ ํ˜•์‹์ž…๋‹ˆ๋‹ค. * PEM ํŒŒ์ผ์—์„œ ๋ฐœ๊ฒฌ๋˜๋Š” "BEGIN/END CERTIFICATE" ๋ฌธ์ด ์—†์Šต๋‹ˆ๋‹ค. * ์ผ๋ฐ˜์ ์ธ ํ™•์žฅ์ž: .cer, .der. * ์ข…์ข… Java ํ”Œ๋žซํผ๊ณผ ํ•จ๊ป˜ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. ### **P7B/PKCS#7 ํ˜•์‹** * Base64 ASCII๋กœ ์ €์žฅ๋˜๋ฉฐ, ํ™•์žฅ์ž๋Š” .p7b ๋˜๋Š” .p7c์ž…๋‹ˆ๋‹ค. * ๊ฐœ์ธ ํ‚ค๋ฅผ ์ œ์™ธํ•˜๊ณ  ์ธ์ฆ์„œ์™€ ์ฒด์ธ ์ธ์ฆ์„œ๋งŒ ํฌํ•จ๋ฉ๋‹ˆ๋‹ค. * Microsoft Windows ๋ฐ Java Tomcat์—์„œ ์ง€์›๋ฉ๋‹ˆ๋‹ค. ### **PFX/P12/PKCS#12 ํ˜•์‹** * ์„œ๋ฒ„ ์ธ์ฆ์„œ, ์ค‘๊ฐ„ ์ธ์ฆ์„œ ๋ฐ ๊ฐœ์ธ ํ‚ค๋ฅผ ํ•˜๋‚˜์˜ ํŒŒ์ผ์— ์บก์Šํ™”ํ•˜๋Š” ์ด์ง„ ํ˜•์‹์ž…๋‹ˆ๋‹ค. * ํ™•์žฅ์ž: .pfx, .p12. * ์ฃผ๋กœ Windows์—์„œ ์ธ์ฆ์„œ ๊ฐ€์ ธ์˜ค๊ธฐ ๋ฐ ๋‚ด๋ณด๋‚ด๊ธฐ์— ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. ### **ํ˜•์‹ ๋ณ€ํ™˜** **PEM ๋ณ€ํ™˜**์€ ํ˜ธํ™˜์„ฑ์„ ์œ„ํ•ด ํ•„์ˆ˜์ ์ž…๋‹ˆ๋‹ค: * **x509 to PEM** ```bash openssl x509 -in certificatename.cer -outform PEM -out certificatename.pem ``` * **PEM์„ DER๋กœ** ```bash openssl x509 -outform der -in certificatename.pem -out certificatename.der ``` * **DER to PEM** ```bash openssl x509 -inform der -in certificatename.der -out certificatename.pem ``` * **PEM์„ P7B๋กœ** ```bash openssl crl2pkcs7 -nocrl -certfile certificatename.pem -out certificatename.p7b -certfile CACert.cer ``` * **PKCS7์—์„œ PEM์œผ๋กœ** ```bash openssl pkcs7 -print_certs -in certificatename.p7b -out certificatename.pem ``` **PFX ๋ณ€ํ™˜**์€ Windows์—์„œ ์ธ์ฆ์„œ๋ฅผ ๊ด€๋ฆฌํ•˜๋Š” ๋ฐ ์ค‘์š”ํ•ฉ๋‹ˆ๋‹ค: * **PFX์—์„œ PEM์œผ๋กœ** ```bash openssl pkcs12 -in certificatename.pfx -out certificatename.pem ``` * **PFX to PKCS#8**๋Š” ๋‘ ๋‹จ๊ณ„๋กœ ์ด๋ฃจ์–ด์ง‘๋‹ˆ๋‹ค: 1. PFX๋ฅผ PEM์œผ๋กœ ๋ณ€ํ™˜ ```bash openssl pkcs12 -in certificatename.pfx -nocerts -nodes -out certificatename.pem ``` 2. PEM์„ PKCS8๋กœ ๋ณ€ํ™˜ํ•˜๊ธฐ ```bash openSSL pkcs8 -in certificatename.pem -topk8 -nocrypt -out certificatename.pk8 ``` * **P7B to PFX** ๋˜ํ•œ ๋‘ ๊ฐœ์˜ ๋ช…๋ น์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค: 1. P7B๋ฅผ CER๋กœ ๋ณ€ํ™˜ ```bash openssl pkcs7 -print_certs -in certificatename.p7b -out certificatename.cer ``` 2. CER ๋ฐ ๊ฐœ์ธ ํ‚ค๋ฅผ PFX๋กœ ๋ณ€ํ™˜ํ•˜๊ธฐ ```bash openssl pkcs12 -export -in certificatename.cer -inkey privateKey.key -out certificatename.pfx -certfile cacert.cer ``` ***
\ [**Trickest**](https://trickest.com/?utm_source=hacktricks&utm_medium=text&utm_campaign=ppc&utm_term=trickest&utm_content=certificates)๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์„ธ๊ณ„์—์„œ **๊ฐ€์žฅ ์ง„๋ณด๋œ** ์ปค๋ฎค๋‹ˆํ‹ฐ ๋„๊ตฌ๋กœ ๊ตฌ๋™๋˜๋Š” **์›Œํฌํ”Œ๋กœ์šฐ**๋ฅผ ์‰ฝ๊ฒŒ ๊ตฌ์ถ•ํ•˜๊ณ  **์ž๋™ํ™”**ํ•˜์„ธ์š”.\ ์ง€๊ธˆ ๋ฐ”๋กœ ์•ก์„ธ์Šคํ•˜์„ธ์š”: {% embed url="https://trickest.com/?utm_source=hacktricks&utm_medium=banner&utm_campaign=ppc&utm_content=certificates" %} {% hint style="success" %} AWS ํ•ดํ‚น ๋ฐฐ์šฐ๊ธฐ ๋ฐ ์—ฐ์Šตํ•˜๊ธฐ:[**HackTricks Training AWS Red Team Expert (ARTE)**](https://training.hacktricks.xyz/courses/arte)\ GCP ํ•ดํ‚น ๋ฐฐ์šฐ๊ธฐ ๋ฐ ์—ฐ์Šตํ•˜๊ธฐ: [**HackTricks Training GCP Red Team Expert (GRTE)**](https://training.hacktricks.xyz/courses/grte)
HackTricks ์ง€์›ํ•˜๊ธฐ * [**๊ตฌ๋… ๊ณ„ํš**](https://github.com/sponsors/carlospolop) ํ™•์ธํ•˜๊ธฐ! * **๐Ÿ’ฌ [**Discord ๊ทธ๋ฃน**](https://discord.gg/hRep4RUj7f) ๋˜๋Š” [**ํ…”๋ ˆ๊ทธ๋žจ ๊ทธ๋ฃน**](https://t.me/peass)์— ์ฐธ์—ฌํ•˜๊ฑฐ๋‚˜ **Twitter** ๐Ÿฆ [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**๋ฅผ ํŒ”๋กœ์šฐํ•˜์„ธ์š”.** * **[**HackTricks**](https://github.com/carlospolop/hacktricks) ๋ฐ [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) ๊นƒํ—ˆ๋ธŒ ๋ฆฌํฌ์ง€ํ† ๋ฆฌ์— PR์„ ์ œ์ถœํ•˜์—ฌ ํ•ดํ‚น ํŠธ๋ฆญ์„ ๊ณต์œ ํ•˜์„ธ์š”.**
{% endhint %}