Question

Every week a series of ssh attack attempts on homer.wcitac.org is posted to a web page:...

Every week a series of ssh attack attempts on homer.wcitac.org is posted to a web page: http://homer.wcitac.org/sec290/hwk2/. Look at it in your browser. Each line represents a failed ssh login attempt for a user that doesn't exist on homer.wcitac.org. Each time you refresh the page, you will get a look at a different part of the log file. Your job is to find and display just the IP address of the first failed password displayed on the page. Since the data changes each time the web page is refreshed, you'll need to generalize your program so that it always displays the first IP address. Note that since the length of the user names will vary, the location of the first IP address will move around a little bit. And, IP addresses vary in length. Be sure to account for this. Program code is written in Python 3.0

it was not specified about Library being used or not

0 0
Add a comment Improve this question Transcribed image text
Answer #1
import urllib.request  # Needed to read webpage

link = "http://homer.wcitac.org/sec290/hwk2/"  # web page link
content = urllib.request.urlopen(link).read()  # reading web page source code
logs = str(content).split('<p>')  # splitting the content so as to get first line in the second position of the list
text = logs[1].split(']:')[1]  # splitting first line using ']:'
IP = ''  # to store IP address

text = text.split('from ')[1]  # 'from' followed by space is the last character before IP
# therefore taking the second element after splitting

IP = text.split(' ')[0]  # splitting the rest using space and IP is the first element

print('The first failed IP address is: ', IP)

Output:

Add a comment
Know the answer?
Add Answer to:
Every week a series of ssh attack attempts on homer.wcitac.org is posted to a web page:...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Description: In this assignment, you will be launching a denial of service attack on a web...

    Description: In this assignment, you will be launching a denial of service attack on a web server. We will be using hping3, a command-line oriented network security tool inside Kali Linux (an advanced penetration testing Linux distribution). Setting up the victim machine Download the Windows XP virtual machine with WebGoat server installed, using the following link. We will use this machine as the victim machine and launch a DoS attack on the WebGoat server.https://drive.google.com/open?id=0BwCbaZv8DevUejBPWlNHREFVc2s Open the victim machine and launch...

  • Suppose within your Web browser you click on a link to obtain a Web page. The...

    Suppose within your Web browser you click on a link to obtain a Web page. The content of the web page is not cached in the local caching server, and the IP address for the associated URL is not cached in your local host either, so that a DNS look-up is necessary to obtain the IP address. Suppose that n DNS servers need to be visited before your host receives the IP address from DNS, and each of successive visits...

  • Suppose within your web browser you click on a link to obtain a web page. The...

    Suppose within your web browser you click on a link to obtain a web page. The IP address for the associated URL is not cached in your local host, so a DNS look up is necessary to obtain the given IP address. Further suppose that 3 DNS servers are visited before your host receives the IP address form DNS. The round trip time between the client and the ithDNS server is Ti(1≤i≤3), and that between the jthDNS server and the...

  • Suppose within your Web browser you click on a link to obtain a Web page. The...

    Suppose within your Web browser you click on a link to obtain a Web page. The content of the web page is not cached in the local caching server, and the IP address for the associated URL is not cached in your local host either, so that a DNS look-up is necessary to obtain the IP address. Suppose that n DNS servers need to be visited before your host receives the IP address from DNS, and each of successive visits...

  • Use python 3 to solve: Every web browser has both a back and a forward button...

    Use python 3 to solve: Every web browser has both a back and a forward button which allows the user to navigate to previously seen web pages. Your task is to implement this functionality using two stacks: ·        The input to your program will be a sequence of commands. The ">" and "<" tokens will be used to indicate forward and back, respectively. All other input will be web addresses (you can assume they will always be valid). ·        You...

  • Problem # 1 (30 points): Suppose within your Web browser you click on a link to...

    Problem # 1 (30 points): Suppose within your Web browser you click on a link to obtain a web page Suppose that the IP address for the associated URL is not cached in your local host, so that a DNS look- up is necessary to obtain the IP address. Suppose that two (2) DNS servers are visited before your host receives the IP address from DNS; the successive visits incur an RTT of RTT1 and RTT2. Further suppose that the...

  • JUDY'S HTML TUTORIAL MENU CREATING YOUR FIRST WEB PAGE The best way to make a web...

    JUDY'S HTML TUTORIAL MENU CREATING YOUR FIRST WEB PAGE The best way to make a web page is to just dive right in. Open Notepad. To open notepad in Windows, click the windows icon in the lower left corner of the screen and then type "notepad." Notepad is a text editor. Other text editors you may consider are TextPad, Sublime Text, or NotePad++. Do not use Word or WordPad; they are word processors. If you are using an Apple computer...

  • ER Modeling: Assignment In order to receive credit for this assignment, you must draw your ER...

    ER Modeling: Assignment In order to receive credit for this assignment, you must draw your ER model using a compute program and then turn in on the blackboard. Your ER model should include all of the necessary entity sets, relationships and keys, as well a weak entities and superclass/subclass relationships, if needed. A company decides to implement a software to monitor its employees' web surfing, and stores history of each employee's surfing in a database, as well as all of...

  • The first script is validate.sh. This is a simple form validation script that will be used...

    The first script is validate.sh. This is a simple form validation script that will be used to verify the inputs given. Normally, this would be done to validate input from a website or another program before entry into a database or other record storage. In this case, we will keep it simple and only focus on the input validation step. In particular, the script should prompt the user for four values: first name, last name, zip code, and email address....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT