Skip to content

Instantly share code, notes, and snippets.

View MrWhiteD's full-sized avatar
👹
Clever lol

Yuriy Belalov MrWhiteD

👹
Clever lol
  • Russia Ekaterinburg
View GitHub Profile
@MrWhiteD
MrWhiteD / code.php
Last active August 16, 2022 05:08
[Исключить пользователя из Стоп листа Bitrix программно через код ] https://coderun.ru/prostye-otvety/isklyuchit-polzovatelya-iz-stop-lista-bitrix-programmno-cherez-kod/ #bitrix #битрикс #стоплист
<?
public static function load(): void {
global $DB;
$ip = self::$rules_exclude;//например '111.111.111.111'
\CModule::IncludeModule('security');
$query_exec = <<<EOT
@MrWhiteD
MrWhiteD / instruction.txt
Created August 16, 2022 05:10
[Битрикс — снимаем ограничение входа в админку по ip адресу] https://1c8.pl.ua/bitriks-snimaem-ogranichenie-vhoda-v-adminku-po-ip-adresu/ #bitrix #битрикс
1. Откройте файл /bitrix/modules/security/admin/security_403.php удалите все или закомментируйте
2. Далее в админке переходим Рабочий стол / Настройки / Проактивная защита / Защита административного раздела = Выключить защиту
3. Возвращаем содержимое /bitrix/modules/security/admin/security_403.php
@MrWhiteD
MrWhiteD / code.php
Last active February 8, 2024 06:34
[BITIRX. Как восстановить доступ администратора на сайт] https://dev.1c-bitrix.ru/learning/course/index.php?COURSE_ID=35&LESSON_ID=2161 #bitrix #битрикс #bitrixsecurity #bitrixauth #admin
<?php
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");
global $USER;
$USER->Authorize(1);
header('Location: /bitrix/admin/');
unlink(__FILE__);
?>
@MrWhiteD
MrWhiteD / code.php
Created August 17, 2022 10:35
[Битрикс , вирус, редиректы и уязвимость в модуле vote] https://fstrange.ru/coder/php/bitrix-virus-vote.html #bitrix #битрикс #security #backdoor
<?
//В файл /bitrix/tools/vote/uf.php перед required
// Добавляем:
$request = \Bitrix\Main\Context::getCurrent()->getRequest();
if ( $request ->isPost()) {
CHTTP::SetStatus( "404 Not Found" );
@define( "ERROR_404" , "Y" );
die ();
}
@MrWhiteD
MrWhiteD / file_get_contents_curl.php
Created September 13, 2022 05:19
[file_get_content при отключенном allow_url_fopen] #php #allow_url_fopen
<?
function file_get_contents_curl($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
@MrWhiteD
MrWhiteD / .settings.php
Last active October 17, 2023 07:39
[Логирование ошибок битрикс] #exception_handling #log
<?
'log' => array (
'settings' => array (
'file' => 'bitrix/modules/error.log',
'log_size' => 1000000,
),
),
@MrWhiteD
MrWhiteD / nginx_error.conf
Created October 5, 2022 07:15
[Nginx — уходим на технические работы] #nginx #error #503
# Тестирование ошибок. Возвращаем заголовок
header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Retry-After: 300');
#Чтобы nginx ловил ошибки бэка (апача)
proxy_intercept_errors on;
@MrWhiteD
MrWhiteD / debug.php
Last active July 5, 2024 05:26
[Лог дебаг битрикс] #bitrix #debug #log #dump
<?
// https://dev.1c-bitrix.ru/api_d7/bitrix/main/diag/debug/index.php
\Bitrix\Main\Diag\Debug::dumpToFile($variable, $varName = '__'.date('d.m.Y H:i:s'), $fileName = '');
//вардампим через file_put_contents
ob_start();
echo "page_type=".$page_type;
var_dump($_SERVER);
$out = ob_get_contents();
@MrWhiteD
MrWhiteD / params.js
Created October 18, 2022 06:30
[get параметры JS] #js #_GET #javascript
var params = window.location.search.replace('?','').split('&').reduce(
function(p,e){
var a = e.split('=');
p[ decodeURIComponent(a[0])] = decodeURIComponent(a[1]);
return p;
},
{}
);
@MrWhiteD
MrWhiteD / parse_tm.php
Created October 21, 2022 04:37
[Парсинг телеги] #tm #telegram #парсинг
//https://docs.madelineproto.xyz/docs/LOGIN.html#getting-permission-to-use-the-telegram-api
//https://github.com/danog/MadelineProto
//https://docs.telethon.dev/en/stable/#
//https://ru.stackoverflow.com/questions/688356/%D0%94%D0%BE%D1%81%D1%82%D0%B0%D1%82%D1%8C-%D0%B2%D1%81%D0%B5-%D1%81%D0%BE%D0%BE%D0%B1%D1%89%D0%B5%D0%BD%D0%B8%D1%8F-%D1%81-%D0%BF%D1%83%D0%B1%D0%BB%D0%B8%D1%87%D0%BD%D0%BE%D0%B3%D0%BE-%D1%87%D0%B0%D1%82%D0%B0-telegram