SlideShare a Scribd company logo
1 of 13
Аудит безопасности
сайта Drupal
Кочетов Дмитрий
Последствия взлома сайта
● Падение сайта в результатах поисковой выдачи
● Потери репутации и клиентов
● Утечки конфиденциальной информации
● Загрузка вирусов посетителям сайта
Аудит безопасности сайта
это комплекс работ по выявлению ошибок в коде сайта и
программном обеспечении сервера,
воспользовавшимися которыми злоумышленники могут
атаковать и взломать сайт.
Аудит безопасности Drupal-сайта состоит из
следующих шагов:
● Поиск вирусов на Drupal-сайте;
● Анализ изменений в ядре и модулях Drupal;
● Выявление лишних файлов в ядре и модулях Drupal;
● Поиск вредоносного кода в блоках со вставками PHP и JavaScript в
базе данных;
● Анализ логов Drupal и веб-сервера на предмет подозрительной
активности;
● Выявление подозрительной активности на сайте в логах веб-сервера
и сайта Drupal;
● Анализ настроек прав доступа Drupal и форматов ввода Drupal;
● Анализ настроек веб-сервера.
Поиск вирусов на Drupal-сайте
● AI-Bolit
● Linux Malware Detect
Анализ изменений в ядре и модулях Drupal
● Установить модули Hacked! + Diff
● Анализировать изменения в файлах
● Поиск строк со странной кодировкой или со ссылкой
на скрипты
Выявление лишних файлов в ядре и
модулях Drupal
Для проверки используется скрипт, определяющий файлы отсутствующие в
архивах ядра, модулей и тем.
Для скрипта нужны три аргумента:
● путь до каталога с модулями
● путь к корню сайта
● путь до каталога с темой оформления
sh script.sh ~/domains/example.ru/html/sites/all/modules
~/domains/example.ru/html
~/domains/example.ru/html/sites/all/themes/omega
Запускать скрипт в папке hacked_cache
Анализировать файл otchet.log
Поиск вредоносного кода в блоках со
вставками PHP и JavaScript в базе данных
Cделать дамп БД сайта, переименовать в db.sql.
Выполняем команды:
● cat db.sql | grep '<?php[^<]*>' > otchet_php.log
● cat db.sql | grep '<script[^<]*>' > otchet_script.log
● cat db.sql | grep '<object[^<]*>' > otchet_object.log
● cat db.sql | grep '<iframe[^<]*>' > otchet_iframe.log
● cat db.sql | grep '<embed[^<]*>' > otchet_embed.log
Анализ логов Drupal и веб-сервера
● Анализируем в журнале drupal критические ошибки
● Анализ логов веб-сервера
● Выборка PHP
cat log_access.log |awk ' { if($9==200) print $7 }'|grep .php >php.log
● Выборка CGI
cat log_access.log | awk ' { print $7 } ' | grep ".cgi" > cgi.log
● Выборка POST-запросов
cat log_access.log | grep POST | awk ' { print $6 $7 } ' | sort | uniq -c | sort -rn > post.lo
● Проверка каждого POST-запроса на количество уникальных ip-адресов
cat log_access* | grep 'user' | awk '{print $1 $6}' | sort | uniq -c | sort -rn
Анализ настроек прав доступа Drupal и
форматов ввода Drupal
Security review
https://www.drupal.org/project/security_review
Анализ настроек веб-сервера
● Анализ прав на директорию сайта и файлы в ней
● Анализируем umask.
● Проверить корректность настройки PHP
● Проверить директиву PHP open_basedir
Проверка на уязвимость
Выполнить проверку возможности взлома сайта модулем Drupalgeddon
https://www.drupal.org/project/drupalgeddon
Проверка наличия троянов в файлах PHP
find ./ -type f -name "*.php" -exec grep -l '$form1=@$_COOKIE' {} ;
Проверка базы данных:
SELECT * FROM menu_router WHERE access_arguments LIKE '%form1(@$_COOKIE%';
SELECT * FROM role WHERE name='megauser';
SELECT * FROM users WHERE name='drupadev';
SELECT * FROM users WHERE name='drupaldev';
SELECT * FROM users WHERE name='drupdev';
Анализ учетных записей и ролей
SELECT * FROM role;
SELECT * FROM users;
Кочетов Дмитрий
DevOps
d.kochetov@initlab.ru
+7 928 20 80 992
Золотой спонсор:При поддержке: Серебряные спонсоры:
Благодарю за внимание!

More Related Content

Featured

Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 

