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
I will mark you as brainlist
weeeeeb [17]

Answer:

download it

Explanation:

because if u upload it will not save .

7 0
3 years ago
Read 2 more answers
Which letter is represented by the code 01001011?
Nastasia [14]
First questions answer is : K
……
Second question :

To solve these questions you take 8 digits and look for them in the table ~
01001000 H
01000101 E
01001100 L
01001100 L
01001111 O

Answer : HELLO
6 0
3 years ago
Read 2 more answers
Suggest ways in which web designers can use color to make a statement about the subject of a web page, a brand, or the website i
Ulleksa [173]

Hi. :")

As it is used to attract interest in advertisements, different colors can be used in order to attract attention here. Or the upper left corner technique can be used. The important contents are placed in the upper left corner. Because, in the country where I live, in the technology design class, people have always studied the upper left corner further.

Good Luck!

#Turkey

4 0
3 years ago
A ball is released from a 10 m high roof and bounces two thirds as high on each successive bounce. After traveling a total of 40
skelet666 [1.2K]

Answer:

Four times traveling 40,12345 mts

Explanation:

We can express this as a sum as follows

\sum_{i=1}^4(10\cdot  \frac{2}{3}^{i - 1} + 10\cdot  \frac{2}{3}^{i } ) = 3250/81=40.12345679

The first term is the dropping part and the second is the upward motion. this sums up to 40,12345 m after bouncing four times. As a program we could write using the while loop.

distance=0;

i:=0;

while distance<40 do

i:=i+1;

distance:=distance+ 10\cdot  \frac{2}{3}^{i - 1} + 10\cdot  \frac{2}{3}^{i };

end while;

Here the answer is in i and the closest distance traveled after reaching 40 is in the variable distance.

4 0
4 years ago
You have created a new storage space using a single 500 GB external USB 3.0 drive. The drive is becoming full, so you add anothe
Dimas [21]

Answer:

In the clarification section following, the definition including its query is mentioned.

Explanation:

  • I believe we possess 2 other discs except for the major memory card-a USB 500 GB USB 3.0 drive, just one TB USB 2.0 drive. So we're making a two-array mirrored storage space resilience kit. We get a warning when we duplicate files from either the C: drive towards this second adaptation that you should be running out of places.
  • That was because these need to have a backup process around each other discs throughout the situation of a two-way mirror.
  • This serves to protect the organization from disc failure and enhances the overall efficiency of the device. Thus, even when copying, even though only several 100 MB has also been cut and pasted to something like the disc, the disc intercepts that the information collected from either the 500 GB drive as well as the major disc must be stored there. And that is how the alert arrives that throughout the new trip, we're running out of space. So this is how they so easily get the alarm.

3 0
3 years ago
Other questions:
  • Riser cards on some proprietary systems plug into a unique socket or slot on the motherboard. These are also called________
    6·1 answer
  • In India, the adoption of new telecommunication services was ____________ Select one: a. slow b. rapid c. frought with errors d.
    15·1 answer
  • Moore’s law states that the number of transistors on integrated circuits doubles approximately every two years?
    15·2 answers
  • Write the correct word to complete the sentence:
    7·1 answer
  • Write a program that randomly (using the random number generator) picks gift card winners from a list of customers (every custom
    14·1 answer
  • At Moore High, 456 students attended the prom. This is 65 more students than
    13·2 answers
  • Write down the importance of computers in this modern era of information technology in brief.​
    13·1 answer
  • What would a good digital citizen do if he sees his classmate left her email account open on a school computer by mistake?
    11·1 answer
  • I hs no life hahahaha
    8·2 answers
  • 3.12 LAB: Output range with increment of 5 Write a program whose input is two integers, and whose output is the first integer an
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!