Python Forum
hardest week yet: some guidence please
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
hardest week yet: some guidence please
#5
(Aug-16-2019, 06:16 PM)ichabod801 Wrote: For step 2, you should be checking in line, not in auth_log. Once you have that fixed, do you see a pattern in the output from step 2? If so, you use that pattern in step 3.

thank you I just figured that out prior to checking back in I am now working on step 3, with 1 and 2 functional.

(Aug-16-2019, 06:19 PM)nilamo Wrote: What does it do from the terminal? That's the only place that matters (unless you have different instructions for the course).
It works fine in terminal. I now have step 1 and 2 complete thank you

My step 3
The word before every user name is user and the word after is from. I wrote this code which i think is the right format (ofcorse it doesnt work)
intruder_log = {}

with open("auth.log.1") as auth_log:
    for line in auth_log:
        if "Failed password" in line:
            start = intruder_log.find("user")
            end = intruder_log.find("from")

            invalid_user = intruder_log[start : end ]

            print("invalid_user: {}".format(invalid_user))
Reply


Messages In This Thread
RE: hardest week yet: some guidence please - by raymond2688 - Aug-16-2019, 06:32 PM
slice help - by raymond2688 - Aug-17-2019, 12:52 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Calculating the number of day of the week RbaPhoenix 3 2,570 Mar-27-2020, 09:23 PM
Last Post: Larz60+
  week 1 python help - string formatting ? raymond2688 20 8,066 Jul-09-2019, 08:10 PM
Last Post: snippsat
  Trying to get the week number from a string of numbers fad3r 2 3,279 Apr-15-2018, 06:52 PM
Last Post: ljmetzger

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020