Grosse attaque de l’IP 123.172.67.122 (Chine) : Il faut filtrer cette IP !

L’IP tente toutes les extensions PHP possible … j’ai compté 591 noms différents, parmis les grands classiques :

  • autoloader.php
  • confg.php
  • core.php
  • error.php
  • license.php
  • meijianxue.php
  • phpinfo.php
  • secure.php
  • settings.php
  • user.php
  • whoami.php
  • wp-admins.php
  • wp-config.php
  • xmlrpc.php

La meilleure réponse c’est de la mettre en liste noire :

iptables -A INPUT -s 123.172.67.122  -j DROP 
iptables-save > /etc/iptables/rules.v4

Pour l’instant j’ai 57 IP dans ma liste :

# cat /etc/iptables/rules.v4 | grep DROP | awk '{print $4}' | sort | uniq | wc -l
57

La majorité des IP c’est Chine, Russie …. Misère.

Si vous faites un RT / Like / Partage d’un de ses dix sites … c’est surement que vous partagez n’importe quoi !

Voici une liste de site complotiste :


Source : https://www.conspiracywatch.info/complosphere-quels-sont-les-10-sites-les-plus-visites.html

France Soir est bien connu pour ses faux articles sur le COVID …

NexCloud : Mise à jours en version 20.0.10

Avant la mise à jours j’ai du lancer une commande :

#  sudo -u www-data php7.3 /usr/share/nginx/nextcloud/occ db:convert-filecache-bigint
[sudo] password for XXXXX:
Following columns will be updated:

* federated_reshares.share_id
* filecache_extended.fileid
* files_trash.auto_id
* share_external.id
* share_external.parent

This can take up to hours, depending on the number of files in your instance!
Continue with the conversion (y/n)? [n] An unhandled exception has been thrown:
Error: Call to undefined method Symfony\Component\Console\Question\ConfirmationQuestion::getAutocompleterCallback() in /usr/share/nginx/nextcloud/3rdparty/symfony/console/Helper/QuestionHelper.php:108
Stack trace:
#0 /usr/share/nginx/nextcloud/3rdparty/symfony/console/Helper/QuestionHelper.php(61): Symfony\Component\Console\Helper\QuestionHelper->doAsk(Object(Symfony\Component\Console\Output\StreamOutput), Object(Symfony\Component\Console\Question\ConfirmationQuestion))
#1 /usr/share/nginx/nextcloud/core/Command/Db/ConvertFilecacheBigInt.php(121): Symfony\Component\Console\Helper\QuestionHelper->ask(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\StreamOutput), Object(Symfony\Component\Console\Question\ConfirmationQuestion))
#2 /usr/share/nginx/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OC\Core\Command\Db\ConvertFilecacheBigInt->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /usr/share/nginx/nextcloud/3rdparty/symfony/console/Application.php(1000): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 /usr/share/nginx/nextcloud/3rdparty/symfony/console/Application.php(271): Symfony\Component\Console\Application->doRunCommand(Object(OC\Core\Command\Db\ConvertFilecacheBigInt), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 /usr/share/nginx/nextcloud/3rdparty/symfony/console/Application.php(147): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 /usr/share/nginx/nextcloud/lib/private/Console/Application.php(215): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /usr/share/nginx/nextcloud/console.php(100): OC\Console\Application->run()
#8 /usr/share/nginx/nextcloud/occ(11): require_once('/usr/share/ngin...')
#9 {main}

Mais cela plantait à chaque fois … j’ai donc vu qu’il fallait mettre :

# sudo -u www-data php7.3 /usr/share/nginx/nextcloud/occ  db:convert-filecache-bigint  --no-interaction

A noter que par moment les droits sur les logs sont modifiés … et il faut les remettre en place :

# sudo chown www-data.www-data   /var/log/nextcloud.log

A part cela rien d’anormal …

HumHub : Compression d’image …

J’ai pu voir dans la documentation que c’était possible : https://docs.humhub.org/docs/admin/uploads/ . A noter que j’utilise la version : 1.8.2.

J’ai donc modifié la configuration dans /var/www/humhub/protected/config/common.php :

<?php
/**
* This file provides to overwrite the default HumHub / Yii configuration by your local common (Console and Web) environments
* @see http://www.yiiframework.com/doc-2.0/guide-concept-configurations.html
* @see http://docs.humhub.org/admin-installation-configuration.html
* @see http://docs.humhub.org/dev-environment.html
*/
return [
'modules' => [
'file' => [
'imageMaxResolution' => '1920x1080',
'imageJpegQuality' => 75,
'imagePngCompressionLevel' => 9,
'imageWebpQuality' => 75,
]
]
];

Ensuite j’ai lancé la commande :

# sudo su
# /usr/bin/php /var/www/humhub/protected/yii file/downscale-images
*** File module console

Downscaling uploaded files:....

Afin de compresser les images précédentes, mais j’ai eu un crash :

Exception 'Imagine\Exception\RuntimeException' with message 'Resize operation failed'

in humhub/protected/vendor/imagine/imagine/src/Imagick/Image.php:295

Caused by: Exception 'ImagickException' with message 'cache resources exhausted ...

in /humhub/protected/vendor/imagine/imagine/src/Imagick/Image.php:292

Stack trace:
#0 /humhub/protected/vendor/imagine/imagine/src/Imagick/Image.php(292): Imagick->resizeimage(1920, 2560, 0, 1)
#1 /humhub/protected/humhub/modules/file/libs/ImageHelper.php(129): Imagine\Imagick\Image->resize(Object(Imagine\Image\Box))
#2 /humhub/protected/humhub/modules/file/commands/FileController.php(93): humhub\modules\file\libs\ImageHelper::downscaleImage(Object(humhub\modules\file\models\File))
#3 [internal function]: humhub\modules\file\commands\FileController->actionDownscaleImages()
#4 /humhub/protected/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#5 /humhub/protected/vendor/yiisoft/yii2/base/Controller.php(181): yii\base\InlineAction->runWithParams(Array)
#6 /humhub/protected/vendor/yiisoft/yii2/console/Controller.php(184): yii\base\Controller->runAction('downscale-image...', Array)
#7 /humhub/protected/vendor/yiisoft/yii2/base/Module.php(534): yii\console\Controller->runAction('downscale-image...', Array)
#8 /humhub/protected/vendor/yiisoft/yii2/console/Application.php(181): yii\base\Module->runAction('file/downscale-...', Array)
#9 /humhub/protected/vendor/yiisoft/yii2/console/Application.php(148): yii\console\Application->runAction('file/downscale-...', Array)
#10 /humhub/protected/vendor/yiisoft/yii2/base/Application.php(392): yii\console\Application->handleRequest(Object(yii\console\Request))
#11 /humhub/protected/yii(29): yii\base\Application->run()
#12 {main}

J’ai donc modifié le fichier /etc/ImageMagick-6/policy.xml :

<policy domain="resource" name="disk" value="8GiB"/>