Please create an account to participate in the Slashdot moderation system


Forgot your password?
Security IT

Ask Slashdot: FTP Server Honeypots? 298

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?"
This discussion has been archived. No new comments can be posted.

Ask Slashdot: FTP Server Honeypots?

Comments Filter:
  • by bugs2squash ( 1132591 ) on Thursday May 19, 2011 @05:24PM (#36184794)
    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.
    • by JustNiz ( 692889 ) on Thursday May 19, 2011 @05:35PM (#36184934)

      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!!

    • Re: (Score:3, Insightful)

      by maswan ( 106561 )

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

      • That's a fine idea for private systems. For private servers I use only ssh with certificates. Poof, hack attempts are gone.

        For a public facing FTP server the idea is to keep it easy. It should work with any FTP client out of the box with no configuration. In this case your only defense is to pick real username and long, quality passwords.

    • Comment removed based on user account deletion
    • by RichM ( 754883 )
      Not sure why you'd run SSH over the standard port...
      • Security through obscurity. That works well. NOT!
        • 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.

        • Re:ssh is the same (Score:5, Insightful)

          by icebraining ( 1313345 ) on Thursday May 19, 2011 @06:51PM (#36185796) Homepage

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

        • Re:ssh is the same (Score:5, Informative)

          by WuphonsReach ( 684551 ) on Thursday May 19, 2011 @10:09PM (#36187464)
          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.
    • I finally solved the issue of logs of failed logins with a way simpler metod... in the initial message I tell everybody the root password.

      Been years since I saw one of those pesky messages.

    • by blair1q ( 305137 )

      I have a cuckoo bird who listens for such traffic and dangles my keys on the modem connector when it happens.

    • Send the Phone Spiders!

    • About all you can do is briefly connect the Ethernet to a power outlet ...

      Or, you could geolocate their IP and nuke them from orbit. It's the only way to be sure.

  • by The MAZZTer ( 911996 ) <> on Thursday May 19, 2011 @05:25PM (#36184810) Homepage
    They could easily be zombies or proxies you're seeing, especially zombies since it sounds automated.
    • by bab72 ( 302207 )

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

    • I agree, looks like the dude is totally amateur and panicked over something he saw in the logs. Everyone has these automated scans. Rest easy, hackers are not targeting you specifically.
      • by jd ( 1658 )

        They are, however, bloody annoying and make spotting anything important that much harder.

        If you know legit connections will be in certain IP blocks, ban all others.

        If not but you've decent FTP software, have it block access from any IP that tries to access specific accounts (such as Administrator, samba, nagios or whatever ones that both don't exist and are being targeted on your box).

        If you prefer something more entertaining, use Linux' packet munging code. What you want to do is detect inbound connections

  • by gilgongo ( 57446 ) on Thursday May 19, 2011 @05:26PM (#36184820) Homepage Journal

    I've used Fail2ban in the past: []

    • by trainman ( 6872 )

      I second Fail2Ban, I've set my tripwire VERY tight for services. I also agree with the following post, SFTP, I'm phasing out FTP myself. About bloody time.

    • by mirix ( 1649853 )

      Yeah, there are a few script package deals, fail2ban, denyhosts(?), etc.

      Or you can just modify iptables / pf / whatever your firewall is directly. I've got a rule on pf to plonk any traffic on ssh if more than 3 connections are made in some amount of time.

      Of course, all of these aren't immune to massive distributed attacks, as a billion * three attempts is still 3 billion attempts.

  • by DWMorse ( 1816016 ) on Thursday May 19, 2011 @05:26PM (#36184834) Homepage

    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.

    • by Shakrai ( 717556 ) on Thursday May 19, 2011 @05:33PM (#36184918) Journal

      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.

      • Have you ever thought of just running ssh on a port other than 22? I haven't use 22 in many years. We get tons of garbage attacks on the webserver, but I haven't had a single attempt on my ssh server in years. Not one. I still check the logs, but now it takes seconds instead of an hour. One less thing to have to worry about.

        Putting ftp on a different port(s) is much more problematic, but changing sshd is trivial.

      • Even better.

        iptables -A INPUT -s -j DROP

    • by LWATCDR ( 28044 )

      Every once in a while some one will do something. After checking my logs I found one day I found some attacks coming from a university in the UK. Sent that section of the log to the admin of the school. I got a nice email back thanking me for email because it allowed him to find and fix the machine that was compromised.
      Another option would be to write a script that would detect any attempt at admin access that fails more than three times and block the IP for a week or so.

    • 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.

      That's a pretty good idea. I take it you use the ip blocks given in []

      The only slight snag is that the IP I'm on at work in the UK doesn't seem to be listed, so I'm not sure how reliable this list is, although I guess a false negative is better than a false positive.

    • Block by country dynamically: []

      It's a bit cobbled together, but it works for me.

  • 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...)

  • I always found that honeypots also attracted MORE attention to the network, rather than serving as a tool of defense.

    Essentially, even if you did get the police involved to the point where they could trace the hackers, chances are they are using some type of TOR technology, and the ones that aren't, the little bobby droptables of the world, probably aren't worth prosecuting.

    Save yourself the headache and forgo the unnecessary risk and stress of honeypotting.
  • I would recommended that you use SSH/SFTP except for FTP FTP is one of those old standards made before people realized that they could sniff networks, and pull login names and passwords.

    FTP and Telnet are one of those simple protocalls if you are woried about security, HTTPS, SSH and SFTP

    • by mortonda ( 5175 )

      This doesn't change the problem, brute force attempts come through on ssh too. All you solution does is transfer the question to a different port.

      That said, I prefer scp myself.

    • by antdude ( 79039 )

      Can SFTP do resume downloads and uploads yet?

  • seriously. read the HBGary emails dumped by anonymous. the guy was running crack programs against people he found on irc.

    and this was a federal government contractor with millions in income.

    its only the tip of the iceberg.

    James Bamford's book The Shadow Factory describes specifically how their new system, Turbulence, provides 'offensive' capabilities.

    (coincidentially, two of the documents that whistleblower Thomas Drake is under Espionage Act indictment for were related to Turbulence)

  • Personally I use the lfd daemon with the csf firewall script on my servers. fail2ban is similar.

    People should not get unlimited attempts to connect to your services.

    At the same time, you don't want to clog up your firewall rules with thousands of denied IPs, so I usually set the filter rather high so it will not impact real users (you would be surprised how many users need 10 or 15 attempts to guess their password if they forgot) but only people really performing a serious brute force password guessing atta

  • 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: 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.

  • by dclozier ( 1002772 ) on Thursday May 19, 2011 @05:41PM (#36185050)
    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. []

    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.
  • by BlueCoder ( 223005 ) on Thursday May 19, 2011 @05:43PM (#36185070)

    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.

  • Option 1 - set an access list on your border router and permit connections only from the networks of your users

    Option 2 - eliminate FTP externally, make everyone connect via VPN and run FTP internally.

    Option 3 - Option 1 plus SFTP rather than FTP.

    There are more options of course. There are ways to mitigate the number of attacks, but you have to research and implement them. Good luck!

  • Like you, I saw the same thing. That said, I also configured my system to respond as though it was a Windows 2000 server, when in reality it was a linux box, so it could try guessing "administrator" all it wants.... That said, I also wrote a script and cron job to parse all the access logs, keep counts of failed login attempts by IP address, subnet, and ISP block, and when they hit certain thresholds, update my firewall rules to reject all connections to that address, subnet, and ISP. I saw a lot of stuff
    • by Drathus ( 152223 )

      I did the same (except not making it present as a Windows box. =P)

      Just a simple perl script that parses for patterns I can specify and performs actions based on the thresholds I set in each recipe.

      I've got it so X failures in Y hours might lock you out for a time, but then re-allow. Z failures in Y hours will result in a permanent ban, etc.

      It's not as full featured as a full adaptive firewall, but it lets me watch what I want to watch. Both user logins as wells as specific 404s from apache, etc.

  • Let's see how stupid they are. Find a nasty virus variant, package it in a file called Kiddy_Porn.exe and drop it on your server. Set up an account with the login Administrator:Password and have that account point to just this file. Maybe put some others in a directory to give it some legitimacy.

    Monitor your logs and laugh your butt off when you see get /kiddy_porn.exe

  • 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.

    So, your week lasts for about 5 seconds?

  • SFTP. It's 2011. (Score:4, Insightful)

    by bedouin ( 248624 ) on Thursday May 19, 2011 @06:16PM (#36185404)

    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.

    • 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
  • I wrote a (T)FTP server that after 6 trys gives the user a 6 minute delay; after another 10 tries another delay (15 minutes) is applied, but after 20 to 30 (psedo- random) total failed attempts in one day, the user (irregardless of username) is given what seems like access to the system. They can list a limited set of small "files and directories", although none actually exist, and all simulated file contents are mundane, boring, and severely rate limited.

    Only one fake "guest" account is allowed at a t

  • I would bet that if it is coming from a single IP at a time, it is coming from a country where English is not the primary language. You can try to report it, but you'll likely get a reply in a language you cannot read and the correspondence will stop there.

    Alternately, if you are seeing distributed (botnet) attempts, there isn't much point in trying. You'll have dozens (if not more) of different addresses, and they are almost always all transient anyways. You could spend your time going through all t
    • by blair1q ( 305137 )

      I would be it's coming from China.

      I get fairly periodic hits to my firewalled router. They probe random ports a couple of times then disappear for 40 minutes, then do it again, pretty much 24/7/365.

      There's more than just .cn IPs in there, but the .cn ones have persisted for years.

  • Setup a fake login with a separate file structure. Fill it with Goatse and gay porn.

    Alternately (or in addition to) add some random viruses that you know they'll click on.

  • Fail2Ban seems to work well, and one of the mail servers I use does it, but i asked him to not use int on my server - I wanted the wrapper option instead of iptables, and my admin partner balked. He wanted to keep the bans in place for years, which is fairly pointless, except he has a secret admirer that comes back and hax on his system every 2 years or so. I'm not sure i can take him anywhere with me any more, he's pissed someone off who has more scripts than he does. Fortunately his secret admirer is n

    • BTW, you ARE using ftps or something secure, aren't you? Plain old FTP is so insecure you need to run it in jail, non-root, no write perms, and mark everything r/o.

      I have a team here that uses JScape, but there are other FTPS, S/FTP, and such tools out there. Gotta do it, my friend. FTP is nearly useless. I use SCP a lot, but I will tolerate the clients.

  • Filezilla can do automatic bans. I am sure your favourite FTP server can do that as well. 5 failed login attempts = auto ban for 3 hours. That solved all our problems in the office.

    For home, just running an FTP server on a different port got rid of these kind of attacks completely. Of course, blocking hinet and other chinese netblocks works as well. You have a lot of options here.

  • by glassware ( 195317 ) on Thursday May 19, 2011 @08:26PM (#36186696) Homepage Journal

    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.

    • 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 t
      • by Bogtha ( 906264 )

        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 real

  • fail2ban (Score:4, Informative)

    by gr8fulnded ( 254977 ) on Thursday May 19, 2011 @08:30PM (#36186724)

    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." []

  • by Kamphor ( 609888 ) on Thursday May 19, 2011 @09:27PM (#36187178)
    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' 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.

    # script to sense bad ssh or ftp login tries from the same ip address
    while [ 1 ];
    # block known linux service user accounts ssh attempts
    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`;
    if ! `grep -q $badip /etc/hosts.deny`; then
    echo "ALL: $badip" >> /etc/hosts.deny;
    echo "route add -host $badip gw" >> /etc/
    route add -host $badip gw;

    # null route any attempt at non-existant users for ssh attempts
    for badip in `awk '/sshd/ && /invalid user/ {print $13}' /var/log/auth.log | tail -100 | sort | uniq`;
    if ! `grep -q $badip /etc/hosts.deny`; then
    echo "ALL: $badip" >> /etc/hosts.deny;
    echo "route add -host $badip gw" >> /etc/
    route add -host $badip gw;
    # scan for behavior - probe ssh then try password
    # first loop- check for ssh probe
    for badip in `awk '/sshd/ && /not receive identification string/ {print $12}' /var/log/auth.log | tail -2`;
    if [ $previous == $badip ]; then
    i=`expr $i + 1`;
    # echo "in spoofed checker $badip $i"
    #echo "these are the bad ip addresses: $badip $previous $i";
    # 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`;
    if [ $previous == $badip2 ]; then
    i=`expr $i + 1`;
    # echo "in spoofed checker $badip2 $i"
    if [ $i -ge 3 ]; then
  • by dweller_below ( 136040 ) on Friday May 20, 2011 @12:28AM (#36188168)

    HoneyPots can be an important layer. But you need the other layers. We use the following layers to protect SSH ( )

    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 or 435-797-1804.


"The Avis WIZARD decides if you get to drive a car. Your head won't touch the pillow of a Sheraton unless their computer says it's okay." -- Arthur Miller