<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mintesnot afework on Medium]]></title>
        <description><![CDATA[Stories by Mintesnot afework on Medium]]></description>
        <link>https://medium.com/@mintesnotafework12?source=rss-fc6d38a6bffc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*0RijQS0JldMujFwEyBtkbw.jpeg</url>
            <title>Stories by Mintesnot afework on Medium</title>
            <link>https://medium.com/@mintesnotafework12?source=rss-fc6d38a6bffc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 25 Nov 2026 00:16:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mintesnotafework12/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Forgotten Firewall]]></title>
            <link>https://medium.com/@mintesnotafework12/the-forgotten-firewall-4507aa3943cd?source=rss-fc6d38a6bffc------2</link>
            <guid isPermaLink="false">https://medium.com/p/4507aa3943cd</guid>
            <category><![CDATA[linus]]></category>
            <category><![CDATA[ssti]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[firewall]]></category>
            <dc:creator><![CDATA[Mintesnot afework]]></dc:creator>
            <pubDate>Tue, 29 Jul 2025 11:36:25 GMT</pubDate>
            <atom:updated>2025-07-29T11:36:25.401Z</atom:updated>
            <content:encoded><![CDATA[<p>I was doing a CTF machine called whiterose and it is a kind of machine that you are required to use a serve side template injection to get into the system. When I started working on the machine it was some what easier than I assume and i was going quick. But after completing some of the tasks i stack. I could not reslove the issue. The problem was that I was able to inject command using ejs ssti. But when itry to make request to my machine, It could not. I started doing staff which i non-techiniqcal.I tried to do many things but it does not work. But finally I remember that every incoming request what blocked by my firewall. The forgotten firewall was the issue</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4507aa3943cd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Worship]]></title>
            <link>https://medium.com/@mintesnotafework12/worship-cfd79a5756c7?source=rss-fc6d38a6bffc------2</link>
            <guid isPermaLink="false">https://medium.com/p/cfd79a5756c7</guid>
            <dc:creator><![CDATA[Mintesnot afework]]></dc:creator>
            <pubDate>Thu, 06 Mar 2025 16:52:35 GMT</pubDate>
            <atom:updated>2025-03-06T16:52:35.418Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*GK58dxiZia-_weflxbVwHQ.jpeg" /></figure><p>As an enthusiastic person who desires and search about church and christianity in history, I want to say something about the worship.</p><p>Most of the denoumination whether ancient or new has their kind of worship. For pentecostal, They use what the ethiopian evangenical church use. For catholic, They have what we call mass and after the second vatican they have modernized their litergey and worship style to be like the pentecostals. For classical protestant, they like hymn and pslams. For eastern orthodoxy, They have an amazing worship and litergey which take breath when you see it. But the ethiopian one is so amazing, well organized, structured and best of the best in my view. The music, litergey, worship, order of things……. I can say everything including the music is so amazing . sometimes I think this can not be from man, This must have a divine intervation or hand. Yes, I may not agree with the content in some form but I can boldly say and rate it out of 100 as 10000……000. Just no words, I really thank God to make me see this and be part of it in life.</p><p>The only thing i can say is wow……….</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cfd79a5756c7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TLS and SSL with openssl for Nobes : Part 4 Create advanced Public key Infrastructure]]></title>
            <link>https://medium.com/@mintesnotafework12/tls-and-ssl-with-openssl-for-nobes-part-4-create-advanced-public-key-infrastructure-2cc91c5fe999?source=rss-fc6d38a6bffc------2</link>
            <guid isPermaLink="false">https://medium.com/p/2cc91c5fe999</guid>
            <category><![CDATA[tls]]></category>
            <category><![CDATA[openssl]]></category>
            <category><![CDATA[advanced-pki]]></category>
            <category><![CDATA[pki]]></category>
            <category><![CDATA[certification]]></category>
            <dc:creator><![CDATA[Mintesnot afework]]></dc:creator>
            <pubDate>Sat, 17 Aug 2024 16:43:07 GMT</pubDate>
            <atom:updated>2024-08-17T16:43:07.780Z</atom:updated>
            <content:encoded><![CDATA[<h3>TLS and SSL with openssl for Nobes : Part 4 Create advanced Public key Infrastructure</h3><h3>Advance PKI</h3><h3>pre-request</h3><ol><li><em>understand the configuration of the email,web, root and issuing files</em></li><li><em>have a basic understanding of certificate autority and PKI</em></li><li><em>Have my part 2 and 3 level of understanding</em></li></ol><p>The main reference that we are going to use the openssl docuemtnation for PKI infrastructure.(<a href="https://pki-tutorial.readthedocs.io/en/latest/simple/index.html">https://pki-tutorial.readthedocs.io/en/latest/simple/index.html</a>)</p><p>First we need to setup the file structure that we are going to use. The main thing is not the file structre it may vary from person to person and pki to pki but you have to give atttention to the configuration files as they are the one that are going to be used.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/467/0*6ZOzJhSRLYYJaM8n.png" /></figure><pre>mkdir advanced-pki<br>cd advanced-pki<br>mkdir root-ca email-issuing-ca tls-issuing-ca software-issuing-ca email-server web-server software-verfication</pre><p>The above command will create a root directory to work on and a director for each entity and CA.</p><pre> cd root-ca<br> mkdir etc private cert database crl csr issued-cert<br> cp /dev/null database/index.dat &amp;&amp; echo 10 &gt; database/serial.dat &amp;&amp; echo 10 &gt; database/crl_number<br> vim etc/root-ca.conf<br> openssl req -new -config etc/root-ca.conf -out csr/root-ca.csr -keyout private/root-ca.key<br> openssl ca -selfsign -config etc/root-ca.conf -in csr/root-ca.csr -out cert/root-ca.crt -extensions root_ca_ext -days 7305<br> openssl ca -gencrl -config etc/root-ca.conf -out crl/root-ca.crl<br> cd ..</pre><p>The above command is used to make the structre for root ca and create a csr and sign it using self-signed certificate concept. Also it generate a crl folder that is going to be used for adding revoked certificates. The file structure is the same as part two. The configuration for the root is</p><pre> # Green Root CA<br><br> [ default ]<br> ca                      = root-ca               # CA name<br> dir                     = /home/mintesnot/pki/advanced-pki/root-ca                     # Top dir<br> base_url                = http://mintesnot.org   # CA base URL<br> aia_url                 = $base_url/$ca.cer     # CA certificate URL<br> crl_url                 = $base_url/$ca.crl     # CRL distribution point<br><br> # CA certificate request<br><br> [ req ]<br> default_bits            = 2048                  # RSA key size<br> encrypt_key             = yes                   # Protect private key<br> default_md              = sha256                # MD to use<br> utf8                    = yes                   # Input is UTF-8<br> string_mask             = utf8only              # Emit UTF-8 strings<br> prompt                  = no                    # Don&#39;t prompt for DN<br> distinguished_name      = ca_dn                 # DN section<br> req_extensions          = ca_reqext             # Desired extensions<br><br> [ ca_dn ]<br> countryName             = &quot;ET&quot;<br> organizationName        = &quot;Mintesnot Inc&quot;<br> organizationalUnitName  = &quot;Mintesnot Certification Inc&quot;<br> commonName              = &quot;mintesnot.org&quot;<br><br> [ ca_reqext ]<br> keyUsage                = critical,keyCertSign,cRLSign<br> basicConstraints        = critical,CA:true<br> subjectKeyIdentifier    = hash<br><br> # CA operational settings<br><br> [ ca ]<br> default_ca              = root_ca               # The default CA section<br><br> [ root_ca ]<br> certificate             = $dir/cert/$ca.cert       # The CA cert<br> private_key             = $dir/private/$ca.key # CA private key<br> new_certs_dir           = $dir/issued-cert           # Certificate archive<br> serial                  = $dir/database/serial.dat # Serial number file<br> crlnumber               = $dir/database/crl_number # CRL number file<br> database                = $dir/database/index.dat # Index file<br> rand_serial             = yes                   # Use random serial numbers<br> unique_subject          = no                    # Require unique subject<br> default_days            = 3652                  # How long to certify for<br> default_md              = sha256                # MD to use<br> policy                  = match_pol             # Default naming policy<br> email_in_dn             = no                    # Add email to cert DN<br> preserve                = no                    # Keep passed DN ordering<br> name_opt                = multiline,-esc_msb,utf8 # Subject DN display options<br> cert_opt                = ca_default            # Certificate display options<br> copy_extensions         = none                  # Copy extensions from CSR<br> x509_extensions         = signing_ca_ext        # Default cert extensions<br> default_crl_days        = 365                   # How long before next CRL<br> crl_extensions          = crl_ext               # CRL extensions<br><br> [ match_pol ]<br> countryName             = match                 # Must match &#39;NO&#39;<br> stateOrProvinceName     = optional              # Included if present<br> localityName            = optional              # Included if present<br> organizationName        = match                 # Must match &#39;Green AS&#39;<br> organizationalUnitName  = optional              # Included if present<br> commonName              = supplied              # Must be present<br><br> [ any_pol ]<br> domainComponent         = optional<br> countryName             = optional<br> stateOrProvinceName     = optional<br> localityName            = optional<br> organizationName        = optional<br> organizationalUnitName  = optional<br> commonName              = optional<br> emailAddress            = optional<br><br> # Extensions<br><br> [ root_ca_ext ]<br> keyUsage                = critical,keyCertSign,cRLSign<br> basicConstraints        = critical,CA:true<br> subjectKeyIdentifier    = hash<br> authorityKeyIdentifier  = keyid:always<br><br> [ signing_ca_ext ]<br> keyUsage                = critical,keyCertSign,cRLSign<br> basicConstraints        = critical,CA:true,pathlen:0<br> subjectKeyIdentifier    = hash<br> authorityKeyIdentifier  = keyid:always<br> authorityInfoAccess     = @issuer_info<br> crlDistributionPoints   = @crl_info<br><br> [ crl_ext ]<br> authorityKeyIdentifier  = keyid:always<br> authorityInfoAccess     = @issuer_info<br><br> [ issuer_info ]<br> caIssuers;URI.0         = $aia_url<br><br> [ crl_info ]<br> URI.0                   = $crl_url</pre><pre> cd email-issuing-ca<br> mkdir etc private cert database crl csr issued-cert<br> cp /dev/null database/index.dat &amp;&amp; echo 10 &gt; database/serial.dat &amp;&amp; echo 10 &gt; database/crl_number<br> vim etc/email-issuing-ca.conf<br> openssl req -new -config etc/email-issuing-ca.conf -out ../root-ca/csr/email-issuing-ca.csr -keyout private/email-issuing-ca.key<br> cd ../root-ca<br> openssl ca -config etc/root-ca.conf -in csr/email-issuing-ca.csr -out ../email-issuing-ca/cert/email-issuing-ca.crt -extensions signing_ca_ext<br> cd ../email-issuing-ca<br> openssl ca -gencrl  -config etc/email-issuing-ca.conf -out crl/email-issuing-ca.crl<br> cat cert/email-issuing-ca.crt ../root-ca/cert/root-ca.crt &gt; cert/email-issuing-ca-chain.pem<br> cd ..</pre><p>This the certifciate, private key and crl generation for the email issuing ca in layer two. The configuration file that we used is</p><pre># Green Email CA<br><br>[ default ]<br>ca                      = email-issuing-ca              # CA name<br>dir                     = /home/mintesnot/pki/advanced-pki/email-issuing-ca                   # Top dir<br>base_url                = http://mintesnot.org   # CA base URL<br>aia_url                 = $base_url/$ca.cer     # CA certificate URL<br>crl_url                 = $base_url/$ca.crl     # CRL distribution point<br><br># CA certificate request<br><br>[ req ]<br>default_bits            = 2048                  # RSA key size<br>encrypt_key             = yes                   # Protect private key<br>default_md              = sha256                # MD to use<br>utf8                    = yes                   # Input is UTF-8<br>string_mask             = utf8only              # Emit UTF-8 strings<br>prompt                  = no                    # Don&#39;t prompt for DN<br>distinguished_name      = ca_dn                 # DN section<br>req_extensions          = ca_reqext             # Desired extensions<br><br>[ ca_dn ]<br>countryName             = &quot;ET&quot;<br>organizationName        = &quot;Mintesnot AS&quot;<br>organizationalUnitName  = &quot;Mintesnot Certificate Authority&quot;<br>commonName              = &quot;mintesnot.org&quot;<br><br>[ ca_reqext ]<br>keyUsage                = critical,keyCertSign,cRLSign<br>basicConstraints        = critical,CA:true,pathlen:0<br>subjectKeyIdentifier    = hash<br><br># CA operational settings<br><br>[ ca ]<br>default_ca              = email_ca              # The default CA section<br><br>[ email_ca ]<br>certificate             = $dir/cert/$ca.crt       # The CA cert<br>private_key             = $dir/private/$ca.key # CA private key<br>new_certs_dir           = $dir/issued-cert           # Certificate archive<br>serial                  = $dir/database/serial.dat # Serial number file<br>crlnumber               = $dir/database/crl_number # CRL number file<br>database                = $dir/database/index.dat # Index file<br>rand_serial             = yes                   # Use random serial numbers<br>unique_subject          = no                    # Require unique subject<br>default_days            = 730                   # How long to certify for<br>default_md              = sha256                # MD to use<br>policy                  = match_pol             # Default naming policy<br>email_in_dn             = yes                   # Add email to cert DN<br>preserve                = no                    # Keep passed DN ordering<br>name_opt                = multiline,-esc_msb,utf8 # Subject DN display options<br>cert_opt                = ca_default            # Certificate display options<br>copy_extensions         = copy                  # Copy extensions from CSR<br>x509_extensions         = email_ext             # Default cert extensions<br>default_crl_days        = 1                     # How long before next CRL<br>crl_extensions          = crl_ext               # CRL extensions<br><br>[ match_pol ]<br>countryName             = match                 # Must match &#39;NO&#39;<br>stateOrProvinceName     = optional              # Included if present<br>localityName            = optional              # Included if present<br>organizationName        = match                 # Must match &#39;Green AS&#39;<br>organizationalUnitName  = optional              # Included if present<br>commonName              = supplied              # Must be present<br>emailAddress            = optional              # Included if present<br><br>[ any_pol ]<br>domainComponent         = optional<br>countryName             = optional<br>stateOrProvinceName     = optional<br>localityName            = optional<br>organizationName        = optional<br>organizationalUnitName  = optional<br>commonName              = optional<br>emailAddress            = optional<br><br># Extensions<br><br>[ email_ext ]<br>keyUsage                = critical,digitalSignature,keyEncipherment<br>basicConstraints        = CA:false<br>extendedKeyUsage        = emailProtection,clientAuth<br>subjectKeyIdentifier    = hash<br>authorityKeyIdentifier  = keyid:always<br>authorityInfoAccess     = @issuer_info<br>crlDistributionPoints   = @crl_info<br><br>[ crl_ext ]<br>authorityKeyIdentifier  = keyid:always<br>authorityInfoAccess     = @issuer_info<br><br>[ issuer_info ]<br>caIssuers;URI.0         = $aia_url<br><br>[ crl_info ]<br>URI.0                   = $crl_url</pre><pre>cd tls-issuing<br> mkdir etc private cert database crl csr issued-cert<br> cp /dev/null database/index.dat &amp;&amp; echo 10 &gt; database/serial.dat &amp;&amp; echo 10 &gt; database/crl_number<br> vim etc/tls-issuing-ca.conf<br> openssl req -new -config etc/tls-issuing-ca.conf -out ../root-ca/csr/tls-issuing-ca.csr -keyout private/tls-issuing-ca.key<br> cd ..<br> openssl ca -config etc/root-ca.conf -in csr/tls-issuing-ca.csr -out ../tls-issuing-ca/cert/tls-issuing-ca.crt -extensions signing_ca_ext<br> cd ../tls-issuing-ca<br> openssl ca -gencrl  -config etc/tls-issuing-ca.conf -out crl/tls-issuing-ca.crl<br> cat cert/tls-issuing-ca.crt ../root-ca/cert/root-ca.crt &gt; cert/tls-issuing-ca-chain.pem<br> cd ..</pre><p>The above one is used to make the tls ca and the configuration file for it is</p><pre># Green TLS CA<br><br>[ default ]<br>ca                      = tls-issuing-ca                # CA name<br>dir                     = /home/mintesnot/pki/advanced-pki/tls-issuing-ca                     # Top dir<br>base_url                = http://mintesnot.org   # CA base URL<br>aia_url                 = $base_url/$ca.cer     # CA certificate URL<br>crl_url                 = $base_url/$ca.crl     # CRL distribution point<br><br># CA certificate request<br><br>[ req ]<br>default_bits            = 2048                  # RSA key size<br>encrypt_key             = yes                   # Protect private key<br>default_md              = sha256                # MD to use<br>utf8                    = yes                   # Input is UTF-8<br>string_mask             = utf8only              # Emit UTF-8 strings<br>prompt                  = no                    # Don&#39;t prompt for DN<br>distinguished_name      = ca_dn                 # DN section<br>req_extensions          = ca_reqext             # Desired extensions<br><br>[ ca_dn ]<br>countryName             = &quot;ET&quot;<br>organizationName        = &quot;Mintesnot AS&quot;<br>organizationalUnitName  = &quot;Mintesnot Certificate Authority&quot;<br>commonName              = &quot;Mintesnot TLS CA&quot;<br><br>[ ca_reqext ]<br>keyUsage                = critical,keyCertSign,cRLSign<br>basicConstraints        = critical,CA:true,pathlen:0<br>subjectKeyIdentifier    = hash<br><br># CA operational settings<br><br>[ ca ]<br>default_ca              = tls_ca                # The default CA section<br><br>[ tls_ca ]<br>certificate             = $dir/cert/$ca.crt       # The CA cert<br>private_key             = $dir/private/$ca.key # CA private key<br>new_certs_dir           = $dir/issued-cert           # Certificate archive<br>serial                  = $dir/database/serial.dat # Serial number file<br>crlnumber               = $dir/database/crl_number # CRL number file<br>database                = $dir/database/index.dat # Index file<br>rand_serial             = yes                   # Use random serial numbers<br>unique_subject          = no                    # Require unique subject<br>default_days            = 365                   # How long to certify for<br>default_md              = sha256                # MD to use<br>policy                  = match_pol             # Default naming policy<br>email_in_dn             = yes                   # Add email to cert DN<br>preserve                = no                    # Keep passed DN ordering<br>name_opt                = multiline,-esc_msb,utf8 # Subject DN display options<br>cert_opt                = ca_default            # Certificate display options<br>copy_extensions         = copy                  # Copy extensions from CSR<br>x509_extensions         = server_ext            # Default cert extensions<br>default_crl_days        = 1                     # How long before next CRL<br>crl_extensions          = crl_ext               # CRL extensions<br><br>[ match_pol ]<br>countryName             = match                 # Must match &#39;NO&#39;<br>stateOrProvinceName     = optional              # Included if present<br>localityName            = optional              # Included if present<br>organizationName        = match                 # Must match &#39;Green AS&#39;<br>organizationalUnitName  = optional              # Included if present<br>commonName              = supplied              # Must be present<br>emailAddress            = optional              # Included if present<br><br>[ extern_pol ]<br>countryName             = supplied              # Must be present<br>stateOrProvinceName     = optional              # Included if present<br>localityName            = optional              # Included if present<br>organizationName        = supplied              # Must be present<br>organizationalUnitName  = optional              # Included if present<br>commonName              = supplied              # Must be present<br>emailAddress            = optional              # Included if present<br><br>[ any_pol ]<br>domainComponent         = optional<br>countryName             = optional<br>stateOrProvinceName     = optional<br>localityName            = optional<br>organizationName        = optional<br>organizationalUnitName  = optional<br>commonName              = optional<br>emailAddress            = optional<br><br># Extensions<br><br>[ server_ext ]<br>keyUsage                = critical,digitalSignature,keyEncipherment<br>basicConstraints        = CA:false<br>extendedKeyUsage        = serverAuth,clientAuth<br>subjectKeyIdentifier    = hash<br>authorityKeyIdentifier  = keyid:always<br>authorityInfoAccess     = @issuer_info<br>crlDistributionPoints   = @crl_info<br><br>[ client_ext ]<br>keyUsage                = critical,digitalSignature<br>basicConstraints        = CA:false<br>extendedKeyUsage        = clientAuth<br>subjectKeyIdentifier    = hash<br>authorityKeyIdentifier  = keyid:always<br>authorityInfoAccess     = @issuer_info<br>crlDistributionPoints   = @crl_info<br><br>[ crl_ext ]<br>authorityKeyIdentifier  = keyid:always<br>authorityInfoAccess     = @issuer_info<br><br>[ issuer_info ]<br>caIssuers;URI.0         = $aia_url<br><br>[ crl_info ]<br>URI.0                   = $crl_url</pre><pre>cd software-issuing<br> mkdir etc private cert database crl csr issued-cert<br> cp /dev/null database/index.dat &amp;&amp; echo 10 &gt; database/serial.dat &amp;&amp; echo 10 &gt; database/crl_number<br> vim etc/software-issuing-ca.conf<br> openssl req -new -config etc/software-issuing-ca.conf -out ../root-ca/csr/software-issuing-ca.csr -keyout private/software-issuing-ca.key<br> cd ..<br> openssl ca -config etc/root-ca.conf -in csr/software-issuing-ca.csr -out ../software-issuing-ca/cert/software-issuing-ca.crt -extensions signing_ca_ext<br> cd ../software-issuing-ca<br> openssl ca -gencrl  -config etc/software-issuing-ca.conf -out crl/software-issuing-ca.crl<br> cat cert/software-issuing-ca.crt ../root-ca/cert/root-ca.crt &gt; cert/software-issuing-ca-chain.pem<br> cd ..</pre><p>The configuration for code signing CA and it s configuration is</p><pre># Green Software CA<br><br>[ default ]<br>ca                      = software-issuing-ca           # CA name<br>dir                     = /home/mintesnot/pki/advanced-pki/software-issuing-ca                     # Top dir<br>base_url                = http://mintesnot.org   # CA base URL<br>aia_url                 = $base_url/$ca.cer     # CA certificate URL<br>crl_url                 = $base_url/$ca.crl     # CRL distribution point<br><br># CA certificate request<br><br>[ req ]<br>default_bits            = 2048                  # RSA key size<br>encrypt_key             = yes                   # Protect private key<br>default_md              = sha256                # MD to use<br>utf8                    = yes                   # Input is UTF-8<br>string_mask             = utf8only              # Emit UTF-8 strings<br>prompt                  = no                    # Don&#39;t prompt for DN<br>distinguished_name      = ca_dn                 # DN section<br>req_extensions          = ca_reqext             # Desired extensions<br><br>[ ca_dn ]<br>countryName             = &quot;ET&quot;<br>organizationName        = &quot;Mintesnot AS&quot;<br>organizationalUnitName  = &quot;Mintesnot Certificate Authority&quot;<br>commonName              = &quot;Mintesnot Software CA&quot;<br><br>[ ca_reqext ]<br>keyUsage                = critical,keyCertSign,cRLSign<br>basicConstraints        = critical,CA:true,pathlen:0<br>subjectKeyIdentifier    = hash<br><br># CA operational settings<br><br>[ ca ]<br>default_ca              = software_ca           # The default CA section<br><br>[ software_ca ]<br>certificate             = $dir/cert/$ca.crt       # The CA cert<br>private_key             = $dir/private/$ca.key # CA private key<br>new_certs_dir           = $dir/issued-cert           # Certificate archive<br>serial                  = $dir/database/serial.dat # Serial number file<br>crlnumber               = $dir/database/crl_number # CRL number file<br>database                = $dir/database/index.dat # Index file<br>rand_serial             = yes                   # Use random serial numbers<br>unique_subject          = no                    # Require unique subject<br>default_days            = 1826                  # How long to certify for<br>default_md              = sha256                # MD to use<br>policy                  = match_pol             # Default naming policy<br>email_in_dn             = yes                   # Add email to cert DN<br>preserve                = no                    # Keep passed DN ordering<br>name_opt                = multiline,-esc_msb,utf8 # Subject DN display options<br>cert_opt                = ca_default            # Certificate display options<br>copy_extensions         = copy                  # Copy extensions from CSR<br>x509_extensions         = codesign_ext          # Default cert extensions<br>default_crl_days        = 30                    # How long before next CRL<br>crl_extensions          = crl_ext               # CRL extensions<br><br>[ match_pol ]<br>countryName             = match                 # Must match &#39;NO&#39;<br>stateOrProvinceName     = optional              # Included if present<br>localityName            = optional              # Included if present<br>organizationName        = match                 # Must match &#39;Green AS&#39;<br>organizationalUnitName  = optional              # Included if present<br>commonName              = supplied              # Must be present<br>userId                  = supplied              # Must be present<br><br>[ any_pol ]<br>domainComponent         = optional<br>countryName             = optional<br>stateOrProvinceName     = optional<br>localityName            = optional<br>organizationName        = optional<br>organizationalUnitName  = optional<br>commonName              = optional<br>userId                  = optional<br>emailAddress            = optional<br><br># Extensions<br><br>[ codesign_ext ]<br>keyUsage                = critical,digitalSignature<br>basicConstraints        = CA:false<br>extendedKeyUsage        = critical,codeSigning<br>subjectKeyIdentifier    = hash<br>authorityKeyIdentifier  = keyid:always<br>authorityInfoAccess     = @issuer_info<br>crlDistributionPoints   = @crl_info<br><br>[ crl_ext ]<br>authorityKeyIdentifier  = keyid:always<br>authorityInfoAccess     = @issuer_info<br><br>[ issuer_info ]<br>caIssuers;URI.0         = $aia_url<br><br>[ crl_info ]<br>URI.0                   = $crl_url</pre><pre>cd email-server<br> mkdir etc private cert<br> vim etc/email-server.conf<br> openssl req -new -config etc/email-server.conf -out ../email-issuing-ca/csr/fred.csr -keyout private/fred.key<br> cd ../email-issuing-ca<br> openssl ca -config etc/email-issuing-ca.conf -in csr/fred.csr -out ../email-server/cert/fred.crt -extensions email_ext<br> cd ..</pre><p>The command used to generate a certificate an email user using the eemail ca and the configuration file is</p><pre># Email certificate request<br><br>[ req ]<br>default_bits            = 2048                  # RSA key size<br>encrypt_key             = yes                   # Protect private key<br>default_md              = sha256                # MD to use<br>utf8                    = yes                   # Input is UTF-8<br>string_mask             = utf8only              # Emit UTF-8 strings<br>prompt                  = yes                   # Prompt for DN<br>distinguished_name      = email_dn              # DN template<br>req_extensions          = email_reqext          # Desired extensions<br><br>[ email_dn ]<br>countryName             = &quot;1. Country Name (2 letters) (eg, US)       &quot;<br>countryName_max         = 2<br>stateOrProvinceName     = &quot;2. State or Province Name   (eg, region)   &quot;<br>localityName            = &quot;3. Locality Name            (eg, city)     &quot;<br>organizationName        = &quot;4. Organization Name        (eg, company)  &quot;<br>organizationalUnitName  = &quot;5. Organizational Unit Name (eg, section)  &quot;<br>commonName              = &quot;6. Common Name              (eg, full name)&quot;<br>commonName_max          = 64<br>emailAddress            = &quot;7. Email Address            (eg, name@fqdn)&quot;<br>emailAddress_max        = 40<br><br>[ email_reqext ]<br>keyUsage                = critical,digitalSignature,keyEncipherment<br>extendedKeyUsage        = emailProtection,clientAuth<br>subjectKeyIdentifier    = hash<br>subjectAltName          = email:copy</pre><pre>cd software-verfication<br> mkdir etc private cert<br> vim etc/software-verification.conf<br> openssl req -new -config etc/software-verification.conf -out ../software-issuing-ca/csr/mintesnot-code.csr -keyout private/mintesnot-code.key<br> cd ../software-issuing-ca<br> openssl ca -config etc/software-issuing-ca.conf -in csr/mintesnot-code.csr -out ../software-verfication/cert/mintesnot-code.crt -extensions codesign_ext<br> cd ..</pre><p>The above is for code signing and the configuration is</p><pre># Code-signing certificate request<br><br>[ req ]<br>default_bits            = 2048                  # RSA key size<br>encrypt_key             = yes                   # Protect private key<br>default_md              = sha256                # MD to use<br>utf8                    = yes                   # Input is UTF-8<br>string_mask             = utf8only              # Emit UTF-8 strings<br>prompt                  = yes                   # Prompt for DN<br>distinguished_name      = codesign_dn           # DN template<br>req_extensions          = codesign_reqext       # Desired extensions<br><br>[ codesign_dn ]<br>countryName             = &quot;1. Country Name (2 letters) (eg, US)       &quot;<br>countryName_max         = 2<br>stateOrProvinceName     = &quot;2. State or Province Name   (eg, region)   &quot;<br>localityName            = &quot;3. Locality Name            (eg, city)     &quot;<br>organizationName        = &quot;4. Organization Name        (eg, company)  &quot;<br>organizationalUnitName  = &quot;5. Organizational Unit Name (eg, section)  &quot;<br>commonName              = &quot;6. Common Name              (eg, full name)&quot;<br>commonName_max          = 64<br>userId                  = &quot;7. User ID                  (eg, unique ID)&quot;<br><br>[ codesign_reqext ]<br>keyUsage                = critical,digitalSignature<br>extendedKeyUsage        = critical,codeSigning<br>subjectKeyIdentifier    = hash</pre><pre> cd web-server<br> mkdir etc private cert<br> vim etc/web-server.conf<br> vim etc/web-client.conf<br> openssl req -new -config etc/web-server.conf -out ../tls-issuing-ca/csr/mintesnot-org-server.csr -keyout private/mintesnot-org-server.key<br> openssl req -new -config etc/web-client.conf -out ../tls-issuing-ca/csr/mintesnot-org-client.csr -keyout private/mintesnot-org-client.key<br> cd ../tls-issuing-ca<br> openssl ca -config etc/tls-issuing-ca.conf -in csr/mintesnot-org-server.csr -out ../tls-server/cert/mintesnot-org-server.crt -extensions server_ext<br> openssl ca -config etc/tls-issuing-ca.conf -in csr/mintesnot-org-client.csr -out ../web-server/cert/mintesnot-org-client.crt -extensions client_ext<br> cd ..</pre><p>The above command shows a creation of tls server and client certificate using the below confiugration</p><pre># TLS server certificate request<br><br>[ default ]<br>SAN                     = DNS:www.mintesnot.org   # Default SAN<br><br>[ req ]<br>default_bits            = 2048                  # RSA key size<br>encrypt_key             = no                    # Protect private key<br>default_md              = sha256                # MD to use<br>utf8                    = yes                   # Input is UTF-8<br>string_mask             = utf8only              # Emit UTF-8 strings<br>prompt                  = yes                   # Prompt for DN<br>distinguished_name      = server_dn             # DN template<br>req_extensions          = server_reqext         # Desired extensions<br><br>[ server_dn ]<br>countryName             = &quot;1. Country Name (2 letters) (eg, US)       &quot;<br>countryName_max         = 2<br>stateOrProvinceName     = &quot;2. State or Province Name   (eg, region)   &quot;<br>localityName            = &quot;3. Locality Name            (eg, city)     &quot;<br>organizationName        = &quot;4. Organization Name        (eg, company)  &quot;<br>organizationalUnitName  = &quot;5. Organizational Unit Name (eg, section)  &quot;<br>commonName              = &quot;6. Common Name              (eg, FQDN)     &quot;<br>commonName_max          = 64<br><br>[ server_reqext ]<br>keyUsage                = critical,digitalSignature,keyEncipherment<br>extendedKeyUsage        = serverAuth,clientAuth<br>subjectKeyIdentifier    = hash<br>subjectAltName          = $ENV::SAN</pre><pre># TLS client certificate request<br><br>[ req ]<br>default_bits            = 2048                  # RSA key size<br>encrypt_key             = yes                   # Protect private key<br>default_md              = sha256                # MD to use<br>utf8                    = yes                   # Input is UTF-8<br>string_mask             = utf8only              # Emit UTF-8 strings<br>prompt                  = yes                   # Prompt for DN<br>distinguished_name      = client_dn             # DN template<br>req_extensions          = client_reqext         # Desired extensions<br><br>[ client_dn ]<br>countryName             = &quot;1. Country Name (2 letters) (eg, US)       &quot;<br>countryName_max         = 2<br>stateOrProvinceName     = &quot;2. State or Province Name   (eg, region)   &quot;<br>localityName            = &quot;3. Locality Name            (eg, city)     &quot;<br>organizationName        = &quot;4. Organization Name        (eg, company)  &quot;<br>organizationalUnitName  = &quot;5. Organizational Unit Name (eg, section)  &quot;<br>commonName              = &quot;6. Common Name              (eg, full name)&quot;<br>commonName_max          = 64<br>emailAddress            = &quot;7. Email Address            (eg, name@fqdn)&quot;<br>emailAddress_max        = 40<br><br>[ client_reqext ]<br>keyUsage                = critical,digitalSignature<br>extendedKeyUsage        = clientAuth<br>subjectKeyIdentifier    = hash<br>subjectAltName          = email:copy</pre><p>The final file tree will look like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*v7RGoQJpr5jI0tE24cRhLA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/811/1*-xb8tULlIJL9EK7h4jvPMQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/504/1*9FR0Jdpp-H9g_aC7IIo0hQ.png" /></figure><blockquote>The above one does not have any description. The description for the file and folder structure is found in the part two this series.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2cc91c5fe999" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TLS and SSL with openssl for Nobes : Part 3 Create Simple Public key Infrastructure]]></title>
            <link>https://medium.com/@mintesnotafework12/tls-and-ssl-with-openssl-for-nobes-part-3-create-simple-public-key-infrastructure-93a8aa56a99b?source=rss-fc6d38a6bffc------2</link>
            <guid isPermaLink="false">https://medium.com/p/93a8aa56a99b</guid>
            <category><![CDATA[ssl]]></category>
            <category><![CDATA[certificate-authority]]></category>
            <category><![CDATA[certificate]]></category>
            <category><![CDATA[pki]]></category>
            <dc:creator><![CDATA[Mintesnot afework]]></dc:creator>
            <pubDate>Sat, 17 Aug 2024 07:55:38 GMT</pubDate>
            <atom:updated>2024-08-17T09:28:06.934Z</atom:updated>
            <content:encoded><![CDATA[<h3>TLS and SSL with openssl for Nobes : Part 3 Create Simple Public key Infrastructure</h3><h3>Simple PKI</h3><p>I believe in our previous session we were doing ssl simple pki but i think i does not go well so we will now get to it with detailed explanation and reference.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/467/0*Rl_3jTXXD7SPRZEQ.png" /></figure><h3><em>pre-request</em></h3><ol><li><em>understand the configuration of the email,web, root and issuing files</em></li><li><em>have a basic understanding of certificate autority and PKI</em></li><li><em>Have my part 2 level of understanding</em></li></ol><p>The main reference that we are going to use the openssl docuemtnation for PKI infrastructure.(<a href="https://pki-tutorial.readthedocs.io/en/latest/simple/index.html">https://pki-tutorial.readthedocs.io/en/latest/simple/index.html</a>)</p><p>First we need to set up the file structure. You can use your file structure but i am going to use the below one which is not the standard i used to work with it.</p><pre>$ mkdir simple-ca<br>$ cd simple-ca<br>$ mkdir root-ca issuing-ca email-server web-server</pre><p>This is PKI will have root ca and one issuing ca with two clients which are web and email servers.</p><pre>$ cd root-ca/<br>$ mkdir etc private cert crl database issued-cert csr<br>$ touch database/index.dat &amp;&amp; touch database/serial.dat &amp;&amp; touch database/crl_number<br>$ vim etc/root-ca.conf<br>$ openssl req -new -config etc/root-ca.conf -out csr/root-ca.csr -keyout private/root-ca.key<br>$ openssl ca -selfsign -config etc/root-ca.conf -in csr/root-ca.csr -out cert/root-ca.crt -extensions root_ca_ext<br>$ cd ..</pre><p>The above code will create the required files for root which are creating basic folder to work on. Then create the files that are must before using <strong>openssl ca</strong> command. The fourth one will write the following text to the file. From the file below you need to change the dir to your working directory. finally we create a CSR using the configuration file and sign it the user private key which was generated at the time of CSR generation. the fifth says it is requesting a key based on the configuration of the etc/root-ca.conf then wirte the output CSR to he root-ca.csr file then store the private key which will be generated based on the configuration file section req to private/root-ca.key file. Now you can change the permission as a security requiement. For instance the private should be read only for the owner nothing for others.</p><pre># Simple Root CA<br> # The [default] section contains global constants that can be referred to from<br> # the entire configuration file. It may also hold settings pertaining to more<br> # than one openssl command.<br><br> [ default ]<br> ca                      = root-ca               # CA name<br> dir                     = &lt;&quot;you dir&quot;&gt;/simple-ca/root-ca                     # Top dir<br><br> # The next part of the configuration file is used by the openssl req command.<br> # It defines the CA&#39;s key pair, its DN, and the desired extensions for the CA<br> # certificate.<br><br> [ req ]<br> default_bits            = 2048                  # RSA key size<br> encrypt_key             = yes                   # Protect private key<br> default_md              = sha256                # MD to use<br> utf8                    = yes                   # Input is UTF-8<br> string_mask             = utf8only              # Emit UTF-8 strings<br> prompt                  = no                    # Don&#39;t prompt for DN<br> distinguished_name      = ca_dn                 # DN section<br> req_extensions          = ca_reqext             # Desired extensions<br><br> [ ca_dn ]<br> 0.domainComponent       = &quot;org&quot;<br> 1.domainComponent       = &quot;mintesnot&quot;<br> organizationName        = &quot;Mintesnot Inc&quot;<br> commonName              = &quot;Mintesnot Root CA&quot;<br><br> [ ca_reqext ]<br> keyUsage                = critical,keyCertSign,cRLSign<br> basicConstraints        = critical,CA:true<br> subjectKeyIdentifier    = hash<br><br> # The remainder of the configuration file is used by the openssl ca command.<br> # The CA section defines the locations of CA assets, as well as the policies<br> # applying to the CA.<br><br> [ ca ]<br> default_ca              = root_ca               # The default CA section<br><br> [ root_ca ]<br> certificate             = $dir/cert/$ca.crt       # The CA cert<br> private_key             = $dir/private/$ca.key # CA private key<br> new_certs_dir           = $dir/issued-cert           # Certificate archive<br> serial                  = $dir/database/serial.dat # Serial number file<br> crlnumber               = $dir/database/crl_number # CRL number file<br> database                = $dir/database/index.dat # Index file<br> rand_serial             = yes                   # Use random serial numbers<br> unique_subject          = no                    # Require unique subject<br> default_days            = 3652                  # How long to certify for<br> default_md              = sha256                # MD to use<br> policy                  = match_pol             # Default naming policy<br> email_in_dn             = no                    # Add email to cert DN<br> preserve                = no                    # Keep passed DN ordering<br> name_opt                = multiline,-esc_msb,utf8 # Subject DN display options<br> cert_opt                = ca_default            # Certificate display options<br> copy_extensions         = none                  # Copy extensions from CSR<br> x509_extensions         = signing_ca_ext        # Default cert extensions<br> default_crl_days        = 365                   # How long before next CRL<br> crl_extensions          = crl_ext               # CRL extensions<br><br> # Naming policies control which parts of a DN end up in the certificate and<br> # under what circumstances certification should be denied.<br><br> [ match_pol ]<br> domainComponent         = match                 # Must match &#39;simple.org&#39;<br> organizationName        = match                 # Must match &#39;Simple Inc&#39;<br> organizationalUnitName  = optional              # Included if present<br> commonName              = supplied              # Must be present<br><br> [ any_pol ]<br> domainComponent         = optional<br> countryName             = optional<br> stateOrProvinceName     = optional<br> localityName            = optional<br> organizationName        = optional<br> organizationalUnitName  = optional<br> commonName              = optional<br> emailAddress            = optional<br><br> # Certificate extensions define what types of certificates the CA is able to<br> # create.<br><br> [ root_ca_ext ]<br> keyUsage                = critical,keyCertSign,cRLSign<br> basicConstraints        = critical,CA:true<br> subjectKeyIdentifier    = hash<br> authorityKeyIdentifier  = keyid:always<br><br> [ signing_ca_ext ]<br> keyUsage                = critical,keyCertSign,cRLSign<br> basicConstraints        = critical,CA:true,pathlen:0<br> subjectKeyIdentifier    = hash<br> authorityKeyIdentifier  = keyid:always<br><br> # CRL extensions exist solely to point to the CA certificate that has issued<br> # the CRL.<br><br> [ crl_ext ]<br> authorityKeyIdentifier  = keyid:always</pre><pre>$ mkdir etc private cert crl database issued-cert csr<br>$ touch database/index.dat &amp;&amp; touch database/serial.dat &amp;&amp; touch database/crl_number<br>$ vim etc/issuing-ca.conf<br>$ openssl req -new -config etc/issuing-ca.conf -out ../root-ca/csr/issuing-ca.csr -keyout private/issuing-ca.key<br>$ cd ../root-ca<br>$ openssl ca -config etc/root-ca.conf -in csr/issuing-ca.csr -out ../issuing-ca/cert/issuing-ca.crt -extensions signing_ca_ext<br>$ cd ..</pre><p>The above command as the root will creat and write the configuration file then send a CSR to the root-CA in line 4. Then the root will sign it based on the configuration file it has and will use the extension sign-ca-ext which says it is a type of ca with three fuctionality or it will use the sign to do three things.</p><pre># Simple Signing CA<br><br> # The [default] section contains global constants that can be referred to from<br> # the entire configuration file. It may also hold settings pertaining to more<br> # than one openssl command.<br><br> [ default ]<br> ca                      = issuing-ca            # CA name<br> dir                     = /home/mintesnot/pki/mintesnot-ca/simple-ca/issuing-ca                     # Top dir<br><br> # The next part of the configuration file is used by the openssl req command.<br> # It defines the CA&#39;s key pair, its DN, and the desired extensions for the CA<br> # certificate.<br><br> [ req ]<br> default_bits            = 2048                  # RSA key size<br> encrypt_key             = yes                   # Protect private key<br> default_md              = sha256                # MD to use<br> utf8                    = yes                   # Input is UTF-8<br> string_mask             = utf8only              # Emit UTF-8 strings<br> prompt                  = no                    # Don&#39;t prompt for DN<br> distinguished_name      = ca_dn                 # DN section<br> req_extensions          = ca_reqext             # Desired extensions<br><br> [ ca_dn ]<br> 0.domainComponent       = &quot;org&quot;<br> 1.domainComponent       = &quot;mintesnot&quot;<br> organizationName        = &quot;Mintesnot Inc&quot;<br> commonName              = &quot;Mintesnot Signing CA&quot;<br><br> [ ca_reqext ]<br> keyUsage                = critical,keyCertSign,cRLSign<br> basicConstraints        = critical,CA:true,pathlen:0<br> subjectKeyIdentifier    = hash<br><br> # The remainder of the configuration file is used by the openssl ca command.<br> # The CA section defines the locations of CA assets, as well as the policies<br> # applying to the CA.<br><br> [ ca ]<br> default_ca              = signing_ca            # The default CA section<br><br> [ signing_ca ]<br> certificate             = $dir/cert/$ca.crt       # The CA cert<br> private_key             = $dir/private/$ca.key # CA private key<br> new_certs_dir           = $dir/issued-cert           # Certificate archive<br> serial                  = $dir/database/serial.dat # Serial number file<br> crlnumber               = $dir/database/crl_number # CRL number file<br> database                = $dir/database/index.dat # Index file<br> rand_serial             = yes                   # Use random serial numbers<br> unique_subject          = no                    # Require unique subject<br> default_days            = 730                   # How long to certify for<br> default_md              = sha256                # MD to use<br> policy                  = match_pol             # Default naming policy<br> email_in_dn             = yes                   # Add email to cert DN<br> preserve                = no                    # Keep passed DN ordering<br> name_opt                = multiline,-esc_msb,utf8 # Subject DN display options<br> cert_opt                = ca_default            # Certificate display options<br> copy_extensions         = copy                  # Copy extensions from CSR<br> x509_extensions         = email_ext             # Default cert extensions<br> default_crl_days        = 7                     # How long before next CRL<br> crl_extensions          = crl_ext               # CRL extensions<br><br> # Naming policies control which parts of a DN end up in the certificate and<br> # under what circumstances certification should be denied.<br><br> [ match_pol ]<br> domainComponent         = match                 # Must match &#39;simple.org&#39;<br> organizationName        = match                 # Must match &#39;Simple Inc&#39;<br> organizationalUnitName  = optional              # Included if present<br> commonName              = supplied              # Must be present<br> emailAddress            = optional              # Included if present<br><br> [ any_pol ]<br> domainComponent         = optional<br> countryName             = optional<br> stateOrProvinceName     = optional<br> localityName            = optional<br> organizationName        = optional<br> organizationalUnitName  = optional<br> commonName              = optional<br> emailAddress            = optional<br><br> # Certificate extensions define what types of certificates the CA is able to<br> # create.<br><br> [ email_ext ]<br> keyUsage                = critical,digitalSignature,keyEncipherment<br> basicConstraints        = CA:false<br> extendedKeyUsage        = emailProtection,clientAuth<br> subjectKeyIdentifier    = hash<br> authorityKeyIdentifier  = keyid:always<br><br> [ server_ext ]<br> keyUsage                = critical,digitalSignature,keyEncipherment<br> basicConstraints        = CA:false<br> extendedKeyUsage        = serverAuth,clientAuth<br> subjectKeyIdentifier    = hash<br> authorityKeyIdentifier  = keyid:always<br><br> # CRL extensions exist solely to point to the CA certificate that has issued<br> # the CRL.<br><br> [ crl_ext ]<br> authorityKeyIdentifier  = keyid:always</pre><p>Finally we need to generate signature for a website or tls and email services.</p><pre>$ cd email-server<br>$ mkdir private cert etc<br>$ vim etc/email-server.conf<br>$ openssl req -new -config etc/email-server.conf -out ../issuing-ca/csr/fred.csr -keyout private/fred.key<br>$ cd ../issuing-ca/<br>$ openssl ca -config etc/issuing-ca.conf -in csr/fred.csr -out ../email-server/cert/fred.crt -extensions email_ext<br>$ cd ..<br>$  <br>$ ###########################################################################################<br>$<br>$ cd web-server<br>$ mkdir private cert etc<br>$ vim etc/wev-server.conf<br>$ openssl req -new -config etc/web-server.conf -out ../issuing/csr/mintesnot-org.csr -keyout private/mintesnot-org.key<br>$ cd ../issuing-ca/<br>$ openssl ca -config etc/issuing-ca.conf -in csr/mintesnot-org.csr -out ../web-server/cert/mintesnot-org.crt -extensions server_ext<br>$ cd ..</pre><p>This line will have create a email and web certificate by issuing the root server.</p><p>The description for this files and all is found in the part two of the Tls with Openssl. Here we are just implementing.</p><p>The last that we need is a certificate revokation. to do so we can use</p><pre>$ cd ../issuing-ca<br>$ openssl ca -config etc/issuing-ca.conf -revoke issued-cert/24FB611035FDC0BDA45DE350A35A7AA67745F428.pem -crl_reason superseded<br>$ openssl ca -gencrl -config etc/issuing-ca.conf -out crl/issuing-ca.crl</pre><p>For the above code the issuing-ca wants to revoke a private key signature. This can happen due to two reason which are expire and private key compromise the lower certificate holder. First we revoke the key as the configuration says the Certificate archieve will be stored the issued-cert folder then we generate a certificate revokation list based the issuing configuration and then we will sign it and store it.</p><pre># TLS server certificate request<br><br> # This file is used by the openssl req command. The subjectAltName cannot be<br> # prompted for and must be specified in the SAN environment variable.<br><br> [ default ]<br> SAN                     = DNS:www.mintesnot.org   # Default SAN<br><br> [ req ]<br> default_bits            = 2048                  # RSA key size<br> encrypt_key             = no                    # Protect private key<br> default_md              = sha256                # MD to use<br> utf8                    = yes                   # Input is UTF-8<br> string_mask             = utf8only              # Emit UTF-8 strings<br> prompt                  = yes                   # Prompt for DN<br> distinguished_name      = server_dn             # DN template<br> req_extensions          = server_reqext         # Desired extensions<br><br> [ server_dn ]<br> 0.domainComponent       = &quot;1. Domain Component         (eg, com)      &quot;<br> 1.domainComponent       = &quot;2. Domain Component         (eg, company)  &quot;<br> 2.domainComponent       = &quot;3. Domain Component         (eg, pki)      &quot;<br> organizationName        = &quot;4. Organization Name        (eg, company)  &quot;<br> organizationalUnitName  = &quot;5. Organizational Unit Name (eg, section)  &quot;<br> commonName              = &quot;6. Common Name              (eg, FQDN)     &quot;<br> commonName_max          = 64<br><br> [ server_reqext ]<br> keyUsage                = critical,digitalSignature,keyEncipherment<br> extendedKeyUsage        = serverAuth,clientAuth<br> subjectKeyIdentifier    = hash<br> subjectAltName          = $ENV::SAN</pre><pre># Email certificate request<br><br> # This file is used by the openssl req command. Since we cannot know the DN in<br> # advance the user is prompted for DN information.<br><br> [ req ]<br> default_bits            = 2048                  # RSA key size<br> encrypt_key             = yes                   # Protect private key<br> default_md              = sha256                # MD to use<br> utf8                    = yes                   # Input is UTF-8<br> string_mask             = utf8only              # Emit UTF-8 strings<br> prompt                  = yes                   # Prompt for DN<br> distinguished_name      = email_dn              # DN template<br> req_extensions          = email_reqext          # Desired extensions<br><br> [ email_dn ]<br> 0.domainComponent       = &quot;1. Domain Component         (eg, com)      &quot;<br> 1.domainComponent       = &quot;2. Domain Component         (eg, company)  &quot;<br> 2.domainComponent       = &quot;3. Domain Component         (eg, pki)      &quot;<br> organizationName        = &quot;4. Organization Name        (eg, company)  &quot;<br> organizationalUnitName  = &quot;5. Organizational Unit Name (eg, section)  &quot;<br> commonName              = &quot;6. Common Name              (eg, full name)&quot;<br> commonName_max          = 64<br> emailAddress            = &quot;7. Email Address            (eg, name@fqdn)&quot;<br> emailAddress_max        = 40<br><br> [ email_reqext ]<br> keyUsage                = critical,digitalSignature,keyEncipherment<br> extendedKeyUsage        = emailProtection,clientAuth<br> subjectKeyIdentifier    = hash<br> subjectAltName          = email:copy</pre><h3>Verfication</h3><p>first we need to install firefox and nginx installed then you need to do the following step by step</p><ol><li>Add the root certificate to firefox you first go setting and go to privacy section and scroll down until you get certificates</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pN9-ujvJzUtScOBf7nHvfw.png" /></figure><p>Then click on view certificate then click import . Then search the root Certificate then add it Finally you will see this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*E31WTTfYMsszuE0rVcFrqA.png" /></figure><p>Then click ok and Go to you terminal then copy the private key and ther certifcate of the web-server to the /etc/nginx/ssl folder if folder ssl is not there create it.</p><pre>$ sudo mkdir /etc/nginx/ssl<br>$ sudo cp /home/mintesnot/pki/mintesnot-ca/simple-ca/web-server/cert/mintesnot-org.crt /etc/nginx/ssl/<br>$ sudo cp /home/mintesnot/pki/mintesnot-ca/simple-ca/web-server/private/mintesnot-org.key /etc/nginx/ssl/<br>$ sudo chmod 444 /etc/nginx/ssl<br>$ sudo nano /etc/sites-available/default</pre><p>Then modify</p><pre>##<br># You should look at the following URL&#39;s in order to grasp a solid understanding<br># of Nginx configuration files in order to fully unleash the power of Nginx.<br># https://www.nginx.com/resources/wiki/start/<br># https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/<br># https://wiki.debian.org/Nginx/DirectoryStructure<br>#<br># In most cases, administrators will remove this file from sites-enabled/ and<br># leave it as reference inside of sites-available where it will continue to be<br># updated by the nginx packaging team.<br>#<br># This file will automatically load configuration files provided by other<br># applications, such as Drupal or Wordpress. These applications will be made<br># available underneath a path with that package name, such as /drupal8.<br>#<br># Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.<br>##<br><br># Default server configuration<br>#<br>server {<br>        listen 80 default_server;<br>        listen [::]:80 default_server;<br><br>        # SSL configuration<br>        #<br>        # listen 443 ssl default_server;<br>        # listen [::]:443 ssl default_server;<br>        #<br>        # Note: You should disable gzip for SSL traffic.<br>        # See: https://bugs.debian.org/773332<br>        #<br>        # Read up on ssl_ciphers to ensure a secure configuration.<br>        # See: https://bugs.debian.org/765782<br>        #<br>        # Self signed certs generated by the ssl-cert package<br>        # Don&#39;t use them in a production server!<br>        #<br> # include snippets/snakeoil.conf;<br><br>        root /var/www/html;<br><br>        # Add index.php to the list if you are using PHP<br>        index index.html index.htm index.nginx-debian.html;<br><br>        server_name _mintesnot.org;     #add your domain here<br><br>        location / {<br>                # First attempt to serve request as file, then<br>                # as directory, then fall back to displaying a 404.<br>                try_files $uri $uri/ =404;<br>        }<br><br>        # pass PHP scripts to FastCGI server<br>        #<br>        #location ~ \.php$ {<br>        #       include snippets/fastcgi-php.conf;<br>        #<br>        #       # With php-fpm (or other unix sockets):<br>        #       fastcgi_pass unix:/run/php/php7.4-fpm.sock;<br>        #       # With php-cgi (or other tcp sockets):<br>        #       fastcgi_pass 127.0.0.1:9000;<br>        #}<br><br>        # deny access to .htaccess files, if Apache&#39;s document root<br>        # concurs with nginx&#39;s one<br>        #<br>        #location ~ /\.ht {<br>        #       deny all;<br>        #}<br>}<br><br><br># Virtual Host configuration for example.com<br>#<br># You can move that to a different file under sites-available/ and symlink that#<br># You can move that to a different file under sites-available/ and symlink that<br># to sites-enabled/ to enable it.<br>#<br>server {<br>       listen 443 ssl;<br>       listen [::]:443;<br><br>       server_name mintesnot.org;   #add your domain here<br><br>       root /var/www/html;<br>       index index.html;<br><br>       ssl_certificate /etc/nginx/ssl/mintesnot-org.crt;<br>       ssl_certificate_key /etc/nginx/ssl/mintesnot-org.key;<br><br>       location / {<br>               try_files $uri $uri/ =404;<br>       }<br>}</pre><p>Then check if the configuration of nginx is correct and restart</p><pre>$ sudo nginx -t<br>$ sudo nginx -s reload<br>$ sudo systemctl restart nginx</pre><p>Then add the domain name to the hosts file</p><pre>$sudo nano /etc/hosts</pre><pre>127.0.0.1 mintesnot.org<br>127.0.0.1 www.mintesnot.org</pre><p>Add the above one the /etc/hosts file then now open firefox and browser to <a href="https://mintesnot.org/">https://mintesnot.org</a>. you can replace the domain name with your…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UWc8i5IATtTxH_41EzqBHA.png" /></figure><p>To check the certificate information click the lock and say more information</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/573/1*NLuWFK1Y4Et4HL1PIxt1aA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*Hg0MbLHKx1GASEtIEFn_3Q.png" /></figure><p>Click on the view certificate icon and you will find this which is a locally valid PKI infrastructure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d_62WCr3gjlt3kaCyb21xA.png" /></figure><p>To Be continued ……..</p><p>In the next section i will return with advanced PKI so stay safe and do not get caught.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93a8aa56a99b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TLS and SSL with openssl for Nobes : Part 2]]></title>
            <link>https://medium.com/@mintesnotafework12/tls-and-ssl-with-openssl-for-nobes-part-2-d306d02d71f7?source=rss-fc6d38a6bffc------2</link>
            <guid isPermaLink="false">https://medium.com/p/d306d02d71f7</guid>
            <category><![CDATA[openssl]]></category>
            <category><![CDATA[tls-certificate]]></category>
            <category><![CDATA[certificate]]></category>
            <category><![CDATA[ssl-certificate]]></category>
            <dc:creator><![CDATA[Mintesnot afework]]></dc:creator>
            <pubDate>Fri, 16 Aug 2024 20:13:13 GMT</pubDate>
            <atom:updated>2024-08-16T20:13:13.768Z</atom:updated>
            <content:encoded><![CDATA[<h3>TLS and SSL with openssl for Nobes : Part 2</h3><p>In this section we will go to the next section to revise we have seen about the ssl and tls basic, basics of PKI, Self-signed certificate and Certificate signing request. For this section we will go through Root CA, Intermidary CA and end-entity CA.</p><h3>Pre-requirement</h3><p>Befor we start we need three things</p><ol><li>linux based operating system(<a href="https://ubuntu.com/download/desktop">https://ubuntu.com/download/desktop</a>)</li><li>openssl version above 1.1.2(<a href="https://openssl-library.org/source/index.html">https://openssl-library.org/source/index.html</a>)</li><li>basic understanding of Openssl for tls and ssl(<a href="https://medium.com/@mintesnotafework12/tls-and-ssl-with-openssl-for-nobes-part-1-3f884fc4e7b5">https://medium.com/@mintesnotafework12/tls-and-ssl-with-openssl-for-nobes-part-1-3f884fc4e7b5</a>)</li><li>Everything in IT needs coffee</li></ol><h3>Certificate autority(CA)</h3><p>As we have said certificate autority is the one that give certificates to peoples with pair of private and public key to ensure that the key they have is authentic. Many we can divide them based functionality which are the root CA, Intermediate CA and Signing CA.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/0*G_hVT0VxkoYbaJ8Z.gif" /></figure><ol><li><strong>Root CA </strong>: CA at the root of a PKI hierarchy. Issues only CA certificates.</li><li><strong>Intermediate CA </strong>: CA below the root CA but not a signing CA. Issues only CA certificates.</li><li><strong>Signing(Issuing) CA</strong> : CA at the bottom of a PKI hierarchy. Issues only user certificates.</li></ol><p>As we have CA we also use different certificate for each</p><ol><li><strong>Root Certificate</strong> : Self-signed CA certificate at the root of a PKI hierarchy. Serves as the PKI’s trust anchor.</li><li><strong>CA Certificate</strong> : Certificate of a CA. Used to sign certificates and CRLs.</li><li><strong>User Certificate :</strong> End-entity certificate issued for one or more purposes: email-protection, server-auth, client-auth, code-signing, etc. A user certificate cannot sign other certificates.</li><li><strong>Cross Certificate : </strong>CA certificate issued by a CA external to the primary PKI hierarchy. Used to connect two PKIs and thus usually comes in pairs.</li></ol><blockquote>The fourth one will not concern us for now as it is a more advanced and sophesticated issue.</blockquote><p>The last thing that we need to define here is the term file format as defined in openssl documentation certificate and private can take two types which are the PEM and DER.</p><ol><li><strong>PEM(privacy Enhanced Mail)</strong> : is text based base64 encoded file format that add description at the header and footer.</li><li><strong>DER(Distinguished Encoding Rules)</strong> : is binary format that is mostly used by window based systems to store key and certificate.</li></ol><blockquote>For this section we will use openssl in linux so it will be pem for us</blockquote><p>This is the basic defination for all now we will look at the configuration file they have and there structure in detail.</p><p><strong>Simple PKI</strong></p><p>This is a type of PKI which only contain one root CA and Issuing CA. As the name indicate it is used for understand the working of the two mostly we will not find this in the real world.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/929/1*1kel-Wo-dJ_aP-00DZPQag.png" /></figure><p>To do so first we need to build the file structure for the root and the issuing CA. Both of them will have there own folder which will contain seven folders.</p><ol><li><strong>private</strong> : is the folder that contain the private key for the root or issuing CA. As we know private keys are so important and they are the core so we need to change the permission after writting the private key.</li><li><strong>Issued certs</strong> : is the folder that contain the list of certifcates issued to other CAs.</li><li><strong>CRL</strong> : is the list of certification revocation list which is the list of certificate that were authentic but revoked either due to time or compromise of the private key of the issuing body.</li><li><strong>CSR : </strong>is the list of certificate signing request from CA or End users for Root CA or Intermindary CA respectively.</li><li><strong>Data</strong> : is the one that hold information like serial number, index of the certificates and other additional information.</li><li><strong>Cert</strong> : is the folder that contain the certificate for the root or the issuing CA.</li><li><strong>etc</strong> : is the folder contain the basic configuration file for either for root or issuing CA on there own folder or place.</li></ol><p>To implement this we need to creat the above strcutre both for the root and the issuing CA.</p><ol><li>But first we need to creat folder to work on.</li></ol><pre>$ mkdir simple_certificate     #creat a folder to work on <br>$ cd simple_certificate        #change the director to the created one <br>$ mkdir root_ca issuing_ca     #create folder for root and issuing CA</pre><p>2. Now we have the folder for both the root and issuing CA. Now creat the file-structure for both.</p><pre>$ cd root_ca<br>$ mkdir private issued_certs cert crl csr data etc<br>$ cd ../issuing_ca<br>$ mkdir private issued_certs cert crl csr data etc<br>$ cd ..</pre><p>Now if we run the tree command our system will look like</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/1*cBRmHqvot1IOSbLfHgS4Ew.png" /></figure><blockquote>Note data folder in the openssl documentation may be called database.</blockquote><p>3. Now we need to fill the data folder with files that are required now i assume you are on the <strong>simpe_certificate</strong> folder if not go there.</p><pre>$ cp /dev/null root_ca/index.dat<br>$ echo 01 &gt; root_ca/serial.dat<br>$ echo 01 &gt; root_ca/crl_number<br>$ cd ../issueing_ca<br>$ cp /dev/null root_ca/index.dat<br>$ echo 01 &gt; root_ca/serial.dat<br>$ echo 01 &gt; root_ca/crl_number<br>$ cd ..</pre><p>This three files are mandatory.</p><p>→ The index file consists of zero or more lines, each containing the following fields separated by tab characters:</p><ol><li>Certificate status flag (V=valid, R=revoked, E=expired).</li><li>Certificate expiration date in [YY]YYMMDDHHMMSSZ format.</li><li>Certificate revocation date in [YY]YYMMDDHHMMSSZ[,reason] format. Empty if not revoked.</li><li>Certificate serial number in hex.</li><li>Certificate filename or literal string ‘unknown’.</li><li>Certificate subject DN.</li></ol><p>→ The “” file contains a single line: unique_subject = no. It reflects the setting in the CA section of the configuration file at the time the first record is added to the database.</p><p>→ The openssl ca command uses two serial number files:</p><ol><li>Certificate serial number file.</li><li>CRL number file.</li></ol><p>The files contain the next available serial number in hex.If the CA section sets rand_serial = yes the contents of the certificate serial number file are ignored; it must still exist though.</p><p>After doing all your file structure should look like</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*npCEaqzUPhuOpubJLUlOfg.png" /></figure><p>4. Now we need to creat the configuration file for the root and issuing CA.</p><pre>$ nano root_ca/etc/root_ca.conf       </pre><pre>[ ca ]<br>default_ca = CA_default<br><br>[ CA_default ]<br>dir               = /home/mintesnot/hackthebox/simple-ca/issuing_ca  # is where my root folder exist<br>certs             = $dir/cert                              # is where the certificate for the root found <br>crl_dir           = $dir/crl                               # is where the certificate revocation list found<br>new_certs_dir     = $dir/issued_certs                      # is where the list for issued certs found<br>database          = $dir/data/index.dat                    # is where the index file for the database is found<br>serial            = $dir/data/serial.dat                   # is where the next serial number is found<br>RANDFILE          = $dir/private/.rand                     <br>private_key       = $dir/private/rsakey4096.pem            # is the private key for the root<br>certificate       = $dir/cert/rsacrt4096.pem               # is where the certificate <br>crlnumber         = $dir/data/crl_number                   <br>crl               = $dir/crl/root.crl                      # is the certificat revocation list file<br>crl_extensions    = crl_ext<br>default_crl_days  = 30<br>default_md        = sha256                                 # is the default message digist algorthim<br>name_opt          = ca_default  <br>cert_opt          = ca_default<br>default_days      = 3650                                   # is the number of days the certificate is valid for<br>preserve          = no<br>policy            = policy_any                              # is the rule or policy that the root must follow<br>email_in_dn       = no<br><br>[ policy_any ]<br>countryName             = supplied                            # supplied means it is must to add this field<br>stateOrProvinceName     = optional                            # optional is it is not must you can leave it blank<br>organizationName        = match                               # means this must match with the root orgnazaion unit name<br>organizationalUnitName  = optional<br>commonName              = supplied<br>emailAddress            = optional<br><br>[ req ]<br>default_bits        = 2048                                    # This is the default rsa key size<br>distinguished_name  = req_distinguished_name                  # this the data that will be gather either in command line or other option<br>string_mask         = utf8only<br>default_md          = sha256<br>x509_extensions     = v3_ca<br><br>[ req_distinguished_name ]<br>countryName                     = Country Name (2 letter code)<br>stateOrProvinceName             = State or Province Name<br>localityName                    = Locality Name<br>0.organizationName              = Organization Name<br>organizationalUnitName          = Organizational Unit Name<br>commonName                      = Common Name<br>emailAddress                    = Email Address<br><br>countryName_default             = ET<br>stateOrProvinceName_default     = Addis-Abeba<br>localityName_default            = <br>0.organizationName_default      = Ethio overflow<br>organizationalUnitName_default  = YE-Kolo-temari<br>emailAddress_default            = pki@ethio.overflow<br><br>[ v3_ca ]<br>subjectKeyIdentifier = hash<br>authorityKeyIdentifier = keyid:always,issuer<br>keyUsage = critical, digitalSignature, cRLSign, keyCertSign<br>basicConstraints = critical, CA:true, pathlen:2<br>crlDistributionPoints = URI:http://ethio.overflow/myRoot.crl<br><br>[ v3_intermediate_ca ]<br>subjectKeyIdentifier = hash<br>authorityKeyIdentifier = keyid:always,issuer<br>basicConstraints = critical, CA:true, pathlen:0<br>keyUsage = critical, digitalSignature, cRLSign, keyCertSign<br>crlDistributionPoints = URI:http://ethio.overflow/issuing.crl<br>authorityInfoAccess = caIssuers;URI:http://ethio.overflow/rsacrt4096.pem<br></pre><p>I believe the comment has a good description of the function and purpose of the line. For those that does not have comment that mean they are not important.</p><pre>$ nano issuing_ca/etc/issuing_ca.conf        </pre><pre>[ ca ]<br>default_ca = CA_default<br><br>[ CA_default ]<br>dir               = /home/mintesnot/hackthebox/simple-ca<br>certs             = $dir/cert<br>crl_dir           = $dir/crl<br>new_certs_dir     = $dir/issued_certs<br>database          = $dir/data/index.dat<br>serial            = $dir/data/serial.dat<br>RANDFILE          = $dir/private/.rand<br>private_key       = $dir/private/rsa2048key.pem<br>certificate       = $dir/cert/rsa2048cert.pem<br>crlnumber         = $dir/data/crl_number<br>crl               = $dir/crl/issuing.crl<br>crl_extensions    = crl_ext<br>default_crl_days  = 30<br>default_md        = sha256<br>name_opt          = ca_default<br>cert_opt          = ca_default<br>default_days      = 1826<br>preserve          = no<br>policy            = policy_any<br><br><br>[ policy_any ]<br>countryName             = optional<br>stateOrProvinceName     = optional<br>localityName            = optional<br>organizationName        = optional<br>organizationalUnitName  = optional<br>commonName              = supplied<br>emailAddress            = optional<br><br>[ req ]<br>default_bits        = 2048<br>distinguished_name  = req_distinguished_name<br>string_mask         = utf8only<br>default_md          = sha256<br>x509_extensions     = v3_ca<br><br>[ req_distinguished_name ]<br>countryName                     = Country Name (2 letter code)<br>stateOrProvinceName             = State or Province Name<br>localityName                    = Locality Name<br>0.organizationName              = Organization Name<br>organizationalUnitName          = Organizational Unit Name<br>commonName                      = Common Name<br>emailAddress                    = Email Address<br><br>countryName_default             = ET<br>stateOrProvinceName_default     = Addis-Abeba<br>localityName_default            = <br>0.organizationName_default      = Ethio overflow<br>organizationalUnitName_default  = YE-Kolo-temari<br>emailAddress_default            = pki@ethio.overflow<br> <br><br>[ user_cert ]<br>basicConstraints = CA:FALSE<br>subjectKeyIdentifier = hash<br>authorityKeyIdentifier = keyid,issuer<br>keyUsage = critical, nonRepudiation, digitalSignature, keyEncipherment<br>extendedKeyUsage = clientAuth, emailProtection<br>crlDistributionPoints = URI:http://ethio.overflow/issuing.crl<br>authorityInfoAccess = caIssuers;URI:http://ethio.overflow/rsa2048cert.pem<br><br>[ server_cert ]<br>basicConstraints = CA:FALSE<br>subjectKeyIdentifier = hash<br>authorityKeyIdentifier = keyid,issuer:always<br>keyUsage = critical, digitalSignature, keyEncipherment<br>extendedKeyUsage = serverAuth<br>crlDistributionPoints = URI:http://ethio.overflow/issuing.crl<br>authorityInfoAccess = caIssuers;URI:http://ethio.overflow/rsa2048cert.pem<br><br>[ codeSigning_cert ]<br>basicConstraints = CA:FALSE<br>subjectKeyIdentifier = hash<br>authorityKeyIdentifier = keyid,issuer:always<br>keyUsage = critical, digitalSignature, keyEncipherment<br>extendedKeyUsage = codeSigning<br>crlDistributionPoints = URI:http://ethio.overflow/issuing.crl<br>authorityInfoAccess = caIssuers;URI:http://ethio.overflow/rsa2048cert.pem<br><br>[ crl_ext ]<br>authorityKeyIdentifier=keyid:always<br><br>[ ocsp ]<br>basicConstraints = CA:FALSE<br>subjectKeyIdentifier = hash<br>authorityKeyIdentifier = keyid,issuer<br>keyUsage = critical, digitalSignature<br>extendedKeyUsage = critical, OCSPSigning</pre><p><strong>What are this files ?</strong></p><p>This files are the configuration used by openssl to perform different operation like key generation, prompt for information and more.</p><p>5. The next step is to generate private key for the root</p><pre>$ openssl genrsa -aes256  -out root_ca/private/rsakey4096.pem 4096  # this will generate a key and prompt you for password</pre><p>6 . We need to sign the key and generate a self-signed certifcate using the configuration file we built for root</p><pre>$ openssl req -config root_ca/etc/root_ca.conf -key root_ca/private/rsakey4096.pem -new -x509 -sha256 -extensions v3_ca -days 3650 -out root_ca/cert/rsacrt4096.pem</pre><blockquote>Note the private key for the root is password protected so you need to enter the password for the private key</blockquote><p>7. Now At this stage we will get to the issuer CA configuration done by first creating a rsa 2048 private key and store it in issers private folder</p><pre>$ openssl genrsa -aes256 -out issuing_ca/private/rsa2048key.pem 2048 <br>$ chmod 400 issuing_ca/private/rsa2048key.pem</pre><p>8. We need to issue a certificate to the root</p><pre>$ openssl req -config root_ca/etc/root_ca.conf -new -sha256 -out issuing_ca/csr/rsa2048csr.pem</pre><p>9. the root will sign my cerificate signing request</p><pre>$ openssl ca -config root_ca/etc/root_ca.conf -extensions v3_intermediate_ca -days 1826 -notext -md sha256 -in issuing_ca/csr/rsa2048csr.pem -out issuing_ca/cert/rsa2048cert.pem<br>$ chmod 444 issuing_ca/cert/rsa2048cert.pem</pre><p>10. Now we need to verify the certificate by concatenating the root certification with the intermidary certification.</p><pre>$ cat issuing_ca/cert/rsa2048cert.pem root_ca/cert/rsacrt4096.pem &gt; /tmp/verify<br>$ openssl verfiy -CAfile /tmp/verify issuing_ca.cert </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/465/1*wH3Fug01UjgnYa1nmCTLSQ.png" /></figure><blockquote>If you see this message you are good to go, if not go back to step 1.</blockquote><p>11. After this time we can issue certificate and the issuer can respond for that. TO do we can</p><pre>$ mkdir -p website/private website/cert<br>$ openssl genrsa -out website/private/rsa2048.pem<br>$ openssl req -key ../private/rsa2048key.pem -new -sha256 -out rsa2048csr.pem<br>$ openssl ca -config issuing_ca/etc/issuing_ca.conf -extensions server_cert -notext -days 365 -md sha256 -in website/cert/rsa2048csr.pem -out website/cert/rsa2048cert.pem</pre><p>Now you can also use this to sign code and email. I think You get good thing out of this have a great time</p><blockquote>TO be continued….</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d306d02d71f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TLS and SSL with openssl for Nobes : Part 1]]></title>
            <link>https://medium.com/@mintesnotafework12/tls-and-ssl-with-openssl-for-nobes-part-1-3f884fc4e7b5?source=rss-fc6d38a6bffc------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f884fc4e7b5</guid>
            <category><![CDATA[tls-certificate]]></category>
            <category><![CDATA[ssl]]></category>
            <category><![CDATA[tls]]></category>
            <category><![CDATA[openssl]]></category>
            <category><![CDATA[openssl-certificate]]></category>
            <dc:creator><![CDATA[Mintesnot afework]]></dc:creator>
            <pubDate>Fri, 16 Aug 2024 12:14:03 GMT</pubDate>
            <atom:updated>2024-08-16T12:14:03.989Z</atom:updated>
            <content:encoded><![CDATA[<h3>TLS and SSL with openssl for Nobes : Part 1</h3><h3><strong>Introduction</strong></h3><p>OpenSSL is a software library for applications that provide secure communications over computer networks against eavesdropping, and identify the party at the other end. It is widely used by Internet servers, including the majority of HTTPS websites and email security. It was developed by <a href="https://www.google.com/search?sca_esv=6306a503b65c9e12&amp;sca_upv=1&amp;sxsrf=ADLYWIKjGzAqj5KD-ID1zcV6RuzhJ5KdcQ:1723800365593&amp;q=The+OpenSSL+Project&amp;si=ACC90nyByJNAHfkzzi7l4JA4fcQKXOYDCI7plJH6uVksGWg6Xji3mW6pvQUit1HOxOTuSTPdwrTX1rplS9zFBqW37sfak9S7TGkZlP8ekSIpShdg-MeRkayjJzpn6VvRO23W0hb7F5OYNbNJ3E-GkATSx8XEF_0JyIWXQPS2j0ZJLOLPU-4E1U55gH4lKThEPzfqKs59KKHfcQHLdqJPIGBF-lOc3YydPA%3D%3D&amp;sa=X&amp;sqi=2&amp;ved=2ahUKEwjCx9HjmPmHAxWLxQIHHZCAAaYQmxMoAHoECCQQAg">The OpenSSL Project</a> and realsed for the first time 1998; 26 years ago. The main repo is found in <a href="https://www.github.com/openssl/openssl">https://www.github.com/openssl/openssl</a>. The main language used to develop it is C, Assembly, perl.</p><p>We can also say openssl is a tool that is used to generate certificate for building public infrastructure. now let us look at basic terminologies.</p><h3><strong>Terminology</strong></h3><ol><li><strong>Public Key Infrastructure (PKI):</strong> Security architecture where trust is conveyed through the signature of a trusted CA.</li></ol><p><strong>2. Certificate Authority (CA):</strong> Entity issuing certificates and CRLs.</p><p><strong>3. Registration Authority (RA):</strong> Entity handling PKI enrolment. May be identical with the CA.</p><p><strong>4. Certificate</strong>: Public key and ID bound by a CA signature.</p><p><strong>5. Certificate Signing Request (CSR):</strong> Request for certification. Contains public key and ID to be certified.</p><p><strong>6. Certificate Revocation List (CRL)</strong>: List of revoked certificates. Issued by a CA at regular intervals.</p><p><strong>7. Certification Practice Statement (CPS):</strong> Document describing structure and processes of a CA.</p><p>8. <strong>Public key cryptography</strong> : is a assymetric key cryptography uses two set of keys to encrypt and decrypt a data. There are main three ones which are RSA,ELLPTIC CURVE AND DIFFULE HELLMEN.</p><p>9<strong>. Privacy Enhanced Mail (PEM)</strong> : Text format. Base-64 encoded data with header and footer lines. Preferred format in OpenSSL and most software based on it (e.g. Apache mod_ssl, stunnel).</p><h3>X509 certificate</h3><p>The x509 certificate has a formate and structure. The main ones are issuer and subject which are the one that gives the certificate and the one that request the certificate.</p><p>The issuer and subject of a certificate need to provide specific information for valid certification. The X.509 standard defines those requirements.</p><p><strong>X.509 certificate fields:</strong></p><ul><li><strong>version</strong>: The version number of the x.509 certificate. (if omitted, version 1 is assumed)</li><li><strong>serialNumber</strong>: Unique serial number that is created for each certificate that is created by a CA.</li><li><strong>signature:</strong> The algorithm used to generate the signature. It must match the signatureAlgorithm.</li><li>i<strong>ssuer:</strong> The distinguished name (DN) of the issuing CA.</li><li><strong>validity:</strong> Two dates of time — from notBefore (issued date) through notAfter (expiry date).</li><li><strong>subject:</strong> Distinguished name of the validated entity to which the certificate is issued.</li><li><strong>subjectPublicKeyInfo:</strong> The public-key algorithm and value (RSA, DSA, or Diffie-Hellman).</li></ul><p><strong>X.509 Version 3 extensions fields:</strong></p><ul><li><strong>extnId:</strong> This is used to identify this extension.</li><li><strong>critical:</strong> This is a boolean value that is used to inform if the extension is vital or not.</li><li><strong>extnValue:</strong> Contains an octet string that could be interpreted freely by a community utilizing an optional extension.</li></ul><h3>Basics of Openssl</h3><p>let us start with generating public key and private key with openssl</p><blockquote>Generating public and private key</blockquote><ol><li><strong>RSA</strong></li></ol><p>It is a public key crypto system that uses 1 private key and 65537 as public key. It has a lot in the background it will do different maths but it will use the private key which is called ‘<strong>d</strong>’ and module which is called ’<strong>n</strong>’. The public key will be 65537 which is called ‘<strong>e</strong>’ and module which is called ‘<strong>n</strong>’.</p><p>To generate RSA key we can use</p><pre>$ openssl genrsa -out &lt;filename.pem&gt; &lt;key-size&gt;</pre><p>The above command will generate an RSA private key with the key size of the specified key size and it will put it in PEM formate to the &lt;filename.pem&gt; file.</p><pre>$ openssl genrsa -out rsa512.pem 512</pre><p>The above command will generate an rsa key with the size of 512 and put it to a file called rsa512.pem in PEM formate.</p><p>To inspect the rsa key we can use</p><pre>$ openssl rsa -in &lt;filename.pem&gt; -text -noout</pre><p>The above command will enable us to look at the private and public key with additional parameters like module, cofficent and more. It need a file which contain the private key and the -text means show me meta data which means the public key, module, cofficent, prime numbers and more. the -noout means do not show the private key.</p><pre>$ openssl rsa -in rsa512.pem -text -noout</pre><p>The above command will generate the output of</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/1*Ld1fMNREzU5y9iTna2JlCQ.png" /></figure><blockquote>Challenge : Generate a 2048 key lenght rsa private key and store it in rsa2048.pem Finally inspect it.</blockquote><p><strong>2. Elleptic curve</strong></p><p>This is another public key crypto which uses the concept of mathimaticas to generate private and public key which shorter lenght and higher security than RSA.</p><p>TO generate an elleptic curve key we have to options which are creating EC parameter file and generate using those or generate directly.</p><pre>$ openssl genpkey -genparam -algorithm EC -pkeyopt ec_paramgen_curve:&lt;option-types&gt; -out e&lt;filename.pem&gt;</pre><p>The above command will generate a file with the option specified for EC algorhthim which we are going to use it to generate private key. There are many options. Every installtion and version has different number of options. TO look at those</p><pre>$ openssl ecparam -list_curves</pre><pre>$ openssl genpkey -genparam -algorithm EC -pkeyopt ec_paramgen_curve:secp384r1 -out EC-Param.pem</pre><p>The above will generate a EC parameter file using the secp384r1 option and store the key in EC-Param.pem with the PEM format. To generate the key you need to</p><pre>$ openssl genpkey -paramfile EC-Param.pem -out eckey1.pem</pre><p>The above command will use the parameter file to generate a private key with the name of eckey1.pem</p><p>We can use the second option which is in one command generating the key.</p><pre>$ openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:P-384 -out eckey2.pem</pre><p>The main difference is the option name. which means the first one will use the ASN1 OID and the second will use NIST CURVE.</p><p>Finally if you want to inspect the file we can use</p><pre>$ openssl ec -in eckey1.pem</pre><p>This will generate a</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*CDN7X0X0aV6tLKVL7QUpGw.png" /></figure><blockquote>Challenge generate a key using the two options with the option of prime256v1(ASN1 OID) the P-256( NIST CURVE) Then store it in eckey2.pem Finally inspect it.</blockquote><h3>Certificate Generation</h3><p>In generating a certificate we have two options which are using a self-signed certificate or making certificate signing request to a certificate autority. we will see both of them.</p><ol><li><strong>Self-signed certificates</strong></li></ol><p>For this we will generate a x509 format certificate using the openssl req command or utility.</p><pre>$ openssl req -x509 -key &lt;private key&gt; -out &lt;filename.pem&gt;</pre><p>The above command will generate a certificate for the private key that we store in file and store it in a filename.pem file with PEM format by default.</p><pre>$ openssl req -x509 -key rsa512.pem -out rsa512cert.pem</pre><p>The above one is a real example i believe you have done the rsa session so this will be easy.</p><p>When we hit enter it will ask as some questions as we know the main aim of a certificate is to tell about you. so the system will ask the below questions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l0o7EJ_SySMa8zuA-ulR2w.png" /></figure><p>From this for your own use the Common name is the only thing the is important. The only thing that client browser or email has access to is the domain name like google.com or something.com So that the most critical. But for a certificate aurtority the other are vital as the CA will try to validate the information provided by before giving you a certificate.</p><blockquote>For automation we can use the -<strong>subj </strong>option to specify the prompted information. The domain name is required but others are optional.</blockquote><pre>$ openssl req -x509 -key rsa512.pem -out rsa512cert.pem -subj &quot;/C=ET/ST=Addis-abeba/L=kolfa-keranio/O=Ethio\ Overflow/CN=mintesnotafework.org&quot;</pre><blockquote><strong>C</strong> — country</blockquote><blockquote><strong>ST </strong>— state</blockquote><blockquote><strong>L-</strong>city</blockquote><blockquote><strong>O</strong>-comapny</blockquote><blockquote><strong>CN </strong>— Domain name or FQDN</blockquote><p>To inspect the certificate you need to perform the following</p><pre>$ openssl x509 -in rsa512cert.pem -text -noout</pre><p>THis will generate the below the key may differ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p19YH2j2Vr8xWXLzZjWb_g.png" /></figure><p>As we can the information we have entered is found in subjects section. it also contain serial, subject , issuer, serial number, version, signature, public key of the requestor.</p><p>To check write the following command</p><pre>$ openssl rsa -in rsa512.pem -text -noout</pre><p>which will return the information which is the same as the certificate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/903/1*3NzcgxhPFFRgsdZ13v4QUg.png" /></figure><p>You may how can know it is self-signed certificate? That is a good one the issuer and the subject field are the same which means i am the owner of this certificate or the owner is the certifier.</p><blockquote>Note some times you may see the subject name is different from the name your server has. That means the subject alternative will contain the Domain name.</blockquote><p>Other inspection options is we can only fetch the specific fields like the date or issuer or subject by adding the need at the end.</p><pre>$ openssl x509 -in rsa512cret.pem -&lt;field-name&gt; -noout</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iLzWlJH0ZZy0GWoKw7JjRQ.png" /></figure><blockquote>challenge now generate a certificate using the 2048 lenght rsa key,eckey1.pem and eckey2.pem Finally inspect it?</blockquote><blockquote>Note the public key information will differ for EC algorthim</blockquote><p>For your information we have gone into the details of certifcation but the step we have gone can be automated which means we can generate a private key and sign the certificate in one line.</p><pre>$ openssl req -x509 -new rsa:&lt;key-size&gt; -out &lt;filename.pem&gt;<br>$ openssl req -x509 -new ec:&lt;ec-param-file&gt; -out &lt;filename.pem&gt;</pre><p>The above command will generate the key and sign it. for the rsa we define the algothim and the key size but for the ellptic curve algorthim we specify the algothim and the param file which was generated at the Basics of openssl EC-param file generation section. So let us see one one for rsa and ec.</p><pre>$ <br>$ openssl req -x509 -newkey rsa:512 -out rsa512.pem    #for rsa with 512 key size</pre><pre>$ openssl genpkey -genparam -algorithm EC -pkeyopt ec_paramgen_curve:secp384r1 -out EC-Param.pem<br>$ openssl req -x509 -newkey ec:EC-Param.pem -out eccert1.pem       #for the ec algorthim with p-384</pre><blockquote>But using this will have a draw back which is when updating the key at the time of expire we will not have access to the private key so that will make it some what diffcult.</blockquote><h3>Certificate request</h3><p>The main thing to take from this section that when we need to have a certificate in the real world we request for it to a valid certificate autority and the autority will perform the validation process and return the certificate and we can use that for either our ssl or tls sessions. Let use see how it goes.</p><ol><li>we generate a request and that contain our public key and the subject information using</li></ol><pre>$ openssl req -new -key &lt;key-file&gt; -out &lt;csr-filename.pem&gt;</pre><p>This command will prompt us to enter the subject information but if we need the shorter version we can</p><pre>$ openssl req -new -key &lt;key-file&gt; -out &lt;csr-filename.pem&gt; -subj &quot;/C=ET/ST=Addis-abeba/L=kolfa-keranio/O=Ethio\ Overflow/CN=mintesnotafework.org&quot;</pre><p>May be we do not have the private key so we can also generate both the key and csr with one command</p><pre>$ openssl req -new -newkey rsa:512 -out &lt;csr-filename.pem&gt; -subj &quot;/C=ET/ST=Addis-abeba/L=kolfa-keranio/O=Ethio\ Overflow/CN=mintesnotafework.org&quot;    #for rsa<br>$ openssl genpkey -genparam -algorithm EC -pkeyopt ec_paramgen_curve:secp384r1 -out EC-Param.pem #ec parameter file generation<br>$ openssl req -x509 -newkey ec:EC-Param.pem -out eccsr1.pem -subj &quot;/C=ET/ST=Addis-abeba/L=kolfa-keranio/O=Ethio\ Overflow/CN=mintesnotafework.org&quot;   #ec certificate generation</pre><p>This will give as a Certificate signing request file that we can send to a CA to get certificate.</p><p>To inspect this we can use the following command</p><pre>$ openssl req -in &lt;csr-filename.pem&gt; -text -noout</pre><p><strong>Example</strong></p><p>we generate a private and csr using the below command with RSA</p><pre>$ openssl req -new -newkey rsa:512 -out rsa512csr.pem -subj &quot;/C=ET/ST=Addis-abeba/L=kolfa-keranio/O=Ethio\ Overflow/CN=mintesnotafework.org&quot;    #for rsa to generate rsa and csr<br>$ openssl req -in rsa512csr.pem -text -noout</pre><p>This will give the below command which is called a CSR.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tccNe0C__tXfxw2v2gO35Q.png" /></figure><p>As we can see it has the version, subject, public key information and signature algrthim with the value.</p><blockquote>TO BE CONTINUED…………….</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f884fc4e7b5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Biblical Terminal]]></title>
            <link>https://medium.com/@mintesnotafework12/biblical-terminal-2d76e18067c3?source=rss-fc6d38a6bffc------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d76e18067c3</guid>
            <category><![CDATA[figlet]]></category>
            <category><![CDATA[christian]]></category>
            <category><![CDATA[chirstian-hacker]]></category>
            <category><![CDATA[lolcat]]></category>
            <category><![CDATA[linux-tutorial]]></category>
            <dc:creator><![CDATA[Mintesnot afework]]></dc:creator>
            <pubDate>Fri, 16 Aug 2024 06:53:15 GMT</pubDate>
            <atom:updated>2024-08-16T06:53:15.043Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wHZqHrIXpRRscMcjW9YaEQ.png" /></figure><p>Before i get to the point let me tell you i was thinking about making my terminal display a verse from the bible with good apperance i googled and get two tools which are figlet which is used to make font-design and lolcat which is used to make colorful text.</p><h3>Pre-request</h3><ol><li>Linux based operating system</li><li>The bible in txt or text formate.(<a href="https://openbible.com/texts.htm">https://openbible.com/texts.htm</a>)</li><li>Everything in IT need coffee</li></ol><p>Let us look how you can do it step by step</p><ol><li>Install figlet and lolcat using your repository manager for me it is apt.</li></ol><pre>$ sudo apt update &amp;&amp; sudo apt install figlet lolcat</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*2VcLqpdws8Fb1qvOuRjBCw.png" /></figure><p>2. clone the font type compatable with figlet from (<a href="https://github.com/xero/figlet-fonts">https://github.com/xero/figlet-fonts</a>)</p><pre>$ git clone https://github.com/xero/figlet-fonts.git</pre><p>3. Extract and Store it some where you can access like Desktop.</p><p>4. go to your home directory</p><pre>$ cd ~</pre><p>5. open the .bashrc file using your prefered editor. bashrc file is the file that run every time you open terminal.</p><pre>$ nano ~/.bashrc</pre><p>if you are not using zsh instead</p><pre>$ nano ~/.zshrc</pre><p>6. go to the bottom and add the following code</p><pre>shuf -n 1 /usr/share/kj-bible.txt | tr [&quot;       &quot;] [&quot;\n&quot;] &gt; /tmp/file.txt<br>cat /tmp/file.txt | head -n 1 | figlet -c -w 160 -f ~/Desktop/figlet-fonts/Roman.flf -c | lolcat<br>cat /tmp/file.txt | tail -n 1 | figlet -w 160 -c -f small | lolcat</pre><p>On the desktop section you can add folder you extracted the git folder to and write</p><pre>cat /tmp/file.txt | head -n 1 | figlet -c -w 160 -f &lt;folder-path&gt;/figlet-fonts/Roman.flf -c | lolcat</pre><blockquote>Happy hacking and have a blessed day</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d76e18067c3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Did Edward Do the right thing?]]></title>
            <link>https://medium.com/@mintesnotafework12/did-edward-do-the-right-thing-8610280ae846?source=rss-fc6d38a6bffc------2</link>
            <guid isPermaLink="false">https://medium.com/p/8610280ae846</guid>
            <category><![CDATA[privacy]]></category>
            <category><![CDATA[snowden]]></category>
            <category><![CDATA[edward-snowden]]></category>
            <dc:creator><![CDATA[Mintesnot afework]]></dc:creator>
            <pubDate>Fri, 16 Aug 2024 06:25:23 GMT</pubDate>
            <atom:updated>2024-08-16T06:29:03.173Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/584/0*aGYBwPA9VJZ3Bo5W" /></figure><p>Watching the movie “Snowden” this morning got me thinking about privacy and security in our digital age. A friend insisted I watch it, claiming it’s essential viewing for any aspiring hacker. While I disagree with the idea that movies create hackers, the film’s central question — is our information truly private and secure? — resonated with me as a cybersecurity engineer.</p><p>We rely on platforms like Telegram, TikTok, and Facebook for communication, trusting these companies to handle our data responsibly. But can we truly trust them? Should we allow corporations to control our information? I believe personal data should be protected by the individual, not outsourced. If we aren’t willing to take steps to safeguard our own information, why should anyone else?</p><p>It’s ironic that many people demand privacy but are unwilling to make any sacrifices. They freely share personal data in exchange for free services while simultaneously complaining about privacy breaches.</p><p>I believe in taking proactive steps to protect your privacy. While complete trust is impossible, it’s essential to choose services carefully. I personally prefer platforms like Proton VPN and their email service for enhanced security and privacy. Decentralized systems like Bitcoin and Tor offer additional layers of protection compared to traditional centralized infrastructures.</p><p>By understanding cryptography and implementing strong security measures, you can significantly improve your online privacy. Remember, your digital footprint is your responsibility. Stay safe and avoid getting caught in the crossfire.</p><h3><strong>How about this:</strong></h3><p>Imagine you lend your phone to a friend. They use it to make calls, send messages, and access various apps. Later, you discover they’ve deleted their activity. Unbeknownst to them, your phone has a hidden recording function that captures everything. Upon reviewing the recordings, you find evidence of behavior that deeply hurts you. You have the power to expose their actions and potentially ruin their life.</p><p>My friend shouldn’t have done that, but I understand why they might feel justified in retaliating. But who’s really at fault? The person who lent their phone, or the friend who misused it? Having everything in clear text is wrong. so if I do anything i am write as he is not willing to do even one thing to protect him self.</p><p>So my last advice everybody whats your information so please try to secure your self? As that is your responsibility not mine. If you want to know more about how? contact me here is my portfolio</p><p><a href="https://mintesnotafework.github.io/Port-Folio/">https://mintesnotafework.github.com/PortFoils</a></p><blockquote>Have fun and Do not get Caught?</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8610280ae846" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hack The Box : Appointment walkthrough]]></title>
            <link>https://medium.com/@mintesnotafework12/hack-the-box-appointment-walkthrough-a177c4252fce?source=rss-fc6d38a6bffc------2</link>
            <guid isPermaLink="false">https://medium.com/p/a177c4252fce</guid>
            <category><![CDATA[hackthebox]]></category>
            <category><![CDATA[appointment]]></category>
            <dc:creator><![CDATA[Mintesnot afework]]></dc:creator>
            <pubDate>Wed, 14 Aug 2024 09:13:53 GMT</pubDate>
            <atom:updated>2024-08-14T09:13:53.601Z</atom:updated>
            <content:encoded><![CDATA[<h3>Hack The Box : Appointment walkthrough</h3><p>Hello i returned back with the fawn box from hackthebox. THis week i believe we will focus on the starting point machines to make it easier for us to understand how HTB work. Let get into it</p><p>pre-requirement</p><ol><li>connect with hackthebox using the openvpn file</li><li>check your connection using the ping command</li></ol><p>To get more about this go to this link <a href="https://medium.com/@mintesnotafework12/hack-the-box-hacking-meow-53b6cf1be6ae">https://medium.com/@mintesnotafework12/hack-the-box-hacking-meow-53b6cf1be6ae</a></p><p>It will show you how connect and check your connection</p><h3>Answering the questions</h3><ol><li>Sql stands for structured query lanugage. It is a Language that is used to interact with a database server like mysql and postgres.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*4p_oYzbscLo6Cs5kgoJM4w.png" /></figure><p>2. The most know sql vuln is sql injection which is being able to directly feed sql query to the database server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*2xQ2zthOQ7WPVA8OmM7iFA.png" /></figure><p>3. The name for sql injection in the 2021 top ten post is found in the link below <a href="https://owasp.org/Top10/">https://owasp.org/Top10/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*1jgkeAzMTmbjlRFmSEcwGA.png" /></figure><p>4. The service name and version can found using the command</p><pre>$ nmap -sV -p 80 &lt;ip-address&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AYGC8Tzy-d0OCN5I-Mw5VA.png" /></figure><p>5. The standard port for http which uses the TLS/SSL for securing the data in transit is 443</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*RBboasHZzhl3DXw9PEDTzw.png" /><figcaption>6</figcaption></figure><p>6. The term using for folder in web application is the same as the linux based systems which is directory</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*mhQ4gFSxVKTzE1DCxXYnUA.png" /></figure><p>7. When we ask for resource from an web server it will respond with different status code to indicate the operation success or failure. the code used to show that the server is unable to find a resource is 404.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*Ll_pkln9hUJmnb_QVJs27g.png" /></figure><p>8. THe option we use to brute force directory is called dir and to brute force subdomains is called vhost</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*rIUR2_3_toDg8W1jvS5L4Q.png" /></figure><p>9. In mysql and post gres we can comment using the special charater ‘#’ which will tell the server not to execute the command or anything after this character.</p><p>10. Now we can open our preferred browser and go to the url http://&lt;ip-address&gt;. After that we can enter admin’ # then enter what ever we want ot the password field then enter and we will get the below page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eUDrAmsM4PsSYOSIpcuAiQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/675/1*DHmPk6JccSzDibefYf_n5w.png" /></figure><p>Let us look why this happen when we give admin;# it will send the below command to the sql server and as we have said # is comment so it will comment the rest and return the data if the username found.</p><pre>select username,password from users where username=&#39;admin&#39;#&#39; and password=&#39;sdljfasklf&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*YIHnGa-z5MduiZ8JZty2_g.png" /></figure><p>Submite the flag to the last question and you are done.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/1*s-8cz5jKYDxjIPeIvoZqxg.png" /></figure><blockquote>Congra you have 9wn3d appointment</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a177c4252fce" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HackTheBox : Redeemer]]></title>
            <link>https://medium.com/@mintesnotafework12/hackthebox-redeemer-d54640400813?source=rss-fc6d38a6bffc------2</link>
            <guid isPermaLink="false">https://medium.com/p/d54640400813</guid>
            <category><![CDATA[redeemer]]></category>
            <category><![CDATA[hackthebox]]></category>
            <dc:creator><![CDATA[Mintesnot afework]]></dc:creator>
            <pubDate>Wed, 14 Aug 2024 07:38:54 GMT</pubDate>
            <atom:updated>2024-08-14T07:38:54.991Z</atom:updated>
            <content:encoded><![CDATA[<h3>HackTheBox : Redeemer</h3><p>Hey i am back with another box from hack the box starting point. I believe you have seen my previous posts. so let me get directly to the box.</p><h3>pre-requirement</h3><ol><li>connect with hackthebox using the openvpn file</li><li>check your connection using the ping command</li></ol><p>To get more about this go to this link <a href="https://medium.com/@mintesnotafework12/hack-the-box-hacking-meow-53b6cf1be6ae">https://medium.com/@mintesnotafework12/hack-the-box-hacking-meow-53b6cf1be6ae</a></p><p>It will show you how connect and check your connection</p><h3>Answering the Questions</h3><ol><li>To answer the first question we need to perform nmap scan from the port 0 to 9999 using</li></ol><pre>$ nmap -p 1-9999 &lt;ip-address&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*s5bw9kVwFXZQ3d7nxzPoTA.png" /></figure><p>You will find the port 6379 tcp port open.</p><p>2. To get the service running on a give system in nmap we use the option -sV</p><pre>$ nmap -sV -p 6379 &lt;ip-address&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6gulRwFh5eeoEkmky0KzOQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*5YRr4QwRqF047YFIVkrXbg.png" /></figure><p>3. Then we find redis which an open source, in-memory, NoSQL key/value store that is used primarily as an application cache or quick-response database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/1*eQuqzrs4NcTFFv-wgfB3wg.png" /></figure><p>4. the command line utility used to interact with a redis server is redis_cli</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/1*nk0SG7kG8VJyJX7kjP0GBQ.png" /></figure><p>5. To specify a host we can use the -h command option with redis-cli</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UVCHGpnfWCuzE3sDDt9b4g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/1*XWV9sdii4tOBpm4NFHLbYA.png" /></figure><p>6. After we connect with the redis server using the command line utility we can use the info command to see more helpful informations</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OnWoCd4WOXvXOCmEy3Bnxw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*Xu9XkRemCT8qaBKOx-ARvA.png" /></figure><p>7. the version that we get from the scan is 5.0.7</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*tqRPktkuJxJ96VhbOGUlTw.png" /></figure><p>8. as the sql databases we use the select command to select a database from the redis server</p><pre>#select &lt;index-number&gt;<br>select 0</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*GLGiwWQph5vqJSyCUbntZQ.png" /></figure><p>9. To select the number key use the keys all</p><pre>keys *</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*geT8aUbvUO6gDK_5nwhMmg.png" /></figure><p>10. the command we used to obtain the keys is</p><pre>keys *</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*Ri6nSihz42jqt8zNMMUqFg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*b25GhmAgaodQfGJZr6s0cg.png" /></figure><p>11. we need to submit the root flag by viewing the content of the flag key using</p><pre>get flag</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*WLqig2veIwbPlx7bRCYV1A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*bpD6rldUIDFBVxyR0-VB3A.png" /></figure><h3>See you very soon my friend</h3><h3>Until then stay safe and do not get caught</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d54640400813" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>