Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Бан ботов
- /sbin/iptables -A INPUT -m string --algo kmp --string "BOTNAME" -p tcp --dport 80 -j DROP
- Удалить правило:
- /sbin/iptables -D INPUT -m string --algo kmp --string "BOTNAME" -p tcp --dport 80 -j DROP
- Если не работает переход по ссылкам https из панели, нужно проверить ssl на VPS и возможно сделать заглушку.
- Подсчёт IP в запросах к nginx:
- cat /var/log/nginx/access.log | cut -f1 -d' ' | sort | uniq -c | sort -n | tac | head
- Если сайт кидает 500 ошибку при правилах Rewrite, попробовать переключить режим работы PHP с CGI на Apache.
- Если после даунгрейда PHP не работает PHP как CGI, стоит удалить php.conf файл.
- Автоматизация секурных обновлений:
- wget script.friendhosting.net/uppo.sh; bash uppo.sh; rm -f uppo.sh
- If "iotop" shows that most resources are used by jbd2/md2-8 and not by mysql service,
- try to add:
- innodb_flush_method=O_DSYNC
- to my.cnf [mysqld] section and restart mysql service.
- Очистка кэша и перезапуск панели испменеджер в случае кривого отобажения:
- /usr/local/ispmgr/sbin/pkgctl -D cache
- /usr/local/ispmgr/sbin/pkgctl -D -m ispmgr cache
- rm -rf /usr/local/ispmgr/var/.xmlcache
- killall -9 ispmgr
- Запретить ООМ-киллеру убивать мускуль:
- pgrep -f $(which mysql) | while read PID; do echo -17 > /proc/$PID/oom_adj; done
- Таймауты nginx-а как прокси:
- server {
- ...
- proxy_connect_timeout 600;
- proxy_send_timeout 600;
- proxy_read_timeout 600;
- send_timeout 600;
- ...
- }
- Cжатие:
- server {
- ....
- gzip on;
- gzip_disable "msie6";
- gzip_types image/svg+xml text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript image/png image/jpg image/jpeg;
- }
- Права на каталоги 755 и файлы 644:
- find dir/ -type d -exec chmod 755 {} \;
- find dir/ -type f -exec chmod 644 {} \;
- Задампить все базы в разные файлы:
- for dbname in `echo show databases| mysql -u root -pvvAteWlBR8|egrep -v "Database|mysql|information_schema|performance_schema"`;
- do echo "Dump $dbname...";
- mysqldump -u root -pvvAteWlBR8 $dbname > "$dbname.sql";
- done
- Импорт всех .sql баз из каталога с попутным созданием баз:
- for file in `ls`; do dbname=`echo $file| sed 's/\.sql//g'`; echo "Creating database \`$dbname\`" ; mysql -u root -ppass -e "create database $dbname"; mysql -u root -ppass $dbname < $file; done
- Удалённый дамп мускуля по ssh (выполнять на локальной машине, IP и пароль - удалённой):
- ssh -p 3333 -l root 217.12.221.15 "mysqldump -u root -pIHi2JRCGsy -A | gzip -3 -c" > allbases.sql.gz
- Чтобы получить список всех www доменов из ISPManager, достаточно выполнить команду:
- /usr/local/ispmgr/sbin/mgrctl -m ispmgr wwwdomain | sed 's/=/ /' | awk '{print $2}' | sed "s/^/`ip a | grep inet | grep -v inet6| grep -v 127| tr -s ' ' | cut -f 3 -d ' ' | cut -f 1 -d'/'` /g"
- Если на дебиане не работает ПМА с ошибкой типа не может загрузить мускульный модуль, чек:
- root@akigl148:/etc# grep -R "extension=mysql.so" *
- php5/mods-available/mysql.ini:extension=mysql.so
- php5/cgi/conf.d/20-mysql.ini:extension=mysql.so
- php5/apache2/conf.d/20-mysql.ini:extension=mysql.so
- php5/cli/conf.d/20-mysql.ini:extension=mysql.so
- php5/conf.d/20-mysql.ini:extension=mysql.so
- Лечение кракозябликов:
- [mysqld]
- character-set-server=cp1251
- collation-server=cp1251_general_ci
- init-connect="SET NAMES cp1251"
- skip-character-set-client-handshake
- virtualhost: AddDefaultCharset UTF-8
- CP1251
- Даунгрейд дебиан РНР до 5.3:
- deb http://ftp.debian.org/debian/ squeeze main contrib non-free
- deb http://security.debian.org/ squeeze/updates main contrib non-free
- apt-get update
- apt-cache showpkg php5
- видим что-то типа:
- Provides:
- 5.4.45-0+deb7u1 -
- 5.4.44-0+deb7u1 -
- 5.3.3-7+squeeze19 -
- Reverse Provides:
- VERSION="5.3.3-7+squeeze19" и погнали
- apt-get install --reinstall php5=$VERSION php5-cli=$VERSION php5-common=$VERSION php5-cgi=$VERSION libapache2-mod-php5=$VERSION php-pear=$VERSION php5-curl=$VERSION php5-gd=$VERSION php5-intl=$VERSION php5-mysql=$VERSION php5-pspell=$VERSION php5-recode=$VERSION php5-sqlite=$VERSION php5-tidy=$VERSION php5-xmlrpc=$VERSION php5-xsl=$VERSION php5-mcrypt=$VERSION
- !Пустая админ-страница Вордпресса:
- There is a bug in WordPress 3.3.1 causing the issue. It may affect other versions as well.
- To solve the issue you can update WordPress to the current stable release and do integration testing afterwards.
- Or you can do a quick bug fix.
- To fix the bug:
- Open file blog/wp-admin/includes/screen.php in your favorite text editor.
- On line 706 find the following PHP statement: <?php echo self::$this->_help_sidebar; ?>
- Replace it with the statement: <?php echo $this->_help_sidebar; ?>
- Save your changes.
- Тест работы SOCKS5 Proxy:
- curl --socks5-hostname usernik:BHCY7Um4@82.118.17.73:1111 binfalse.de -v
- https://friendhosting.net/admin_bar.php?do=fullinfo&id=6482 - у него есть работающие прокси на socks5
- Конфиги весты и замена инклюдов (защита от брута) :
- sed -i -e s/nginx.*.conf/include.conf/g /home/admin/conf/web/nginx.conf
- Выкл РНР варнинги и нотайсы в php.ini
- error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING
- Бан IP:
- iptables -I INPUT -j DROP -s 127.0.0.1
- iptables -D INPUT -j DROP -s
- Бан порта:
- iptables -A INPUT -p tcp --destination-port {PORT-NUMBER-HERE} -j DROP
- PHPinfo
- <?php
- phpinfo();
- ?>
- Удаление BOM:
- sed -i '1 s/^\xef\xbb\xbf//' /home/admin/web/legendbatles.ru/public_html/index.php
- Iptables ограничение адреса и порта:
- iptables -A INPUT -p tcp --dport 8000 -s 1.2.3.4 -j ACCEPT
- iptables -A INPUT -p tcp --dport 8000 -j DROP
- ns1.frienddns.info
- ns2.frienddns.info
- ns3.frienddns.net
- ns4.frienddns.net
- Подключения:
- netstat -anp | grep 80 | grep tcp | awk '{print $5}' | cut -d":" -f 1 | sort | uniq -c | sort -k1rn | head -n 30 | awk '{ print $1 "\t" $2 }'
- !!!Не втыкать смотреть в .htaccess, когда проблема с обработкой файлов
- Блокирование доступа к некоторому порту отовсюду, кроме:
- iptables -A INPUT -p tcp --dport 3306 ! -s 127.0.0.0/8 -j DROP
- Добавление доменов в ИСП из консоли:
- for i in `cat domains.txt`; do /usr/local/ispmgr/sbin/mgrctl -m ispmgr wwwdomain.edit domain=$i alias=www.$i docroot=auto owner=radioloc admin=admin@$i autosubdomain=asdnone ip=195.28.182.32 php=phpcgi sok=ok; done
- OK
- Создание базы данных в ИСП:
- /usr/local/ispmgr/sbin/mgrctl -m ispmgr db.edit name=radioloc_30secon dbtype=MySQL owner=radioloc dbencoding=default dbuser=newuser dbusername=radioloc_30secon dbpassword=radioloc_30secon dbconfirm=radioloc_30secon sok=ok
- ISPMGR 5 create user
- /usr/local/mgr5/sbin/mgrctl -m ispmgr user.edit name=testuser fullname=testuser passwd=9379995Aa confirm=9379995Aa preset=Full_default sok=ok
- ISPMGR 4 create user
- /usr/local/ispmgr/sbin/mgrctl -m ispmgr user.edit name=testuser passwd=123456 confirm=123456 phpcgi=on disklimit=0 sok=ok
- Либо
- /usr/local/ispmgr/sbin/mgrctl -m ispmgr user.edit name=testuser passwd=123456 confirm=123456 phpcgi=on preset=custom disklimit=0 ftplimit=10 sok=ok
- Либо
- /usr/local/ispmgr/sbin/mgrctl -m ispmgr user.edit name=testuser passwd=123456 confirm=123456 phpcgi=on preset=default sok=ok
- (с соответствующим шаблоном)
- Удалить домен с сохранением файлов ISP 4:
- /usr/local/ispmgr/sbin/mgrctl -m ispmgr wwwdomain.delete elid=sssuppertest.alex.ru wwwdomain.delete.confirm elid=sssuppertest.alex.ru docroot=on sok=ok
- Нет места у АПАЧА:
- http://wiki.iphoster.ru/wiki/CentOS_-_apache:_%2828%29No_space_left_on_device:_Couldn't_create_accept_lock_%28/etc/httpd/logs/accept.lock%29_%285%29
- nginx header too big:
- http {
- proxy_buffer_size 128k;
- proxy_buffers 4 256k;
- proxy_busy_buffers_size 256k;
- }
- Получить айпи: ip a|egrep inet|egrep -v "inet6|host"|gawk -F ' ' {'print $2'}|sed 's/\/24//'
- Конвертирование в MyISAM
- TABLES=$(mysql -pXXXXXXX -uXXXXXXX --skip-column-names -B -D $DB -e 'show tables')
- for T in $TABLES
- do
- mysql -pXXXXX -uXXXXX -D $DB -e "ALTER TABLE $T ENGINE=MYISAM"
- done
- Глюк с ПМА и SSL(в /etc/phpmyadmin):
- $cfg['PmaAbsoluteUri'] = 'http://'.$_SERVER["HTTP_HOST"].':81/myadmin/';
- Option InsecureDomain в /usr/local/ispmgr/etc/ispmgr.conf и перезапустите ISPmanager
- wget -O nginx_bot_autoban.sh http://195.28.182.231/nginx_bot_autoban.sh; bash nginx_bot_autoban.sh; rm -rf nginx_bot_autoban.sh
- Блокирование реферов:
- if ( $http_referer ~* (kyamoviehai.com|rainforestbands.com|dogshowsonice.com|racebandrange.com|topworkhandsandlegs.com) ){
- return 403;
- }
- # gunzip /usr/share/doc/phpmyadmin/examples/create_tables.sql.gz
- # mysql -u root -h localhost -p
- Enter password:
- mysql> source /usr/share/doc/phpmyadmin/examples/create_tables.sqlJudnYGYJh9
- Query OK, 1 row affected (0.00 sec)
- ...
- mysql> quit
- Bye
- И перезайти в phpmyadmin.
- Список ботов:
- Plukkie|GetintentCrawler|GrapeshotCrawler|XoviBot|Mail.RU_Bot|WebArtexBot|DeuSu|HaosouSpider|TOBBOT|uMBot-LN|Yahoo!|BuzzSumo|Sogou web spider|MegaIndex|bingbot|AddThis.com|BLEXBot|BuddhaBot|Ezooms|
- AhrefsBot|Baiduspider|PaperLiBot|Twitterbot|QuerySeekerSpider|meanpathbot|SemrushBot|SolomonoBot|Butterfly|UnwindFetchor|rogerbot|NING|
- TweetmemeBot|SeznamBot|coccoc|Yeti|Moreover|TurnitinBot|METASpider|
- Nekstbot|SputnikBot|Nigma.ru|DotBot|MJ12bot|Netcraft|OpenLinkProfiler|
- WebFilter|NjuiceBot|Gigabot|JS-Kit|Voyager|PostRank|Aport|ia_archiver|DotBot|SurveyBot|larbin|
- Butterfly|LinkExchanger|Soup|spbot|MLBot|InternetSeer|FairShare|
- Birubot|YottosBot|gold crawler|Linguee|Ezooms|lwp-trivial|Purebot|kmSearchBot|SiteBot|CamontSpider|
- ptd-crawler|HTTrack|suggybot|ttCrawler|Nutch|Zeus
- Отломанная таблица просмотров DLE:
- DROP TABLE IF EXISTS `dle_views`;
- CREATE TABLE `dle_views` (
- `id` mediumint(8) NOT NULL AUTO_INCREMENT,
- `news_id` int(11) NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`)
- ) ENGINE=MyISAM AUTO_INCREMENT=1/*!40101 DEFAULT CHARSET=cp1251 */;
- DROP TABLE IF EXISTS `dle_login_log`;
- CREATE TABLE `dle_login_log` (
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
- `ip` varchar(16) NOT NULL DEFAULT '',
- `count` smallint(6) NOT NULL DEFAULT '0',
- `date` int(11) unsigned NOT NULL DEFAULT '0',
- PRIMARY KEY (`id`),
- UNIQUE KEY `ip` (`ip`),
- KEY `date` (`date`)
- ) ENGINE=MyISAM AUTO_INCREMENT=1/*!40101 DEFAULT CHARSET=cp1251 */;
- -j, --file=FILE Full path to single file to check^M
- -l, --list=FILE Full path to create plain text file with a list of found malware^M
- -p, --path=PATH Directory path to scan, by default the file directory is used^M
- Current path: {$defaults['path']}^M
- -m, --memory=SIZE Maximum amount of memory a script may consume. Current value: $memory_limit^M
- Can take shorthand byte values (1M, 1G...)^M
- -s, --size=SIZE Scan files are smaller than SIZE. 0 - All files. Current value: {$defaults['max_size_to_scan']}^M
- -a, --all Scan all files (by default scan. js,. php,. html,. htaccess)^M
- -d, --delay=INT delay in milliseconds when scanning files to reduce load on the file system (Default: 1)^M
- -e, --cms=FILE cms filename to load .aknown files from. E.g. --cms=wordpress^M
- -x, --mode=INT Set scan mode. 0 - for basic, 1 - for expert and 2 for paranoic.^M
- -k, --skip=jpg,... Skip specific extensions. E.g. --skip=jpg,gif,png,xls,pdf^M
- -r, --report=PATH/EMAILS^M
- Full path to create report or email address to send report to.^M
- You can also specify multiple email separated by commas.^M
- -q, Use only with -j. Quiet result check of file, 1=Infected ^M
- --cmd="command [args...]"^M
- Run command after scanning^M
- --one-pass Do not calculate remaining time^M
- --quarantine Archive all malware from report^M
- --with-2check Create or use AI-BOLIT-DOUBLECHECK.php file^M
- --imake^M
- -rwsr-xr-x - /usr/sbin/exim
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement