Этот проект показывает PoC как специалист red team может использовать возможности 1С для получение доступа к тестируемой машине.
PoC.2.mp4
Перед тем как мы начнем, опишу используемое ПО:
- 1C Предприятие 8 - Что бы разработать внешнюю обработку в конфигуратор и запустить её режиме предприятия
- Wampserver - Сервер который выдаст полезную нагрузку в виде простого MessageBox
Файлы в репозитории:
- code.1c - Файл с исходным кодом на 1С
- sample.epf - Файл внешней обработки который использовался в видео
Создадим любой проект в режиме Конфигуратора
-
Создадим внешнюю обработку, используя Файл -> Новый -> Внешняя обработка.
-
Добавляем команду и переносим её на панель, что бы пользователь нажал на кнопку и запустил нагрузку.
.
-
Теперь мы можем как пример отправить письмо заинтересованному лицу (обычно бухгалтер), со следующим притекстом: Здравствуйте, мы компания, которая занимается 1С Разработкой, и у нас появился новый продукт по интеграции ЭДО, Ватсап, чего-либо-еще. Мы создали внешнюю обработку, попробуйте запустить её в 1С
- Так как это PoC, то функционал предоставленный здесь довольно мал и сегодняшние технологии защиты быстро отсекут полезную нагрузку. Можно попытаться сделать запуск полезной нагрузки как fileless вызывая PowerShell.
- Прошу заметить что у каждого пользователя 1С стоят очень разные настройки. В видео запуска были видны "предупреждения", хотя при тестировании одного и того же кода на другой системе таких же уведомлений не поступало.
This project is Proof-of-Concept of using quite popular software called 1C as a means to achieve initial foothold at internal network.
1C is complex ecosystem of software products in use in CIS countries (particularly Russia). Most often it is used for internal finance bookkeeping. You can learn more about particular use case related to this manual here: https://v8.1c.ru/buhv8/
Before we dive in, let me tell what I use for this PoC: I use Windows 10 machine with following software:
- 1C Предприятие 8 - to develop this PoC and run it
- Wampserver - to host simple MessageBox PE executable (http://localhost/hello.exe)
Files in repository are:
- code.1c - source code
- sample.epf - the "dropper" used in video
First let create any project under 1C and get to Конфигуратор mode
-
We need to create Внешняя обработка, using Файл -> Новый -> Внешняя обработка.
-
Then we name project whatever we want and click at icon of magnifying glass.
-
We create command and move it to the form so user could click button and launch our payload.
.
-
After all of this, we could use mail to send phishing message to accountant (much more chance that they use 1C to do everyday tasks) with pretext like this: Hello, We are 1C Software development company and we created new product to integrate your database with Jira/Whatsapp whatever. You could try it using out external configuration. Please download it and put it inside your active 1C Client instance so you could see how amazing our product is
As 1C language could leverage COM objects and many more features, we can create fileless dropper. In video you can see user could be presented with warnings, but keep in mind that security configuration differs between different versions of 1C, different databases in use etc. I had tested it on two different machines, with different 'Demo database' configurations and language settings yet I wasnt warned as much as in PoC video.