23

Nov

Crazy php code injections

Posted by jerry as Hacking, Security

 As I’ve written about here several times, the onslaught of unsuccessful php include attacks continues.  Today, I saw a new file referenced - bot.txt.  It looked like this in the apache log file:

Read the rest of this entry »

20

Nov

Current crop of php include attempts

Posted by jerry as Hacking, Security

I’m not sure why I’m so fascinated by this crude and ineffective hacking attempt, but I am.  Here are the currently active hosts:

http://www.mta.cl/galeria2/galery2.jpg??
http://www.mta.cl/galeria2/galery.txt?
http://www.freewebtown.com/w8ting/safe.txt??
http://tools.aerofito.com/safeon.txt??
http://64.203.191.222/.check/c.txt?
http://www.ohanlonpaving.com/phpmic.txt.txt?
http://rotation.wooshck.org/image/safe.txt?
http://83.19.144.26/bo.do??
http://www.old2sold.net/newpitbulonspread.txt?
http://coolpc.com.tw/evaluate/safe?
http://www.ena-gmbh.de/download/cikos.txt?
http://www.dip-kostroma.ru/bak_skompa/themes/runcms/menu/images/.asc/www?????????????????????????????
http://www.freewebtown.com/komandan/tool/q3.txt?
http://www.manycontentz.com//ine/img/contr.txt??
http://ninaru.hut2.ru/images/cs.txt?
http://amygirl.land.ru/baby?
http://electro.lydo.org/rfi/id.txt?
http://freewebs.com/chika_manis_banget/cmd.txt???
http://www.martinschaab.de/php/id.txt?
http://www.realtyna.com/about.gif??
http://zamkad.ru/pub/buffer_upload/…/cmd.txt?
http://www.realtyna.com/safe.txt??
http://www.cluelesstravel.com/guestheath/id.txt??
http://bondick.net/flashchat/nick_image/htaccess?
http://kiopmanminsuion.chat.ru/http?
http://phila.wonbuddhism.info/bbs//skin/zero_vote/images/btn_black.gif?
http://193.109.188.20/0/templates/rhuk_solarflare_ii/css/contr.txt??
http://www.martinschaab.de/php/phpSecurePages//phpSecurePages/u.txt?

19

Nov

PHP include attacks rolling on…

Posted by jerry as Hacking, Security

I’ve written about this a bit, and I’ve started a current attack list on networkstike.com, but the intensity seems to be increasing in these attempts.  I decide to google one of the URL’s that’s included, and right off the bat, I found this article from a web site that’s seeing the same thing.  I believe these attacks are being launched from a botnet, trolling for vulnerable sites to use for some kind of illicit business.

What was really interesting to me in my google search for some of the inclusion URLs is the number of log files that are available and indexed via google.  For a long time, I have gotten many hits with the referral set to a spammy site - an obvious attempt to get some clicks and link mojo with Google.   I never really thought a lot about it, but I can see that it’s probably a fairly effective thing, given the number of log files I found via google.

The current list of php inclusion hits for my sites is below:

http://www.s1ko.jazztel.es/safe.gif?
http://gw-gold.net/dragoc/id.txt?
http://musicgirll.chat.ru/wav/mysong?
http://www.mta.cl/galeria2/galery.txt?
http://www.mta.cl/galeria2/galery.jpg?
http://www.madinaedu.gov.sa/safeon.txt??
http://www.modelismo.alternativo.nom.br//poll/polldata/readme.txt??
http://shellbr.com.sapo.pt/safeon.txt??
http://zamkad.ru/pub/buffer_upload/…/cmd.txt?
http://www.volontaridelrotary2040.com/html/modules/xt_conteudo/NewFile.txt?
http://telkomsex.com/ec.txt?
http://193.109.188.20/0/templates/rhuk_solarflare_ii/css/contr.txt??
http://www.dip-kostroma.ru/bak_skompa/themes/runcms/menu/images/.asc/www?????????????????????????????
http://neu.sv-badbentheim.de/hide.txt?
http://www.smartlabphd.com/book/list/skin/zero_vote/images/setup_pages2.gif???
http://www.smartlabphd.com/book/list/skin/zero_vote/images/setup_pages.gif???
http://www.urjb.com/photos/albums/userpics/10001/thumb_blank.gif??
http://www.hgbruce.com/components/com_rsgallery/safeon.txt??
http://tr-igus.com/safe.txt?
http://www.valerieataylor.com/gb/book2.gif??
http://servergazi.com/portal/images/stories/web.gif??
http://hackbsd.net/.xrt/safe.gif?
http://www.freewebtown.com/w8ting/safe.txt??
http://rumusic.chat.ru/rumusic.wav?
http://ninaru.hut2.ru/images/cs.txt?
http://amygirl.land.ru/baby?
http://www.martinschaab.de/php/id.txt?
http://x0.741.com/pb.txt?
http://location-investment.com/Connections/r8.txt?
http://jjisdfiuw834wsdd.chat.ru/js?

