diff --git a/modules/generators/structured_content/hackerbot_config/asymmetric_enc_rsa/templates/asymmetric_enc_rsa_lab.xml.erb b/modules/generators/structured_content/hackerbot_config/asymmetric_enc_rsa/templates/asymmetric_enc_rsa_lab.xml.erb index 4c3137a7a..82c95a6fb 100644 --- a/modules/generators/structured_content/hackerbot_config/asymmetric_enc_rsa/templates/asymmetric_enc_rsa_lab.xml.erb +++ b/modules/generators/structured_content/hackerbot_config/asymmetric_enc_rsa/templates/asymmetric_enc_rsa_lab.xml.erb @@ -137,7 +137,7 @@ Randomised instance generated by [SecGen](http://github.com/cliffe/SecGen) (<%= Create a public and private RSA key pair within the <%= $chall_1_path %> directory using the file names key.pub and key.priv for the public and private key respectively. - grep 'BEGIN PRIVATE KEY' <%=$chall_1_path %>/key.priv > /dev/null; priv=$?; grep 'BEGIN PUBLIC KEY' <%=$chall_1_path %>/key.pub > /dev/null; pub=$?; echo $priv$pub + grep "BEGIN .*PRIVATE KEY" <%=$chall_1_path %>/key.priv > /dev/null; priv=$?; grep "BEGIN .*PUBLIC KEY" <%=$chall_1_path %>/key.pub > /dev/null; pub=$?; echo $priv$pub 22 @@ -168,7 +168,7 @@ Randomised instance generated by [SecGen](http://github.com/cliffe/SecGen) (<%= Create another public and private RSA key pair within the <%= $chall_2_path %> directory using the file names key.pub and key.priv for the public and private key respectively. Encrypt a message file containing "<%= $chall_2_msg %>" using the public key and store the encrypted message within <%= $chall_2_path %>/message.enc - grep 'BEGIN PRIVATE KEY' <%=$chall_2_path %>/key.priv > /dev/null; priv=$?; grep 'BEGIN PUBLIC KEY' <%=$chall_2_path %>/key.pub > /dev/null; pub=$?; ls <%= $chall_2_path %>/message.enc 2> /dev/null; mfile=$?; msg_decrypt=`openssl pkeyutl -in <%= $chall_2_path %>/message.enc -decrypt -inkey <%= $chall_2_path %>/key.priv 2>/dev/null`; echo $priv$pub$mfile$msg_decrypt + grep "BEGIN .*PRIVATE KEY" <%=$chall_2_path %>/key.priv > /dev/null; priv=$?; grep "BEGIN .*PUBLIC KEY" <%=$chall_2_path %>/key.pub > /dev/null; pub=$?; ls <%= $chall_2_path %>/message.enc 2> /dev/null; mfile=$?; msg_decrypt=`openssl pkeyutl -in <%= $chall_2_path %>/message.enc -decrypt -inkey <%= $chall_2_path %>/key.priv 2>/dev/null`; echo $priv$pub$mfile$msg_decrypt 000<%= $chall_2_msg %> @@ -202,7 +202,7 @@ Randomised instance generated by [SecGen](http://github.com/cliffe/SecGen) (<%= false - Using the given values in the example above (p = 7, q = 23, N = 161, phiN = 132, e = (5,161), d = 53), decrypt the following ciphertext: "<%= $chall_3_ciphertext %>" + Using the given values in the example above (p = 7, q = 23, N = 161, phiN = 132, e = 5, d = 53), decrypt the following ciphertext: "<%= $chall_3_ciphertext %>" OK @@ -233,7 +233,7 @@ Randomised instance generated by [SecGen](http://github.com/cliffe/SecGen) (<%= false - Using the given values in the example above (p = 7, q = 23, N = 161, phiN = 132, e = (5,161), d = 53), encrypt the following message: "<%= $chall_4_message %>" + Using the given values in the example above (p = 7, q = 23, N = 161, phiN = 132, e = 5, d = 53), encrypt the following message: "<%= $chall_4_message %>" OK diff --git a/modules/generators/structured_content/hackerbot_config/asymmetric_enc_rsa/templates/rsa_python3_example.md.erb b/modules/generators/structured_content/hackerbot_config/asymmetric_enc_rsa/templates/rsa_python3_example.md.erb index 4936e3749..61d33d705 100644 --- a/modules/generators/structured_content/hackerbot_config/asymmetric_enc_rsa/templates/rsa_python3_example.md.erb +++ b/modules/generators/structured_content/hackerbot_config/asymmetric_enc_rsa/templates/rsa_python3_example.md.erb @@ -92,4 +92,13 @@ e.g. ord('Z') will return 90. (41 ** d) % N ... etc ... ... etc ... + +*** Decrypted message: 84 104 101 32 72 111 98 105 116 116 *** +>>> chr(84) # T +>>> chr(104) # h +>>> chr(101) # e +... etc ... +... etc ... ``` + +Note: chr() is the inverse of ord(), where chr takes an integer representation of a character as a parameter and returns the associated character. \ No newline at end of file diff --git a/modules/generators/structured_content/hackerbot_config/symmetric_enc_aes/templates/symmetric_enc_aes_lab.xml.erb b/modules/generators/structured_content/hackerbot_config/symmetric_enc_aes/templates/symmetric_enc_aes_lab.xml.erb index ef4c2f54f..1583ffe75 100644 --- a/modules/generators/structured_content/hackerbot_config/symmetric_enc_aes/templates/symmetric_enc_aes_lab.xml.erb +++ b/modules/generators/structured_content/hackerbot_config/symmetric_enc_aes/templates/symmetric_enc_aes_lab.xml.erb @@ -238,7 +238,7 @@ Randomised instance generated by [SecGen](http://github.com/cliffe/SecGen) (<%= What is the decrypted message? - <%= $dec_python_message %> + .*<%= $dec_python_message %>.* :) <%= $flags.pop %>