ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    I'm under attack I need help in ssh

    IT Discussion
    7
    26
    6.3k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • I
      inroute
      last edited by inroute

      Hi everyone,

      I think I'm under attack I need help please.

      Hackers are trying to login to my pbx gateway. I don't know why I viewed the log file to see why my gateway is rebooting himself every few minutes using this command below

      tail -f /var/log/messages
      authpriv.info dropbear[32417]: Child connection from xx.xx.xx.xx:2xxxx
      authpriv.info dropbear[32417]: exit before auth: Disconnect received
      auth.warn login[20056]: invalid password for 'UNKNOWN' on 'pts/7'
      auth.warn login[20118]: invalid password for 'UNKNOWN' on 'pts/1'
      auth.warn login[20582]: invalid password for 'UNKNOWN' on 'pts/4'
      auth.warn login[20656]: invalid password for 'UNKNOWN' on 'pts/5'

      And I see UNKNOWN user is trying to access.

      I did a research about that on Google and I found a solution for that say have close SSH PasswordAuthentication. But I followed the steps to do that an I didn't find the file sshd_config that should be edit In etc/SSH/

      Can someone help me please.

      stacksofplatesS 1 Reply Last reply Reply Quote 0
      • T
        tiagom
        last edited by

        What OS?

        I 1 Reply Last reply Reply Quote 0
        • I
          inroute @tiagom
          last edited by

          @tiagom GNU/Linux

          scottalanmillerS 1 Reply Last reply Reply Quote 0
          • stacksofplatesS
            stacksofplates @inroute
            last edited by

            @inroute said in I'm under attack I need help in ssh:

            Hi everyone,

            I think I'm under attack I need help please.

            Hackers are trying to login to my pbx gateway. I don't know why I viewed the log file to see why my gateway is rebooting himself every few minutes using this command below

            tail -f /var/log/messages
            authpriv.info dropbear[32417]: Child connection from xx.xx.xx.xx:2xxxx
            authpriv.info dropbear[32417]: exit before auth: Disconnect received
            auth.warn login[20056]: invalid password for 'UNKNOWN' on 'pts/7'
            auth.warn login[20118]: invalid password for 'UNKNOWN' on 'pts/1'
            auth.warn login[20582]: invalid password for 'UNKNOWN' on 'pts/4'
            auth.warn login[20656]: invalid password for 'UNKNOWN' on 'pts/5'

            And I see UNKNOWN user is trying to access.

            I did a research about that on Google and I found a solution for that say have close SSH PasswordAuthentication. But I followed the steps to do that an I didn't find the file sshd_config that should be edit In etc/SSH/

            Can someone help me please.

            make sure you use /etc/ssh not /etc/SSH, the second doesn't exist.

            You'll want to change these two:

            PasswordAuthentication yes
            PubkeyAuthentication no
            

            to

            PasswordAuthentication no
            PubkeyAuthentication yes
            

            Make sure to add your key before you restart the sshd process.

            I 1 Reply Last reply Reply Quote 1
            • I
              inroute @stacksofplates
              last edited by

              @stacksofplates there is no ssh file or folder under /etc/

              stacksofplatesS 1 Reply Last reply Reply Quote 0
              • stacksofplatesS
                stacksofplates @inroute
                last edited by

                @inroute said in I'm under attack I need help in ssh:

                @stacksofplates there is no ssh file or folder under /etc/

                what's your output from ls /etc/

                1 Reply Last reply Reply Quote 0
                • stacksofplatesS
                  stacksofplates
                  last edited by

                  Also what PBX is this? Is it FreePBX?

                  1 Reply Last reply Reply Quote 0
                  • coliverC
                    coliver
                    last edited by coliver

                    Would be a good idea to setup fail 2 ban as well.

                    stacksofplatesS T 2 Replies Last reply Reply Quote 3
                    • T
                      tiagom
                      last edited by

                      From the original post looks like you are using dropbear ssh.. config should be /etc/config/dropbear

                      Looks like you need to set

                      option PasswordAuth 'off'
                      

                      https://wiki.openwrt.org/doc/uci/dropbear has more details as i couldn't (quickly) find official documentation.

                      stacksofplatesS 1 Reply Last reply Reply Quote 0
                      • stacksofplatesS
                        stacksofplates @coliver
                        last edited by

                        @coliver said in I'm under attack I need help in ssh:

                        Would be a good idea to setup fail 2 ban as well.

                        I hope at some point in the future they make the setup a little easier. It's fairly daunting for a new person. Pam_tally2 and faillock are fairly easy to set up, but rely on PAM. Would be nice to have a middle ground.

                        1 Reply Last reply Reply Quote 0
                        • stacksofplatesS
                          stacksofplates @tiagom
                          last edited by

                          @tiagom said in I'm under attack I need help in ssh:

                          From the original post looks like you are using dropbear ssh.. config should be /etc/config/dropbear

                          Looks like you need to set

                          option PasswordAuth 'off'
                          

                          https://wiki.openwrt.org/doc/uci/dropbear has more details as i couldn't (quickly) find official documentation.

                          Good catch, I didn't notice that.

                          1 Reply Last reply Reply Quote 0
                          • T
                            tiagom @coliver
                            last edited by

                            @coliver said in I'm under attack I need help in ssh:

                            Would be a good idea to setup fail 2 ban as well.

                            Agreed.

                            1 Reply Last reply Reply Quote 0
                            • I
                              inroute
                              last edited by

                              there is no config folder in the /etc/ directory but i found dropbear folder in the /etc/ directory and it contain tow files

                              dropbear _dss_host_key
                              dropbear _rsa_host_key

                              any idea

                              1 Reply Last reply Reply Quote 0
                              • T
                                tiagom
                                last edited by

                                What about under /etc/default/dropbear

                                What distro and pbx are you running so we can stop guessing.

                                I 2 Replies Last reply Reply Quote 0
                                • I
                                  inroute @tiagom
                                  last edited by

                                  @tiagom no there no under /etc/default/dropbear

                                  sorry Tiagom im new in Linux
                                  the pbx is Panasonic gsm gateway

                                  1 Reply Last reply Reply Quote 0
                                  • I
                                    inroute @tiagom
                                    last edited by

                                    @tiagom Linux version 3.0.76-4.i586 gcc version 4.4.1 ( GCC)

                                    1 Reply Last reply Reply Quote 0
                                    • T
                                      tiagom
                                      last edited by tiagom

                                      It looks like you need to set

                                       DROPBEAR_EXTRA_ARGS="-s"
                                      

                                      in the dropbear init file.

                                      https://github.com/mkj/dropbear/blob/master/debian/dropbear.init

                                      *It states Do not configure this file. Edit /etc/default/dropbear instead! in the latest version. Your version maybe older or modified by panasonic since /etc/default/dropbear doesnt exist..

                                      Arg found here

                                      http://linux.die.net/man/8/dropbear

                                      But honestly, if there is a firewall in front of this pbx box it maybe easier to do it there.

                                      I 2 Replies Last reply Reply Quote 0
                                      • I
                                        inroute @tiagom
                                        last edited by

                                        @tiagom so what do you think i must do to stop hackers and right now one hacker he made the gateway reboots like 100 time

                                        is there a way that i can block him

                                        scottalanmillerS 1 Reply Last reply Reply Quote 0
                                        • I
                                          inroute @tiagom
                                          last edited by

                                          @tiagom please see this link
                                          http://manpages.ubuntu.com/manpages/precise/man8/dropbearkey.8.html

                                          do you think it will help and honestly if you can guide me on how to do it .
                                          it will be nice from you

                                          1 Reply Last reply Reply Quote 0
                                          • T
                                            tiagom
                                            last edited by tiagom

                                            Its difficult to suggest without knowing the environment..

                                            The simplest is change passwords if its compromised.

                                            If its behind a firewall you can block traffic on port 22 unless its from your ip..

                                            I 1 Reply Last reply Reply Quote 2
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • First post
                                              Last post