Joomla gehackt?!

Hi,
you think you have been hacked? We will try to give you some help on how to proceed further.

Please note that this thread is locked, it can be discussed here.

 

At first we have to gather some information:

 

  • What version of Joomla do you have?

 

Joomla 1.0.3 Stable (14 okt 2005)

 

Upgrade to Joomla 1.0.11 Stable

 

  • What version of PHP/MySQL/Apache do you have?

 

PHP 4.4.4-pl4-gentoo
MySQL 4.1.21

 

you should consider updating to at least PHP 4.4.x and MySQL 4.1.13, since these versions are the minimum requirement for native UTF-8 support.

 

  • What kind of hosting do you have?

 

Nedlinux 25 Mb package http://www.nedlinux.com

 

shared hosting environment. Sometimes your account can get hacked by accounts for other sites on that server. This is a configuration error by your provider and can be prevented, but not all providers are so thorough. If you find out, that your account has been hacked via another users account, contact your provider and demand him to correct his configuration to prevent this in the future.

 

  • Do you have access to the access logs of the server?

 

No

 

  • Which third party extensions do you have installed? (Components, modules, plugins/mambots)

 

Akobook
zOOm
Simpleboard
MOS chat

 

  • Which informations do you have from your provider? Did they send you something in addition?

 

Mail about image_upload.php script of simpleboard beimg used

 

  • Do you have a backup?

 

Yes, 29 september

 

  • Have you checked the folder permissions?

 

Yes

 

  • Have you really been hacked?

 

I think so!!

 

 

 

 

 

-----------------------------------------------------------------------------------------------------------

 

  1. Secure your software against direct access
  2. Secure your software against remote file inclusion
  3. Secure your software against SQL injections
  4. Secure your software against XSS scripting
  5. Make sure your software does not need register_globals
  6. Check access privileges of users
  7. How to achieve raw component output (for pictures, RSS-feeds etc.)
  8. Various things to be aware of

 

 

 

 

 

Acties/Plan:

 

 

 

Uitzoeken hoe ik de rechten van de componenten directory kan beheren / wijzigen

 

- Via Global Configuration >> Server >> File/Directory creation>> CHMOD new files/directories.

 

mappen 755
bestanden 644

 

map includes moet chmod 755 hebben

 

 

 

-         Via FTP Files backup terugzetten.

 

-         Via tool….???

 

-         Via ISProvider Nedlinux

 

 

 

Kijken of ik delen van TP51 forum kan overzetten naar www

 

 

 

Joomla 1.0.11 upgrade downloaden en installeren op www.johfrael.nl

 

Laatste versie simpleboard downloaden (omzetten naar Joomlaboard?)

 

 

 

 

 

 

 

Uitzoeken virusmelding/hackallert van Kasperski op backupfile

 

(>> backupfile terugzetten uitpakken en scannen?)

 

HackTool.Linux.ProcHider.a

 

Trojan-Hacktool.Linux.Prochider.A

 

 

 

Type    Malware

 

Type Description       Malware ("malicious software") consists of software with clearly malicious, hostile, or harmful functionality or behavior and that is used to compromise and endanger individual PCs as well as entire networks.

 

Category         Trojan

 

Category Description            Trojan is a general term for malicious software that is installed under false or deceptive pretenses or is installed without the user's full knowledge and consent. Most Trojans exhibit some form of malicious, hostile, or harmful functionality or behavior.

 

Level   High

 

Level Description      High risk threats are typically installed without user interaction through security exploits, and can severely compromise system security. Such threats may open illicit network connections, use polymorphic tactics to self-mutate, disable security software, modify system files, and install additional malware. These threats may also collect and transmit personally identifiable information (PII) without your consent and severely degrade the performance and stability of your computer.

 

Advice Type   Remove

 

File Traces

 

 

 

 

 

Acties/Plan:

 

 

 

Uitzoeken hoe ik de rechten van de componenten directory kan beheren / wijzigen

 

- Via Global Configuration >> Server >> File/Directory creation>> CHMOD new files/directories.

 

mappen 755
bestanden 644

 

map includes moet chmod 755 hebben

 

 

 

-         Via FTP Files backup terugzetten.

 

-         Via tool….???

 

-         Via ISProvider Nedlinux

 

 

 

Kijken of ik delen van TP51 forum kan overzetten naar www

 

 

 

Joomla 1.0.11 upgrade downloaden en installeren op www.johfrael.nl

 

Laatste versie simpleboard downloaden (omzetten naar Joomlaboard?)

 

 

 

 

 

 

 

Uitzoeken virusmelding/hackallert van Kasperski op backupfile

 

(>> backupfile terugzetten uitpakken en scannen?)

 

HackTool.Linux.ProcHider.a

 

Wat zijn de twee belangrijkste problemen:
1. Session save path <path>, Unwritable.
2. Alle Joomla! subdirectories: Unwritable.