Featured (20)

Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 

Аудит безопасности Drupal (Кочетов Дмитрий)

  • 2. Последствия взлома сайта ● Падение сайта в результатах поисковой выдачи ● Потери репутации и клиентов ● Утечки конфиденциальной информации ● Загрузка вирусов посетителям сайта
  • 3. Аудит безопасности сайта это комплекс работ по выявлению ошибок в коде сайта и программном обеспечении сервера, воспользовавшимися которыми злоумышленники могут атаковать и взломать сайт.
  • 4. Аудит безопасности Drupal-сайта состоит из следующих шагов: ● Поиск вирусов на Drupal-сайте; ● Анализ изменений в ядре и модулях Drupal; ● Выявление лишних файлов в ядре и модулях Drupal; ● Поиск вредоносного кода в блоках со вставками PHP и JavaScript в базе данных; ● Анализ логов Drupal и веб-сервера на предмет подозрительной активности; ● Выявление подозрительной активности на сайте в логах веб-сервера и сайта Drupal; ● Анализ настроек прав доступа Drupal и форматов ввода Drupal; ● Анализ настроек веб-сервера.
  • 5. Поиск вирусов на Drupal-сайте ● AI-Bolit ● Linux Malware Detect
  • 6. Анализ изменений в ядре и модулях Drupal ● Установить модули Hacked! + Diff ● Анализировать изменения в файлах ● Поиск строк со странной кодировкой или со ссылкой на скрипты
  • 7. Выявление лишних файлов в ядре и модулях Drupal Для проверки используется скрипт, определяющий файлы отсутствующие в архивах ядра, модулей и тем. Для скрипта нужны три аргумента: ● путь до каталога с модулями ● путь к корню сайта ● путь до каталога с темой оформления sh script.sh ~/domains/example.ru/html/sites/all/modules ~/domains/example.ru/html ~/domains/example.ru/html/sites/all/themes/omega Запускать скрипт в папке hacked_cache Анализировать файл otchet.log
  • 8. Поиск вредоносного кода в блоках со вставками PHP и JavaScript в базе данных Cделать дамп БД сайта, переименовать в db.sql. Выполняем команды: ● cat db.sql | grep '<?php[^<]*>' > otchet_php.log ● cat db.sql | grep '<script[^<]*>' > otchet_script.log ● cat db.sql | grep '<object[^<]*>' > otchet_object.log ● cat db.sql | grep '<iframe[^<]*>' > otchet_iframe.log ● cat db.sql | grep '<embed[^<]*>' > otchet_embed.log
  • 9. Анализ логов Drupal и веб-сервера ● Анализируем в журнале drupal критические ошибки ● Анализ логов веб-сервера ● Выборка PHP cat log_access.log |awk ' { if($9==200) print $7 }'|grep .php >php.log ● Выборка CGI cat log_access.log | awk ' { print $7 } ' | grep ".cgi" > cgi.log ● Выборка POST-запросов cat log_access.log | grep POST | awk ' { print $6 $7 } ' | sort | uniq -c | sort -rn > post.lo ● Проверка каждого POST-запроса на количество уникальных ip-адресов cat log_access* | grep 'user' | awk '{print $1 $6}' | sort | uniq -c | sort -rn
  • 10. Анализ настроек прав доступа Drupal и форматов ввода Drupal Security review https://www.drupal.org/project/security_review
  • 11. Анализ настроек веб-сервера ● Анализ прав на директорию сайта и файлы в ней ● Анализируем umask. ● Проверить корректность настройки PHP ● Проверить директиву PHP open_basedir
  • 12. Проверка на уязвимость Выполнить проверку возможности взлома сайта модулем Drupalgeddon https://www.drupal.org/project/drupalgeddon Проверка наличия троянов в файлах PHP find ./ -type f -name "*.php" -exec grep -l '$form1=@$_COOKIE' {} ; Проверка базы данных: SELECT * FROM menu_router WHERE access_arguments LIKE '%form1(@$_COOKIE%'; SELECT * FROM role WHERE name='megauser'; SELECT * FROM users WHERE name='drupadev'; SELECT * FROM users WHERE name='drupaldev'; SELECT * FROM users WHERE name='drupdev'; Анализ учетных записей и ролей SELECT * FROM role; SELECT * FROM users;
  • 13. Кочетов Дмитрий DevOps d.kochetov@initlab.ru +7 928 20 80 992 Золотой спонсор:При поддержке: Серебряные спонсоры: Благодарю за внимание!