Brute force protection

@memes

  • Pacmanlives@lemmy.world
    link
    fedilink
    arrow-up
    14
    ·
    9 months ago

    I remember in college editing OpenSSH source code to instead of return wrong password to a root shell prompt just to stop brute force attacks

  • gibmiser@lemmy.world
    link
    fedilink
    arrow-up
    131
    arrow-down
    1
    ·
    9 months ago

    As a non programmer, is the joke that humans will retype their password assuming that they made a typo?

    If so, sick indeed.

    • Infynis@midwest.social
      link
      fedilink
      English
      arrow-up
      107
      arrow-down
      2
      ·
      9 months ago

      The guy coding made it so, on your first attempt, even if you answer correctly, it will tell you your login failed due to incorrect username or password, to joke about how it feels like you always get it wrong on the first try

      • soloner@lemmy.world
        link
        fedilink
        arrow-up
        23
        arrow-down
        6
        ·
        edit-2
        9 months ago

        The logic is bugging me, though. It should be if isFirstAttempt || !isPasswordCorrect

        I understand the meme is trying to convey in spite of being correct to still return an error, but then it doesn’t account for when the password is actually incorrect.

        • reflectedodds@lemmy.world
          link
          fedilink
          arrow-up
          17
          ·
          9 months ago

          Like the other person said, it’s not meant to always fail the first time you enter any password.

          It is meant to fail the first time you enter the correct password.

          • winterayars@sh.itjust.works
            link
            fedilink
            arrow-up
            2
            arrow-down
            1
            ·
            9 months ago

            So it should be: if password == correct and first_success == true then { login failure; first_success = false }

            Something like that.

        • QuaternionsRock@lemmy.world
          link
          fedilink
          arrow-up
          48
          ·
          edit-2
          9 months ago

          That defeats the brute-force attack protection…

          The idea is that brute-force attackers will only check each password once, while real users will likely assume they mistyped and retype the same password.

          The code isn’t complete, and has nothing to do with actually incorrect passwords.

    • NutWrench@lemmy.world
      link
      fedilink
      arrow-up
      11
      ·
      9 months ago

      I would assume that I was being phished and the attacker wanted me to re-type the password to verify that it’s correct.

  • cobra89@beehaw.org
    link
    fedilink
    arrow-up
    9
    ·
    9 months ago

    Not to be pedantic but wouldn’t it be IsFirstLoginWithAttemptedPassword or am I missing something?

    • chraebsli@programming.dev
      link
      fedilink
      arrow-up
      8
      arrow-down
      1
      ·
      9 months ago

      no, since it first checks if the password is correct. if it is, display error message. if it is corrent and the second time, accept the password (code not in screenshot) but if the password is wrong, it doesnt check if it is the first attempt.

        • pythonoob@programming.dev
          link
          fedilink
          arrow-up
          1
          ·
          9 months ago

          It wouldn’t stop most brute force attacks, which are not performed on the live web service, but rather on a password hasb list that was stolen via some other means.

        • chraebsli@programming.dev
          link
          fedilink
          arrow-up
          3
          ·
          9 months ago

          You can’t really prevent a brute force attack. Even if you prevent it from one IP or so, you can still do “distributed” brute force attacks.

          Also only allowing one password per 5 seconds or so per IP will not work if you have lots of users and they are at work and have the same IP.

    • piracy_is_good_xdd@lemmy.dbzer0.com
      link
      fedilink
      arrow-up
      5
      ·
      9 months ago

      No, it’s correct - say your password gets leaked across thousands of passwords. A hacker will try to crack all of them with a program that guesses them once, which as the image suggests defeats these types of programs

  • normalexit@lemmy.world
    link
    fedilink
    arrow-up
    8
    ·
    9 months ago

    This is a really interesting idea, but a password manager would throw a wrench in it.

    I’d assume my password was invalidated or stored incorrectly, so I’d reset, then I’d try to log in, wtf… this website blows.

  • finkrat@lemmy.world
    link
    fedilink
    arrow-up
    14
    ·
    edit-2
    9 months ago

    Won’t protect against an offline attack (just will confuse the hell out of the hacker) but might confound an online attack? Until someone gets wise and runs the tool a second time. Loving the chaotic neutral vibes here.

    • zalgotext@sh.itjust.works
      link
      fedilink
      arrow-up
      6
      arrow-down
      2
      ·
      9 months ago

      It doesn’t really even protect against online attacks though. Like, if you’re going through a list of known accounts, by definition it won’t be any of those accounts’ first time logging in, right?

      And if you’re not going through a list of known accounts, good luck getting anywhere with your attack any time this millennia

  • Matriks404@lemmy.world
    link
    fedilink
    arrow-up
    78
    arrow-down
    1
    ·
    edit-2
    9 months ago

    Well, I sometimes input the same password 15-times in a row, and it works only on the last try. ¯⁠\⁠_⁠(⁠ツ⁠)⁠_⁠/⁠¯

  • TORFdot0@lemmy.world
    link
    fedilink
    English
    arrow-up
    32
    arrow-down
    4
    ·
    9 months ago

    If they had the password right the first try, that isn’t a brute force attack, thats a credential leak.

    • iAvicenna@lemmy.world
      link
      fedilink
      arrow-up
      9
      ·
      9 months ago

      could also work in a brute force scenario, but first attempt would be not first attempt in a set amount of time but first attempt for each password by the user in a fixed amount of time

    • winterayars@sh.itjust.works
      link
      fedilink
      arrow-up
      16
      ·
      9 months ago

      It should be that it rejects the password the first time it’s entered correctly but accepts it on every subsequent try. That actually would provide some protection against like dictionary attacks and raw brute force attacks.