Daar sta je dan. Net alles ge-unzipped, ge-uploaded, je wilt beginnen met configureren maar je kunt niets. Erger nog, in de installatiehandleiding en in de beschikbare FAQ's is hier NIETS over te vinden. Dat wordt dus googlen. Of hier verder lezen.

Wat kun je doen.
1. De session save path unwritable kun je op twee manieren oplossen. De kern van het probleem zit niet in Joomla! zelf maar in een parameter van de PHP configuratie. In de php.ini staat een foute directory of naar een directory waartoe je geen rechten hebt (dat laatste bijvoorbeeld bij een webprovider).

Oplossing (a):
Als je rechten hebt op de complete server (het is bijvoorbeeld je eigen PC) dan moet je zoeken naar het bestand php.ini.
(Als je meerdere php.ini's op je PC vindt, dan is het de php.ini in de directory die je in Apaches httpd.conf ziet staan na de waarde PHPIniDir. Bij mijn test-PC: PHPIniDir "C:/php5")
Zoek in de php.ini naar de waarde
session.save_path = <path>
Vervang de waarde in <path> in een geldige waarde en sla php.ini op.
Herstart Apache, ga naar het pre-installation check en het zou moeten werken. [2]

Oplossing (b).
Als je afhankelijk bent van een serviceprovider dan zal optie (a) hoogst waarschijnlijk niet werken. Gelukkig is er nog een andere - niet zo voor de hand liggende - oplossing.
Open het bestand htaccess.txt in de Joomla! directory.
Voeg de volgende regel toe
php_value session.save_path <path>
Welke waarde voor <path> moet je nu nemen? Als je site bij een serviceprovider staat, dan zit je zeer waarschijnlijk op een virtuele webserver te werken. Een geldig lijkend pad is niet geldig want het pad moet vanaf de root vanaf de fysieke server lopen, en jij ziet alleen virtuele paden.
Nu even knutselen:
maak een bestand info.php met de volgende inhoud:

HTML: info.php

 

1
2
3
4
5
6
7
8

<html><head>
<title>PHP Info</title>
</head>
<body>
<?php
phpinfo();
?>
</body></html>

 



Zet dit in de root van je webserver. Typ in je browser jouwdomein.nl/info.php. Een uitgebreid overzicht van de PHP configuratie verschijnt.
Zoek naar de variable DOCUMENT_ROOT. Daar staat de echte pad naar je webroot! In mijn geval:
/var/www/vhosts/mijndomein.nl/httpdocs/
Vul dit aan naar een geschikte directory, ik heb voor
/var/www/vhosts/mijndomein.nl/httpdocs/cache gekozen, omdat ik dat ergens las (link kwijt, helaas).

 

 

 

JohFraEl:

 

/home/sites/webhosting/johfrael/johfrael/www

 

TP51:

 

/home/sites/webhosting/johfrael/johfrael/tp51

 


Sla nu het htaccess.txt bestand op, kopieer het naar de root van je webserver en hernoem het naar .htaccess. Het verdwijnt nu uit het zicht van je FTP programma want onder *nix zijn bestanden die met een punt beginnen hidden bestanden.

Ga opnieuw naar de pre-installatie check. Als alles goed is gegaan staat er nu
Session save path /var/www/vhosts/mijndomein.nl/httpdocs/cache, Writable
(jouw pad zal natuurlijk anders zijn dan de mijne). [3]
(met info.php kun je ook het pad naar de php.ini vinden die je nodig het voor oplossing (a)).

 

 

 

JohFraEl:

 

/etc/php/apache2-php4/php.ini

2. Alle Joomla! subdirectories Unwritable.
Voor het oplossen van dit probleem moet je de toegangsrechten aanpassen. Ik heb geen idee waarom dit standaard verkeerd gaat (op *nix dan, bij Windows gaat het wel goed is mijn ervaring).
Welke rechten je moet toepassen staat op de Nederlandse Joomla! Wiki [4]

administrator/backup/
administrator/components/
administrator/modules/
administrator/templates/
cache/
components/
images/
images/banners/
images/stories/
language/
mambots/
mambots/content/
mambots/search/
media/
modules/
templates/

Alle mappen die je hierboven ziet moeten op 707 (-rwx---rwx) gezet worden.
Ook de map ‘mambots/editors’ moet op 707 (-rwx---rwx) gezet worden.

 

  • php-bestanden: 644
  • configuratie bestanden: 666
  • overige mappen: 755

 


Dit kan je doen met het commando CHMOD. In het FTP programma FileZilla zit dezelfde functionaliteit onder de rechtermuistoets, onder File attributes.

Ik hoop dat ik hiermee mensen geholpen heb. Zelf heb ik twee avonden moeten googlen voor ik het voor elkaar had (voor beide machines dan). Misschien een hint voor de Joomla! ontwikkelaars om dit in de handleiding mee te nemen.

[1] http://www.joomla.org/content/view/12/26/
[2] http://forum.mamboserver....;p=155585&postcount=7
[3] http://forum.dutchjoomla....ion+save+path+Unwriteable
[4] http://wiki.dutchjoomla.org/index.php/Bestandsrechten