Create a python program to obtain a collection of TLS certificates. You dont need to save...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Create a python program to obtain a collection of TLS certificates. You dont need to save every field of the certificate, but you should consider which fields might be useful for foren- sics/analytics later on. There is no required number of certificates, but you will need a large collection for the higher level machine learning tasks. Submit a document containing the following. 1. Your code and a screenshot of it running. 2. A description of what part of the certificates you have saved. 3. A print out of all the certs you have collected. You may find the following code helpful in getting started. import ss1 hostname = 'www.google.com port 443 f = open('cert.der', 'wb'). cert = ssl.get_server_certificate ((hostname, port)) f.write(ssl.PEM_cert_to_DER_cert (cert)) f.close() ### or alternatively ### # Import modules import socket import pyshark # Docs: https://github.com/KimiNewt/pyshark/ from pprint import pprint data = pyshark. FileCapture (unipcap.pcap) #Loop through each item (packet) for pkt in data: if TLS in pkt: # Look for attribute of x509 if hasattr(pkt['TLS' ], 'x509sat_utf8string'): print (pkt[TLS]) pprint(dir (pkt['TLS'])) print (pkt['TLS'].x589sat_utf8string) print (NEW CERT) Create a python program to obtain a collection of TLS certificates. You dont need to save every field of the certificate, but you should consider which fields might be useful for foren- sics/analytics later on. There is no required number of certificates, but you will need a large collection for the higher level machine learning tasks. Submit a document containing the following. 1. Your code and a screenshot of it running. 2. A description of what part of the certificates you have saved. 3. A print out of all the certs you have collected. You may find the following code helpful in getting started. import ss1 hostname = 'www.google.com port 443 f = open('cert.der', 'wb'). cert = ssl.get_server_certificate ((hostname, port)) f.write(ssl.PEM_cert_to_DER_cert (cert)) f.close() ### or alternatively ### # Import modules import socket import pyshark # Docs: https://github.com/KimiNewt/pyshark/ from pprint import pprint data = pyshark. FileCapture (unipcap.pcap) #Loop through each item (packet) for pkt in data: if TLS in pkt: # Look for attribute of x509 if hasattr(pkt['TLS' ], 'x509sat_utf8string'): print (pkt[TLS]) pprint(dir (pkt['TLS'])) print (pkt['TLS'].x589sat_utf8string) print (NEW CERT)
Expert Answer:
Answer rating: 100% (QA)
To obtain a collection of TLS certificates and save relevant information from the certificates you can use the ssl module in Python to establish a con... View the full answer
Related Book For
Financial Accounting and Reporting a Global Perspective
ISBN: 978-1408076866
4th edition
Authors: Michel Lebas, Herve Stolowy, Yuan Ding
Posted Date:
Students also viewed these computer network questions
-
How do you schedule a trial? What is the claim you need to file.
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Precision Systems, Inc. (PSI)* Precision Systems, Inc. (PSI) has been in business for more than 40 years and has generally reported a positive net income. The company manufactures and sells...
-
Given the sprinkler system layout in Figure A, calculate the flow and pressure required at point RN#1 (point B in Figure B) without considering the impact of velocity pressures. Note that RN#1 (point...
-
A barge is 15 ft wide and floats with a draft of 4 ft. It is piled so high with gravel that its center of gravity is 3 ft above the waterline, as shown. Is it stable? Gi 4 ft 7.5 ft7.5ft
-
A skeleton of Pine Florals' balance sheet appears as follows (amounts in thousands): Use the following ratio data to complete Pine Florals' balance sheet: a. Debt ration is 0.58. b.Current ration is...
-
Calculate the kinetic energy correction factor for each of the following velocity profiles for a circular pipe: (a) \(u=u_{\max }\left(1-\frac{r}{R} ight)\) (b) \(u=u_{\max...
-
Seger, Inc., is an unlevered firm with expected annual earnings before taxes of $21 million in perpetuity. The current required return on the firms equity is 16 percent, and the firm distributes all...
-
An air-filled capacitor is formed from two long conducting cylindrical shells that are coaxial and have radii of 16 mm and 78 mm. The electric potential to the outer conductor is -321 V (k = 1/4TTE =...
-
What are the most significant differences between the AICPA and the PCAOB standard unmodified opinion audit reports?
-
EMP may be involved. All the five tables Employees, Departments, Locations, Dept, Use table Employees for this Q1. List the employee_id, last name, first name, manager (immediate supervisor) ID for...
-
A product earns an annual gross revenues of $90,000, the variable cost is $60. The fixed costs are $30,000 and the product is sell for $90. The quantity of product sold las year was 1,000. What is...
-
How does Oracle Database support continuous availability and disaster recovery through features like Oracle Data Guard, Active Data Guard, and Far Sync, providing synchronous and asynchronous...
-
(c) (10 pts) Suppose that the fund manager just shorted another portfolio worth of $10 million with a beta of 1.2, what position in the futures should the fund manager take now to make the combined...
-
The Corner Grill needs a new refrigeration unit which costs $28,000. The unit has a 4-year life after which time it will be worthless. The unit belongs in a 20 percent CCA class. The equipment can be...
-
What public policies could be enacted today to help ensure a secure financial future for today's students fifty years from now?
-
. Isiah, the Managing Director of Rita's Taxis, wants to add another car to their fleet. He decides, therefore, to buy a second-hand Toyota Auris Hybrid car from DeMedeiros' Cars for 7500....
-
A researcher reports a significant two-way between-subjects ANOVA, F(3, 40) = 2.96. State the decision to retain or reject the null hypothesis for this test.
-
1 Give some arguments in favor of at least four different methods of depreciation. 2 Does depreciation provide or consume cash? 3 Give some arguments in favor of each method of reporting the sale of...
-
The balance sheet of the Mutter & Tochter companies, as of 31 December X1, is given in the following table (Mutter Co. is the parent and Tochter Co. is the subsidiary). Separate balance sheets as at...
-
Multiple Choice Questions Select the right answer (only one possible answers unless otherwise stated). 1 The statement of financial position/balance sheet emphasizes the dynamics of the cash flowing...
-
Earnings is calculated deducting: A. Dividends on ordinary shares. B. Dividends on preference shares. C. Tax expense. D. Interest expense.
-
Set out in Figure 16.10 are summarized balance sheets and income statements for F Co. for 20X1 and 20X2. You are required to: Figure 16.10 a. prepare a table of ratios, covering all aspects of...
-
Under IFRS, income statements are required to show: A. Extraordinary items. B. Unusual items. C. Exceptional items. D. None of the above.
Study smarter with the SolutionInn App