WP search malware
grep -RPn "(passthru|exec|eval|shell_exec|assert|str_rot13|system|phpinfo|base64_decode|chmod|mkdir|fopen|fclose|readfile) *\("
grep -RPn "(passthru|exec|eval|shell_exec|assert|str_rot13|system|phpinfo|base64_decode|chmod|mkdir|fopen|fclose|readfile) *\("
bulk crap uninstaller
https://www.bcuninstaller.com/
https://www.shouldiremoveit.com/
https://www.builtbybel.com/apps/bloatbox
English World / OOBE
https://www.oo-software.com/en/shutup10
https://www.thewindowsclub.com/ultimate-windows-tweaker-4-windows-10
sudo sed -i -re 's/([a-z]{2}\.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
setfacl --restore=perme.txt
<FilesMatch \.php$>
# Apache 2.4.10+ can proxy to unix socket
SetHandler "proxy:unix:/var/run/php/php5.6-fpm.sock|fcgi://localhost/"
</FilesMatch>
sudo update-alternatives --set php /usr/bin/phpx.x
echo "alias php='/opt/plesk/php/7.0/bin/php'" >> ~/.bashrc
rw init=/bin/bash
mkdir -p storage/framework/{sessions,views,cache}
grep --include=*.php -rnw . -e 'qsdqsd'
find . -iname "*.php" | xargs grep 'teletab'
find /etc/ -name "*.conf" 2>/dev/null | xargs grep request_terminate_timeout
cat /dev/null > ~/.bash_history && history -c && exit
Install memcached
/opt/plesk/php/7.1/bin/pecl install memcached
apt-get install make plesk-php71-dev gcc libmemcached-dev git pkg-config zlib1g-dev
<?php
//phpinfo();
error_reporting(E_ALL|E_STRICT);
ini_set('display_errors', true);
$mem = new Memcached();
$mem->addServer("127.0.0.1", 11211);
$result = $mem->get("blah");
echo '<hr>';
$mem = new memcached();
$mem->addServer("127.0.0.1", 11211);
$result = $mem->get("Test");
if ($result) {
echo $result;
} else {
echo "Test key not found, adding key";
$mem->set("Test", "I found a match, memcache is working") or die("Nothing Saved...");
}
?>
Vider les log de plus de 10Mo
find . -type f -name "error_log" -size +10M -exec truncate -s 0 {} +
Rechercher les fichiers modifiés dans les derniers jour
Find files modifiy last 10 days
find . -regex '\./[^.].+' -mtime -10
Colonnaire l'ip public de son serveur linux
curl ipinfo.io/ip
Lister les disques et partions / show partion and hard disk linux
lsblk -o SIZE,NAME,FSTYPE,LABEL,MOUNTPOINT
Remove mail queue postifx by subject
Supprimer les email en attente par sujet suite à un hack de boite email, plesk postfix
Pour voir quelle boite email envoie les spam il faut faire une recherche sur sasl_username
find /var/spool/postfix/deferred/ -exec grep -l 'sujet' {} \; | xargs -r -n1 basename | xargs -r -n1 postsuper -d