ITSC203 Lab3a
ITSC203 Lab3a
ITSC203 Lab3a
EVALUATION:
1 Problem 1 15
2 Problem 2 30
TOTAL MARK 45
Background Reading
Read chapters 6–10 in How to Think Like a Computer Scientist: Learning with Python,
available at www.greenteapress.com/thinkpython/thinkCSpy.pdf.
https://docs.python.org/3.8/
Important Information
YOU MUST PRESENT IMAGES OF YOUR CODE BEING EXECUTED. DO NOT
SUBMIT YOUR ANSWERS IN THE DOCUMENT. CREATE A BLANK DOCUMENT
AND SUBMIT YOUR ANSWERS THERE.
2. Comments on lines where you used some unique computation that might be tricky to
comprehend a month later.
list1 = [x for x in range(20) if x % 4 == 1] # Using list comprehension to ….
3|Page
Notice if the user enters a1a2 or 11223344 as the test pattern they do not show up again
in the non-repeating sequences above.
Question 1:
1. Imagine you entered a sequence like AAAAAAAAAAA, where the A’s colored in red
represent the sequence you are seeking.
Why is it not possible to tell exactly which offset your AAAA pattern begins at? 1pt
2. Is it possible to put the bytes that represent characters below 0x20 and above 0x7E
into your non-repeating sequence? If it is not possible explain why? 2pts
4|Page
3. Will uppercase letters be treated differently from lowercase letters when placed on the
stack? Why? 1pts
5. To test your program, simply generate a sequence then select a part of that
sequence.
Example execution:
Happy Penetration Testing!!! Remember to always get permission; it’s the right thing to do 😊
Figure 1: Installing the prettytable module. Other required modules can be installed in a similar
fashion.
4. After generating the table below Figure 2, programmatically list the IP Addresses that
are in the same subnet? 5pts
{
"Comp477": ["Gigabyte", 9133.27, "70561924KIQqzw", "68.192.163.42/255.255.240.0"],
"Comp678": ["Asus", 7264.42, "56024371IQCewb", "198.78.85.109/255.255.248.0"],
"Comp894": ["Acer", 4564.22, "41928367UHPkxu", "192.167.55.136/255.255.240.0"],
"Comp592": ["Dell", 9378.82, "20451398MFWusg", "192.167.86.14/255.255.255.128"],
"Comp397": ["Acer", 8115.08, "74189306HKLvwu", "176.33.145.182/255.255.248.0"],
"Comp697": ["Asus", 8941.52, "17892534DZOlru", "10.0.252.127/255.255.192.0"],
"Comp966": ["Dell", 9539.92, "46193287TYIurw", "10.0.222.132/255.255.252.0"],
"Comp964": ["Dell", 4274.43, "04237918UTSdkj", "200.3.34.67/255.255.192.0"],
"Comp634": ["Google", 5182.86, "95430287FCQfbk", "68.192.177.108/255.255.192.0"],
"Comp565": ["Toshiba", 1904.33, "57018243JPYtpu", "192.167.63.98/255.255.240.0"],
"Comp906": ["Dell", 5228.37, "96134827IHGibu", "176.33.20.163/255.255.192.0"],
"Comp481": ["Asus", 7790.58, "05793218BRZjgl", "198.78.237.73/255.255.248.0"],
"Comp370": ["Dell", 9251.70, "89531276LIMqby", "68.192.129.199/255.255.192.0"],
"Comp703": ["Toshiba", 7520.04, "53179426FUXqjz", "200.3.191.102/255.255.192.0"],
"Comp493": ["Google", 4621.55, "06514398WINzou", "198.78.59.119/255.255.240.0"]
6|Page
Figure 2: Example of the code generating output, it shows the result of printing the dictionary
using the prettyprint module.
7|Page
QUESTIONS (6pts)
1. The table doesn’t appear sorted by any of the fields. What field(s) would be logical
choices if the information were to be sorted? Why would you choose these fields? Give
at least 2. 2pts
2. As part of a Cyber Security team we often need to consider what assets a company has.
Why do you need to know details about the computer assets a company has? 1pt
a. In answering this question, you can think about security controls that relate to the
physical security of the device and the technology installed on it. Consider how it
will communicate or where it is located.
SUBMISSION
1. Submit your python code, answers to the questions and the screenshot(s) of the output
of your working program.