Slashdot Mirror


Ask Slashdot: FTP Server Honeypots?

An anonymous reader writes "I run an FTP server for a few dozen people, and it seems like every week I have a random IP address connect to my box and try guessing 'Administrator' passwords once every five seconds or so. This poses no real risk to me, since all my accounts have custom (uncommon) names. But if this is happening to me, I would wager lots of people are at risk of low level, persistent, long term password cracking attempts. Is there a way to report the perpetrators, or any action we can take to address this kind of danger?"

44 of 298 comments (clear)

  1. ssh is the same by bugs2squash · · Score: 4, Funny

    About all you can do is briefly connect the Ethernet to a power outlet and hope that the tubes carry the high voltage across the interweb and fry their equipment. Of course, timing is everything.

    --
    Nullius in verba
    1. Re:ssh is the same by JustNiz · · Score: 3, Funny

      Mod parent up Wow this works really well!
      Since briefly connecting my ethernet to the power socket I haven't had any hack attempts at all!! That must have showed them!!

    2. Re:ssh is the same by maswan · · Score: 2, Insightful

      Stop allowing password-based access. There is no way anyone is going to be able to guess a key by connecting and trying them.

    3. Re:ssh is the same by InlawBiker · · Score: 2

      It actually works very well. Almost every break-in attempt is from a script. Almost every script only tries the default port. You can easily eliminate a very large number of script attacks just by changing the port.

    4. Re:ssh is the same by icebraining · · Score: 4, Insightful

      Proper security measures and changing port is better than having only the former.

    5. Re:ssh is the same by Mr.+Freeman · · Score: 2

      At a decent company yeah, that's probably how it would go.

      At Dell the response would probably be "Have you tried rebooting the computer?"

      --
      -1 disagree is not a modifier for a reason. -1 troll, flaimbait, redundant, overrated are NOT acceptable substitutes.
    6. Re:ssh is the same by WuphonsReach · · Score: 4, Informative

      Security through obscurity. That works well. NOT!

      The point of "don't rely on security through obscurity" is that being obscure should not be your only layer of defense.

      Moving your SSH service off of the default port has a few benefits:

      - Most of the standard attack scripts no longer work against your server.

      - Your security logs are 99% less cluttered (if not 99.9%), making it easier to see the more determined and worrisome attackers.

      I never leave a public facing server's SSH port on the default, it's not hard to specify an alternate port in the SSH clients and it makes my life a lot simpler when I don't have to wade through a few thousand password attempts each day on the standard port. There are a few attackers out there who do port-scanning first to find the SSH port before trying dictionary attacks, but since we don't do password authentication they're still left out in the cold unless they get our private SSH keys.

      --
      Wolde you bothe eate your cake, and have your cake?
  2. Probably not worth the effort by The+MAZZTer · · Score: 3, Informative

    They could easily be zombies or proxies you're seeing, especially zombies since it sounds automated.

    1. Re:Probably not worth the effort by bab72 · · Score: 2

      What? First, I had to worry about zombies eating my flesh - Now, I have to worry about them hacking into my FTP server, too?!?

      --
      Bab72 (Not my real name)
    2. Re:Probably not worth the effort by SharpFang · · Score: 2

      On my WWW server all common IIS exploits are HTTP/1.1 301 Moved Permanently Location: http://www.microsoft.com/%5Bsame path]

      --
      45 5F E1 04 22 CA 29 C4 93 3F 95 05 2B 79 2A B2
  3. Fail2ban? by gilgongo · · Score: 2

    I've used Fail2ban in the past:

    http://www.fail2ban.org/wiki/index.php/Main_Page

    --
    "And the meaning of words; when they cease to function; when will it start worrying you?"
    1. Re:Fail2ban? by WuphonsReach · · Score: 2

      denyhosts is your best bet, IMHO. After a few failed attempts, it blocks the IP and kills automated attacks.

      Except that for the more serious attackers, who have botnets at their disposal, it doesn't do much. In a attack by a botnet, each IP address only hits your server a handful of times and they're synchronized so that each bot tries a different username/password combination. But since there are a few thousand or tens of thousands of machines in the botnet, it adds up to a few tens of thousands of attack attempts.

      denyhosts and fail2ban are fine against the script kiddies operating from a single source IP, but not so good against the larger adversaries.

      --
      Wolde you bothe eate your cake, and have your cake?
  4. Well, not really... by DWMorse · · Score: 4, Insightful

    Proactively? Not really. The systems used for this are typically overseas, in countries that more or less don't care.

    However, you -can- configure your server to disregard even initial connection attempts from specific ranges of IP addresses. I solved a lot of this on my own home FTP server by (sorry comrads) telling my server to ignore connection attempts from Russia and China.

    Upon doing so, it went from a daily occurrence, to maybe one attempt a month. Usually less.

    And, if a friend ever needs to FTP in from one of these countries, it's a simple enough rule change.

    --
    There's a spot in User Info for World of Warcraft account names? Really?
  5. DISA or FBI by HyTeK3000 · · Score: 2

    I had a few meetings with local FBI cyber people, and they recommended for me to send things like that to either DISA or to them (the local field office for my area) Contact your local FBI field office and see what they say. If you can talk to their cyber division they are usually helpful. (usually...)

  6. rate limit incoming connections based on IP by Shakrai · · Score: 5, Informative

    Easier than banning every overseas IP, IMHO anyway. This is what I do for SSH:

    # Allow SSH with a rate limit
    iptables -A INPUT -i ppp0 -p tcp --syn --dport 22 -m hashlimit --hashlimit 15/hour --hashlimit-burst 3 --hashlimit-htable-expire 600000 --hashlimit-mode srcip --hashlimit-name ssh -j ACCEPT
    iptables -A INPUT -i ppp0 -p tcp --syn --dport 22 -j LOG --log-prefix "[DROPPED SSH]: "
    iptables -A INPUT -i ppp0 -p tcp --syn --dport 22 -j DROP

    There may be a more eloquent way to do this but it gets the job done.

    --
    I want peace on earth and goodwill toward man.
    We are the United States Government! We don't do that sort of thing.
  7. ftp sends passwords in cleartext; sftp+denyhosts by bcrowell · · Score: 2

    You say this poses no real risk to you, because your passwords are immune to dictionary attacks. But ftp sends passwords in cleartext, so it actually does pose a risk to you if someone is able to sniff your packets on the public internet.

    But anyway, if you feel that the risk to you is insignificant, then why are you asking the question? Are you asking it on behalf of other people who might want to security-harden their ftp servers? If those people are worried, why wouldn't they have already switched from ftp to sftp? And if they're running sftp, they can protect against attacks of the type you're describing by installing denyhosts:http://denyhosts.sourceforge.net/ Denyhosts does have a cooperative blacklisting facility of the type you were asking about.

    I could be wrong, but since ftp is inherently insecure, I would be surprised if someone had created software with the same functionality as denyhosts that would work with ftp. That would be like retrofitting a tricycle to make it supersonic.

  8. Change Ports! by dclozier · · Score: 2

    Most automated scans will not take the time to scan for open ports. (that I have experienced)

    Also consider FTP with SSL / TLS like what can be done with vsftpd. http://vsftpd.beasts.org/

    As mentioned elsewhere in this thread consider using Fail2ban which is easily configured for monitoring failed attempts at connecting to your server and can then block the IP after a configurable threshold is reached.

  9. Re:No by 0100010001010011 · · Score: 4, Informative

    Denyhosts also. I just set this up after finding over 40,000 failed ssh attempts in the last 3 days.

  10. Worst thing is the bandwidth drain by BlueCoder · · Score: 3, Interesting

    If your security is even modest as far as passwords there is no need to worry. More sophisticated attacks using coordinated bot nets are the really scary thing but can be countered by limiting the number of login attempts a second/minute. But it's all just extended dictionary attacks. Only someone really dedicated does brute force. This is the equivalent of someone going through a parking lot and checking to see if anyone left their door unlocked and or keys inside their car. If you can just change the port used for ftp, it cuts it down by 99 percent.

    The problem is the bandwidth. You have to pay for it anyway. Even if your server doesn't acknowledge it. Someone really dedicated using a bot net can easily give you overage charges.

  11. Comment removed by account_deleted · · Score: 2

    Comment removed based on user account deletion

  12. Re:No by mlts · · Score: 2

    That sums it up right there. Why? Lots of reasons:

    1: A honeypot might get someone in legal hot water if someone then launches criminal activity from it. For example, if someone's honeypot was used for torrents or CP, it will be tough explaining to cops (or the RIAA's pet judge) that the owner knowingly allowed such activity to happen and hoping not to get found culpable/convicted.

    2: FTP for anonymous downloads is one thing (assuming a hardened FTP server.) Anonymous uploads can be done too, provided you clean the incoming directory. FTP for users with passwords sent plaintext is just bad form. Use sftp, or scp for this.

    3: Before '97, you could call an ISP or other domain and deal with someone who would be ready/willing/able to stop someone hacking from a site. These days, nobody cares, especially offshore domains. IP address banning is noble, but just not running the service unless needed is the best bet.

    4: Even with IP banning, it won't do much. Blackhats have a crapload of bots on wide IP ranges. Better to just figure out what ranges to allow and deny everyone else.

    5: Passwords should never be used anyway. Use S/Key or OPIE if one can't authenticate using two factor stuff. Best of all, use public key authentication over ssh. This way, there is no way a brute force attack could succeed, if the SSHGuard program or other anti-guessing daemon doesn't work.

  13. Re:ftp sends passwords in cleartext; sftp+denyhost by alostpacket · · Score: 5, Funny

    That would be like retrofitting a tricycle to make it supersonic.

    So you're saying it would be totally awesome?

    --
    PocketPermissions Android Permission Guide
  14. Re:Yep, by zebs · · Score: 3, Interesting

    Hmmm, on the systems I help look after we occasionally see large number of RDP sessions with invalid logons. On some rare occasions we've been able to RDP to the source IP (get to the logon screen). Gives me the impression that its a bot.

  15. SFTP. It's 2011. by bedouin · · Score: 3, Insightful

    Unless you're running an anonymous FTP to download Linux ISOs or something there's no need for it.

    Cyberduck for OS X, FileZilla for Windows, and gFTP all do SFTP and are free. If you're already using SFTP then only allow specific users and disable root access. Key authentication is ideal like others have mentioned but sometimes a hassle.

    The first (and hopefully last time) I was rooted was in '99 on a Redhat box through FTP using a buffer overflow. Since then I learned my lesson.

  16. Re:FBI? by webmistressrachel · · Score: 2

    Surely trying every doorknob on a terraced street qualifies as intent to tresspass and steal??

    --
    This tagline was transcoded to result in at least one smirk. If you experience failure to smirk, please consult your Gen
  17. Re:No by QuasiEvil · · Score: 2

    Denyhosts is the bomb. Seriously, I get weeks where I used to get hammered with ssh login dictionary attacks. Now, denyhosts nicely bans them, and best of all, it can share back with a central server so once somebody starts attacking a couple people, we all ban their asses. It's one of the first things I install on any new server. Seriously, I think I'm going to go send the DH guys another donation because they're so damned awesome.

    DH is ssh-centric, though. For your FTP problem, fail2ban is better.

  18. The longer answer. by Tatarize · · Score: 4, Insightful

    The longer answer is do anything you want. I highly recommend spending a lot of time to configure an "administrator" login. Then have it take one to a fake directory with nothing important. Wait until that IP drops off the inevitable giant pile of files to be shared with other people, and then when all the stuff is uploaded. Disable it and keep the files. It seems like pretending to be there for a short while could get you many gigabytes of something. It would be like peer to peer in reverse.

    --

    It is no longer uncommon to be uncommon.
    1. Re:The longer answer. by diodeus · · Score: 5, Funny

      Years ago we found our FTP server was full. It was hacked and contained all kinds of movies and xbox games. We just happened to like movies and xbox games, so we gave it a bit more space.

  19. Re:No by Sancho · · Score: 3, Interesting

    We use honeypots purely for denyhosts purposes. These are machines which are not in DNS and should never have machines connect to it. If a machine connects, we assume that it's malicious and add it to a blocklist which is shared amongst the rest of our machines. No one ever gets in to the honeypot. One could wait for a failed login attempt to occur (it would be a little more generous to scanners who aren't trying to break in)--it's just a tradeoff. We're much harsher.

  20. RMS's root password by billstewart · · Score: 2

    It was "carriage return".

    --

    Bill Stewart
    New Fast-Compression-only CPR http://preview.tinyurl.com/dy575ks
    1. Re:RMS's root password by Darinbob · · Score: 3, Funny

      He also had a README file whose contents were
      "cat: README: No such file or directory".

  21. Reporting the perps by Zomalaja · · Score: 2

    I have had good results when the attacking IP is from a provider such as Comcast, AT&T, Amazon Cloud, etc.
    When it's from "China Unicom Hebei Province Network", like the IP's that hit my router all day long every day scanning port 27977, no reason to even send an abuse message.

    No offense meant to anyone from that part of the world.

  22. Reply from the submitter by glassware · · Score: 3, Insightful

    I'm the guy who posted (accidentally sent it in via anonymous).

    1) I like the idea of programs like DenyHosts and Fail2Ban; as some people mentioned FileZilla also has a nifty "auto-ban" option which I've used too. I specifically like using a shared list of bad hosts; that was really what I was asking for, so thank you all! Totally answered my question.

    2) Switching from FTP is indeed an option. I originally started by using FTPS, which is nicely supported by FileZilla but not by many other programs. The trouble was that a many users had routing difficulties and were unable to reach the FTPS server from their location. The worst part was that many routing difficulties were transient: when they were at the office it would fail, when they were at starbucks it would work, when they were at a hotel it would fail, etc.

    3) I would wager that SFTP is pretty much the right solution. I figure I'll get started on looking for an SFTP replacement for FileZilla server.

    1. Re:Reply from the submitter by WuphonsReach · · Score: 2

      If the users need to authenticate - switch to SCP over SSH. Switching to SFTP sounds nice in theory, until some tech comes along and screws up the FTP server config and people are able to start logging in again over regular FTP.

      If the content is designed to be public readable, setup a download only FTP site that requires no authentication, and do the uploads via SCP.

      If you need to allow uploads, setup a folder that allows anonymous uploads, but don't let FTP users download from that folder. Retrieve the files from the server using SCP, or have an automated system scan them for malware (and delete anything that starts with the EXE signature) and then transfer them over SSH to an internal server.

      (Never allow anonymously uploaded files to be downloaded by anonymous users. The warez folks will come camp on your server as a way to trade files. Which is why you set /uploads as upload-only and require the use of a different access method to retrieve the files.)

      --
      Wolde you bothe eate your cake, and have your cake?
    2. Re:Reply from the submitter by BradleyUffner · · Score: 2

      What ever became of port knocking? Where to gain access to a specific port you had to hit several other ports in a specific order to gain access. When I read about it, it seemed like a wonderful idea, but I haven't heard anything about it for years. It seems that something like that could help.

    3. Re:Reply from the submitter by Bogtha · · Score: 2

      If the users need to authenticate - switch to SCP over SSH. Switching to SFTP sounds nice in theory, until some tech comes along and screws up the FTP server config and people are able to start logging in again over regular FTP.

      That doesn't make sense. SFTP is not a normal FTP server exposed over an SSH or SSL tunnel. There's no "FTP server config" you can screw up and magically transform an SFTP server into an FTP server. Even if there were, server configs don't change on their own, it doesn't really make sense to say "don't switch to something secure because that means if you disable security you won't have that security".

      In fact, if your criticism held weight at all, your recommendation would be going in the opposite direction - SCP is just RCP over SSH.

      --
      Bogtha Bogtha Bogtha
  23. fail2ban by gr8fulnded · · Score: 3, Informative

    How about fail2ban? We use it to block multiple SSH attempts. It blacklists IP's for a user-defined amount of time and then unblocks them again. Works like a charm, every time. Hell, it's even locked me out on more than one time (because I didn't update the whitelist file for my workstation's IP).

    "Fail2ban scans log files like /var/log/pwdfail or /var/log/apache/error_log and bans IP that makes too many password failures. It updates firewall rules to reject the IP address."

    http://www.fail2ban.org/wiki/index.php/Main_Page

  24. Re:No by GameboyRMH · · Score: 2

    Who needs to synchronize ban lists? Have it ban a host for a week or so after 10 failed attempts (for both existing and nonexistent accounts, so they can't brute-force usernames). No meaningful number of brute-force attempts will get through to any box that way.

    --
    "When information is power, privacy is freedom" - Jah-Wren Ryel
  25. shell script to auto null route brute force attack by Kamphor · · Score: 3, Interesting

    Guess it's time to give back to the community....a few years ago, I wrote a custom script to continually tail out lines at a time from /var/log/auth.log and null route the bad ip's....to date, I have 4316 ip's null routed. I have the following script running as a background job initiated from /etc/rc.local hope this is helpful to people.

    ----begin----
    #!/bin/bash
    # script to sense bad ssh or ftp login tries from the same ip address
    while [ 1 ];
    do
    # block known linux service user accounts ssh attempts
    previous=0;
    i=0;
    for badip in `awk '/sshd/ && /Failed password for /' /var/log/auth.log | egrep -i "root|bin|daemon|adm|lp|sync|shutdown|halt|mail|news|uucp|operator|games|rpm|vcsa|rpc|xfs|apache|rpcuser|sshd|ftp|kamphor|named|messagebus|haldaemon|ntp|openvpn|x11|polkituser|avahi|avahi-autoipd|htdig|pulse" | awk '{print $11}'| tail -100 | sort | uniq`;
    do
    if ! `grep -q $badip /etc/hosts.deny`; then
    echo "ALL: $badip" >> /etc/hosts.deny;
    echo "route add -host $badip gw 127.0.0.1" >> /etc/routeblock.sh
    route add -host $badip gw 127.0.0.1;
    fi
    done

    # null route any attempt at non-existant users for ssh attempts
    previous=0;
    i=0;
    for badip in `awk '/sshd/ && /invalid user/ {print $13}' /var/log/auth.log | tail -100 | sort | uniq`;
    do
    if ! `grep -q $badip /etc/hosts.deny`; then
    echo "ALL: $badip" >> /etc/hosts.deny;
    echo "route add -host $badip gw 127.0.0.1" >> /etc/routeblock.sh
    route add -host $badip gw 127.0.0.1;
    fi
    done
    # scan for behavior - probe ssh then try password
    previous=0;
    i=0;
    # first loop- check for ssh probe
    for badip in `awk '/sshd/ && /not receive identification string/ {print $12}' /var/log/auth.log | tail -2`;
    do
    if [ $previous == $badip ]; then
    i=`expr $i + 1`;
    # echo "in spoofed checker $badip $i"
    else
    i=0;
    fi
    #echo "these are the bad ip addresses: $badip $previous $i";
    previous=$badip;
    done
    # end first for loop
    #start second loop - check for failed logins
    for badip2 in `grep $badip /var/log/auth.log | awk '/sshd/ && /Failed/ {print $11}' | tail -2`;
    do
    if [ $previous == $badip2 ]; then
    i=`expr $i + 1`;
    # echo "in spoofed checker $badip2 $i"
    else
    i=0;
    fi
    if [ $i -ge 3 ]; then

  26. Re:No by orangesquid · · Score: 2

    This is the sort of thing I've considered doing, but I've worried about locking myself out, if I'm trying to connect remotely and having a particularly bad case of clumsy typing.
    A similar example to my worry follows.... it's a very interesting idea, but I wonder what procedures you have in place to prevent the following??

    ---

    Sancho:> Hey, orangesquid, can you check out something on sancho3 for me, in /var/log?
    orangesquid:> sure, let me open a shell

    os@orangesquid.net:~$ ssh sancho3.sancho.com
    Resolver timed out
    os@orangesquid.net:~$ grep sancho3 ~/sancho-hosts
    11.22.33.49 sancho3
    os@orangesquid.net:~$ ssh 11.22.33.46
    ^C "Dammit, clumsy hands"
    os@orangesquid.net:~$ ssh 11.22.33.49
    Connection timed out
    os@orangesquid.net:~$ ping 11.22.33.49 -c3
    Ping 11.22.33.49 (64 bytes) from 99.88.77.66
    ---
    4 packets transmitted, 0 packets received
    "Stupid auto-block..."

    os@orangesquid.net:~$ mail sancho2000@gmail.com
    Hey, can you unblock me? Typo!
    .
    os@orangesquid.net:~$
    MAIL FROM: postmaster@sancho.com
    You attempted to send mail to "sancho2000@gmail.com" from 99.88.77.66. This IP address has been banned. Sorry.

    --
    --TheOrangeSquid Is it any wonder things seem so awry? We swim in a sea of confusion and don't have to think to survive
  27. Re:fail2ban by Nimey · · Score: 2

    It's a pretty simple concept - a basic heuristic for dodgy-looking connection attempts, and then blocking the originating IP at the firewall. Once it's reasonably bug-free it won't need maintenance until Linus decides to switch to a different firewall again.

    --
    Hail Eris, full of mischief...

    E pluribus sanguinem
  28. SSH HoneyPots have many benefits. by dweller_below · · Score: 2

    HoneyPots can be an important layer. But you need the other layers. We use the following layers to protect SSH (https://it.wiki.usu.edu/ssh_description )

    1.) The firewall limits the vulnerable scope of SSH to a few trusted hosts.
    2.) The firewall can also be used to prevent credential guessing by rate-limiting connections to the SSH port.
    3.) The SSH Port is treated as a shared secret. Only interesting, targeted attacks find the SSH server.
    4.) The SSH server should not allow known usernames including root. The attacker must find a username.
    5.) The admin is trained to create good passwords for his usernames.
    6.) SSH users are taught to verify the identity of their systems when they first connect.
    7.) System admins must regularly review the activity of their SSH servers.
    8) Security monitors all SSH connections, including ones on non-standard ports. We follow up on connections that seem interesting.
    9.) USU has SSH HoneyPots that help us respond to SSH attack.

    SSH HoneyPots give us several benefits:

    1) They make it easy to automate blocking SSH attackers, with virtually no chance of false positives. Some patterns of attack are designed to bypass Fail2ban, but the HoneyPots have to problem handling them.

    2) We notify remote ISPs (and remote managers) that they have attacking systems. This is surprisingly effective. When we started (6 years ago) less than 1 notify in 8 seemed to have any effect. Now about 1/2 of the notifications seem to be have an effect. And remember, virtually every one of those attacking computers belongs to an innocent victim. Notification helps them, and it improves the overall security of the internet. We have also confirmed that notifications drive away some attackers.

    3) We collect and analyze guessed credentials.
    - If they meet our complexity requirements, they are added to our central black-list.
    - Patterns of credentials reveal patterns of attack and patterns of attackers. It's a Heisenberg thing. An attacker both changes the target, and reveals information about himself. Password guessing reveals a lot of information. Virtually every attack has been a unique combination of credentials. You can do cluster analysis against the combinations. You can find relationships between attacks and IPs. You can track how these relationships change over time. You can correlate this information with your other intelligence. The FBI came to us and asked about some attacking IPs. Almost all of them had hit our SSH HoneyPots. We were able to pass all this intelligence back to them.

    Our SSH Honeypots (and several other SSH servers) now have the following banner:

    ---
    USU tracks internet abuse. We have SSH honeypots that automate
    the process of detection, notification, and blocking. These
    honeypots also collect credentials and analyze them.

    If this system is a honeypot, your access will be reported as abuse.
    Your credentials will be logged. Your IP address will be blocked.

    If you believe that your access has been misidentified as abuse,
    please contact USU IT Security at security@usu.edu or 435-797-1804.
    ---

    Miles

  29. Here's the irony by dbIII · · Score: 2

    People who worry about computer security are forbidding the clients of my company from installing software on their MS Windows computers. That means they cannot install the software to do SFTP on their computers - so in the name of security they are using plain old vanilla FTP! For as long as this stupid situation persists I'll be using FTP. The alternatives the clients can actually use are stupid web based FTP done badly ideas like those idiots that set up a system where a password change wouldn't keep people out.
    I think I'll be hosting it until we either get some SFTP client that becomes as ubiquitous as winzip or until Microsoft bundle one in.
    There's a lot of clunky web based FTP front ends out there but nothing I've seen that does things well with uploads doing https all the way and leaving FTP out of it completely.

  30. Re:SFTP. It's 2011. by bigrockpeltr · · Score: 2

    Sorry but as far as i remember Filezilla server does not do SFTP only FTPS(implicit and explicit) as secure connections.
    http://en.wikipedia.org/wiki/File_Transfer_Protocol#Secure_FTP

    Although the end result is the same the process is different. Its like watering your garden with a supermodel, you can fill a watering can or use your hose but the end result is the same... your pants will be wet.

    --
    $ unzip, strip, touch, finger, grep, mount, fsck, more, yes,fsck,fsck,fsck,umount, sleep