I’ve started downloading the files and looking at them.  Many of them are loosly copied off of one another, some are exactly the same.  Some are quite complex, all-in-one shells, that would allow complete server control.  Most of them appear to give some basic information, like directory, available disk space, effetive UID and GID, and the like.

09

Nov

Web Site Security Guide

Posted by jerry as Security, Uncategorized

So, in the aftermath of my little incident, I decided to write an article for NetworkStrike on how to keep your website secure.  I’ve included it below: 

Background


The “cost of entry” to run a website is very low now, and we have seen an explosion of small sites on the Internet. Supporting this trend has been the availability of free and open source applications that allow site owners to do nearly anything they want, from blogs to wikis to forums. 

Unfortunately, nearly all of the software has inherent bugs that can be exploited by bad people. The exploitation of such bugs has matured in a similar fashion to the applications themselves.  Compromised web sites are a foundation to many threats currently on the Internet. Site owners are unknowingly supporting illegal activities such as:

  • Hosting warez
  • Hosting copyrighted files
  • Hosting tools to compromise other sites
  • Sending massive amounts of spam
  • Host phishing sites to steal money
  • Become part of command and control for botnets

Running a web site properly is truly becoming a social responsibility. If you are not part of the solution, you are likely part of the problem. 

This guide outlines some general and basic security measures that you MUST take if you want to make sure your site is not defaced or otherwise compromised.

Key elements needed in a web hosting platform


 Use a host that uses suphp

Try as you might, if another site on the server you share does not follow prudent security measures, then your site it still vulnerable. Suphp executes php scripts as the user-id and group-id of the account – not the userid/group id of the web server.

This will allow more restrictive permissions on your directories and will prevent an attacked from being able to read your php files.

Some hosts will not want to use suphp, as it can cause performance problems.

Build a relationship with provider on dealing with security issues

Firewall outbound connections

 This is not always practical or possible, but firewalling traffic originating from the server – other than what is expected – can prevent backdoor tools from phoning home.

Run suhosin patch for php

Suhosin can stop the exploitation of many different types of coding weaknesses and some vulnerabilities in php itself.

Keeping up with the web software you use


  • Subscribe to mailing list for any application software used as part of your site.  Nearly all such applications have an “announcement” list that is low traffic.
  • Attempt to participate regularly in the forums or discussion lists for the software you use. You will often get advanced warning of security issues and interim fixes.  You will also know if the software is at risk of being abandoned and not updated.
  • Upgrade after a security fix release within 3 days.  Vulnerabilities are often exploited soon after they are discovered.
  • If an application you use becomes abandon, plan to migrate your site to a new tool as fast as possible.
  • Try not to customize software.  This will slow down your ability to patch or upgrade, because you’ll have to rewrite code, test, etc, and that can be difficult to do when it’s not on your timeline.
  • Attempt to remove ‘powered by’ and version number references.  Nearly all open source web applications proudly, but this has turned out to be an extrodinarily efficient way to systematically identify sites running vulnerable software. 
  • Create a file with a random name in your html directory. Do not reference the file in your site. Grep your web logs daily for the file being accessed. Any hits may indicate that your site has been compromised.
  • Scan for file differences and notify of differences

Your responsibilities as a site owner


  • Perform frequent off-site backups.  Even if you have a local backup strategy, such as to another server, it is imperative to maintain an offsite backup.  While it doesn’t happen often, datacenters are broken into and servers are phyically stolen.
  • Do not store sensitive data like credit card numbers.  Just don’t do it.
  • Change account passwords regularly