Infosec Report A2
Infosec Report A2
Infosec Report A2
Lab 1
Setup, folder creation and generating certificate authority key
mkdir demoCA
cd demoCA
mkdir certs crl newcerts
touchindex . txt serial
echo 01> serial
cd . .
openssl req−new−x 509−keyout ca . key −out ca . crt−config /etc/ ssl/openssl . cnf
Viewing ca.key and ca.srt
cat ca . key
cat ca . srt
Generating Server key
openssl req−new−key server . key −out server .csr−config/etc /ssl /openssl . cnf
Configuring DNS
¿ VirtualHost∗:80> ¿
ServerName i210486. com
DocumentRoot / var /www /html
DirectoryIndex index . html
¿ /VirtualHost >¿
Editing default-ssl.conf
¿ VirtualHost∗:443 >¿
ServerName i210486. com
DocumentRoot / var /www /html
DirectoryIndex index . html
SSLEngine on
SSLCertificateFile/etc /apache 2 /ssl/ pkicert . pem
¿ /VirtualHost >¿
Starting enabling ssl, checking config and starting server
Website Display
Setup MIMT
Adding replacing ssl certificate for nu.edu.pk with my created ssl certificate
¿ VirtualHost∗:443 >¿
ServerName nu . edu . pk
DocumentRoot / var /www /html
DirectoryIndex index . html
SSLEngine on
SSLCertificateFile/etc /apache 2 /ssl/ pkicert . pem
¿ /VirtualHost >¿
¿ VirtualHost∗:80> ¿
ServerName nu . edu . pk
DocumentRoot / var /www /html
DirectoryIndex index . html
¿ /VirtualHost >¿
Editing /etc/hosts
openssl req−new−key nuedu .key −out nuedu . csr−config/etc /ssl /openssl . cnf
Signing Certificate
openssl ca−¿ nuedu . csr−out nuedu . crt−cert ca . crt−keyfile ca . key −config /etc/ssl /openssl . cnf
Setting compromised SSL in apache
sock.send(str(public_key).encode('utf-8'))
server_public_key = int(sock.recv(256).decode('utf-8'))
The function above runs on both client and server, the function makes a privatekey between 1 and p-1,
and calculates
a
publicKey=g mod P
Where “a” is the random private integer that is decided on both client and server side. Then the
calculated key is sent to each other via socket.send() and socket.recieve(). Before sending, the key is
encoded into bytes to be sent, and decoded while received.
Username
Password
Registration Confirmation
Encrypted Communication