Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Новая сигнатура не применилась #115

Open
rame0 opened this issue Feb 16, 2016 · 3 comments
Open

Новая сигнатура не применилась #115

rame0 opened this issue Feb 16, 2016 · 3 comments

Comments

@rame0
Copy link

rame0 commented Feb 16, 2016

Добавил в базу сигнатур вот аткую:
($.?)\s=\s_.?\1[.?].\1[._?].\1[.*?]

Для поиска подобных файлов:

Сигнатуру пометил как критическую. Запустил манул, после ожидания получил результат. Загрузил его в анализатор и увидел, что файлы по регулярке не нашлись.

Хотя, через консоль все отлично находится: http://prntscr.com/a459y8

@rame0
Copy link
Author

rame0 commented Feb 17, 2016

Пока чистил свой сервер, вывел несколько регулярок для GREP для поиска файлов. Возможно они вам пригодятся:

grep -rP --exclude=.{js,png,jpg,gif,log,ini} --regexp='($.?)\s=\s_".?\1[.?]\s_.\s_\1[._?]' ./* | cut -d: -f1 | sort -u
grep -rP --exclude=
.{js,png,jpg,gif,log,ini} --regexp='.eval\s(\s_base64_decode\s_(.' ./ | cut -d: -f1 | sort -u
grep -rP --exclude=.{js,png,jpg,gif,log,ini} --regexp='.eval\s(.' ./ | cut -d: -f1 | sort -u
grep -rP --exclude=
.{js,png,jpg,gif,log,ini} --regexp='.base64_decode\s(.' ./ | cut -d: -f1 | sort -u
grep -rP --exclude=*.{js,png,jpg,gif,log,ini} --regexp='.preg[A-z]\s(\s_.?e".' ./* | cut -d: -f1 | sort -u

grep -rP --exclude=.{js,png,jpg,gif,log,ini} --regexp='.BackConnect.' ./* | cut -d: -f1 | sort -u
grep -rP --exclude=
.{js,png,jpg,gif,log,ini} --regexp='.SuExecByps.' ./* | cut -d: -f1 | sort -u
grep -rP --exclude=.{js,png,jpg,gif,log,ini} --regexp='.Cgi\s_Shell.' ./_ | cut -d: -f1 | sort -u
grep -rP --exclude=
.{js,png,jpg,gif,log,ini} --regexp='.FilesMan.' ./* | cut -d: -f1 | sort -u

@kolyandula
Copy link

Там ведь всё выражение оборачивается в скобки
preg_match('#(' . $sigContent . ')#smi', $content, $found, PREG_OFFSET_CAPTURE)
Так что номер обратной ссылки нужно увеличить на единицу.
Выражение вставляется с модификатором /s и точка совпадает также и с переводом строки.
Так что из \s*.*? можно убрать \s*
(\$\w+)\s*=.*?\2\[.*?\]\.\2\[.*?\]\.\2\[.*?\]

@rame0
Copy link
Author

rame0 commented Feb 17, 2016

Спасибо, не учел, что выражение оборачивается в скобки. А насчет \s*.*? - да, случайно осталась. В "финальной" версии регулярки между \s и .* я добавил ".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants