1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Ugo [173]
4 years ago
8

Statement: There are two files. One file, "badIP_list.txt" has a listing of known bad IP addresses. These addresses were extract

ed from Talos Threat Hunting listings for 26 Jul 2018. The second file, "server_logs.txt", is a listing of IP addresses pulled off of your firewall logs, representing computers which have attempted entry into your network through network services, such as http, ssh and ftp. You will find which bad actors have attempted to enter your network for the purpose of tuning your firewalls and IDS's. Challenge: Write a program which reads in both files and checks the IP addresses from your server logs against the know bad IP's. If there is a match, write the bad IP address to a file titled "filter_list.txt". List unique IP's, do not list duplicates. Also, at the end of the "filter_list.txt" there should be a total of "Known bad IP's detected", and the percentage of IP addresses from your logs which are bad. (Divide the number of bad IP's by the number of total IP's)
Computers and Technology
1 answer:
lapo4ka [179]4 years ago
5 0

Answer:

See explaination

Explanation:

SOURCE CODE IN PYTHON:

inp=open('badIP_list.txt', 'r') #opening file for input

badIPs=[i.rstrip('\n') for i in inp.readlines()] #reading bad IPs

inp.close() #closing file

inp=open('server_logs.txt', 'r') #opening file for input

IPs=[i.rstrip('\n') for i in inp.readlines()] #reading all IPs from log

inp.close() #closing file

uniqueBadIPs=[] #to store unique bad IPs

countBadIPs=0 #to store count of bad IPs

countIPs=0 #to store count of all IPs

for IP in IPs: #iterating through the log of IPs

if IP in badIPs: #checking if IP is bad

countBadIPs+=1

if IP not in uniqueBadIPs: #checking if bad IP is unique

uniqueBadIPs.append(IP)

countIPs+=1

out=open('filter_list.txt', 'w') #opening file for output

out.write('_________________________________________________________\n')

out.write('Date : 26/07/2018\nName : Last, First\nMajor: CS\n\n')

out.write('Server logs contained these known bad IP addresses:\n')

for IP in uniqueBadIPs: #output the unique bad IPs

out.write(IP+'\n')

out.write('\n')

out.write('Total unique known bad IP\'s detected:\n'+str(len(uniqueBadIPs))+'\n\n')

out.write('Percentage of bad IP addresses in server logs:\n{:.2f}%\n'.format(countBadIPs*100/countIPs))

out.write('_________________________________________________________')

out.close() #closing file

You might be interested in
A Network Systems employee set up a network-wide password system in which other employees log in to access their work. Which tas
Anton [14]

The correct answer is C. protecting confidentiality.

3 0
3 years ago
Read 2 more answers
Match the installation type to its description.
MariettaO [177]

Answer:

Following are the types of installation matched to its respective definitions.

<h3>Upgrade installation:</h3>

What you do when you have a computer with an existing operating system that needs to be upgraded.

This means that while working on a window when you get attracted by the update introduced recently and you upgrade your window accordingly.

For example: Updating a window from 8 to 10 or desired features.

<h3>Multiple boot installation:</h3>

What you do when you have several operating systems on one computer.

In this type of installation, a computer has different windows for different accounts. You can boot to the desired installed window by switching account.

<h3>Clean installation:</h3>

What you do on a brand new computer that has never been set up before and does not have an operating system on it yet.

It can be defined as the installation of window done very first time on to the computer. Sometimes when the window gets deleted due to virus or any other factor, the installation at that time will also be termed as Clean Installation.

<h2>I hope it will help you!</h2>
5 0
3 years ago
While performing maintenance work on the components of a computer, you feel a small electric shock. Before you began working, yo
Colt1911 [192]
Static electricity could have build up because of your clothes
6 0
4 years ago
If an element is nested within another element, what happens to each line of the nested element?
Elden [556K]

Nested elements are elements that are placed within another element.

When an element is nested within another, all lines of the nested element will <em>inherit </em>the <em>properties </em>of the parent element.

Take for instance, the following HTML code

<em><p align = "center"> I am a <b>boy</b> </p></em>

In the above HTML code,

The bold element (i.e. <b>) is nested in the paragraph element (i.e. <p>)

The paragraph element is aligned center.

This means that, all elements in the paragraph element (including the <em>bold element</em>) will be centralized.

Hence, all lines of a nested element will <em>inherit </em>the properties of the parent element.

Read more about nested elements at:

brainly.com/question/22914599

7 0
3 years ago
Please
levacccp [35]

Answer:

inspect

Explanation:

7 0
3 years ago
Other questions:
  • The sequence of folders to a file or folder is called a(n) ________
    8·1 answer
  • Which type of address is used at the transport layer to identify the receiving application?
    14·1 answer
  • Jim maintains attendance records for his employees for the year. Row B includes the dates of attendance, and column A includes t
    5·2 answers
  • Select the correct answer
    11·2 answers
  • 2. Name the three building blocks of design that pertain to form.
    7·1 answer
  • Program code that can be evaluated to a value is called a(n):__________
    12·1 answer
  • Select the correct answer.
    9·2 answers
  • Biểu diễn cây sau bằng mảng một chiều
    12·1 answer
  • What does the computer receive when you press a key on a laptop keyboard?
    8·1 answer
  • To create a cell reference in another spreadsheet you must need to start with _______ sign.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!