├── report ├── missfont.log ├── report.pdf ├── images │ ├── net1.jpg │ ├── net2.jpg │ ├── scoreboard.jpg │ ├── module_round_schema.png │ ├── module_round_schema1.png │ ├── module_round_structure.png │ ├── module_round_toservice.png │ └── module_round_toservice1.png ├── eco │ ├── images │ │ ├── zbx.jpg │ │ ├── tima_u.png │ │ ├── timur_t.png │ │ ├── dima_main.png │ │ └── gena_zabbix.jpg │ ├── services │ │ ├── timur.tex │ │ ├── gena.tex │ │ └── dima.tex │ └── main.tex ├── ГПО+презентация.pptx ├── individual_reports │ ├── GPO5.png │ ├── score.png │ ├── score1.png │ ├── Algoritm.pdf │ ├── Naglyadno.pdf │ ├── next_semester.tex │ ├── programs │ │ └── python_sample.py │ ├── scoreboard.tex │ ├── architech.tex │ ├── flags.tex │ ├── network.tex │ └── round.tex ├── makereport.sh ├── plani.tex ├── instruments │ ├── rabbit.tex │ ├── argparse.tex │ ├── teamwork.tex │ ├── flask.tex │ ├── zabbix.tex │ ├── python.tex │ ├── tex.tex │ ├── git.tex │ └── mongo.tex ├── referat.tex ├── problem_form.tex ├── title.tex ├── lit.bib ├── intro.tex ├── technical_attributes.tex ├── config.tex ├── report.tex ├── lit.bib~5 ├── lit.bib~4 ├── lit.bib~3 ├── lit.bib~2 ├── report.fdb_latexmk └── utf8gost705u.bst ├── tests └── services │ ├── some_service1 │ └── checker.py │ └── some_service2 │ └── checker.py ├── visualization └── theme1 │ ├── images │ ├── bg.jpg │ ├── brizz.png │ ├── keva.png │ ├── yozik.png │ ├── censored.png │ ├── honeypot.png │ ├── leetmore.png │ ├── SUSlo.PAS.png │ ├── curiosity.png │ └── ufologists.png │ ├── index.html │ ├── css │ └── index.css │ └── js │ ├── apigame_emu.js │ └── index.js ├── classes ├── templates │ ├── game_not_started.html │ ├── is_not_avialable.html │ ├── layout.html │ └── index.html ├── config │ ├── get.py │ └── put.py ├── checker │ ├── threads.py │ ├── queue.py │ └── main.py ├── statistic.py ├── initialize.py ├── round.py ├── flags.py ├── zond.py └── scoreboard.py ├── .gitignore ├── config ├── main.sample.py └── game.json ├── config.ini ├── functions.py ├── install.sh ├── README.md ├── main.py ├── starter_allinone.py └── LICENSE /report/missfont.log: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /report/report.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevaTeam/ctf-attack-defense/HEAD/report/report.pdf -------------------------------------------------------------------------------- /report/images/net1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevaTeam/ctf-attack-defense/HEAD/report/images/net1.jpg -------------------------------------------------------------------------------- /report/images/net2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevaTeam/ctf-attack-defense/HEAD/report/images/net2.jpg -------------------------------------------------------------------------------- /report/eco/images/zbx.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevaTeam/ctf-attack-defense/HEAD/report/eco/images/zbx.jpg -------------------------------------------------------------------------------- /report/ГПО+презентация.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevaTeam/ctf-attack-defense/HEAD/report/ГПО+презентация.pptx -------------------------------------------------------------------------------- /tests/services/some_service1/checker.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | print("123") 5 | -------------------------------------------------------------------------------- /tests/services/some_service2/checker.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | print("123") 5 | -------------------------------------------------------------------------------- /report/eco/images/tima_u.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevaTeam/ctf-attack-defense/HEAD/report/eco/images/tima_u.png -------------------------------------------------------------------------------- /report/eco/images/timur_t.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevaTeam/ctf-attack-defense/HEAD/report/eco/images/timur_t.png -------------------------------------------------------------------------------- /report/images/scoreboard.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevaTeam/ctf-attack-defense/HEAD/report/images/scoreboard.jpg -------------------------------------------------------------------------------- /report/eco/images/dima_main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevaTeam/ctf-attack-defense/HEAD/report/eco/images/dima_main.png -------------------------------------------------------------------------------- /report/eco/images/gena_zabbix.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevaTeam/ctf-attack-defense/HEAD/report/eco/images/gena_zabbix.jpg -------------------------------------------------------------------------------- /report/individual_reports/GPO5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevaTeam/ctf-attack-defense/HEAD/report/individual_reports/GPO5.png -------------------------------------------------------------------------------- /report/individual_reports/score.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevaTeam/ctf-attack-defense/HEAD/report/individual_reports/score.png -------------------------------------------------------------------------------- /visualization/theme1/images/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevaTeam/ctf-attack-defense/HEAD/visualization/theme1/images/bg.jpg -------------------------------------------------------------------------------- /report/images/module_round_schema.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevaTeam/ctf-attack-defense/HEAD/report/images/module_round_schema.png -------------------------------------------------------------------------------- /report/individual_reports/score1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevaTeam/ctf-attack-defense/HEAD/report/individual_reports/score1.png -------------------------------------------------------------------------------- /visualization/theme1/images/brizz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevaTeam/ctf-attack-defense/HEAD/visualization/theme1/images/brizz.png -------------------------------------------------------------------------------- /visualization/theme1/images/keva.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevaTeam/ctf-attack-defense/HEAD/visualization/theme1/images/keva.png -------------------------------------------------------------------------------- /visualization/theme1/images/yozik.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevaTeam/ctf-attack-defense/HEAD/visualization/theme1/images/yozik.png -------------------------------------------------------------------------------- /report/images/module_round_schema1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevaTeam/ctf-attack-defense/HEAD/report/images/module_round_schema1.png -------------------------------------------------------------------------------- /report/images/module_round_structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevaTeam/ctf-attack-defense/HEAD/report/images/module_round_structure.png -------------------------------------------------------------------------------- /report/images/module_round_toservice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevaTeam/ctf-attack-defense/HEAD/report/images/module_round_toservice.png -------------------------------------------------------------------------------- /report/individual_reports/Algoritm.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevaTeam/ctf-attack-defense/HEAD/report/individual_reports/Algoritm.pdf -------------------------------------------------------------------------------- /report/individual_reports/Naglyadno.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevaTeam/ctf-attack-defense/HEAD/report/individual_reports/Naglyadno.pdf -------------------------------------------------------------------------------- /visualization/theme1/images/censored.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevaTeam/ctf-attack-defense/HEAD/visualization/theme1/images/censored.png -------------------------------------------------------------------------------- /visualization/theme1/images/honeypot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevaTeam/ctf-attack-defense/HEAD/visualization/theme1/images/honeypot.png -------------------------------------------------------------------------------- /visualization/theme1/images/leetmore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevaTeam/ctf-attack-defense/HEAD/visualization/theme1/images/leetmore.png -------------------------------------------------------------------------------- /report/images/module_round_toservice1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevaTeam/ctf-attack-defense/HEAD/report/images/module_round_toservice1.png -------------------------------------------------------------------------------- /visualization/theme1/images/SUSlo.PAS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevaTeam/ctf-attack-defense/HEAD/visualization/theme1/images/SUSlo.PAS.png -------------------------------------------------------------------------------- /visualization/theme1/images/curiosity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevaTeam/ctf-attack-defense/HEAD/visualization/theme1/images/curiosity.png -------------------------------------------------------------------------------- /visualization/theme1/images/ufologists.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KevaTeam/ctf-attack-defense/HEAD/visualization/theme1/images/ufologists.png -------------------------------------------------------------------------------- /report/makereport.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | pdflatex report.tex 4 | bibtex report.aux 5 | pdflatex report.tex 6 | pdflatex report.tex 7 | pdflatex report.tex -------------------------------------------------------------------------------- /classes/templates/game_not_started.html: -------------------------------------------------------------------------------- 1 | {% extends "layout.html" %} 2 | 3 | {% block title %}Игра еще не начилась{% endblock %} 4 | {% block body %} 5 |
6 |

Игра еще не началась! Зайдите чуть позднее

7 |
8 | {% endblock %} -------------------------------------------------------------------------------- /classes/templates/is_not_avialable.html: -------------------------------------------------------------------------------- 1 | {% extends "layout.html" %} 2 | 3 | {% block title %}Игра еще не началась{% endblock %} 4 | {% block body %} 5 |
6 |

Таблица результатов пока недоступна!

Зайдите чуть позднее

7 |
8 | {% endblock %} -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/* 2 | __pycache__/* 3 | 4 | classes/__pycache__/* 5 | checkers/* 6 | 7 | config/main.py 8 | 9 | *.pyc 10 | report/report.aux 11 | 12 | *.toc 13 | *.tex~ 14 | report/report.* 15 | !report/report.pdf 16 | 17 | *.log 18 | tmp.config.json 19 | 20 | starter_allinone.d/* -------------------------------------------------------------------------------- /report/plani.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate} 2 | \item Дополнение документации в зависимости от отзывов; 3 | \item Проведение соревнований SibirCTF 2017; 4 | \item Разработка нового функционала и улучшение старого; 5 | \item Привлечение к использованию данного программного комплекса других команд. 6 | \end{enumerate} -------------------------------------------------------------------------------- /visualization/theme1/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /report/individual_reports/next_semester.tex: -------------------------------------------------------------------------------- 1 | \begin{enumerate} 2 | \item Добавление мониторинга системы в процессе проведения игры; 3 | \item Автоматическая установка зависимостей, использующихся в платформе; 4 | \item Покрытие кода юнит-тестами; 5 | \item Подготовка платформы для межрегиональных соревнований по информационной безопасности; 6 | \item Написание публикации. 7 | \end{enumerate} 8 | -------------------------------------------------------------------------------- /classes/config/get.py: -------------------------------------------------------------------------------- 1 | class ConfigGet: 2 | def __init__(self, db): 3 | self.db = db 4 | 5 | def get_all_teams(self): 6 | return self.db.teams.find() 7 | 8 | def get_all_services(self): 9 | return self.db.services.find() 10 | 11 | def get_all(self): 12 | self.teams = self.get_all_teams() 13 | self.services = self.get_all_services() 14 | -------------------------------------------------------------------------------- /config/main.sample.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | DATABASE = { 4 | 'HOST': 'localhost', 5 | 'PORT': 27017 6 | } 7 | 8 | API_SERVER = '' 9 | 10 | CHECKER = { 11 | 'ROUND_LENGTH': 60, # Длина раунда в секундах 12 | 'LENGTH': 4 # Время жизни флага в раундах 13 | } 14 | 15 | FLAGS = { 16 | 'PORT': 2605 17 | } 18 | 19 | CHECKER_METHOD = 'async' # Async or queue 20 | 21 | QUEUE = { 22 | 'HOST': 'localhost', 23 | 'USERNAME': 'username', 24 | 'PASSWORD': 'pass' 25 | } 26 | 27 | BASE_PATH = os.path.dirname(__file__) + '/../' -------------------------------------------------------------------------------- /report/instruments/rabbit.tex: -------------------------------------------------------------------------------- 1 | RabbitMQ --- платформа, реализующая систему обмена сообщениями между компонентами программной системы (Message Oriented Middleware) на основе стандарта AMQP \cite{rabbit_wiki}. 2 | 3 | 4 | В первую очередь он предназначен для быстрой организации расределенной системы, обменивающейся задачами (горизонтальное масштабирование). 5 | 6 | Платформа состоит из: 7 | 8 | \begin{itemize} 9 | \item Сервера RabbitMQ (master сервер); 10 | \item Поддержки протоколов HTTP, XMPP и STOMP; 11 | \item Клиентов RabbitMQ (slave сервер); 12 | \end{itemize} 13 | 14 | RabbitMQ применяется в том случае, когда схема «получен запрос, сделан запрос в БД, составлен ответ, передан пользователю» не справляется с нагрузкой. -------------------------------------------------------------------------------- /report/instruments/argparse.tex: -------------------------------------------------------------------------------- 1 | 2 | Argparse --- это библиотека для обработки аргументов (ключей, параметров) командной строки для языка программирования Python. 3 | 4 | Основные возможности Argparse: 5 | \begin{itemize} 6 | \item Анализ документов sys.argv; 7 | \item Конвертирование строковых аргументов в объекты программы и работа с ними; 8 | \item Форматирование и вывод информативных подсказок; 9 | \item Обработка позиционных аргументов; 10 | \item Поддержка субкоманд. 11 | \end{itemize} 12 | 13 | Позиционные аргументы — это аргументы, влияющие на работу программы, в зависимости от порядка, в котором они в эту программу передаются. Простейший пример — программа cp, имеющая минимум 2 таких аргумента («cp source destination»). -------------------------------------------------------------------------------- /report/individual_reports/programs/python_sample.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # coding=utf-8 3 | 4 | from sys import argv, exit 5 | 6 | def check(hostname): 7 | return 101 8 | 9 | def put(hostname, id, flag): 10 | return 101 11 | 12 | def get(hostname, id, flag): 13 | return 101 14 | 15 | if __name__ == '__main__': 16 | if len(argv) > 1: 17 | if argv[1] == "check": 18 | if len(argv) > 2: 19 | exit(check(argv[2])) 20 | elif argv[1] == "put": 21 | if len(argv) > 4: 22 | exit(put(argv[2], argv[3], argv[4])) 23 | elif argv[1] == "get": 24 | if len(argv) > 4: 25 | exit(get(argv[2], argv[3], argv[4])) 26 | exit(110) -------------------------------------------------------------------------------- /classes/templates/layout.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {% block title %}{% endblock %} 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 | {% block body %}{% endblock %} 17 | 18 | 19 | -------------------------------------------------------------------------------- /report/instruments/teamwork.tex: -------------------------------------------------------------------------------- 1 | Teamwork --- это сервис, предоставляющий возможность управлять своими проектами, задачами, персоналом. 2 | 3 | Основным преимуществом является наличие удобного интерфейса управления проектом, этапами (вехами), задачами. 4 | Проект можно разбить на списки отдельных задач, привязывая их к определенным этапам, а также ограничивая определенным кругом лиц. 5 | Каждой задаче можно назначить одного и более ответственного, установить приоритет, назначить дату начала и окончания, добавить описание, а также настроить оповещение в случае наступления срока окончания задачи. Для более удобного слежения за проектом, соблюдением временных сроков, доступна диаграмма Ганта. 6 | 7 | Программа бесплатна при условии, что команда работает только над одним проектом. 8 | -------------------------------------------------------------------------------- /classes/checker/threads.py: -------------------------------------------------------------------------------- 1 | # from classes.` 2 | import threading 3 | 4 | class Threads: 5 | list = [] 6 | thread = [] 7 | 8 | def __init__(self): 9 | pass 10 | 11 | def put(self, **kwargs): 12 | self.list.append(kwargs) 13 | pass 14 | 15 | def run(self): 16 | self.thread = [] 17 | for item in self.list: 18 | self.thread.append(threading.Thread( 19 | name=item['team']['name'] + ' ' + item['service']['name'], 20 | target=item['to_service'], 21 | args=(item['team'], item['service'], item['flag'], item['flag_id'])) 22 | ) 23 | self.thread[-1].daemon = True 24 | self.thread[-1].start() 25 | 26 | for e, j in enumerate(self.thread): 27 | j.join(timeout=1) 28 | 29 | 30 | def clear(self): 31 | self.list = [] -------------------------------------------------------------------------------- /report/individual_reports/scoreboard.tex: -------------------------------------------------------------------------------- 1 | Целью работы в текущем семестре стало написание программного модуля, осуществляющего отображения состояния работы сервисов. Описание ошибок у сервисов показываются только для своей команды. 2 | 3 | \subsubsection{Принцип работы} 4 | 5 | Программа реализована с использованием микрофреймворка Flask. Программный модуль получает данные из базы данных, выводит результат состояний работы сервисов каждой команды на html страницу. 6 | 7 | Ниже представлена схема работы scoreboard.py (Рисунок 5.2). 8 | 9 | \begin{figure}[ht!] 10 | \center{\includegraphics[width=0.75\linewidth]{images/scoreboard.jpg}} 11 | \caption{Результат работы scoreboard.py} 12 | \end{figure} 13 | 14 | \begin{figure}[ht!] 15 | Алгоритм работы модуля scoreboard представлен ниже (Рисунок 5.3). 16 | \center{\includegraphics[width=0.5\linewidth]{individual_reports/score.png}} 17 | \caption{Cхема работы scoreboard.py} 18 | \end{figure} 19 | 20 | 21 | \clearpage -------------------------------------------------------------------------------- /report/instruments/flask.tex: -------------------------------------------------------------------------------- 1 | \ESKDthisStyle{empty} 2 | Flask - это микрофреймворк, написанный на языке программирования Python, основанный на Werkzeug и Jinja 2. Выпускается под BSD лицензией. 3 | 4 | Слово «микро» означает, что цель написания фреймворка - сохранить ядро простым, но в то же время легко расширяемой. По умолчанию Flask не включает в себя уровень абстракции базы данных, валидацию форм или другие библиотеки, которые с легкостью можно подключить. Вместо этого Flask поддерживает механизм расширения существующего кода так, как будто он уже был подключен к нему. Множество расширений предоставляют интеграцию с базой данных, валидацию форм, поддержку загрузки файлов, аутентификации пользователя и другие полезные функции. 5 | 6 | Особенности фреймворка 7 | \begin{itemize} 8 | \item Удобная работа с URL; 9 | \item Богатые возможности шаблонизатора; 10 | \item Минимальные требования к ресурсам в сравнении с аналогичными фреймворками. 11 | \end{itemize} 12 | 13 | Flask используется в модуле таблицы рейтинга. -------------------------------------------------------------------------------- /report/individual_reports/architech.tex: -------------------------------------------------------------------------------- 1 | \subsubsection{Ядро} 2 | 3 | При запуске платформы ядро выполняет следующие действия: 4 | \begin{itemize} 5 | \item Получение инициализационных данных из API; 6 | \item Создание необходимых таблиц и заполнение их данными, полученными на первом этапе; 7 | \item Сохранение структурированных данных в переменной; 8 | \item Подключение модуля, на основе входных параметров. 9 | \end{itemize} 10 | 11 | 12 | Платформа содержит следующие модули: 13 | \begin{itemize} 14 | \item Прием и проверка принятых флагов; 15 | \item Таблица результатов; 16 | \item Создание задач на проверку сервисов команд (master сервер); 17 | \item Выполнение задач на проверку сервисов команд (slave сервер); 18 | \end{itemize} 19 | 20 | 21 | \subsection{Модуль: прием и проверка принятых флагов} % - Отчёт flags 22 | \input{individual_reports/flags} 23 | 24 | \subsection{Модуль: таблицы результатов} % - Отчёт scoreboard 25 | \input{individual_reports/scoreboard} 26 | 27 | \subsection{Модуль: организации работы с сервисами} % - Отчёт round 28 | \input{individual_reports/round} 29 | -------------------------------------------------------------------------------- /report/instruments/zabbix.tex: -------------------------------------------------------------------------------- 1 | 2 | Zabbix --- свободная система мониторинга и отслеживания статусов разнообразных сервисов компьютерной сети, серверов и сетевого оборудования. 3 | 4 | Архитектура Zabbix: 5 | \begin{itemize} 6 | \item Zabbix-сервер — это ядро программного обеспечения Zabbix. Сервер может удаленно проверять сетевые сервисы, является хранилищем, в котором находятся все конфигурационные, статистические и оперативные данные; 7 | \item Zabbix-прокси — собирает данные о производительности и доступности от имени Zabbix сервера. Все собранные данные заносятся в буфер на локальном уровне и передаются Zabbix серверу, к которому принадлежит прокси-сервер; 8 | \item Zabbix-агент — контроль локальных ресурсов и приложений (таких как жесткие диски, память, статистика процессора и т. д.) на сетевых системах. Эти системы должны работать с запущенным Zabbix агентом; 9 | \item Веб-интерфейс — интерфейс является частью Zabbix сервера, и, как правило (но не обязательно), запущен на том же физическом сервере, что и Zabbix сервер. Работает на PHP, требует веб-сервер (например, Apache). 10 | \end{itemize} -------------------------------------------------------------------------------- /report/individual_reports/flags.tex: -------------------------------------------------------------------------------- 1 | В соревнованиях по информационной безопасности задача команд найти уязвимость и эксплуатировать её, добывая секретную информацию, в нашем случае флаги. Целью модуля является прием и проверка на валидность флагов. 2 | 3 | \subsubsection{Принцип работы} 4 | 5 | Программа реализована с использованием вебсокетов. Программа "слушает" порт, полученный при инициализации. При входящем соединении программа сравнивает IP адрес клиента с данными в базе данных и при нахождении его, клиент определяется как одна из команд и работа с клиентом продолжается. В противном случае соединение обрывается. Строка проверяется на длину символов, далее строка проверяется на наличие в базе данных, времени его жизни (флаги валидны определенное количество времени), принадлежность другой команде (свои флаги сдавать нельзя), а также статус сервиса (аналогичный сервис сдающей команды должен быть поднят). 6 | 7 | Ниже представлен алгоритм работы flags.py (Рисунок 5.1) 8 | 9 | \begin{figure}[ht!] 10 | \center{\includegraphics[width=0.4\linewidth]{individual_reports/GPO5.png}} 11 | \caption{Алгоритм модуля flags.py} 12 | \end{figure} 13 | 14 | \clearpage 15 | -------------------------------------------------------------------------------- /visualization/theme1/css/index.css: -------------------------------------------------------------------------------- 1 | body{ 2 | background-color: #000; 3 | background-image: url(../images/bg.jpg); 4 | background-repeat: no-repeat; 5 | background-position: 0px 0px; 6 | background-size: 100% 100%; 7 | width: 100%; 8 | height: 100%; 9 | margin: 0px; 10 | padding: 0px; 11 | } 12 | 13 | .teamicon{ 14 | display: inline-block; 15 | color: white; 16 | position: fixed; 17 | width: 70px; 18 | height: 70px; 19 | line-height: 70px; 20 | text-align: center; 21 | top: 50%; 22 | margin-top: -35px; 23 | left: 50%; 24 | margin-left: -35px; 25 | background-color: #000; 26 | border: 1px solid #FFF; 27 | border-radius: 5px; 28 | transition: left 0.5s ease-out 0.5s, top 0.5s ease-out 0.5s; 29 | } 30 | 31 | svg { 32 | position: fixed; 33 | width: 100%; 34 | height: 100%; 35 | } 36 | 37 | .place { 38 | position: fixed; 39 | left: 0px; 40 | width: 100%; 41 | top: 0px; 42 | text-align: left; 43 | color: white; 44 | margin: 0px; 45 | padding: 0px; 46 | padding-left: 10px; 47 | font-size: 80px; 48 | } 49 | 50 | .place.pp0{ 51 | padding-left: 10px; 52 | } 53 | 54 | .place.pp1{ 55 | padding-left: 50px; 56 | } 57 | -------------------------------------------------------------------------------- /report/instruments/python.tex: -------------------------------------------------------------------------------- 1 | Python --- высокоуровневый язык программирования общего назначения, ориентированный на повышение производительности разработчика и читаемости кода. Синтаксис ядра Python минималистичен. В то же время стандартная библиотека включает большой объём полезных функций \cite{python_wiki}. 2 | 3 | 4 | Основные архитектурные черты — динамическая типизация, автоматическое управление памятью, полная интроспекция, механизм обработки исключений, поддержка многопоточных вычислений и удобные высокоуровневые структуры данных. Код в Python организовывается в функции и классы, которые могут объединяться в модули. 5 | 6 | Основными преимуществами языка программирования Python являются большое количество библиотек, кроссплатформенность, широкие возможности профилирования кода. 7 | 8 | Язык обладает чётким и последовательным синтаксисом, продуманной модульностью и масштабируемостью, благодаря чему исходный код написанных на Python программ легко читаем. При передаче аргументов в функции Python использует вызов по соиспользованию. 9 | 10 | Разработка языка Python была начата в конце 1980-х годов сотрудником голландского института CWI Гвидо ван Россумом. -------------------------------------------------------------------------------- /classes/checker/queue.py: -------------------------------------------------------------------------------- 1 | import pika, json 2 | from bson import json_util 3 | 4 | class Queue: 5 | list = [] 6 | queue_name = 'tasks' 7 | 8 | 9 | def __init__(self): 10 | # Устанавливаем соединение 11 | connection = pika.BlockingConnection( 12 | pika.ConnectionParameters( 13 | 'localhost' 14 | ) 15 | ) 16 | self.channel = connection.channel() 17 | 18 | self.channel.queue_declare(queue=self.queue_name) 19 | 20 | def send(self): 21 | pass 22 | 23 | def put(self, **kwargs): 24 | self.list.append(kwargs) 25 | 26 | def run(self): 27 | for task in self.list: 28 | self.channel.basic_publish( 29 | exchange='', 30 | routing_key=self.queue_name, 31 | body=json.dumps(task, default=json_util.default) 32 | ) 33 | 34 | print('Sended') 35 | 36 | def clear(self): 37 | # Если вдруг у нас задания не отправились в очередь 38 | self.list = [] 39 | 40 | # Очищаем очередь, если задания остались 41 | self.channel.queue_purge(queue=self.queue_name) -------------------------------------------------------------------------------- /report/instruments/tex.tex: -------------------------------------------------------------------------------- 1 | \TeX\ --- это созданная американским математиком и программистом Дональдом Кнутом система для вёрстки текстов. Сам по себе \TeX\ представляет собой специализированный язык программирования.Каждая издательская система представляет собой пакет макроопределений этого языка. 2 | 3 | \LaTeX\ --- это созданная Лэсли Лэмпортом издательская система на базе \TeX'а\cite{lvovskyi}. \LaTeX\ позволяет пользователю сконцентрировать свои услия на содержании и структуре текста, не заботясь о деталях его оформления. 4 | 5 | Для подготовки отчётной и иной документации нами был выбран \LaTeX\, так как совместно с системой контроля версий Git он предоставляет возможность совместного создания и редактирования документов. Огромным достоинством системы \LaTeX\ то, что создаваемые с её помощью файлы обладают высокой степенью переносимости \cite{latexrus}. 6 | 7 | Совместно с \LaTeX\ часто используется Bib\TeX\ --- программное обеспечение для создания форматированных списков библиографии. Оно входит в состав дистрибутива \LaTeX\ и позволяет создавать удобную, универсальную и долговечную библиографию. Bib\TeX\ стал одной из причин, по которой нами был выбран \LaTeX\ для создания документации. 8 | -------------------------------------------------------------------------------- /report/eco/services/timur.tex: -------------------------------------------------------------------------------- 1 | Сервис был написан для: 2 | \begin{itemize} 3 | \item проверки корректности работы платформы; 4 | \item выявление возможных проблем, которые могут произойти на соревнованиях; 5 | \item проведения тренировочной игры. 6 | \end{itemize} 7 | 8 | Сервис писался на языке Python с использованием микрофреймворка Flask. 9 | 10 | Тестирование платформы заключалось в тестировании следующий функций: 11 | \begin{itemize} 12 | \item Работа чекера (методы check, get, put); 13 | \item Работа модуля сдачи флагов. 14 | \end{itemize} 15 | 16 | Смысл сервиса состоит в том, что в веб-приложении существует возможность добавления и удаления "to do" записей (задачи для выполнения). Также есть функции регистрации и авторизации, т.е. каждый пользователь видит только свои "to do". 17 | 18 | Сервис содержит несколько уязвимостей: 19 | \begin{itemize} 20 | \item backdoor, с проверкой cookies; 21 | \item внедрение SQL кода в cookies (' OR '1'='1); 22 | \item внедрение SQL запроса в записи "to do" (подмена владельца записи "to do"). 23 | \end{itemize} 24 | 25 | Ниже приведен скриншот работы сервиса (Рисунок 7.2). 26 | \begin{figure}[ht!] 27 | \center{\includegraphics[width=0.8\linewidth]{eco/images/timur_t.png}} 28 | \caption{Сервис todolist} 29 | \end{figure} -------------------------------------------------------------------------------- /report/eco/main.tex: -------------------------------------------------------------------------------- 1 | У организаторов всегда возникает проблема в выборе платформы для проведения соревнований. 2 | 3 | Основные критерии при выборе платформы: 4 | \begin{itemize} 5 | \item стабильность работы; 6 | \item легкость установки и запуска; 7 | \item наличие примеров работы сервиса; 8 | \item наличие документации. 9 | \end{itemize} 10 | 11 | 12 | Стабильность работы и легкость установки были одной из главных задач на этапе проектирования архитектуры платформы и её разработке. Процесс установки и запуска описаны в файле README.md, который находится в репозитории проекта, а также в прилагаемом компакт-диске. 13 | Для решения проблемы наличия примеров работы сервиса, были созданы сервисы: уязвимые программы, общение с которыми осуществляетя платформой через чекеры. 14 | Документация, описывающая процесс установки и запуска, добавляется в зависимости от вопросов и отзывов организаторов соревнований, которые проводили соревнования на платформе. 15 | 16 | Ниже описаны сервисы, использующиеся как пример работы сервиса и позволяющие глубже понять логику работы платформы. 17 | 18 | \subsection{Сервис whoami} 19 | \input{eco/services/dima} 20 | 21 | \subsection{Сервис todolist} 22 | \input{eco/services/timur} 23 | 24 | \subsection{Zabbix} 25 | \input{eco/services/gena} -------------------------------------------------------------------------------- /report/eco/services/gena.tex: -------------------------------------------------------------------------------- 1 | В нашем проекте Zabbix был использован для: 2 | \begin{itemize} 3 | \item мониторинга состояния сети; 4 | \item контролирование ресурсов сервера. 5 | \end{itemize} 6 | 7 | Была проделана следующая работа: 8 | \begin{itemize} 9 | \item был установлен и настроен Zabbix-сервер; 10 | \item для роутера и свитча были написаны шаблоны для получения данных по SNMP; 11 | \item для сервера был установлен и настроен Zabbix-агент, для получения данных с агента используется стандартный шаблон. 12 | \end{itemize} 13 | 14 | Пример вывода информации об отслеживаемом сервере представлен на рисунке 7.3. 15 | \begin{figure}[ht!] 16 | \center{\includegraphics[width=0.8\linewidth]{eco/images/zbx.jpg}} 17 | \caption{Просмотр данных о сервере} 18 | \end{figure} 19 | 20 | Работа над шаблонами: 21 | \begin{itemize} 22 | \item Для начала были получены с устройств строки OID; 23 | \item Для каждой строки OID было написано правило обнаружения в шаблоне; 24 | \item Далее создавались элементы данных и триггеры; 25 | \item Были созданы несколько графиков. 26 | 27 | Ниже приведен пример готового шаблона (Рисунок 7.4). 28 | \begin{figure}[ht!] 29 | \center{\includegraphics[width=0.8\linewidth]{eco/images/gena_zabbix.jpg}} 30 | \caption{Пример готового шаблона} 31 | \end{figure} -------------------------------------------------------------------------------- /config.ini: -------------------------------------------------------------------------------- 1 | [settings] 2 | ; Start time and end time of game (Unix timestamp) 3 | time_start = 1420070400 4 | time_end = 4575744000 5 | 6 | ; Name of game 7 | name = ctfight-0111 8 | 9 | ; Round length ? min/sec 10 | round_length = 40 11 | 12 | ; Life time of flag ? min/sec 13 | flags_lifetime = 4 14 | 15 | ; Port for send flags 16 | flags_port = 2605 17 | admin_login = root 18 | admin_pass = qwe 19 | 20 | ; checkers config 21 | path_to_checkers = checkers/ 22 | filename_checkers = check 23 | 24 | [teams] 25 | 26 | ; Count of teams 27 | count = 3 28 | 29 | team1_name = Someteam1 30 | team1_network = 10.53.16.1 31 | team1_host = 10.53.16.2 32 | team1_logo = http://localhost/images/team1.jpg 33 | 34 | team2_name = Someteam2 35 | team2_network = 10.53.17.1 36 | team2_host = 10.53.17.2 37 | team2_logo = http://localhost/images/team2.jpg 38 | 39 | team3_name = Someteam3 40 | team3_network = 10.53.18.1 41 | team3_host = 10.53.18.2 42 | team3_logo = http://localhost/images/team3.jpg 43 | 44 | [services] 45 | 46 | count = 2 47 | 48 | ; serviceX_name must be only english charackters, _,-,space and numbers 49 | ; serviceX_program path to script 50 | 51 | service1_name = some_service1 52 | service1_program = tests/services/some_service1/checker.py 53 | 54 | service2_name = some_service2 55 | service2_program = tests/services/some_service2/checker.py 56 | -------------------------------------------------------------------------------- /report/referat.tex: -------------------------------------------------------------------------------- 1 | \newpage 2 | \ESKDthisStyle{empty} 3 | \paragraph{\hfill РЕФЕРАТ \hfill} 4 | 5 | Отчет содержит \ESKDtotal{page} страниц, \ESKDtotal{figure} рисунков, \ESKDtotal{bibitem} источников, \ESKDtotal{appendix} приложение. 6 | 7 | %допилить ключевые слова 8 | CTF, ATTACK-DEFENSE, SIBIRCTF, СОРЕВНОВАНИЯ, KEVA, ЗАЩИТА ИНФОРМАЦИИ, ФЛАГИ, ПРИЕМКА ФЛАГОВ, SCOREBOARD, GIT, PYTHON, MONGODB, MONGOOSE, ZABBIX, OPTPARSE, ЧЕКЕРЫ, HTML, CSS, JAVASCRIPT, КОМАНДА, API. 9 | 10 | Цель работы --- доработка программного комплекса, предназначенного для проведения соревнований в области информационной безопасности CTF. 11 | 12 | Задачи, поставленные на данный семестр: 13 | \begin{itemize} 14 | \item Доработка ядра и модулей платформы; 15 | \item Развитие экосистемы платформы; 16 | \item Тестирование программного комплекса в форме тренировок; 17 | \item Проведение SibirCTF на базе разрабатываемой платформы. 18 | \end{itemize} 19 | 20 | Результаты работы в данном семестре: 21 | 22 | \begin{itemize} 23 | \item Проведено соревнования SibirCTF 2016; 24 | \item Доработан модуль работы с чекерами; 25 | \item Созданы сервисы; 26 | \item Написана документация для администраторов; 27 | \item Построена сеть для проведения соревнования SibirCTF; 28 | \item Проведены соревнования SibsutisCTF 2016. 29 | \end{itemize} 30 | 31 | Пояснительная записка выполнена при помощи системы компьютерной вёрстки \LaTeX. 32 | -------------------------------------------------------------------------------- /config/game.json: -------------------------------------------------------------------------------- 1 | { 2 | "settings": { 3 | "time": { 4 | "start":1446314400, 5 | "end":1448906400 6 | }, 7 | "name":"", 8 | "round_length":40, 9 | "flags": { 10 | "lifetime":4, 11 | "port":2605 12 | }, 13 | "admin":{ 14 | "login":"root", 15 | "pass":"qwe" 16 | } 17 | }, 18 | 19 | "teams": [ 20 | { 21 | "name":"Dima", 22 | "network":"10.53.254.155", 23 | "host":"10.53.254.155", 24 | "logo":"http://localhost/images/keva.jpg" 25 | }, 26 | { 27 | "name":"Tima", 28 | "network":"10.53.254.127", 29 | "host":"10.53.254.127", 30 | "logo":null 31 | }, 32 | { 33 | "name":"Dima N.", 34 | "network":"10.53.254.163", 35 | "host":"10.53.254.163", 36 | "logo":null 37 | }, 38 | { 39 | "name":"Maslyata", 40 | "network":"10.53.254.138", 41 | "host":"10.53.254.138", 42 | "logo":null 43 | }, 44 | { 45 | "name":"ADS", 46 | "network":"10.53.254.125", 47 | "host":"10.53.254.125", 48 | "logo":null 49 | }, 50 | { 51 | "name":"Maxim", 52 | "network":"10.53.254.126", 53 | "host":"10.53.254.126", 54 | "logo":null 55 | }, 56 | { 57 | "name":"Lexa", 58 | "network":"10.53.254.143", 59 | "host":"10.53.254.143", 60 | "logo":null 61 | }, 62 | { 63 | "name":"Rita", 64 | "network":"10.53.254.134", 65 | "host":"10.53.254.134", 66 | "logo":null 67 | } 68 | ], 69 | 70 | "services": {} 71 | } -------------------------------------------------------------------------------- /report/eco/services/dima.tex: -------------------------------------------------------------------------------- 1 | При разработке сервиса было поставлено несколько целей: 2 | \begin{itemize} 3 | \item Тестирование программного комплекса; 4 | \item Проведение тренировочной игры для команды; 5 | \item Упаковка сервиса в <<стартовый набор>> для ознакомления. 6 | \end{itemize} 7 | 8 | Сервис написан на языке Python с использованием базы данных MongoDB и микрофреймворка Flask. 9 | 10 | Тестирование платформы заключалось в тестировании следующий функций: 11 | \begin{itemize} 12 | \item Работа чекера (методы check, get, put); 13 | \item Работа модуля сдачи флагов; 14 | \item Работа платформы в условиях медленного <<ответа>> сервиса. 15 | \end{itemize} 16 | 17 | Смысл сервиса состоит в том, что при регистрации пользователь указывает свою электронную почту, пароль и имя. 18 | Если пользователь уже регистрировался, то он просто входит в систему, при условии, что логин и пароль совпадают (Рисунок 6.1). Далее пользователь видит приветственное сообщение в формате <<Привет, <имя пользователя>>> 19 | 20 | 21 | В сервисе содержится несколько уязвимостей: 22 | \begin{itemize} 23 | \item Открытый порт БД (незащищенный паролем); 24 | \item Уязвимость в данных cookie. 25 | \end{itemize} 26 | 27 | Скриншот работы сервиса представлен на рисунке 7.1. 28 | 29 | \begin{figure}[ht!] 30 | \center{\includegraphics[width=0.5\linewidth]{eco/images/dima_main.png}} 31 | \caption{Форма авторизации сервиса} 32 | \end{figure} 33 | \newpage 34 | -------------------------------------------------------------------------------- /report/problem_form.tex: -------------------------------------------------------------------------------- 1 | На данный семестр были поставлены следующие задачи: 2 | 3 | \begin{itemize} 4 | \item определение индивидуальных задач для каждого участника проектной группы; 5 | \item исследование предметных областей в рамках индивидуальных задач; 6 | \item доработка и тестирование программных модулей; 7 | \item проведение соревнований SibirCTF. 8 | \end{itemize} 9 | 10 | Задачи, связанные с разработкой программного комплекса: 11 | 12 | \begin{enumerate} 13 | \item доработка ядра платформы; 14 | \item доработка модуля проверяющей системы; 15 | \item доработка модуля сдачи флага; 16 | \end{enumerate} 17 | 18 | Задачи, связанные с развитием экосистемы: 19 | 20 | \begin{enumerate} 21 | \item создание сервисов; 22 | \item создание руководства администратора; 23 | \item продвижение платформы в CTF сообществе. 24 | \end{enumerate} 25 | 26 | Задачи, связанные с тестированием программного комплекса: 27 | 28 | \begin{enumerate} 29 | \item проверка работы ядра; 30 | \item проверка работы модуля проверяющей системы; 31 | \item проверка работы модуля сдачи флага; 32 | \item проверка работы модуля рейтинговой таблицы; 33 | \item проверка работы модуля администраторской панели; 34 | \item проверка работы всех модулей с помощью нагрузочного тестирования. 35 | \end{enumerate} 36 | 37 | Задачи, связанные с проведением соревнований на разрабатываемой платформе: 38 | 39 | \begin{enumerate} 40 | \item подготовка игровых сервисов; 41 | \item добавление информации о командах; 42 | \item слежение за работой платформы при проведении соревнований; 43 | \item аналитическая работы с игровой информацией; 44 | \end{enumerate} -------------------------------------------------------------------------------- /functions.py: -------------------------------------------------------------------------------- 1 | from threading import Timer 2 | from sys import exit 3 | 4 | def set_interval(func, sec): 5 | def func_wrapper(): 6 | set_interval(func, sec) 7 | func() 8 | 9 | t = Timer(sec, func_wrapper) 10 | t.start() 11 | return t 12 | 13 | def get_config(db): 14 | from classes.configsource.configjson import ConfigJson 15 | config = ConfigJson('tmp.config.json') 16 | teams = [] 17 | for team in db.teams.find(): 18 | teams.append(team) 19 | 20 | services = [] 21 | for service in db.services.find(): 22 | services.append(service) 23 | 24 | return { 25 | 'teams': teams, 26 | 'services': services, 27 | 'settings': config.settings 28 | } 29 | 30 | # Some methods for print message 31 | class ConsoleMessage: 32 | def __init__(self): 33 | pass 34 | 35 | 36 | def success(self, str): 37 | print(ConsoleColors.OKGREEN + str + ConsoleColors.ENDC) 38 | 39 | 40 | def info(self, str): 41 | print(ConsoleColors.OKBLUE + str + ConsoleColors.ENDC) 42 | 43 | 44 | def warning(self, str): 45 | print(ConsoleColors.WARNING + str + ConsoleColors.ENDC) 46 | 47 | 48 | def fail(self, str): 49 | print(ConsoleColors.FAIL + str + ConsoleColors.ENDC) 50 | 51 | 52 | Message = ConsoleMessage() 53 | 54 | 55 | # Colors for console 56 | class ConsoleColors: 57 | HEADER = '\033[95m' 58 | OKBLUE = '\033[94m' 59 | OKGREEN = '\033[92m' 60 | WARNING = '\033[93m' 61 | FAIL = '\033[91m' 62 | ENDC = '\033[0m' 63 | BOLD = '\033[1m' 64 | UNDERLINE = '\033[4m' 65 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Support Functions 5 | # 6 | function install_python_deps { 7 | echo Installing Python Deps - Sudo Required! 8 | sudo pip3 install pymongo 9 | sudo pip3 install requests 10 | sudo pip install --upgrade pip setuptools 11 | sudo pip3 install flask 12 | sudo pip3 install pika 13 | } 14 | 15 | # 16 | # Main Install Logic 17 | # 18 | if [ "$(uname)" == "Darwin" ]; then 19 | # Install for Mac 20 | echo Installing for Mac! 21 | 22 | echo Installing Python 3 and Mongo 23 | brew install python3 mongodb 24 | 25 | echo Installing RabbitMQ Server 26 | brew install rabbitmq 27 | 28 | install_python_deps 29 | 30 | echo Moving config/main.sample.py to config/main.py 31 | cp config/main.sample.py config/main.py 32 | 33 | echo Done! 34 | elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then 35 | # Install for Linux 36 | echo Installing for Linux! 37 | 38 | echo Updating apt - sudo required! 39 | sudo apt-get update 40 | 41 | echo Installing Python 3 and pip3 42 | sudo apt-get install python3 python3-pip -y 43 | 44 | echo Installing Mongo 45 | sudo apt-get install mongodb -y 46 | 47 | echo Installing RabbitMQ Server 48 | sudo apt-get install rabbitmq-server -y 49 | 50 | install_python_deps 51 | 52 | echo Moving config/main.sample.py to config/main.py 53 | cp config/main.sample.py config/main.py 54 | 55 | echo Done! 56 | else 57 | echo Install.sh not supported for you OS. Please report your problem https://github.com/shipko/ctf-attack-defense/issues/new 58 | fi 59 | -------------------------------------------------------------------------------- /classes/checker/main.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | from config.main import BASE_PATH 3 | __author__ = 'dmitry' 4 | 5 | 6 | class Checker: 7 | STATUS_CODE = { 8 | 'SUCCESS': 101, 9 | 'CORRUPT': 102, 10 | 'MUMBLE': 103, 11 | 'DOWN': 104 12 | } 13 | 14 | def __init__(self): 15 | pass 16 | 17 | def status(self, popen): 18 | code = popen.returncode 19 | 20 | if code == self.STATUS_CODE['SUCCESS']: 21 | return True 22 | 23 | # if code not in self.STATUS_CODE.values(): 24 | # code = 0 25 | 26 | raise Exception(popen.returncode, popen.stdout.read()) 27 | 28 | def get(self, host, path_to_program, flag, flag_id): 29 | args = (BASE_PATH + path_to_program, "get", host, flag_id, flag) 30 | 31 | popen = subprocess.Popen(args, stdout=subprocess.PIPE) 32 | 33 | popen.wait() 34 | # TODO: сделать запись в лог переменной output 35 | output = popen.stdout.read() 36 | 37 | return self.status(popen) 38 | 39 | def check(self, host, path_to_program): 40 | args = (BASE_PATH + path_to_program, "check", host) 41 | popen = subprocess.Popen(args, stdout=subprocess.PIPE) 42 | popen.wait() 43 | 44 | return self.status(popen) 45 | 46 | def put(self, host, path_to_program, flag, flag_id): 47 | args = (BASE_PATH + path_to_program, "put", host, flag_id, flag) 48 | 49 | popen = subprocess.Popen(args, stdout=subprocess.PIPE) 50 | popen.wait() 51 | 52 | output = popen.stdout.read() 53 | 54 | return self.status(popen) 55 | -------------------------------------------------------------------------------- /report/instruments/git.tex: -------------------------------------------------------------------------------- 1 | Для разработки программного комплекса для проведения соревнований в области информационной безопасности было решено использовать Git. 2 | 3 | Git --- распределённая система управления версиями файлов. Проект был создан Линусом Торвальдсом для управления разработкой ядра Linux как противоположность системе управления версиями Subversion (также известная как «SVN») \cite{progit}. 4 | 5 | При работе над одним проектом команде разработчикоа необходим инструмент для совместного написания, резервного копирования и тестирования программного обеспечения. Используя Git, мы имеем: 6 | \begin{itemize} 7 | \item Возможность удаленной работы с исходными кодами; 8 | \item Возможность создавать свои ветки, не мешая при этом другим разработчикам; 9 | \item Доступ к последним изменениям в коде, т.к. все исходники хранятся на сервере git.keva.su; 10 | \item Исходные коды защищены, доступ к ним можно получить лишь имея RSA-ключ; 11 | \item Возможность откатиться к любой стабильной стадии проекта. 12 | \end{itemize} 13 | 14 | Основные постулаты работы с кодом в системе Git: 15 | 16 | \begin{itemize} 17 | \item Каждая задача решается в своей ветке; 18 | \item Необходимо делать коммит как только был получен осмысленный результат; 19 | \item Ветка master мержится не разработчиком, а вторым человеком, который производит вычитку и тестирование изменения; 20 | \item Все коммиты должны быть осмысленно подписаны/прокомментированы. 21 | \end{itemize} 22 | 23 | Для работы над проектом был поднят собственный репозиторий на сервере gitlab2.keva.su. 24 | 25 | Исходные файлы проекта: 26 | 27 | git@gitlab2.keva.su:sibirctf/sibirctf-attack-defense.git 28 | -------------------------------------------------------------------------------- /report/individual_reports/network.tex: -------------------------------------------------------------------------------- 1 | SibirCTF 2015: 2 | На прошлогодних соревнования была реализована данная схема сети 3 | \begin{figure}[ht!] 4 | \center{\includegraphics[width=0.8\linewidth]{images/net1.jpg}} 5 | \caption{Схема сети SibirCTF 2015} 6 | \end{figure} 7 | Виртуальная машина каждой команды работала на нашем сервере. У команд были права root. Преимущество данной схемы являлось то, что все команды находились в одинаковых условиях в плане аппартных мощностей. 8 | \newpage 9 | 10 | SibirCTF 2016: 11 | На соревнованиях этого года была реализована немного другая схема сети: 12 | \begin{figure}[ht!] 13 | \center{\includegraphics[width=0.8\linewidth]{images/net2.jpg}} 14 | \caption{Схема сети SibirCTF 2016} 15 | \end{figure} 16 | 17 | По просьбам участников были предоставлены виртуальные машины. В ходе работы сети были обнаружены следующие проблемы: 18 | \begin{itemize} 19 | \item На момент раздачи образов сеть не справилась с нагрузкой. Это было связано с тем, что пропускная способность канала была ограничена, а образ находился на внешнем ресурсе; 20 | \item В конце соревнований пришлось физически отключить одну команду из-за большого объема трафика, который забивал канал. Также сразу становится виден небольшой недостаток данной схемы сети. Раньше все запросы шли в одно место, на сервер виртуальных машин, теперь маршрутизатор должен был рассылать запросы разным командам. Из-за этого маршрутизатор аппаратно не справлялся с нагрузкой. 21 | \end{itemize} 22 | 23 | Выводы, которые были сделаны по итогам соревнований: 24 | 25 | \begin{itemize} 26 | \item Образы надо раздавать на флеш-накопителях; 27 | \item Необходимо заменить аппаратный маршрутизатор на программный (по примеру RuCTF, где он себя отлично показал). 28 | \end{itemize} 29 | -------------------------------------------------------------------------------- /report/title.tex: -------------------------------------------------------------------------------- 1 | \newpage 2 | \ESKDthisStyle{empty} 3 | 4 | \begin{center} 5 | Министерство образования и науки Российской Федерации\\ 6 | Федеральное государственное бюджетное образовательное учреждение высшего профессионального образования\\ 7 | <<ТОМСКИЙ ГОСУДАРСТВЕННЫЙ УНИВЕРСИТЕТ СИСТЕМ УПРАВЛЕНИЯ И РАДИОЭЛЕКТРОНИКИ>> (ТУСУР)\\ 8 | Кафедра комплексной информационной безопасности электронно-вычислительных систем (КИБЭВС)\\ 9 | \end{center} 10 | 11 | \vfill 12 | 13 | \begin{flushright} 14 | \begin{minipage}{0.45\textwidth} 15 | \begin{flushleft} 16 | УТВЕРЖДАЮ\\ 17 | заведующий каф. КИБЭВС 18 | \underline{\hspace{3cm}}А.А. Шелупанов \\ 19 | <<\underline{\hspace{1cm}}>>\underline{\hspace{3cm}}2016г.\\ 20 | \end{flushleft} 21 | \end{minipage} 22 | \end{flushright} 23 | 24 | \vfill 25 | 26 | \begin{center} 27 | ПРОГРАММНЫЙ КОМПЛЕКС ДЛЯ ПРОВЕДЕНИЯ СОРЕВНОВАНИЙ В ОБЛАСТИ ИНФОРМАЦИОННОЙ БЕЗОПАСНОСТИ 28 | 29 | Отчет по групповому проектному обучению 30 | 31 | Группа КИБЭВС-1502 32 | \end{center} 33 | 34 | \vfill 35 | \begin{flushright} 36 | \begin{minipage}{0.45\textwidth} 37 | \begin{flushleft} 38 | Ответственный исполнитель \\ 39 | студент гр. 723 \\ 40 | \underline{\hspace{3cm}}Д.Е. Муковкин \\ 41 | <<\underline{\hspace{1cm}}>>\underline{\hspace{3cm}}2016г.\\ 42 | \end{flushleft} 43 | \end{minipage} 44 | \end{flushright} 45 | 46 | \vfill 47 | 48 | \begin{flushright} 49 | \begin{minipage}{0.45\textwidth} 50 | \begin{flushleft} 51 | Научный руководитель \\ 52 | аспирант каф. КИБЭВС \\ 53 | \underline{\hspace{3cm}}А.И. Гуляев \\ 54 | <<\underline{\hspace{1cm}}>>\underline{\hspace{3cm}}2016г.\\ 55 | \end{flushleft} 56 | \end{minipage} 57 | \end{flushright} 58 | 59 | \vfill 60 | 61 | \begin{center} 62 | 2016 63 | \end{center} 64 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Платформа для проведения игр CTF в формате Attack-defense 2 | ========================================================= 3 | 4 | 5 | Установка 6 | --------- 7 | Автоматизированная установка производится на сервер с операционной системой debian или ubuntu. 8 | 9 | Для установки необходимо перейти в рабочий каталог проекта и запустить install.sh 10 | 11 | ./install.sh 12 | 13 | Установка на другие платформы производится вручную по аналогии. 14 | 15 | Запуск 16 | ------ 17 | Система состоит из отдельных модулей с единой точкой входа. 18 | Для начала необходимо проинициализировать 19 | 20 | python3 main.py init --type=json - для развертывания системы из файла config/game.json 21 | 22 | Для запуска модулей необходимо выполнить команды: 23 | 24 | python3 main.py scoreboard запуск таблицы результатов 25 | python3 main.py flags запуск приемки флагов 26 | python3 main.py start запуск master-сервера для чекеров (посылает информацию в очередь) 27 | python3 main.py start --slave запуск slave-сервера 28 | 29 | English version (sea-kg) 30 | ======================== 31 | # CTF-Attack-Defense System 32 | 33 | The platform for the CTF-competition (Attack-Defense) 34 | 35 | ## Requirements 36 | 37 | * `sudo apt-get install python3 pip3 python3-psutil` 38 | * `sudo apt install mongodb` 39 | * `pip3 install pymongo` 40 | * `pip3 install flask` 41 | 42 | ## Init game 43 | 44 | `python3 main.py init` or `python3 main.py init config.ini` 45 | 46 | ## 1. Start game 47 | `python3 main.py start` 48 | `python3 main.py start --slave` 49 | 50 | ## 2. Start sending flags 51 | `python3 main.py flags` 52 | 53 | ## 3. Run scoreboard (address and port will be printed) 54 | `python3 main.py scoreboard` 55 | -------------------------------------------------------------------------------- /report/lit.bib: -------------------------------------------------------------------------------- 1 | @comment{x-kbibtex-personnameformatting=<%f ><%l><, %s>} 2 | 3 | @book{progit, 4 | added-at = "2011-08-16T15:46:36.000+0200", 5 | author = "{Scott Chacon}", 6 | interhash = "ec1617e7e18c150205bf027b566ef357", 7 | intrahash = "40f70d7bc474085d987786484a09d2bf", 8 | keywords = "git source\_code\_control version\_control", 9 | language = "russian", 10 | timestamp = "2011-08-16T15:46:36.000+0200", 11 | title = "{Pro Git : professional version control [Электронный ресурс]}", 12 | url = "http://progit.org/ebook/progit.pdf", 13 | year = "2011" 14 | } 15 | 16 | @book{valikov, 17 | author = "{Алексей Николаевич Валиков}", 18 | isbn = "5941571291", 19 | language = "russian", 20 | publisher = "{БХВ-Петербург}", 21 | timestamp = "2014.05.29", 22 | title = "{Технология XSLT}", 23 | volume = "544", 24 | year = "2002" 25 | } 26 | 27 | @book{latexrus, 28 | author = "{И. А. Чеботаев, П. З. Котельников}", 29 | language = "russian", 30 | publisher = "Сибирский Хронограф", 31 | timestamp = "2013.12.20", 32 | title = "{\LaTeXe\ по-русски}", 33 | volume = "489", 34 | year = "2004" 35 | } 36 | 37 | @book{lvovskyi, 38 | author = "{С.М. Львовский}", 39 | isbn = "5-94057-091-7", 40 | language = "russian", 41 | owner = "alina", 42 | pages = "448", 43 | publisher = "МЦНМО", 44 | timestamp = "2013.12.20", 45 | title = "{Набор и вёрстка в системе \LaTeX}", 46 | year = "2006" 47 | } 48 | 49 | @article{python_wiki, 50 | language = "russian", 51 | title = "{Python. [Электронный ресурс]}", 52 | url = "https://ru.wikipedia.org/wiki/Python", 53 | year = "2015", 54 | journal = "{ru.wikipedia.org:[сайт]}" 55 | } 56 | 57 | @book{mongo, 58 | language = "english", 59 | timestamp = "2014.05.29", 60 | title = "{The MongoDB 3.2 Manual. [Электронный ресурс]}", 61 | url = "https://docs.mongodb.org/manual/", 62 | year = "2015" 63 | } -------------------------------------------------------------------------------- /report/intro.tex: -------------------------------------------------------------------------------- 1 | CTF (Capture the flag, Захват флага) --- это командные соревнования, целью которых является оценка умения участников атаковать и защищать компьютерные системы. По типу, соревнования делятся на два типа: task-based (квесты), attack-defense (классические соревнования). 2 | 3 | Для проведения соревнований типа attack-defense, каждой команде выдается сервер, на котором имеется ряд сервисов, одинаковые у всех. Сервисами являются программы, которые должны быть запущены на протяжении всего времени соревнований. Раз в минуту жюрейская система проверяет работу сервисов, присылает новый флаг, а также проверяет его наличие на сервере. В роли флага выступает случайно сгенерированная строка, определенной длины. Сервисы заведомо имеют уязвимости, через которые можно украсть флаг. Команда должна найти уязвимости в сервисах и закрыть их. Но также она должна эксплуатировать эти уязвимости на сервисах других команд, похищая флаги. 4 | 5 | Команда Keva имеет большой опыт в проведении соревнований CTF. Во время проведения межрегиональных межвузовских соревнований в области информационной безопасности SibirCTF 2014, 2015 использовались наработки Екатеринбургской команды HackerDom. Однако их решение не подходит нам по некоторым критически важным параметрам. Поэтому было принято решение написать собственную платформу для проведения соревнований CTF. 6 | 7 | Платформа должна отвечать следующим требованиям: 8 | \begin{itemize} 9 | \item Низкое потребление ресурсов сервера; 10 | \item Управление игрой через графический интерфейс; 11 | \item Возможность горизонтального масштабирования. 12 | \end{itemize} 13 | 14 | Новая платформа позволит нам расширить формат проведения соревнований, избавиться от зависимости в использовании чужих программных продуктов, а также решать непредвиденные проблемы в кратчайшие сроки. 15 | 16 | При разработке платформы должны быть использованы уже имеющиеся наработки, в частности, панель администратора и API для task-based проведения соревнований. 17 | -------------------------------------------------------------------------------- /visualization/theme1/js/apigame_emu.js: -------------------------------------------------------------------------------- 1 | window.ApiGame = new function (){ 2 | this.description = "API request for get statistics (Emulation)"; 3 | var self = this; 4 | self.cache = {}; 5 | self.cache.teams = [ 6 | { 7 | 'name': 'yozik', 8 | 'logo': 'images/yozik.png', 9 | 'color': 'white' 10 | }, 11 | { 12 | 'name': 'keva', 13 | 'logo': 'images/keva.png', 14 | 'color': 'yellow' 15 | }, 16 | { 17 | 'name': 'leetmore', 18 | 'logo': 'images/leetmore.png', 19 | 'color': 'pink' 20 | }, 21 | { 22 | 'name': 'brizz', 23 | 'logo': 'images/brizz.png', 24 | 'color': 'red' 25 | }, 26 | { 27 | 'name': 'censored', 28 | 'logo': 'images/censored.png', 29 | 'color': 'green' 30 | }, 31 | { 32 | 'name': 'curiosity', 33 | 'logo': 'images/curiosity.png', 34 | 'color': 'grey' 35 | }, 36 | { 37 | 'name': 'ufologists', 38 | 'logo': 'images/ufologists.png', 39 | 'color': 'purple' 40 | }, 41 | { 42 | 'name': 'honeypot', 43 | 'logo': 'images/honeypot.png' 44 | }, 45 | { 46 | 'name': 'SUSlo.PAS', 47 | 'logo': 'images/SUSlo.PAS.png', 48 | 'color': 'lightgray' 49 | }, 50 | ]; 51 | 52 | self.cache.stat = [] 53 | 54 | for(i in self.cache.teams){ 55 | var stat = { 56 | 'name': self.cache.teams[i].name, 57 | 'score': 0, 58 | 'flags': [] 59 | }; 60 | 61 | for(i1 in self.cache.teams){ 62 | stat['flags'].push({ 63 | 'from': self.cache.teams[i1].name, 64 | 'count': 0 65 | }); 66 | } 67 | self.cache.stat.push(stat) 68 | } 69 | 70 | self.teams = function(){ 71 | return self.cache.teams 72 | }; 73 | 74 | self.stat = function(){ 75 | var d = $.Deferred(); 76 | // emulation network 77 | setTimeout(function(){ 78 | d.resolve(self.cache.stat); 79 | for(i in self.cache.stat){ 80 | var diff = Math.floor(Math.random()*100); 81 | self.cache.stat[i].score += diff; 82 | 83 | for(i1 in self.cache.stat[i].flags){ 84 | self.cache.stat[i].flags[i1].count = Math.floor(Math.random()*10) < 7 ? 0 : 1; 85 | } 86 | } 87 | }, 100); 88 | return d; 89 | }; 90 | }; 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /classes/statistic.py: -------------------------------------------------------------------------------- 1 | from config.main import CHECKER 2 | 3 | class Statistic: 4 | codes = { 5 | 'UP': 101, 6 | 'CORRUPT': 102, 7 | 'MUMBLE': 103, 8 | 'DOWN': 104 9 | } 10 | 11 | def __init__(self, db, config): 12 | self.db = db 13 | self.config = config 14 | 15 | pass 16 | 17 | # Подводим итоги последнего раунда и сохраняем в базу 18 | def summary(self, round): 19 | scoreboard = self.db.scoreboard.find() 20 | status_service = {} 21 | for item in scoreboard: 22 | status_service[item['team']['name'] + '_' + item['service']['name']] = self.codes[item['status']] 23 | 24 | print(status_service) 25 | for team in self.config.get_all_teams(): 26 | for service in self.config.get_all_services(): 27 | last_legacy_round = round - CHECKER['LENGTH'] 28 | 29 | count_attack = self.db.stolen_flags.find({ 30 | 'team._id': team['_id'], 31 | 'flag.service._id': service['_id'], 32 | 'round': last_legacy_round if last_legacy_round > 0 else 0 33 | }).count() 34 | 35 | if team['name'] + '_' + service['name'] in status_service and status_service[team['name'] + '_' + service['name']] == 101: 36 | count_defense = self.db.flags.find({ 37 | 'team._id': team['_id'], 38 | 'service._id': service['_id'], 39 | 'round': round, 40 | 'stolen': False 41 | }).count() 42 | else: 43 | count_defense = 0 44 | 45 | self.db.scoreboard.update_one( 46 | { 47 | 'team._id': team['_id'], 48 | 'service._id': service['_id'] 49 | }, 50 | { 51 | '$inc': { 52 | 'attack': count_attack, 53 | 'defense': count_defense 54 | } 55 | } 56 | ) 57 | -------------------------------------------------------------------------------- /classes/config/put.py: -------------------------------------------------------------------------------- 1 | import requests, os, sys, json 2 | 3 | from config.main import API_SERVER 4 | from functions import Message 5 | 6 | 7 | class Put: 8 | loaded = False 9 | 10 | path_to_config_file = 'config/game.json' 11 | settings = { 12 | 'path_to_checkers': 'checkers', 13 | 'filename_checkers': 'check' 14 | } 15 | 16 | services = {}, 17 | teams = {}, 18 | 19 | def __init__(self, args): 20 | self.args = args 21 | 22 | Message.info('Get config from ' + self.args.type) 23 | 24 | if self.args.type == 'json': 25 | self.from_json() 26 | else: 27 | self.from_api() 28 | 29 | if not self.loaded: 30 | Message.fail("Couldn't get config...Exit") 31 | sys.exit(0) 32 | 33 | def from_api(self): 34 | try: 35 | # Определяем путь до API сервера (откуда мы получаем команды) 36 | api_url = self.args.url if self.args.url != '' else API_SERVER 37 | 38 | if api_url == '': 39 | Message.fail('API server url is not defined in config/main.py.') 40 | Message.fail('Use python3 main.py init --url=\'SOME_URL\' instead') 41 | sys.exit(0) 42 | 43 | response = requests.get(api_url).json() 44 | data = response['response'] 45 | 46 | self.services = data["services"] 47 | self.teams = data["teams"] 48 | 49 | self.settings.update(data["settings"]) 50 | 51 | self.loaded = True 52 | except Exception as e: 53 | print(e) 54 | Message.fail('Error with requests in response') 55 | 56 | def from_json(self): 57 | if not os.path.isfile(self.path_to_config_file): 58 | Message.fail('File not found: ' + self.path_to_config_file) 59 | return 60 | 61 | self.filename = self.path_to_config_file 62 | 63 | try: 64 | with open(self.filename) as data_file: 65 | data = json.load(data_file) 66 | 67 | self.settings = data['settings'] 68 | self.teams = data['teams'] 69 | self.services = data['services'] 70 | 71 | self.loaded = True 72 | except KeyError as e: 73 | Message.fail('Not found parameter ' + str(e) + ' in ' + self.path_to_config_file) 74 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | from config.main import * 2 | from pymongo import MongoClient 3 | 4 | import functions 5 | import argparse 6 | 7 | client = MongoClient(host=DATABASE['HOST'], port=DATABASE['PORT']) 8 | #client.jury.authenticate('keva', 'i_want_want_sleep') 9 | db = client.jury 10 | 11 | def init(parse): 12 | from classes.initialize import Initialize 13 | 14 | Initialize(db, parse) 15 | 16 | 17 | def start(parse): 18 | if parse.slave: 19 | from classes.zond import Zond 20 | 21 | zond = Zond(db) 22 | 23 | zond.run() 24 | 25 | else: 26 | from classes.round import Round 27 | 28 | round = Round(db) 29 | round.next() 30 | 31 | functions.set_interval(round.next, CHECKER['ROUND_LENGTH']) 32 | 33 | 34 | def flags(parse): 35 | from classes.flags import Flags 36 | 37 | flags = Flags(db) 38 | flags.start() 39 | 40 | 41 | def scoreboard(parse): 42 | from classes.scoreboard import Scoreboard 43 | 44 | scoreboard = Scoreboard(db) 45 | scoreboard.start() 46 | 47 | if __name__ == '__main__': 48 | parser = argparse.ArgumentParser(description='The platform for the CTF-competition (Attack-Defense)', 49 | epilog='''Order of actions: init -> start -> flags -> scoreboard. 50 | Good game!''') 51 | 52 | sp = parser.add_subparsers(help='sub-command help') 53 | 54 | sp_init = sp.add_parser('init', help='Initialize the game. Generate teams, services, statistics.') 55 | sp_init.add_argument('--type', help='type of configuration file', nargs='?', default='api') 56 | sp_init.add_argument('--url', help='API server URL ', type=str, default='',) 57 | 58 | sp_init.set_defaults(func=init) 59 | 60 | sp_start = sp.add_parser('start', help='Run checkers and start the game.') 61 | sp_start.add_argument('--slave', help='Run as slave', action='store_true') 62 | sp_start.set_defaults(func=start) 63 | 64 | sp_flags = sp.add_parser('flags', help='The start of the module "flags"') 65 | sp_flags.set_defaults(func=flags) 66 | 67 | sp_scoreboard = sp.add_parser('scoreboard', help='Run scoreboard') 68 | sp_scoreboard.set_defaults(func=scoreboard) 69 | 70 | if 'func' in parser.parse_args(): 71 | parser.parse_args().func(parser.parse_args()) 72 | else: 73 | parser.print_help() 74 | 75 | 76 | -------------------------------------------------------------------------------- /report/instruments/mongo.tex: -------------------------------------------------------------------------------- 1 | Для реализации программного комплекса для проведения соревнований в области информационной безопасноти была использована база данных MongoDB. 2 | 3 | MongoDB --- документо-ориентированная система управления базами данных (СУБД) с открытым исходным кодом, не требующая описания схемы таблиц. Написана на языке C++. \cite{mongo}. 4 | 5 | Основные возможности MongoDB: 6 | \begin{itemize} 7 | \item Документо-ориентированное хранение (JSON-подобная схема данных); 8 | \item Достаточно гибкий язык для формирования запросов; 9 | \item Динамические запросы; 10 | \item Поддержка индексов; 11 | \item Профилирование запросов; 12 | \item Быстрые обновления «на месте»; 13 | \item Эффективное хранение двоичных данных больших объёмов, например, фото и видео; 14 | \item Журналирование операций, модифицирующих данные в базе данных; 15 | \item Поддержка отказоустойчивости и масштабируемости: асинхронная репликация, набор реплик и распределения базы данных на узлы; 16 | \item Возможность работы в соответствии с парадигмой MapReduce; 17 | \item Полнотекстовый поиск, в том числе на русском языке, с поддержкой морфологии. 18 | \end{itemize} 19 | 20 | Архитектура: 21 | 22 | СУБД управляет наборами JSON-подобных документов, хранимых в двоичном виде в формате BSON. Хранение и поиск файлов в MongoDB происходит благодаря вызовам протокола GridFS. Подобно другим документо-ориентированным СУБД (CouchDB и др.), MongoDB не является реляционной СУБД. В СУБД: 23 | 24 | \begin{itemize} 25 | \item Нет такого понятия, как «транзакция». Атомарность гарантируется только на уровне целого документа, то есть частичного обновления документа произойти не может; 26 | \item Отсутствует понятие «изоляции». Любые данные, которые считываются одним клиентом, могут параллельно изменяться другим клиентом. 27 | \end{itemize} 28 | 29 | В MongoDB реализована асинхронная репликация в конфигурации «ведущий — ведомый» (англ. master — slave), основанная на передаче журнала изменений с ведущего узла на ведомые. Поддерживается автоматическое восстановление в случае выхода из строя ведущего узла. Серверы с запущенным процессом mongod должны образовать кворум, чтобы произошло автоматическое определение нового ведущего узла. Таким образом, если не используется специальный процесс-арбитр (процесс mongod, только участвующий в установке кворума, но не хранящий никаких данных), количество запущенных реплик должно быть нечётным. 30 | -------------------------------------------------------------------------------- /starter_allinone.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | import subprocess 5 | import os 6 | import subprocess 7 | from time import sleep 8 | import json 9 | import psutil 10 | import datetime 11 | import threading 12 | 13 | pids = { 14 | 'pid_start' : 0, 15 | 'pid_flags' : 0, 16 | 'pid_scoreboard' : 0, 17 | } 18 | 19 | pid_start = 0 20 | pid_flags = 0 21 | pid_scoreboard = 0 22 | 23 | directory = "starter_allinone.d" 24 | 25 | if not os.path.exists(directory): 26 | os.makedirs(directory) 27 | 28 | def save_pids(): 29 | with open(directory + "/pids.json", 'w') as outfile: 30 | json.dump(pids, outfile) 31 | 32 | if os.path.isfile(directory + "/pids.json"): 33 | with open(directory + "/pids.json") as data_file: 34 | pids = json.load(data_file) 35 | else: 36 | save_pids(); 37 | 38 | logfile = open(directory + "/allinone.log", "w") 39 | 40 | def processIsRun(pid): 41 | return True 42 | 43 | def printMessage(command, s): 44 | s2 = command + ": [" + str(datetime.datetime.now()) + "] " + s 45 | logfile.write(s2 + "\n"); 46 | print(s2) 47 | 48 | def tee_pipe(command, pipe): 49 | for line in pipe: 50 | printMessage(command, line.decode("utf-8").strip()) 51 | 52 | threads = {} 53 | processes = {} 54 | 55 | def checkAndRun(command): 56 | if pids['pid_' + command] == 0: 57 | processes[command] = subprocess.Popen(["python3", "main.py", command], stdout=subprocess.PIPE, stderr=subprocess.PIPE) 58 | pids['pid_' + command] = processes[command].pid 59 | threads[command + 'pipeout'] = threading.Thread(target=tee_pipe, args=(command, processes[command].stdout)) 60 | threads[command + 'pipeout'].start(); 61 | threads[command + 'pipeerr'] = threading.Thread(target=tee_pipe, args=(command, processes[command].stderr)) 62 | threads[command + 'pipeerr'].start(); 63 | 64 | printMessage("","Up 'main.py " + command + "' => " + str(pids['pid_' + command])) 65 | print(processes[command].poll()) 66 | save_pids() 67 | else: 68 | if not psutil.pid_exists(pids['pid_' + command]): 69 | printMessage("", "Not found 'main.py " + command + "' => " + str(pids['pid_' + command])) 70 | pids['pid_' + command] = 0 71 | save_pids() 72 | else: 73 | p = processes[command].poll() # need for kill zombie 74 | # print(str(pids['pid_' + command]) + ' exists ' + str(p)) 75 | 76 | while True: 77 | # print("123 === ") 78 | checkAndRun('start'); 79 | checkAndRun('flags'); 80 | checkAndRun('scoreboard'); 81 | sleep(5) # every 30 seconds check and try run 82 | -------------------------------------------------------------------------------- /report/technical_attributes.tex: -------------------------------------------------------------------------------- 1 | \subsection {Требования к аппаратному обеспечению} 2 | 3 | Необходимо не менее двух компьютеров, находящихся в локальной сети (компьютеры команд-участников), а также сервер, на котором запускается платформа. 4 | 5 | Минимальные системные требования для сервера: 6 | 7 | \begin{itemize} 8 | \item процессор 1ГГц Pentium 4; 9 | \item оперативная память 512 Мб; 10 | \item место на жёстком диске -- 9 Гб. 11 | \end{itemize} 12 | 13 | Минимальные системные требования для компьютеров команд-участников определяются исходя из написанных сервисов. 14 | 15 | \subsection {Требования к программному обеспечению} 16 | Для корректной работы разрабатываемого программного комплекса сервер должен работать под управлением ОС Ubuntu Linux. 17 | Также должны быть установлены следующие пакеты: Python 3.X, MongoDB, PHP 5, MySQL, RabbitMQ, Веб-сервер Apache 2 или Nginx. 18 | 19 | 20 | Требования к ПО команд-участников выставляются уже при непосредственном проведении соревнований. 21 | 22 | \subsection {Требования к сервисам} 23 | Для каждого сервиса необходимо иметь следующие компоненты: 24 | 25 | \begin{itemize} 26 | \item сервис - программа, имеющая уязвимости; 27 | \item чекер - программа, реализующая интерфейс работы между сервисом и проверяющей системой. 28 | \end{itemize} 29 | 30 | Чекер должен содержать в себе 3 метода: 31 | 32 | \begin{enumerate} 33 | \item Check --- проверка доступности сервиса. В параметрах передается адрес сервиса команды-участника; 34 | \item Put --- отправление флага на сервис команды-участника. В параметрах передается адрес сервиса, идентификатор флага и флаг; 35 | \item Get --- получение флага по его идентификатору. В параметрах передается адрес сервиса, идентификатор флага и флаг. 36 | \end{enumerate} 37 | 38 | Вызов чекера происходит при помощью вызова исполняемого файла с необходимыми параметрами. Первым параметром является название метода. 39 | В ответ чекер должен возвращать одно из четырех состояний, обозначенного кодами 101-104: 40 | \begin{itemize} 41 | \item 101 --- сервис команды работает и работает корректно; 42 | \item 102 --- сервис команды работает, но на каком-то этапе отвечает некорректно; 43 | \item 103 --- сервис команды отвечает, но не работает из-за какой-либо ошибки; 44 | \item 104 --- сервис команды не отвечает на запрос. 45 | \end{itemize} 46 | 47 | 48 | \clearpage 49 | Ниже приведен шаблон кода программы чекера. Шаблон написан на языке Python. 50 | 51 | 52 | 53 | \lstinputlisting[language=Python]{individual_reports/programs/python_sample.py} 54 | \clearpage -------------------------------------------------------------------------------- /classes/initialize.py: -------------------------------------------------------------------------------- 1 | from classes.config.put import Put as ConfigPut 2 | import os, stat 3 | from functions import Message 4 | 5 | class Initialize: 6 | config = '' 7 | db = {} 8 | teams = [] 9 | services = [] 10 | settings = [] 11 | 12 | def __init__(self, db, args): 13 | self.db = db 14 | 15 | self.config = ConfigPut(args) 16 | 17 | self.delete_old_data() 18 | self.create_teams() 19 | self.create_service() 20 | self.generate_scoreboard() 21 | 22 | def delete_old_data(self): 23 | Message.info('Removing old data ... ') 24 | 25 | self.db.teams.delete_many({}) 26 | self.db.services.delete_many({}) 27 | self.db.scoreboard.delete_many({}) 28 | self.db.flags.delete_many({}) 29 | self.db.stolen_flags.delete_many({}) 30 | 31 | Message.info('\tDone') 32 | 33 | def create_teams(self): 34 | Message.success('Generate teams') 35 | 36 | for e in self.config.teams: 37 | Message.info("\tInit team {" + e["name"] + "} (Network: " + e["network"] + ")"); 38 | self.db.teams.insert_one(e) 39 | 40 | def create_service(self): 41 | Message.success('Generate services') 42 | 43 | for e in self.config.services: 44 | Message.info("\tInit service {" + e["name"] + "}"); 45 | 46 | self.db.services.insert_one(e) 47 | self.create_program(e['name'], e['program']) 48 | 49 | def create_program(self, filename, program): 50 | path_to_checkers = self.config.settings['path_to_checkers'] 51 | if not os.path.exists(path_to_checkers): 52 | os.mkdir(path_to_checkers, mode=0o777) 53 | 54 | folder = path_to_checkers + '/' + filename 55 | file_path = folder + '/' + self.config.settings['filename_checkers'] 56 | 57 | if not os.path.exists(folder): 58 | os.mkdir(folder, mode=0o777) 59 | 60 | file = open(file_path, 'w') 61 | file.write(program + "\r\n") 62 | file.close() 63 | 64 | # Выставляем права на выполнение 65 | os.chmod(file_path, 0o777) 66 | 67 | def generate_scoreboard(self): 68 | Message.success('Generate scoreboard') 69 | 70 | for team in self.db.teams.find({}): 71 | for service in self.db.services.find({}): 72 | self.db.scoreboard.insert_one({ 73 | 'team': team, 74 | 'service': service, 75 | 'status': 'UP', 76 | 'message': '', 77 | 'up_round': 0, 78 | 'attack': 0, 79 | 'defense': 0 80 | }) 81 | -------------------------------------------------------------------------------- /classes/round.py: -------------------------------------------------------------------------------- 1 | from config.main import CHECKER_METHOD 2 | from functions import Message 3 | 4 | 5 | 6 | from classes.checker.threads import Threads 7 | from classes.statistic import Statistic 8 | from classes.config.get import ConfigGet 9 | 10 | import random 11 | import string 12 | import pymongo 13 | 14 | class Round: 15 | db = {} 16 | 17 | round_count = 0 18 | 19 | def __init__(self, db): 20 | self.db = db 21 | self.config = ConfigGet(self.db) 22 | 23 | self.statistic = Statistic(self.db, self.config) 24 | 25 | self.status_service = {} 26 | 27 | # if CHECKER_METHOD == 'queue': 28 | from classes.checker.queue import Queue 29 | self.checkerManager = Queue() 30 | # else: 31 | # self.checkerManager = Threads() 32 | 33 | 34 | Message.info('Get last round number') 35 | 36 | self.get_round_number() 37 | 38 | Message.info('\t Last round number - ' + str(self.round_count)) 39 | 40 | Message.success('All ready!') 41 | Message.info('Now use python3 main.py init --slave for starting slave client') 42 | 43 | def next(self): 44 | #TODO: косяк в status_service 45 | # Подводим итоги предыдущего раунда 46 | 47 | self.statistic.summary(self.round_count) 48 | # Очищаем предыдущие задачи 49 | self.checkerManager.clear() 50 | 51 | self.round_count += 1 52 | 53 | Message.success('Round: ' + str(self.round_count)) 54 | 55 | for team in self.config.get_all_teams(): 56 | for service in self.config.get_all_services(): 57 | flag = self.generate_flags() 58 | flag_id = self.generate_flag_ids() 59 | 60 | print(team['name'] + ' ' + service['name'] + ' ' + flag) 61 | 62 | self.checkerManager.put( 63 | team = team, 64 | service = service, 65 | flag = flag, 66 | flag_id = flag_id, 67 | round = self.round_count 68 | ) 69 | 70 | self.checkerManager.run() 71 | 72 | def generate_flags(self): 73 | flag = ''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for x in range(33)) 74 | flag += '=' 75 | 76 | return flag 77 | 78 | def generate_flag_ids(self): 79 | return ''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for x in range(10)) 80 | 81 | # Получаем номер раунда 82 | def get_round_number(self): 83 | self.round_count = self.db.flags.find().sort([('round', pymongo.DESCENDING)]).limit(1) 84 | 85 | self.round_count = self.round_count[0]['round'] if self.round_count.count() else 0 86 | -------------------------------------------------------------------------------- /report/config.tex: -------------------------------------------------------------------------------- 1 | \documentclass[12pt]{eskdtext} 2 | \usepackage[numbertop, numbercenter]{eskdplain} 3 | \usepackage[utf8x]{inputenc} 4 | \usepackage{listings} 5 | % - Подключаем шрифты из пакета scalable-cyrfonts-tex 6 | \usepackage{cyrtimes} 7 | 8 | % - Отступ красной строки 9 | \setlength{\parindent}{1.25cm} 10 | 11 | % - Убирает точку в списке литературы 12 | \makeatletter 13 | \def\@biblabel#1{#1 } 14 | 15 | % - Точки для всех пунктов в оглавлении 16 | \renewcommand*{\l@section}{\@dottedtocline{1}{1.5em}{2.3em}} 17 | \renewcommand*{\l@subsection}{\@dottedtocline{1}{1.5em}{2.3em}} 18 | \renewcommand*{\l@subsubsection}{\@dottedtocline{1}{1.5em}{2.3em}} 19 | 20 | % - Для переопределения списков 21 | \renewcommand{\theenumi}{\arabic{enumi}} 22 | \renewcommand{\labelenumi}{\theenumi)} 23 | \makeatother 24 | 25 | \usepackage{enumitem} 26 | \setlist{nolistsep, itemsep=0.3cm,parsep=0pt} 27 | 28 | % - ГОСТ списка литературы 29 | \bibliographystyle{utf8gost705u} 30 | 31 | % - Верикальные отступы заголовков 32 | \ESKDsectSkip{section}{1em}{1em} 33 | \ESKDsectSkip{subsection}{1em}{1em} 34 | \ESKDsectSkip{subsubsection}{1em}{1em} 35 | 36 | % - Изменение заголовков 37 | \usepackage{titlesec} 38 | \titleformat{\section}{\centering\normalfont\normalsize}{\thesection}{1.0em}{} 39 | \titleformat{\subsection}{\centering\normalfont\normalsize}{\thesubsection}{1.0em}{} 40 | \titleformat{\subsubsection}{\centering\normalfont\normalsize}{\thesubsubsection}{1.0em}{} 41 | \titleformat{\paragraph}{\centering\normalsize}{\theparagraph}{1.0em}{} 42 | 43 | % - Оставим место под ТЗ 44 | %\setcounter{page}{4} 45 | 46 | % - Для больших таблиц 47 | \usepackage{longtable} 48 | \usepackage{tabularx} 49 | \renewcommand{\thetable}{\thesection.\arabic{table}} 50 | 51 | % - Используем графику в документе 52 | \usepackage{graphicx} 53 | \graphicspath{{images/}} 54 | \renewcommand{\thefigure}{\thesection.\arabic{figure}} 55 | 56 | % - Счётчики 57 | \usepackage{eskdtotal} 58 | 59 | % - Выравнивание по ширине 60 | \sloppy 61 | 62 | % - Разрешить перенос двух последних букв слова 63 | \righthyphenmin=2 64 | 65 | \RequirePackage{enumitem} 66 | \renewcommand{\alph}[1]{\asbuk{#1}} 67 | \setlist{nolistsep} 68 | \setitemize[1]{label=--, fullwidth, itemindent=\parindent, 69 | listparindent=\parindent}% для дефисного списка 70 | \setenumerate[1]{label=\arabic*), fullwidth, itemindent=\parindent, 71 | listparindent=\parindent}% для нумерованного списка 72 | \setenumerate[2]{label=\alph*), fullwidth, itemindent=\parindent, 73 | listparindent=\parindent, leftmargin=\parindent}% для списка 2-ой ступени, который будет нумероваться а), б) и т.д. 74 | 75 | % - Оформляем листинг кода (не использовать комментарии на русском!) 76 | \usepackage{listings} 77 | \lstset{basicstyle=\ttfamily\small} 78 | \lstset{extendedchars=\true} 79 | 80 | % - выводим текст как есть с размером шрифта scriptsize 81 | \makeatletter 82 | \def\verbatim{\scriptsize\@verbatim \frenchspacing\@vobeyspaces \@xverbatim} 83 | \makeatother 84 | -------------------------------------------------------------------------------- /report/individual_reports/round.tex: -------------------------------------------------------------------------------- 1 | Основное назначение платформы - общение с сервисами команд-участников посредством отправки и проверки специально сгенерированных флагов на сервере. Предназначение этого модуля - работа с интерфейсом сервисов (чекерами). 2 | 3 | \subsubsection{Принцип работы} 4 | Игра делится на раунды, обычно длится 1 минуту (настраивается при инициализации). Интерфейс для работы модуля с сервисом называется чекер. Каждый раунд модуль генерирует задания на проверку всех сервисов команд-участников (master сервер). Далее, задания отправляются в очередь, где ожидают, что их получат сервера, отвечающие за взаимодействие с сервисами команд-участников (slave сервер). После выполнения задачи slave сервер отправляет подтверждение master серверу, который, в свою очередь, делает запись в БД, о завершении проверки. Такая структура взаимодействия модуля с сервисами дает возможность горизонтального масштабирования системы без особых трудностей. Структура ваимодействия master сервера со slave серверами представлена на рисунке 5.4. 5 | 6 | \begin{figure}[ht!] 7 | \center{\includegraphics[width=1.0\linewidth]{images/module_round_structure.png}} 8 | \caption{Иерархическая структура взаимодействия модуля с сервисами} 9 | \end{figure} 10 | 11 | Проверка сервиса команды slave сервером происходит в три этапа: 12 | \begin{enumerate} 13 | \item Проверка работоспособности сервиса команды-участника; 14 | \item Отправление флага на сервис; 15 | \item Проверка того, что флаг сохранен. 16 | \end{enumerate} 17 | 18 | На каждом этапе модуль ожидает в ответ один из четырех чисел: 101, 102, 103, 104. Эти числа также называются статусом сервиса команды-участника. 19 | 20 | 21 | 22 | Число 101 соответствует успешной работе сервиса команды-участника. Число 102 означает, что сервис команды работает, но на каком-то этапе отвечает некорректно. Число 103 означает, сервис команды отвечает, но не работает из-за какой-либо ошибки. Число 104 означает, что сервис команды не отвечает на запрос. 23 | 24 | Если на каком-то этапе чекер возвращает число отличное от 101, дальнейшее выполнение программы прекращается, а статус чекера записывается в базу данных. 25 | 26 | На 1 этапе каждому чекеру посылается адрес сервера команды-участника. 27 | На 2 этапе каждому чекеру посылается адрес сервера, идентификатор флага и сам флаг. 28 | На 3 этапе каждому чекеру посылается адрес сервера, идентификатор флага и сам флаг. 29 | 30 | Алгоритм работы представлен на рисунке 5.5. 31 | \begin{figure}[ht!] 32 | \center{\includegraphics[width=0.3\linewidth]{images/module_round_toservice.png}} 33 | \caption{Блок-схема работы с каждым сервисом каждой команды-участника} 34 | \end{figure} 35 | 36 | Также доступен вариант без использования сервера очередей, основанный на многопоточности. Каждому потоку задается ограничение по времени работы. Это позволяет своевременно завершать процессы, тем самым уменьшается нагрузка на процессор и на потребление памяти. Алгоритм работы представлен на рисунке 5.6. 37 | 38 | \begin{figure}[ht!] 39 | \center{\includegraphics[width=0.5\linewidth]{images/module_round_schema.png}} 40 | \caption{Схема создания потоков} 41 | \end{figure} 42 | -------------------------------------------------------------------------------- /report/report.tex: -------------------------------------------------------------------------------- 1 | \input{config} 2 | 3 | \begin{document} 4 | \input{title} 5 | \input{referat} 6 | 7 | \newpage 8 | \ESKDthisStyle{empty} 9 | \section*{Список исполнителей} 10 | 11 | Муковкин Д.Е. -- программист, ответственный исполнитель. 12 | 13 | Задачи: 14 | \begin{itemize} 15 | \item развертывание инфраструктуры; 16 | \item доработка модуля проверки сервисов, сдачи флагов; 17 | \item доработка панели администратора; 18 | \item настройка и тестирование платформы; 19 | \item подготовка игровых сервисов для SibirCTF; 20 | \item организация SibirCTF (техническая часть); 21 | \item подготовка отчета. 22 | \end{itemize} 23 | 24 | Койшинов Т.С. -- программист. 25 | 26 | Задачи: 27 | \begin{itemize} 28 | \item тестирование платформы; 29 | \item разработка сервиса для платформы; 30 | \item подготовка команды для участия в SibirCTF (разработка тренировочных сервисов); 31 | \end{itemize} 32 | 33 | Засыпкин Г.В. -- программист. 34 | 35 | Задачи: 36 | \begin{itemize} 37 | \item участие в SibirCTF; 38 | \item разработка сети для SibirCTF; 39 | \item тестирование платформы. 40 | \end{itemize} 41 | 42 | Ретивых В.А. -- программист. 43 | 44 | Задачи: 45 | \begin{itemize} 46 | \item разработка сервиса для платформы; 47 | \item тестирование платформы. 48 | \end{itemize} 49 | 50 | Ковальчук А.О. -- программист. 51 | 52 | Задачи: 53 | \begin{itemize} 54 | \item разработка сервиса для платформы; 55 | \item тестирование платформы; 56 | \end{itemize} 57 | 58 | % - содержание 59 | \newpage 60 | \ESKDstyle{plain} 61 | \tableofcontents 62 | 63 | \newpage 64 | \ESKDstyle{plain} 65 | \section*{Введение} 66 | \addcontentsline{toc}{section}{Введение} 67 | \input{intro} 68 | \newpage 69 | \section{Назначение и область применения} 70 | Разрабатываемый программный комплекс предназначен для проведения игр в области информационной безопасности Capture the flag по типу Attack-Defense. 71 | \section{Постановка задачи} 72 | \setcounter{figure}{0} 73 | \input{problem_form} 74 | \section{Инструменты} 75 | \setcounter{figure}{0} 76 | \subsection{Система контроля версий Git} 77 | \input{instruments/git} 78 | \subsection{Система компьютерной вёрстки \TeX} 79 | \input{instruments/tex} 80 | \subsection{Язык программирования Python} 81 | \input{instruments/python} 82 | \subsection{База данных MongoDB} 83 | \input{instruments/mongo} 84 | \subsection{Teamwork - Система управления проектами и задачами} 85 | \input{instruments/teamwork} 86 | \subsection{Flask - микрофреймворк для Python} 87 | \input{instruments/flask} 88 | \subsection{ArgParse - инструмент для создания интерфейсов коммандной строки} 89 | \input{instruments/argparse} 90 | \subsection{Zabbix - система мониторинга сервисов компьютерной сети} 91 | \input{instruments/zabbix} 92 | \subsection{RabbitMQ - система мониторинга сервисов компьютерной сети} 93 | \input{instruments/rabbit} 94 | \newpage 95 | \section{Технические характеристики} 96 | \input{technical_attributes} 97 | \newpage 98 | \section{Разработка программного обеспечения} 99 | \setcounter{figure}{0} 100 | \subsection{Архитектура} 101 | \input{individual_reports/architech} 102 | 103 | \newpage 104 | \section{Построение сети для организации соревнований} 105 | \setcounter{figure}{0} 106 | 107 | \input{individual_reports/network} 108 | 109 | \newpage 110 | \section{Развитие экосистемы} 111 | \setcounter{figure}{0} 112 | 113 | \input{eco/main} 114 | 115 | \newpage 116 | \section{Планы на будущее} 117 | \input{plani} 118 | 119 | \newpage 120 | \section*{Заключение} 121 | \addcontentsline{toc}{section}{Заключение} 122 | В данном семестре нашей группой была выполнена часть работы по созданию платформы для проведения соревнований в области информационной безопасности, определены основные векторы развития и поставлены задачи для дальнейшего развития платформы. 123 | 124 | \newpage 125 | \renewcommand{\refname}{Список использованных источников} 126 | \bibliography{lit} 127 | 128 | \ESKDappendix{Обязательное}{\normalfont Компакт-диск} 129 | Компакт-диск содержит: 130 | \begin{itemize} 131 | \item Электронную версию пояснительной записки в форматах *.tex и *.pdf; 132 | \item Актуальную версию программной платформы для проведения соревнований по информационной безопасности; 133 | \item Платформа панели администратора и API к ней. 134 | \end{itemize} 135 | 136 | \end{document} 137 | -------------------------------------------------------------------------------- /classes/flags.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | from classes.config.get import ConfigGet 4 | from config.main import * 5 | import multiprocessing 6 | import socket 7 | import sys 8 | import time 9 | import re 10 | import pymongo 11 | from ipaddress import IPv4Address, IPv4Network 12 | from functions import Message 13 | 14 | 15 | class Flags: 16 | socket = None 17 | 18 | def __init__(self, db): 19 | self.db = db 20 | self.conn = None 21 | self.address = None 22 | 23 | self.config = ConfigGet(self.db) 24 | 25 | try: 26 | lifetime, round_length = CHECKER['LENGTH'], CHECKER['ROUND_LENGTH'] 27 | except KeyError: 28 | Message.fail('Error with parse in response') 29 | sys.exit(0) 30 | 31 | self.life = lifetime * round_length 32 | self.port = FLAGS['PORT'] 33 | 34 | def start(self): 35 | Message.success('Class is initialized. Starting') 36 | try: 37 | self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 38 | self.socket.bind(('0.0.0.0', self.port)) 39 | self.socket.listen(1) 40 | 41 | while True: 42 | self.conn, self.address = self.socket.accept() 43 | Message.info('connected:' + self.address[0]) 44 | 45 | process = multiprocessing.Process(target=self.recv, args=(self.conn, self.address)) 46 | process.daemon = True 47 | process.start() 48 | 49 | except KeyboardInterrupt: 50 | print('Module flags is shutdown') 51 | self.conn.close() 52 | exit(0) 53 | 54 | def recv(self, connection, address): 55 | teams = self.db.teams.find() 56 | print(address) 57 | team = False 58 | for e in teams: 59 | if IPv4Address(address[0]) in IPv4Network(e['network']): 60 | team = e 61 | break 62 | 63 | if not bool(team): 64 | connection.send(('Who are you?\n Goodbye\n').encode()) 65 | connection.close() 66 | else: 67 | try: 68 | self.process_one_team(connection, team) 69 | except BrokenPipeError: 70 | print('Client is disconnected') 71 | sys.exit(0) 72 | 73 | def process_one_team(self, connection, team): 74 | connection.send(('Welcome! \nYour team - ' + team["name"] + '\n').encode()) 75 | 76 | while True: 77 | data = connection.recv(1024) 78 | data = str(data.rstrip().decode('utf-8')) 79 | 80 | if not re.match('^\w{33}=$',data): 81 | connection.send(('this is not flag\n').encode()) 82 | continue 83 | 84 | flag = self.db.flags.find_one({'flag': data}) 85 | 86 | 87 | if not bool(flag): 88 | connection.send(('Flag is not found\n').encode()) 89 | continue 90 | 91 | if flag['team']['_id'] == team['_id']: 92 | connection.send(('It`s your flag\n').encode()) 93 | continue 94 | 95 | 96 | if (self.life + flag["timestamp"]) <= time.time(): 97 | connection.send(('This flag is too old\n').encode()) 98 | continue 99 | 100 | status = self.db.scoreboard.find_one({ 101 | 'team._id': team['_id'], 102 | 'service._id': flag['service']['_id'] 103 | }) 104 | 105 | if status["status"] != 'UP': 106 | connection.send(('Your service '+ flag['service']['name'] +' is not working\n').encode()) 107 | continue 108 | 109 | count_round = self.db.flags.find().sort([ ('round', pymongo.DESCENDING) ]).limit(1)[0]['round'] 110 | 111 | is_stolen = self.db.stolen_flags.find_one({ 112 | 'team._id': team['_id'], 113 | 'flag._id': flag['_id'] 114 | }) 115 | 116 | if is_stolen: 117 | connection.send(('You are already pass this flag\n').encode()) 118 | continue 119 | 120 | self.db.stolen_flags.insert_one({ 121 | 'team': team, 122 | 'flag': flag, 123 | 'round': count_round, 124 | 'timestamp': time.time() 125 | }) 126 | 127 | self.db.flags.update_one({'flag': data}, {"$set": {"stolen": True}}) 128 | 129 | connection.send(('Accepted\n').encode()) 130 | -------------------------------------------------------------------------------- /report/lit.bib~5: -------------------------------------------------------------------------------- 1 | @comment{x-kbibtex-personnameformatting=<%f ><%l><, %s>} 2 | 3 | @book{progit, 4 | added-at = "2011-08-16T15:46:36.000+0200", 5 | author = "{Scott Chacon}", 6 | interhash = "ec1617e7e18c150205bf027b566ef357", 7 | intrahash = "40f70d7bc474085d987786484a09d2bf", 8 | keywords = "git source\_code\_control version\_control", 9 | language = "russian", 10 | timestamp = "2011-08-16T15:46:36.000+0200", 11 | title = "{Pro Git : professional version control}", 12 | url = "http://progit.org/ebook/progit.pdf", 13 | year = "2011" 14 | } 15 | 16 | @book{valikov, 17 | author = "{Алексей Николаевич Валиков}", 18 | isbn = "5941571291", 19 | language = "russian", 20 | publisher = "{БХВ-Петербург}", 21 | timestamp = "2014.05.29", 22 | title = "{Технология XSLT}", 23 | volume = "544", 24 | year = "2002" 25 | } 26 | 27 | @book{latexrus, 28 | author = "{И. А. Чеботаев, П. З. Котельников}", 29 | language = "russian", 30 | publisher = "Сибирский Хронограф", 31 | timestamp = "2013.12.20", 32 | title = "{\LaTeXe\ по-русски}", 33 | volume = "489", 34 | year = "2004" 35 | } 36 | 37 | @book{lvovskyi, 38 | author = "{С.М. Львовский}", 39 | isbn = "5-94057-091-7", 40 | language = "russian", 41 | owner = "alina", 42 | pages = "448", 43 | publisher = "МЦНМО", 44 | timestamp = "2013.12.20", 45 | title = "{Набор и вёрстка в системе \LaTeX}", 46 | year = "2006" 47 | } 48 | 49 | @article{cfl, 50 | author = "Игорь Юрьевич Михайлов", 51 | journal = "{Компьютерно-техническая экспертиза: [сайт]}", 52 | language = "russian", 53 | owner = "alina", 54 | timestamp = "2013.12.20", 55 | title = "{Компьютерно-техническая экспертиза [Электронный ресурс]}", 56 | url = "http://computer-forensics-lab.org", 57 | year = "{[2013]}" 58 | } 59 | 60 | @book{fedotovforenzika, 61 | author = "Николай Николаевич Федотов", 62 | isbn = "9785911590154", 63 | language = "russian", 64 | lccn = "2008443140", 65 | publisher = "Юрид. мир", 66 | title = "{Форензика - компьютерная криминалистика}", 67 | volume = "432", 68 | year = "2007" 69 | } 70 | 71 | @article{eshelon, 72 | journal = "{Эшелон:[сайт]}", 73 | language = "russian", 74 | owner = "alina", 75 | timestamp = "2013.12.21", 76 | title = "{Сертификация средств защиты информации (СЗИ) по требованиям безопасности информации: сертификация и сертификационные испытания в системах сертификации ФСТЭК России, Минобороны России, ФСБ России, <<АйТи-Сертифика>> [Электронный ресурс]}", 77 | url = "http://www.npo-echelon.ru/services/certification" 78 | } 79 | 80 | @article{mostest, 81 | journal = "{mostest.su:[сайт]}", 82 | language = "russian", 83 | owner = "alina", 84 | timestamp = "2013.12.21", 85 | title = "{Сертификация программного обеспечения, центр сертификации Мостест [Электронный ресурс]}", 86 | url = "http://mostest.su/uslugi-po-sertifikacii-oformlenie-sertifikatov-otkaznyx-pisem-i-dr/sertifikaciya-programmnogo-obespecheniya" 87 | } 88 | 89 | @article{ofpidgin, 90 | journal = "{developer.pidgin.im:[сайт]}", 91 | language = "russian", 92 | owner = "alina", 93 | timestamp = "2013.12.20", 94 | title = "{Официальное сообщество Pidgin}", 95 | url = "https://developer.pidgin.im" 96 | } 97 | 98 | @article{skypechat, 99 | journal = "{Community Skype:[сайт]}", 100 | language = "russian", 101 | owner = "alina", 102 | timestamp = "2013.12.11", 103 | title = "{Официальное сообщество Skype [Электронный ресурс]}", 104 | url = "http://community.skype.com" 105 | } 106 | 107 | @article{xml, 108 | journal = "{msdn.microsoft.com:[сайт]}", 109 | language = "russian", 110 | organization = "Microsoft", 111 | owner = "alina", 112 | timestamp = "2013.12.17", 113 | title = "{Справочник по XML-стандартам [Электронный ресурс]}", 114 | url = "http://msdn.microsoft.com/ru-ru/library/ms256177(v=vs.110).aspx" 115 | } 116 | 117 | @article{qtcross, 118 | journal = "{doc.crossplatform.ru:[сайт]}", 119 | language = "russian", 120 | owner = "alina", 121 | timestamp = "2013.11.23", 122 | title = "{Всё о кроссплатформенном программировании - Qt [Электронный ресурс]}", 123 | url = "http://doc.crossplatform.ru/qt", 124 | year = "2013" 125 | } 126 | 127 | @article{qtdoc, 128 | journal = "{qt-project.org:[сайт]}", 129 | language = "russian", 130 | owner = "alina", 131 | timestamp = "2013.12.20", 132 | title = "{Qt Documentation [Электронный ресурс]}", 133 | url = "http://qt-project.org/doc", 134 | year = "2013" 135 | } 136 | 137 | @article{evt, 138 | journal = "{whitehats.ca:[сайт]}", 139 | language = "russian", 140 | owner = "alina", 141 | timestamp = "2013.12.11", 142 | title = "{Windows Event Log Format [Электронный ресурс]}", 143 | url = "http://www.whitehats.ca/main/members/Malik/malik\_eventlogs/malik\_event\-logs.html", 144 | year = "2005" 145 | } 146 | 147 | -------------------------------------------------------------------------------- /report/lit.bib~4: -------------------------------------------------------------------------------- 1 | @comment{x-kbibtex-personnameformatting=<%f ><%l><, %s>} 2 | 3 | @book{progit, 4 | added-at = "2011-08-16T15:46:36.000+0200", 5 | author = "{Scott Chacon}", 6 | interhash = "ec1617e7e18c150205bf027b566ef357", 7 | intrahash = "40f70d7bc474085d987786484a09d2bf", 8 | keywords = "git source\_code\_control version\_control", 9 | language = "russian", 10 | timestamp = "2011-08-16T15:46:36.000+0200", 11 | title = "{Pro Git : professional version control}", 12 | url = "http://progit.org/ebook/progit.pdf", 13 | year = "2011" 14 | } 15 | 16 | @book{valikov, 17 | author = "{Алексей Николаевич Валиков}", 18 | isbn = "5941571291", 19 | language = "russian", 20 | publisher = "{БХВ-Петербург}", 21 | timestamp = "2014.05.29", 22 | title = "{Технология XSLT}", 23 | volume = "544", 24 | year = "2002" 25 | } 26 | 27 | @book{latexrus, 28 | author = "{И. А. Чеботаев, П. З. Котельников}", 29 | language = "russian", 30 | publisher = "Сибирский Хронограф", 31 | timestamp = "2013.12.20", 32 | title = "{\LaTeXe\ по-русски}", 33 | volume = "489", 34 | year = "2004" 35 | } 36 | 37 | @book{lvovskyi, 38 | author = "{С.М. Львовский}", 39 | isbn = "5-94057-091-7", 40 | language = "russian", 41 | owner = "alina", 42 | pages = "448", 43 | publisher = "МЦНМО", 44 | timestamp = "2013.12.20", 45 | title = "{Набор и вёрстка в системе \LaTeX}", 46 | year = "2006" 47 | } 48 | 49 | @article{cfl, 50 | author = "Игорь Юрьевич Михайлов", 51 | journal = "{Компьютерно-техническая экспертиза: [сайт]}", 52 | language = "russian", 53 | owner = "alina", 54 | timestamp = "2013.12.20", 55 | title = "{Компьютерно-техническая экспертиза [Электронный ресурс]}", 56 | url = "http://computer-forensics-lab.org", 57 | year = "{[2013]}" 58 | } 59 | 60 | @book{fedotovforenzika, 61 | author = "Николай Николаевич Федотов", 62 | isbn = "9785911590154", 63 | language = "russian", 64 | lccn = "2008443140", 65 | publisher = "Юрид. мир", 66 | title = "{Форензика - компьютерная криминалистика}", 67 | volume = "432", 68 | year = "2007" 69 | } 70 | 71 | @article{eshelon, 72 | journal = "{Эшелон:[сайт]}", 73 | language = "russian", 74 | owner = "alina", 75 | timestamp = "2013.12.21", 76 | title = "{Сертификация средств защиты информации (СЗИ) по требованиям безопасности информации: сертификация и сертификационные испытания в системах сертификации ФСТЭК России, Минобороны России, ФСБ России, <<АйТи-Сертифика>> [Электронный ресурс]}", 77 | url = "http://www.npo-echelon.ru/services/certification" 78 | } 79 | 80 | @article{mostest, 81 | journal = "{mostest.su:[сайт]}", 82 | language = "russian", 83 | owner = "alina", 84 | timestamp = "2013.12.21", 85 | title = "{Сертификация программного обеспечения, центр сертификации Мостест [Электронный ресурс]}", 86 | url = "http://mostest.su/uslugi-po-sertifikacii-oformlenie-sertifikatov-otkaznyx-pisem-i-dr/sertifikaciya-programmnogo-obespecheniya" 87 | } 88 | 89 | @article{ofpidgin, 90 | journal = "{developer.pidgin.im:[сайт]}", 91 | language = "russian", 92 | owner = "alina", 93 | timestamp = "2013.12.20", 94 | title = "{Официальное сообщество Pidgin}", 95 | url = "https://developer.pidgin.im" 96 | } 97 | 98 | @article{skypechat, 99 | journal = "{Community Skype:[сайт]}", 100 | language = "russian", 101 | owner = "alina", 102 | timestamp = "2013.12.11", 103 | title = "{Официальное сообщество Skype [Электронный ресурс]}", 104 | url = "http://community.skype.com" 105 | } 106 | 107 | @article{xml, 108 | journal = "{msdn.microsoft.com:[сайт]}", 109 | language = "russian", 110 | organization = "Microsoft", 111 | owner = "alina", 112 | timestamp = "2013.12.17", 113 | title = "{Справочник по XML-стандартам [Электронный ресурс]}", 114 | url = "http://msdn.microsoft.com/ru-ru/library/ms256177(v=vs.110).aspx" 115 | } 116 | 117 | @article{qtcross, 118 | journal = "{doc.crossplatform.ru:[сайт]}", 119 | language = "russian", 120 | owner = "alina", 121 | timestamp = "2013.11.23", 122 | title = "{Всё о кроссплатформенном программировании - Qt [Электронный ресурс]}", 123 | url = "http://doc.crossplatform.ru/qt", 124 | year = "2013" 125 | } 126 | 127 | @article{qtdoc, 128 | journal = "{qt-project.org:[сайт]}", 129 | language = "russian", 130 | owner = "alina", 131 | timestamp = "2013.12.20", 132 | title = "{Qt Documentation [Электронный ресурс]}", 133 | url = "http://qt-project.org/doc", 134 | year = "2013" 135 | } 136 | 137 | @article{evt, 138 | journal = "{whitehats.ca:[сайт]}", 139 | language = "russian", 140 | owner = "alina", 141 | timestamp = "2013.12.11", 142 | title = "{Windows Event Log Format [Электронный ресурс]}", 143 | url = "http://www.whitehats.ca/main/members/Malik/malik\_eventlogs/malik\_event\-logs.html", 144 | year = "2005" 145 | } 146 | 147 | @article{rar, 148 | journal = "{Информация о форматах:[сайт]}", 149 | language = "russian", 150 | title = "{Информация о формате .rar [Электронный ресурс]}", 151 | url = "http://formatsfiles.narod.ru/rar.html", 152 | year = "2010" 153 | } 154 | 155 | @article{New1, 156 | journal = "{forensicswiki.org:[сайт]}", 157 | language = "russian", 158 | title = "{RAR [Электронный ресурс]}", 159 | url = "http://www.forensicswiki.org/wiki/RAR", 160 | year = "2014" 161 | } 162 | 163 | -------------------------------------------------------------------------------- /report/lit.bib~3: -------------------------------------------------------------------------------- 1 | @comment{x-kbibtex-personnameformatting=<%f ><%l><, %s>} 2 | 3 | @book{progit, 4 | added-at = "2011-08-16T15:46:36.000+0200", 5 | author = "{Scott Chacon}", 6 | interhash = "ec1617e7e18c150205bf027b566ef357", 7 | intrahash = "40f70d7bc474085d987786484a09d2bf", 8 | keywords = "git source\_code\_control version\_control", 9 | language = "russian", 10 | timestamp = "2011-08-16T15:46:36.000+0200", 11 | title = "{Pro Git : professional version control}", 12 | url = "http://progit.org/ebook/progit.pdf", 13 | year = "2011" 14 | } 15 | 16 | @book{valikov, 17 | author = "{Алексей Николаевич Валиков}", 18 | isbn = "5941571291", 19 | language = "russian", 20 | publisher = "{БХВ-Петербург}", 21 | timestamp = "2014.05.29", 22 | title = "{Технология XSLT}", 23 | volume = "544", 24 | year = "2002" 25 | } 26 | 27 | @book{latexrus, 28 | author = "{И. А. Чеботаев, П. З. Котельников}", 29 | language = "russian", 30 | publisher = "Сибирский Хронограф", 31 | timestamp = "2013.12.20", 32 | title = "{\LaTeXe\ по-русски}", 33 | volume = "489", 34 | year = "2004" 35 | } 36 | 37 | @book{lvovskyi, 38 | author = "{С.М. Львовский}", 39 | isbn = "5-94057-091-7", 40 | language = "russian", 41 | owner = "alina", 42 | pages = "448", 43 | publisher = "МЦНМО", 44 | timestamp = "2013.12.20", 45 | title = "{Набор и вёрстка в системе \LaTeX}", 46 | year = "2006" 47 | } 48 | 49 | @article{cfl, 50 | author = "Игорь Юрьевич Михайлов", 51 | journal = "{Компьютерно-техническая экспертиза: [сайт]}", 52 | language = "russian", 53 | owner = "alina", 54 | timestamp = "2013.12.20", 55 | title = "{Компьютерно-техническая экспертиза [Электронный ресурс]}", 56 | url = "http://computer-forensics-lab.org", 57 | year = "{[2013]}" 58 | } 59 | 60 | @book{fedotovforenzika, 61 | author = "Николай Николаевич Федотов", 62 | isbn = "9785911590154", 63 | language = "russian", 64 | lccn = "2008443140", 65 | publisher = "Юрид. мир", 66 | title = "{Форензика - компьютерная криминалистика}", 67 | volume = "432", 68 | year = "2007" 69 | } 70 | 71 | @article{eshelon, 72 | journal = "{Эшелон:[сайт]}", 73 | language = "russian", 74 | owner = "alina", 75 | timestamp = "2013.12.21", 76 | title = "{Сертификация средств защиты информации (СЗИ) по требованиям безопасности информации: сертификация и сертификационные испытания в системах сертификации ФСТЭК России, Минобороны России, ФСБ России, <<АйТи-Сертифика>> [Электронный ресурс]}", 77 | url = "http://www.npo-echelon.ru/services/certification" 78 | } 79 | 80 | @article{mostest, 81 | journal = "{mostest.su:[сайт]}", 82 | language = "russian", 83 | owner = "alina", 84 | timestamp = "2013.12.21", 85 | title = "{Сертификация программного обеспечения, центр сертификации Мостест [Электронный ресурс]}", 86 | url = "http://mostest.su/uslugi-po-sertifikacii-oformlenie-sertifikatov-otkaznyx-pisem-i-dr/sertifikaciya-programmnogo-obespecheniya" 87 | } 88 | 89 | @article{ofpidgin, 90 | journal = "{developer.pidgin.im:[сайт]}", 91 | language = "russian", 92 | owner = "alina", 93 | timestamp = "2013.12.20", 94 | title = "{Официальное сообщество Pidgin}", 95 | url = "https://developer.pidgin.im" 96 | } 97 | 98 | @article{skypechat, 99 | journal = "{Community Skype:[сайт]}", 100 | language = "russian", 101 | owner = "alina", 102 | timestamp = "2013.12.11", 103 | title = "{Официальное сообщество Skype [Электронный ресурс]}", 104 | url = "http://community.skype.com" 105 | } 106 | 107 | @article{xml, 108 | journal = "{msdn.microsoft.com:[сайт]}", 109 | language = "russian", 110 | organization = "Microsoft", 111 | owner = "alina", 112 | timestamp = "2013.12.17", 113 | title = "{Справочник по XML-стандартам [Электронный ресурс]}", 114 | url = "http://msdn.microsoft.com/ru-ru/library/ms256177(v=vs.110).aspx" 115 | } 116 | 117 | @article{qtcross, 118 | journal = "{doc.crossplatform.ru:[сайт]}", 119 | language = "russian", 120 | owner = "alina", 121 | timestamp = "2013.11.23", 122 | title = "{Всё о кроссплатформенном программировании - Qt [Электронный ресурс]}", 123 | url = "http://doc.crossplatform.ru/qt", 124 | year = "2013" 125 | } 126 | 127 | @article{qtdoc, 128 | journal = "{qt-project.org:[сайт]}", 129 | language = "russian", 130 | owner = "alina", 131 | timestamp = "2013.12.20", 132 | title = "{Qt Documentation [Электронный ресурс]}", 133 | url = "http://qt-project.org/doc", 134 | year = "2013" 135 | } 136 | 137 | @article{evt, 138 | journal = "{whitehats.ca:[сайт]}", 139 | language = "russian", 140 | owner = "alina", 141 | timestamp = "2013.12.11", 142 | title = "{Windows Event Log Format [Электронный ресурс]}", 143 | url = "http://www.whitehats.ca/main/members/Malik/malik\_eventlogs/malik\_event\-logs.html", 144 | year = "2005" 145 | } 146 | 147 | @article{rar, 148 | journal = "{Информация о форматах:[сайт]}", 149 | language = "russian", 150 | title = "{Информация о формате .rar [Электронный ресурс]}", 151 | url = "http://formatsfiles.narod.ru/rar.html", 152 | year = "2010" 153 | } 154 | 155 | @article{wikirar, 156 | journal = "{forensicswiki.org:[сайт]}", 157 | language = "russian", 158 | title = "{RAR [Электронный ресурс]}", 159 | url = "http://www.forensicswiki.org/wiki/RAR", 160 | year = "2014" 161 | } 162 | 163 | @article{zipparolil, 164 | journal = "{habrahabr.ru:[сайт]}", 165 | language = "russian", 166 | title = "{История одного бага или как я ZIP паролил [Электронный ресурс]}", 167 | url = "http://habrahabr.ru/post/100200" 168 | } 169 | 170 | -------------------------------------------------------------------------------- /classes/templates/index.html: -------------------------------------------------------------------------------- 1 | {% extends "layout.html" %} 2 | 3 | {% block title %}Таблица результатов{% endblock %} 4 | {% block body %} 5 |
6 |

Это SibirCTF 2017, детка!

7 |

Сейчас идет {{ round }} раунд

8 | 9 | 10 | 11 | 12 | {% for team_name, team in scoreboard %} 13 | {% if loop.index == 1 %} 14 | {% for service in team %} 15 | 16 | {% endfor %} 17 | {% endif %} 18 | {% endfor %} 19 | 20 | 21 | 22 | {% for team_name, team in scoreboard %} 23 | 24 | 35 | 36 | {% for service in team %} 37 | 48 | {% else %} 49 | Some problem 50 | {% endfor %} 51 | 52 | {% endfor %} 53 | 54 |
Team{{ service }}
25 | 26 |
27 |
{{ loop.index }}
28 |
29 |
{{ team_name }}
30 |
Score: {{ teams[team_name].score }}
31 | {{ teams[team_name].host }}
32 |
33 |
34 |
38 |
39 | {% if team[service].up_round %}{{ (team[service].uptime)|int() }}{% else %}0{% endif %}% 40 |
41 |
42 |
{{ team[service].attack }}
43 |
{{ team[service].defense }}
44 |
45 | 46 | 47 |
55 |
56 |
Success
57 |
Corrupt
58 |
Mumble
59 |
Down
60 |
61 |
62 | 148 | 155 | {% endblock %} 156 | -------------------------------------------------------------------------------- /report/lit.bib~2: -------------------------------------------------------------------------------- 1 | @comment{x-kbibtex-personnameformatting=<%f ><%l><, %s>} 2 | 3 | @book{progit, 4 | added-at = "2011-08-16T15:46:36.000+0200", 5 | author = "{Scott Chacon}", 6 | interhash = "ec1617e7e18c150205bf027b566ef357", 7 | intrahash = "40f70d7bc474085d987786484a09d2bf", 8 | keywords = "git source\_code\_control version\_control", 9 | language = "russian", 10 | timestamp = "2011-08-16T15:46:36.000+0200", 11 | title = "{Pro Git : professional version control}", 12 | url = "http://progit.org/ebook/progit.pdf", 13 | year = "2011" 14 | } 15 | 16 | @book{valikov, 17 | author = "{Алексей Николаевич Валиков}", 18 | isbn = "5941571291", 19 | language = "russian", 20 | publisher = "{БХВ-Петербург}", 21 | timestamp = "2014.05.29", 22 | title = "{Технология XSLT}", 23 | volume = "544", 24 | year = "2002" 25 | } 26 | 27 | @book{latexrus, 28 | author = "{И. А. Чеботаев, П. З. Котельников}", 29 | language = "russian", 30 | publisher = "Сибирский Хронограф", 31 | timestamp = "2013.12.20", 32 | title = "{\LaTeXe\ по-русски}", 33 | volume = "489", 34 | year = "2004" 35 | } 36 | 37 | @book{lvovskyi, 38 | author = "{С.М. Львовский}", 39 | isbn = "5-94057-091-7", 40 | language = "russian", 41 | owner = "alina", 42 | pages = "448", 43 | publisher = "МЦНМО", 44 | timestamp = "2013.12.20", 45 | title = "{Набор и вёрстка в системе \LaTeX}", 46 | year = "2006" 47 | } 48 | 49 | @article{cfl, 50 | author = "Игорь Юрьевич Михайлов", 51 | journal = "{Компьютерно-техническая экспертиза: [сайт]}", 52 | language = "russian", 53 | owner = "alina", 54 | timestamp = "2013.12.20", 55 | title = "{Компьютерно-техническая экспертиза [Электронный ресурс]}", 56 | url = "http://computer-forensics-lab.org", 57 | year = "{[2013]}" 58 | } 59 | 60 | @book{fedotovforenzika, 61 | author = "Николай Николаевич Федотов", 62 | isbn = "9785911590154", 63 | language = "russian", 64 | lccn = "2008443140", 65 | publisher = "Юрид. мир", 66 | title = "{Форензика - компьютерная криминалистика}", 67 | volume = "432", 68 | year = "2007" 69 | } 70 | 71 | @article{eshelon, 72 | journal = "{Эшелон:[сайт]}", 73 | language = "russian", 74 | owner = "alina", 75 | timestamp = "2013.12.21", 76 | title = "{Сертификация средств защиты информации (СЗИ) по требованиям безопасности информации: сертификация и сертификационные испытания в системах сертификации ФСТЭК России, Минобороны России, ФСБ России, <<АйТи-Сертифика>> [Электронный ресурс]}", 77 | url = "http://www.npo-echelon.ru/services/certification" 78 | } 79 | 80 | @article{mostest, 81 | journal = "{mostest.su:[сайт]}", 82 | language = "russian", 83 | owner = "alina", 84 | timestamp = "2013.12.21", 85 | title = "{Сертификация программного обеспечения, центр сертификации Мостест [Электронный ресурс]}", 86 | url = "http://mostest.su/uslugi-po-sertifikacii-oformlenie-sertifikatov-otkaznyx-pisem-i-dr/sertifikaciya-programmnogo-obespecheniya" 87 | } 88 | 89 | @article{ofpidgin, 90 | journal = "{developer.pidgin.im:[сайт]}", 91 | language = "russian", 92 | owner = "alina", 93 | timestamp = "2013.12.20", 94 | title = "{Официальное сообщество Pidgin}", 95 | url = "https://developer.pidgin.im" 96 | } 97 | 98 | @article{skypechat, 99 | journal = "{Community Skype:[сайт]}", 100 | language = "russian", 101 | owner = "alina", 102 | timestamp = "2013.12.11", 103 | title = "{Официальное сообщество Skype [Электронный ресурс]}", 104 | url = "http://community.skype.com" 105 | } 106 | 107 | @article{xml, 108 | journal = "{msdn.microsoft.com:[сайт]}", 109 | language = "russian", 110 | organization = "Microsoft", 111 | owner = "alina", 112 | timestamp = "2013.12.17", 113 | title = "{Справочник по XML-стандартам [Электронный ресурс]}", 114 | url = "http://msdn.microsoft.com/ru-ru/library/ms256177(v=vs.110).aspx" 115 | } 116 | 117 | @article{qtcross, 118 | journal = "{doc.crossplatform.ru:[сайт]}", 119 | language = "russian", 120 | owner = "alina", 121 | timestamp = "2013.11.23", 122 | title = "{Всё о кроссплатформенном программировании - Qt [Электронный ресурс]}", 123 | url = "http://doc.crossplatform.ru/qt", 124 | year = "2013" 125 | } 126 | 127 | @article{qtdoc, 128 | journal = "{qt-project.org:[сайт]}", 129 | language = "russian", 130 | owner = "alina", 131 | timestamp = "2013.12.20", 132 | title = "{Qt Documentation [Электронный ресурс]}", 133 | url = "http://qt-project.org/doc", 134 | year = "2013" 135 | } 136 | 137 | @article{evt, 138 | journal = "{whitehats.ca:[сайт]}", 139 | language = "russian", 140 | owner = "alina", 141 | timestamp = "2013.12.11", 142 | title = "{Windows Event Log Format [Электронный ресурс]}", 143 | url = "http://www.whitehats.ca/main/members/Malik/malik\_eventlogs/malik\_event\-logs.html", 144 | year = "2005" 145 | } 146 | 147 | @article{rar, 148 | journal = "{Информация о форматах:[сайт]}", 149 | language = "russian", 150 | title = "{Информация о формате .rar [Электронный ресурс]}", 151 | url = "http://formatsfiles.narod.ru/rar.html", 152 | year = "2010" 153 | } 154 | 155 | @article{wikirar, 156 | journal = "{forensicswiki.org:[сайт]}", 157 | language = "russian", 158 | title = "{RAR [Электронный ресурс]}", 159 | url = "http://www.forensicswiki.org/wiki/RAR", 160 | year = "2014" 161 | } 162 | 163 | @article{zipparolil, 164 | journal = "{habrahabr.ru:[сайт]}", 165 | language = "russian", 166 | title = "{История одного бага или как я ZIP паролил [Электронный ресурс]}", 167 | url = "http://habrahabr.ru/post/100200" 168 | } 169 | 170 | @article{updatesolr, 171 | journal = "{wiki.apache.org:[сайт]}", 172 | language = "russian", 173 | title = "{XML Messages for Updating a Solr Index [Электронный ресурс]}", 174 | url = "https://wiki.apache.org/solr/UpdateXmlMessages", 175 | year = "2014" 176 | } 177 | 178 | -------------------------------------------------------------------------------- /classes/zond.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function 2 | import sys 3 | import threading 4 | import os 5 | import pika, time, json 6 | 7 | from bson import json_util 8 | from functions import Message 9 | from classes.checker.main import Checker 10 | from config.main import QUEUE 11 | 12 | try: 13 | import thread 14 | except ImportError: 15 | import _thread as thread 16 | 17 | 18 | class Zond: 19 | path_to_checkers = 'checkers/' 20 | 21 | filename_checkers = 'check' 22 | thread = [] 23 | 24 | codes = { 25 | 101: 'UP', 26 | 102: 'CORRUPT', 27 | 103: 'MUMBLE', 28 | 104: 'DOWN' 29 | } 30 | 31 | def __init__(self, db): 32 | self.db = db 33 | 34 | self.checker = Checker() 35 | connection = pika.BlockingConnection(pika.ConnectionParameters( 36 | host=QUEUE['HOST'], 37 | credentials=pika.credentials.PlainCredentials(QUEUE['USERNAME'], QUEUE['PASSWORD']) 38 | )) 39 | self.channel = connection.channel() 40 | 41 | self.channel.queue_declare(queue='tasks') 42 | 43 | print(' [*] Waiting for messages. To exit press CTRL+C') 44 | 45 | def run(self): 46 | self.channel.basic_consume(self.callback, 47 | queue='tasks', 48 | no_ack=True) 49 | 50 | self.channel.start_consuming() 51 | 52 | def callback(self, ch, method, properties, body): 53 | data = json.loads(body.decode('utf8')) 54 | 55 | print(" [x] Received %r %r" % (data['team']['name'],data['service']['name'])) 56 | 57 | if not os.path.exists('checkers/' + data['service']['name'] + '/check'): 58 | if not os.path.exists('checkers/' + data['service']['name']): 59 | os.mkdir('checkers/' + data['service']['name'], mode=0o777) 60 | 61 | file = open('checkers/' + data['service']['name'] + '/check', 'w') 62 | file.write(data['service']['program'] + "\r\n") 63 | file.close() 64 | 65 | self.thread.append(threading.Thread( 66 | name=(data['team']['name'] + data['service']['name']), 67 | target=self.to_service, 68 | args=(data['round'], data['team'], data['service'], data['flag'], data['flag_id'])) 69 | ) 70 | self.thread[-1].daemon = True 71 | self.thread[-1].start() 72 | 73 | for e, j in enumerate(self.thread): 74 | j.join(timeout=1) 75 | 76 | def cdquit(self, fn_name): 77 | # print to stderr, unbuffered in Python 2. 78 | print('{0} took too long'.format(fn_name), file=sys.stderr) 79 | sys.stderr.flush() # Python 3 stderr is likely buffered. 80 | thread.interrupt_main() # raises KeyboardInterrupt 81 | 82 | def exit_after(self, s): 83 | ''' 84 | use as decorator to exit process if 85 | function takes longer than s seconds 86 | ''' 87 | 88 | def outer(fn): 89 | def inner(*args, **kwargs): 90 | timer = threading.Timer(s, self.cdquit, args=[fn.__name__]) 91 | timer.start() 92 | try: 93 | result = fn(*args, **kwargs) 94 | finally: 95 | timer.cancel() 96 | return result 97 | 98 | return inner 99 | 100 | return outer 101 | 102 | def to_service(self, round, team, service, flag, flag_id): 103 | team = json_util.loads(json.dumps(team)) 104 | service = json_util.loads(json.dumps(service)) 105 | 106 | self.db.flags.insert_one({ 107 | 'round': round, 108 | 'team': team, 109 | 'service': service, 110 | 'flag': flag, 111 | 'flag_id': flag_id, 112 | 'stolen': False, 113 | 'timestamp': time.time() 114 | }) 115 | 116 | path = self.path_to_checkers + service['name'] + '/' + self.filename_checkers 117 | 118 | action = '' 119 | try: 120 | action = 'check' 121 | self.checker.check(team['host'], path) 122 | 123 | action = 'put' 124 | self.checker.put(team['host'], path, flag, flag_id) 125 | 126 | action = 'get' 127 | self.checker.get(team['host'], path, flag, flag_id) 128 | 129 | self.update_scoreboard(team, service, 101) 130 | 131 | except Exception as error: 132 | code, message = error.args 133 | print(error) 134 | Message.fail(team['name'] + ' ' + service['name'] + ' ' + action + ' => error (message: ' + str(message) + ')') 135 | self.update_scoreboard(team, service, code, message) 136 | 137 | 138 | def update_scoreboard(self, team, service, status_code, message=''): 139 | codes = { 140 | 101: 'UP', 141 | 102: 'CORRUPT', 142 | 103: 'MUMBLE', 143 | 104: 'DOWN' 144 | } 145 | 146 | # self.status_service[team['name'] + '_' + service['name']] = status_code 147 | 148 | if status_code not in codes: 149 | Message.fail('\t Invalid checker return code for ' + service['name']) 150 | status_code = 104 151 | 152 | self.db.scoreboard.update_one( 153 | { 154 | 'team._id': team['_id'], 155 | 'service._id': service['_id'] 156 | }, 157 | { 158 | "$set": { 159 | "status": codes[status_code], 160 | 'message': message 161 | }, 162 | '$inc': { 163 | 'up_round': 1 if status_code == 101 else 0 164 | } 165 | } 166 | ) 167 | -------------------------------------------------------------------------------- /visualization/theme1/js/index.js: -------------------------------------------------------------------------------- 1 | function getRandomColor() { 2 | var letters = '0123456789ABCDEF'.split(''); 3 | var color = '#'; 4 | for (var i = 0; i < 6; i++ ) { 5 | color += letters[Math.floor(Math.random() * 16)]; 6 | } 7 | return color; 8 | } 9 | 10 | $(document).ready(function(){ 11 | var teams = ApiGame.teams(); 12 | 13 | var rw = 80; 14 | var width = $('body').width(); 15 | var centerX = (width - rw)/2; 16 | var centerY = ($('body').height() - rw)/2; 17 | var lenteams = teams.length; 18 | var rad = ($('body').height() - 2*rw)/2; 19 | 20 | $('body').append(''); 21 | 22 | var svg = d3.select("svg"); 23 | 24 | var coords = [] 25 | for(var i = 0; i < lenteams; i++){ 26 | var x = Math.floor(Math.sin(2*3.14 * ((i + 0.5)/lenteams))*rad + centerX); 27 | var y = Math.floor(Math.cos(2*3.14 * ((i + 0.4)/lenteams))*rad + centerY); 28 | 29 | function countNearboard(y){ 30 | return coords.filter(function(a) { 31 | var dy = a.y > y ? a.y - y : y - a.y; 32 | var dx = a.x > x ? a.x - x : x - a.x; 33 | return dy < rw + 10 || dx < rw + 10; 34 | }).length; 35 | } 36 | 37 | var di = 0.01; 38 | while(countNearboard(y) > 0 && di < 3){ 39 | y = Math.floor(Math.cos((2*3.14) * ((i + di)/lenteams))*rad + centerY); 40 | if(di > 0){ 41 | di += 0.05; 42 | }else{ 43 | di = di*-1; 44 | } 45 | }; 46 | coords.push({x: x, y: y}); 47 | } 48 | coords = coords.sort(function(a,b){ return a.y > b.y; }) 49 | 50 | for(var i = 0; i < lenteams-1; i++){ 51 | coords[i + 1].y = coords[i].y + rw + 10; 52 | } 53 | 54 | var text_game_name = svg.append('text'); 55 | text_game_name.html("SibirCTF 2016 / Tomsk"); 56 | text_game_name.attr('x', 10); 57 | text_game_name.attr('y', 40); 58 | text_game_name.style("fill", 'lightblue'); 59 | text_game_name.style("stroke", 'lightgreen'); 60 | text_game_name.attr('stroke-width', "1"); 61 | text_game_name.style("font-size","40px") 62 | text_game_name.style("font-weight","bold") 63 | 64 | for(var i = 0; i < lenteams; i++){ 65 | coords[i].y; 66 | $('#place' + i).html(); 67 | 68 | var line = svg.append('line'); 69 | line.attr('x1', 0); 70 | line.attr('x2', width); 71 | line.attr('y1', coords[i].y - 5); 72 | line.attr('y2', coords[i].y - 5); 73 | line.attr('stroke', "lightgreen"); 74 | line.attr('stroke-width', "1"); 75 | 76 | var text = svg.append('text'); 77 | text.html('' + (i+1)); 78 | text.attr('x', 10); 79 | text.attr('y', coords[i].y + 50); 80 | text.style("fill", 'lightblue'); 81 | text.style("stroke", 'lightgreen'); 82 | text.attr('stroke-width', "1"); 83 | text.style("font-size","40px") 84 | text.style("font-weight","bold") 85 | 86 | var text_team_name = svg.append('text'); 87 | 88 | text_team_name.html(teams[i].name); 89 | text_team_name.attr('id', 'place' + i); 90 | text_team_name.attr('x', 50); 91 | text_team_name.attr('y', coords[i].y + 35); 92 | text_team_name.style("fill", 'lightblue'); 93 | text_team_name.style("stroke", 'lightgreen'); 94 | text_team_name.attr('stroke-width', "1"); 95 | text_team_name.style("font-size","26px") 96 | text_team_name.style("font-weight","bold") 97 | 98 | var text_team_score = svg.append('text'); 99 | text_team_score.html(teams[i].score ? teams[i].score : 0); 100 | text_team_score.attr('id', 'score' + i); 101 | text_team_score.attr('x', 50); 102 | text_team_score.attr('y', coords[i].y + 70); 103 | text_team_score.style("fill", 'lightblue'); 104 | text_team_score.style("stroke", 'lightgreen'); 105 | text_team_score.attr('stroke-width', "1"); 106 | text_team_score.style("font-size","26px") 107 | text_team_score.style("font-weight","bold") 108 | } 109 | 110 | 111 | for(t in teams){ 112 | teams[t].flags = []; 113 | for(var i = 0; i < lenteams; i++){ 114 | var flag = svg.append('rect'); 115 | teams[t].flags[i] = flag 116 | flag.style("fill", teams[t].color); 117 | flag.style("visibility", 'hidden'); 118 | flag.attr("width", rw/2); 119 | flag.attr("height", rw/2); 120 | flag.attr("rx", 10); 121 | flag.attr("ry", 10); 122 | flag.attr("transform", "translate(" + coords[t].x + ", " + coords[t].y + ")"); 123 | } 124 | } 125 | 126 | // init base teams 127 | for(t in teams){ 128 | var g = svg.append('g') 129 | teams[t].name = teams[t].name 130 | teams[t].g = g; 131 | teams[t].x = coords[t].x; 132 | teams[t].y = coords[t].y; 133 | g.attr("transform", "translate(" + coords[t].x + ", " + coords[t].y + ")"); 134 | g.attr('id', 'team' + t); 135 | img = g.append('svg:image') 136 | img.attr("xlink:href",teams[t].logo) 137 | img.attr("width", rw); 138 | img.attr("height", rw); 139 | img.attr("x", 0) 140 | img.attr("y", 0) 141 | } 142 | 143 | function getTeamByName(name){ 144 | for(t in teams){ 145 | if(teams[t].name == name) 146 | return teams[t] 147 | } 148 | } 149 | 150 | 151 | function sendFlags(from, to, num){ 152 | var from = getTeamByName(from); 153 | var to = getTeamByName(to); 154 | // console.log(from.name + " -> " + to.name + " num = " + num) 155 | 156 | var val1 = "translate(" + (from.x + rw/4) + ", " + (from.y + rw/4) + ")"; 157 | from.flags[num].attr("transform", val1); 158 | from.flags[num].style("visibility", ''); 159 | var val2 = "translate(" + (to.x + rw/4) + ", " + (to.y + rw/4) + ")"; 160 | from.flags[num].transition().duration(2000).attr("transform", val2); 161 | } 162 | 163 | // animation 164 | setInterval(function(){ 165 | ApiGame.stat().done(function(stat){ 166 | stat = stat.sort(function(a,b){ return a.score < b.score; }) 167 | 168 | for(var i = 0; i < stat.length; i++){ 169 | var flags = stat[i].flags; 170 | for(var i1 = 0; i1 < flags.length; i1++){ 171 | if(flags[i1].from != stat[i].name && flags[i1].count > 0){ 172 | sendFlags(flags[i1].from, stat[i].name, i); 173 | } 174 | } 175 | } 176 | 177 | setTimeout(function(){ 178 | for(i in stat){ 179 | var team = getTeamByName(stat[i].name); 180 | $('#place' + i).html(team.name); 181 | $('#score' + i).html(stat[i].score); 182 | for(var i1 = 0; i1 < lenteams; i1++){ 183 | team.flags[i1].style("visibility", 'hidden'); 184 | } 185 | team.x = coords[i].x; 186 | team.y = coords[i].y; 187 | team.g.transition().duration(2500).attr("transform", "translate(" + team.x + ", " + team.y + ")"); 188 | } 189 | 190 | },2500); 191 | 192 | }); 193 | }, 5000); 194 | }); 195 | 196 | -------------------------------------------------------------------------------- /classes/scoreboard.py: -------------------------------------------------------------------------------- 1 | from flask import Flask 2 | from flask import render_template 3 | from flask import jsonify 4 | from flask import request 5 | 6 | import pymongo 7 | import json 8 | 9 | 10 | class Scoreboard: 11 | 12 | def __init__(self, db): 13 | self.db = db 14 | 15 | self.app = Flask(__name__) 16 | 17 | def sort_team(self, service): 18 | count = 0 19 | team_name, services = service 20 | 21 | for service in services: 22 | count += round((services[service]['uptime'] * (int(services[service]['attack']) + int(services[service]['defense'])) * 0.01), 2) 23 | #count += int(services[service]['attack']) + int(services[service]['defense']) 24 | 25 | 26 | return count 27 | def sort_service(self, service): 28 | print('service') 29 | print(service) 30 | return 1 31 | """ Seee http://flask.pocoo.org/docs/0.10/tutorial/dbcon/#tutorial-dbcon """ 32 | def start(self): 33 | @self.app.route("/") 34 | def index(): 35 | try: 36 | scoreboard = self.db.scoreboard.find() 37 | 38 | if scoreboard.count() == 0: 39 | # Хотелось бы добавить сюда время начала соревнований 40 | return render_template('game_not_started.html') 41 | 42 | sc = {} 43 | teams = {} 44 | 45 | color = {'UP':'success', 'DOWN':'danger', 'CORRUPT':'warning' ,'MUMBLE':'info'} 46 | 47 | visitor_team = self.db.teams.find_one({'host': request.remote_addr}) 48 | if visitor_team == None: 49 | visitor_team = {'_id': ''} 50 | 51 | count_round = self.db.flags.find().sort([ ('round', pymongo.DESCENDING) ]).limit(1)[0]['round'] 52 | 53 | for item in scoreboard: 54 | team_name = item['team']['name'] 55 | if team_name not in sc: 56 | sc[team_name] = {} 57 | teams[team_name] = item['team'] 58 | teams[team_name]['score'] = 0 59 | 60 | sc[team_name][item['service']['name']] = { 61 | 'status': item['status'], 62 | 'own': item['team']['_id'] == visitor_team['_id'], 63 | 'message': item['message'], 64 | 'attack': str(item['attack']), 65 | 'defense': str(item['defense']), 66 | 'up_round': int(item['up_round']), 67 | 'uptime': (item['up_round'] / count_round) * 100 68 | } 69 | uptime = (item['up_round'] / count_round) * 100 70 | 71 | teams[team_name]['score'] += round((uptime * (item['attack'] + item['defense']) * 0.01), 2) 72 | teams[team_name]['score'] = round(teams[team_name]['score'], 2) 73 | 74 | sc = sorted(sc.items(), key=self.sort_team)[::-1] 75 | 76 | 77 | return render_template('index.html', 78 | scoreboard=sc, 79 | color=color, 80 | teams=teams, 81 | round=count_round, 82 | services={'history':{}, 'crypto-inc':{}, 'support':{}, 'loogles':{}, 'runaway': {} } 83 | ) 84 | except Exception: 85 | return render_template('is_not_avialable.html') 86 | 87 | @self.app.route('/api/rating') 88 | def api_rating(): 89 | #try: 90 | scoreboard = self.db.scoreboard.find() 91 | 92 | if scoreboard.count() == 0: 93 | # Хотелось бы добавить сюда время начала соревнований 94 | return render_template('game_not_started.html') 95 | 96 | sc = {} 97 | teams = {} 98 | 99 | color = {'UP':'success', 'DOWN':'danger', 'CORRUPT':'warning' ,'MUMBLE':'info'} 100 | 101 | visitor_team = self.db.teams.find_one({'host': request.remote_addr}) 102 | if visitor_team == None: 103 | visitor_team = {'_id': ''} 104 | 105 | count_round = self.db.flags.find().sort([ ('round', pymongo.DESCENDING) ]).limit(1)[0]['round'] 106 | 107 | for item in scoreboard: 108 | team_name = item['team']['name'] 109 | if team_name not in sc: 110 | sc[team_name] = {} 111 | teams[team_name] = item['team'] 112 | teams[team_name]['score'] = 0 113 | 114 | sc[team_name][item['service']['name']] = { 115 | 'status': item['status'], 116 | 'own': item['team']['_id'] == visitor_team['_id'], 117 | 'message': item['message'], 118 | 'attack': str(item['attack']), 119 | 'defense': str(item['defense']), 120 | 'up_round': int(item['up_round']), 121 | 'uptime': (item['up_round'] / count_round) * 100 122 | } 123 | uptime = (item['up_round'] / count_round) * 100 124 | 125 | teams[team_name]['score'] += round((uptime * (item['attack'] + item['defense']) * 0.01), 2) 126 | teams[team_name]['score'] = round(teams[team_name]['score'], 2) 127 | 128 | sc = sorted(sc.items(), key=self.sort_team)[::-1] 129 | for i,a in enumerate(sc): 130 | print(str(i)) 131 | #sc[i] = sorted(sc[i].items(), key=self.sort_service) 132 | 133 | 134 | #print(sc) 135 | return render_template('index.html', 136 | scoreboard=sc, 137 | color=color, 138 | teams=teams, 139 | round=count_round 140 | ) 141 | #except Exception as e: 142 | #print(e) 143 | #return render_template('is_not_avialable.html') 144 | 145 | self.app.debug = True 146 | self.app.run(host="0.0.0.0", port=9000, threaded=True) 147 | -------------------------------------------------------------------------------- /report/report.fdb_latexmk: -------------------------------------------------------------------------------- 1 | # Fdb version 3 2 | ["pdflatex"] 1417971103 "report.tex" "report.pdf" "report" 1417971103 3 | "/etc/texmf/web2c/texmf.cnf" 1417868002 1101 af7716885e081ab43982cab7b4672c1a "" 4 | "/usr/share/texlive/texmf-dist/fonts/map/fontname/texfonts.map" 1272929888 3287 e6b82fe08f5336d4d5ebc73fb1152e87 "" 5 | "/usr/share/texlive/texmf-dist/fonts/tfm/public/cm/cmr12.tfm" 1136768653 1288 655e228510b4c2a1abe905c368440826 "" 6 | "/usr/share/texlive/texmf-dist/tex/generic/babel-russian/russianb.ldf" 1403649660 22415 9bba9fe773c4528a001bf01368257b28 "" 7 | "/usr/share/texlive/texmf-dist/tex/generic/babel/babel.def" 1395780385 49536 e1475dd245ff2196764ba5b91ac63714 "" 8 | "/usr/share/texlive/texmf-dist/tex/generic/babel/babel.sty" 1395780385 13162 52453613e672419375f5bc44def13451 "" 9 | "/usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty" 1284331290 1458 43ab4710dc82f3edeabecd0d099626b2 "" 10 | "/usr/share/texlive/texmf-dist/tex/generic/oberdiek/atbegshi.sty" 1335995445 24460 92f559a71aac869021852c227c704b38 "" 11 | "/usr/share/texlive/texmf-dist/tex/generic/oberdiek/etexcmds.sty" 1335995445 7612 c47308d923ec19888707b0f1792b326a "" 12 | "/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty" 1303254447 7324 11d14f318d865f420e692d4e6c9c18c3 "" 13 | "/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty" 1303254447 7140 ece2cc23d9f20e1f53975ac167f42d3e "" 14 | "/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifvtex.sty" 1335995445 6797 68c89f65e01894df882dd523d3fc0a8f "" 15 | "/usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty" 1335995445 8253 3bdedc8409aa5d290a2339be6f09af03 "" 16 | "/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvdefinekeys.sty" 1335995445 5152 387d9200f396b498d5fd679ae44ed898 "" 17 | "/usr/share/texlive/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty" 1335995445 14040 8de9f47fabc4ca3bd69b6d795e32751c "" 18 | "/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty" 1335995445 18425 775b341047ce304520cc7c11ca41392e "" 19 | "/usr/share/texlive/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty" 1335995445 19987 01cb2f3c1d21e5f05711b7fd50b17f2a "" 20 | "/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsbsy.sty" 1362954379 2412 2d98314dc5be38f455f8890deeb2d091 "" 21 | "/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty" 1362954379 4357 ad30ad08920902fc9b38caf35a3b0496 "" 22 | "/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsmath.sty" 1362954379 79178 b2e326c351e876df0e5e23df2e02441b "" 23 | "/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsopn.sty" 1362954379 4082 502152465aedb8f6a3c4b0b7c0fa8ae5 "" 24 | "/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty" 1362954379 2637 846ebe982d3549c7ede7ce135456f54a "" 25 | "/usr/share/texlive/texmf-dist/tex/latex/base/exscale.sty" 1399675188 2227 20a06e13e07dd9a839d80242ae09eeec "" 26 | "/usr/share/texlive/texmf-dist/tex/latex/base/ifthen.sty" 1399675188 4947 22c4b902063e8ce2efcc2a8495ecb800 "" 27 | "/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty" 1399675188 5295 be5d5092b838cbeebda7de24a3ab9dd2 "" 28 | "/usr/share/texlive/texmf-dist/tex/latex/base/omsenc.dfu" 1399675188 1793 7bb4e1cf8d618812dcf05cd85cccb71d "" 29 | "/usr/share/texlive/texmf-dist/tex/latex/base/ot1enc.dfu" 1399675188 2545 afa23f923cc3519eb0b895cbf3dadfb5 "" 30 | "/usr/share/texlive/texmf-dist/tex/latex/base/size12.clo" 1399675188 8978 ae5f64dacfe4ff1b713dec8fd98fb590 "" 31 | "/usr/share/texlive/texmf-dist/tex/latex/base/t1enc.dfu" 1399675188 7405 c70c194719f79b7d070eeb68af109b09 "" 32 | "/usr/share/texlive/texmf-dist/tex/latex/base/t2aenc.dfu" 1399675188 9173 9c6bc94106d475c68b8765e3be88fbce "" 33 | "/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def" 1399675188 6275 ac89e3d1c95578574b0b11f34248899e "" 34 | "/usr/share/texlive/texmf-dist/tex/latex/caption/caption.sty" 1368312746 65148 c61accbd2b9a5316d9be0887ec48d722 "" 35 | "/usr/share/texlive/texmf-dist/tex/latex/caption/caption3.sty" 1368312746 62748 b02c0dc118f5f35146d37cec569e83b1 "" 36 | "/usr/share/texlive/texmf-dist/tex/latex/changepage/chngpage.sty" 1256071977 4325 1a4bfd40b7e0a7ed0d541fef6c68f28d "" 37 | "/usr/share/texlive/texmf-dist/tex/latex/cyrillic/t2aenc.def" 1399675188 11832 32024f9595576eb2e7e0c675b519e5b8 "" 38 | "/usr/share/texlive/texmf-dist/tex/latex/extsizes/extarticle.cls" 1137110130 20602 3112294ba237d94ce4a1502cfef3594f "" 39 | "/usr/share/texlive/texmf-dist/tex/latex/geometry/geometry.sty" 1284422013 40502 e003406220954b0716679d7928aedd8a "" 40 | "/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty" 1254151804 14183 42a8fc761b806986eef292369afc2988 "" 41 | "/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty" 1399675188 7911 bf0a64f89bfb668c239ddf6324bf4afb "" 42 | "/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty" 1399675188 2317 0ace13e225e9d95dd9defe947adc9fbb "" 43 | "/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty" 1156702488 3153 c50e6bd54d2dd3933fc52bcf369bec4a "" 44 | "/usr/share/texlive/texmf-dist/tex/latex/lastpage/lastpage.sty" 1359502492 10081 7caa8a4742ed47ad6e4429dd16632450 "" 45 | "/usr/share/texlive/texmf-dist/tex/latex/latexconfig/graphics.cfg" 1278958963 3563 d35e897cae3b8c6848f6677b73370b54 "" 46 | "/usr/share/texlive/texmf-dist/tex/latex/ms/everyshi.sty" 1177890616 3878 6aa7c08ff2621006e0603349e40a30a8 "" 47 | "/usr/share/texlive/texmf-dist/tex/latex/oberdiek/auxhook.sty" 1303254447 3834 707ef09f31d7d2ea47ba89974755dfe0 "" 48 | "/usr/share/texlive/texmf-dist/tex/latex/oberdiek/zref-abspage.sty" 1335995445 2153 4758fe045340c06cad94a5fd209845cb "" 49 | "/usr/share/texlive/texmf-dist/tex/latex/oberdiek/zref-base.sty" 1335995445 20510 d34f2ff6da5204141c620ec21d6b3170 "" 50 | "/usr/share/texlive/texmf-dist/tex/latex/oberdiek/zref-perpage.sty" 1335995445 4037 c8482928c87c0552ac7a0577dc7c04c3 "" 51 | "/usr/share/texlive/texmf-dist/tex/latex/pdftex-def/pdftex.def" 1306616590 55368 3c8a0d99822330f2dfabc0dfb09ce897 "" 52 | "/usr/share/texlive/texmf-dist/tex/latex/rotating/rotating.sty" 1238284825 7131 a49b179ae7108fe42935176733099fc0 "" 53 | "/usr/share/texlive/texmf-dist/tex/latex/tools/calc.sty" 1399675188 10002 f32f4490d0c87a7854adf544bd459155 "" 54 | "/usr/share/texlive/texmf-dist/tex/latex/tools/indentfirst.sty" 1399675188 1405 812cce861a226d5e8105ac55fcb2cbe8 "" 55 | "/usr/share/texlive/texmf-dist/web2c/texmf.cnf" 1406646078 31088 8e088e958dd0258cc5414842768a3a00 "" 56 | "/usr/share/texmf/tex/latex/eskdx/eskdafterpkg.sty" 1305325751 1916 dfa064261325eb2adf713b37c946979d "" 57 | "/usr/share/texmf/tex/latex/eskdx/eskdbiblist.sty" 1305325751 1443 13827a83df7ce9f1cfa0e7bd99a71756 "" 58 | "/usr/share/texmf/tex/latex/eskdx/eskdcap.sty" 1305325751 1045 5a0e05344c3033a6c2b9e23db10a24e4 "" 59 | "/usr/share/texmf/tex/latex/eskdx/eskdexplan.sty" 1305325751 1329 2cd505914327c3a8d18a01fa5a28634c "" 60 | "/usr/share/texmf/tex/latex/eskdx/eskdfont.sty" 1305325751 1796 728e45ff2b4d277874cf5ae0c3902118 "" 61 | "/usr/share/texmf/tex/latex/eskdx/eskdfootnote.sty" 1305325751 2777 846453156e1ec2b63b56463d3ed3fbe2 "" 62 | "/usr/share/texmf/tex/latex/eskdx/eskdhash.sty" 1305325751 2104 f00eec138a0c84a043eac616fa15f237 "" 63 | "/usr/share/texmf/tex/latex/eskdx/eskdindent.sty" 1305325751 816 183ead549489ec7c5bc7a7dcd1eff1f3 "" 64 | "/usr/share/texmf/tex/latex/eskdx/eskdinfo.sty" 1305325751 3200 d5ee2d150cb7f72f6739f22be6fee455 "" 65 | "/usr/share/texmf/tex/latex/eskdx/eskdlang.sty" 1305325751 1201 04ad7b04fa58fb81ae1c3e89b7664b54 "" 66 | "/usr/share/texmf/tex/latex/eskdx/eskdlist.sty" 1305325751 1496 e19f40d35c8f786094dc96a48e202065 "" 67 | "/usr/share/texmf/tex/latex/eskdx/eskdplain.sty" 1305325751 2173 5a0181b5d289e26b03331cab0ae4bfc0 "" 68 | "/usr/share/texmf/tex/latex/eskdx/eskdrussian.def" 1417865130 6856 8eb3b92d9c68be6f94e9fe24217a901c "" 69 | "/usr/share/texmf/tex/latex/eskdx/eskdsect.sty" 1305325751 7029 2e099726a63177fca66b2c783d070724 "" 70 | "/usr/share/texmf/tex/latex/eskdx/eskdstamp.sty" 1305325751 39237 c99558ca4860647c82f2203615be9b5a "" 71 | "/usr/share/texmf/tex/latex/eskdx/eskdtext.cls" 1305325751 4522 af2552f811635f8adeee2e4532c92d1b "" 72 | "/usr/share/texmf/tex/latex/eskdx/eskdtitle.sty" 1305325751 4728 a8a52b6e385409135a63ff1c122ddb52 "" 73 | "/usr/share/texmf/tex/latex/eskdx/eskdtitlebase.sty" 1305325751 2842 514bda757b4ad8cb3bf925e58a1a6abb "" 74 | "/usr/share/texmf/web2c/texmf.cnf" 1406646078 31088 8e088e958dd0258cc5414842768a3a00 "" 75 | "/var/lib/texmf/web2c/pdftex/pdflatex.fmt" 1416688091 3836621 32cac40b284af04e96cdca0b452ffef5 "" 76 | "config.tex" 1417871005 2766 1fa2d51801426eafa3ec68a8ff145bbb "" 77 | "cyrtimes.sty" 0 -1 0 "" 78 | "report.aux" 1417971103 8 a94a2480d3289e625eea47cd1b285758 "" 79 | "report.tex" 1417971103 3381 e7355b825b119c59a39752f4eeb4e44d "" 80 | (generated) 81 | "report.log" 82 | "report.pdf" 83 | -------------------------------------------------------------------------------- /report/utf8gost705u.bst: -------------------------------------------------------------------------------- 1 | %% This bibliography style attempts 2 | %% to format bibliography according to 3 | %% GOST 7.0.5-2008 4 | %% 5 | %% Package version - 1.2 6 | %% 7 | %%version history 8 | %%1.0 базовая версия 9 | %%1.1 поправлена ошибка с полем page (при ненулевом numpages) из одной цифры (c. 319). Теперь - C. 319 10 | %%1.2 поправлен баг, решена проблема с bibentry. В конце каждой записи ставится пустая группа: {}. Строки 145--149 кода 11 | %% 12 | %% For the Ukrainian|English bibliographic entries 13 | %% you need to create field 14 | %% language = {ukrainian|english}. 15 | %% Default language is Russian. 16 | %% Field numpages for books must contain number of pages. 17 | %% 18 | %% See examples in test.pdf and samples.pdf 19 | %% 20 | %% You can send your questions and comments to e-mail: tex_support@uniyar.ac.ru 21 | %% 22 | ENTRY 23 | { address 24 | annote 25 | author 26 | booktitle 27 | bookauthor 28 | chapter 29 | edition 30 | editor 31 | compiler 32 | howpublished 33 | institution 34 | journal 35 | key 36 | month 37 | note 38 | number 39 | organization 40 | pages 41 | numpages 42 | publisher 43 | school 44 | series 45 | title 46 | type 47 | volume 48 | year 49 | language 50 | booklanguage 51 | url 52 | } 53 | {} 54 | { label } 55 | INTEGERS { output.state before.all mid.sentence after.sentence after.block 56 | after.dblslash after.slash after.column after.semicolumn} 57 | FUNCTION {init.state.consts} 58 | { #0 'before.all := 59 | #1 'mid.sentence := 60 | #2 'after.sentence := 61 | #3 'after.block := 62 | #4 'after.dblslash := 63 | #5 'after.slash := 64 | #6 'after.column := 65 | #7 'after.semicolumn := 66 | } 67 | STRINGS { s t } 68 | STRINGS { curlanguage } 69 | FUNCTION {change.language} 70 | { booklanguage empty$ 71 | {""} 72 | {booklanguage 'curlanguage := 73 | "\selectlanguageifdefined{" 74 | curlanguage * 75 | "}" * 76 | } 77 | if$ 78 | } 79 | %% Разделители 80 | FUNCTION {output.nonnull} 81 | %%%{ 's := 82 | { swap$ 83 | output.state mid.sentence = 84 | { ", " * write$ } 85 | { output.state after.block = 86 | { add.period$ write$ 87 | " " " " * write$ 88 | newline$ 89 | "\newblock " write$ 90 | } 91 | { output.state before.all = 92 | 'write$ 93 | { output.state after.dblslash = 94 | { "~//" * change.language * " " * write$ } 95 | { output.state after.slash = 96 | { "~/ " * write$ } 97 | { output.state after.column = 98 | { ": " * write$ } 99 | { output.state after.semicolumn = 100 | { "; " * write$ } 101 | { add.period$ " " * write$ } 102 | if$ 103 | } 104 | if$ 105 | } 106 | if$ 107 | } 108 | if$ 109 | } 110 | if$ 111 | } 112 | if$ 113 | mid.sentence 'output.state := 114 | } 115 | if$ 116 | %%% s 117 | } 118 | FUNCTION {output} 119 | { duplicate$ empty$ 120 | 'pop$ 121 | 'output.nonnull 122 | if$ 123 | } 124 | %% Проверка наличия содержания 125 | FUNCTION {output.check} 126 | { 't := 127 | duplicate$ empty$ 128 | { pop$ "empty " t * " in " * cite$ * warning$ } 129 | 'output.nonnull 130 | if$ 131 | } 132 | FUNCTION {fin.entry} 133 | { add.period$ 134 | write$ 135 | %% вставляем пустую группу в конце. вер.1.2 %%%%%%%%%%%%%%%%%%%%%% 136 | after.sentence 'output.state := 137 | "{}" 138 | write$ 139 | %% конец вставки %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 140 | newline$ 141 | } 142 | %% Смена состояний 143 | FUNCTION {new.block} 144 | { output.state before.all = 145 | 'skip$ 146 | { after.block 'output.state := } 147 | if$ 148 | } 149 | FUNCTION {new.dblslash} 150 | { output.state before.all = 151 | 'skip$ 152 | { after.dblslash 'output.state := } 153 | if$ 154 | } 155 | FUNCTION {new.slash} 156 | { output.state before.all = 157 | 'skip$ 158 | { after.slash 'output.state := } 159 | if$ 160 | } 161 | FUNCTION {new.column} 162 | { output.state before.all = 163 | 'skip$ 164 | { after.column 'output.state := } 165 | if$ 166 | } 167 | FUNCTION {new.semicolumn} 168 | { output.state before.all = 169 | 'skip$ 170 | { after.semicolumn 'output.state := } 171 | if$ 172 | } 173 | FUNCTION {new.sentence} 174 | { output.state after.block = 175 | 'skip$ 176 | { output.state before.all = 177 | 'skip$ 178 | { after.sentence 'output.state := } 179 | if$ 180 | } 181 | if$ 182 | } 183 | %% --------- 184 | FUNCTION {add.blank} 185 | { " " * before.all 'output.state := 186 | } 187 | %% Логические операции 188 | FUNCTION {not} 189 | { { #0 } 190 | { #1 } 191 | if$ 192 | } 193 | FUNCTION {and} 194 | { 'skip$ 195 | { pop$ #0 } 196 | if$ 197 | } 198 | FUNCTION {or} 199 | { { pop$ #1 } 200 | 'skip$ 201 | if$ 202 | } 203 | %% --------- 204 | FUNCTION {non.stop} 205 | { duplicate$ 206 | "}" * add.period$ 207 | #-1 #1 substring$ "." = 208 | } 209 | FUNCTION {new.block.checka} 210 | { empty$ 211 | 'skip$ 212 | 'new.block 213 | if$ 214 | } 215 | FUNCTION {new.block.checkb} 216 | { empty$ 217 | swap$ empty$ 218 | and 219 | 'skip$ 220 | 'new.block 221 | if$ 222 | } 223 | FUNCTION {new.sentence.checka} 224 | { empty$ 225 | 'skip$ 226 | 'new.sentence 227 | if$ 228 | } 229 | FUNCTION {new.sentence.checkb} 230 | { empty$ 231 | swap$ empty$ 232 | and 233 | 'skip$ 234 | 'new.sentence 235 | if$ 236 | } 237 | FUNCTION {field.or.null} 238 | { duplicate$ empty$ 239 | { pop$ "" } 240 | 'skip$ 241 | if$ 242 | } 243 | %% Выделение \emph 244 | FUNCTION {emphasize} 245 | { duplicate$ empty$ 246 | { pop$ "" } 247 | { "\BibEmph{" swap$ * "}" * } 248 | if$ 249 | } 250 | FUNCTION {space.word} 251 | { " " swap$ * " " * } 252 | %% Сокращения для разных языков 253 | %% Русские версии поправлены (не все). Убраны заглавные буквы 254 | FUNCTION {bbl.edby} % { "\bbledby{}" } 255 | { curlanguage "english" = 256 | {"Ed. by "} 257 | { curlanguage "ukrainian" = 258 | {"{Під ред. }"} 259 | { curlanguage "russian" = 260 | {"{под ред. }"} %%%%%%%%%%%%%%%% правлено 261 | {"language is not defined: " language "edited by" * * warning$ "edited by"} 262 | if$} 263 | if$} 264 | if$ 265 | } 266 | FUNCTION {bbl.cmplr} 267 | { curlanguage "english" = 268 | {"Compiler "} 269 | { curlanguage "ukrainian" = 270 | {"{Укл. }"} 271 | { curlanguage "russian" = 272 | {"{сост. }"} %%%%%%%%%%%%%%%% правлено 273 | {"language is not defined: " language "compiler" * * warning$ "compiler"} 274 | if$} 275 | if$} 276 | if$ 277 | } 278 | FUNCTION {bbl.edition} % { "\bbledition{}" } 279 | { curlanguage "english" = 280 | {"edition"} 281 | { curlanguage "ukrainian" = 282 | {"{вид.}"} 283 | { curlanguage "russian" = 284 | {"{изд.}"} 285 | {"language is not defined: " language "edition" * * warning$ "edition"} 286 | if$} 287 | if$} 288 | if$ 289 | } 290 | FUNCTION {bbl.vvolume} % { "\bblVolume{}" } 291 | { curlanguage "english" = 292 | {"Volume"} 293 | { curlanguage "ukrainian" = curlanguage "russian" = or 294 | {"Том"} 295 | {"language is not defined: " language "Volume" * * warning$ "Volume"} 296 | if$} 297 | if$ 298 | } 299 | FUNCTION {bbl.vvol} % { "\bblVol{}" } 300 | { curlanguage "english" = 301 | {"Vol."} 302 | { curlanguage "ukrainian" = curlanguage "russian" = or 303 | {"с."} 304 | {"language is not defined: " language "Vol." * * warning$ "Vol."} 305 | if$} 306 | if$ 307 | } 308 | FUNCTION {bbl.iissue} % { "\bblIssue{}" } 309 | { curlanguage "english" = 310 | {"Issue"} 311 | { curlanguage "ukrainian" = 312 | {"Випуск"} 313 | { curlanguage "russian" = 314 | {"Выпуск"} 315 | {"language is not defined: " language * warning$ "Issue"} 316 | if$} 317 | if$} 318 | if$ 319 | } 320 | FUNCTION {bbl.iiss} % { "\bblIss{}" } 321 | { curlanguage "english" = 322 | {"Iss."} 323 | { curlanguage "ukrainian" = 324 | {"Вип."} 325 | { curlanguage "russian" = 326 | {"Вып."} 327 | {"language is not defined: " language * warning$ "Issue"} 328 | if$} 329 | if$} 330 | if$ 331 | } 332 | FUNCTION {bbl.of} % { "\bblof{}" } 333 | { curlanguage "english" = 334 | {"of"} 335 | { curlanguage "ukrainian" = 336 | {"{із}"} 337 | { curlanguage "russian" = 338 | {"{из}"} 339 | {"language is not defined: " language "of" * * warning$ "of"} 340 | if$} 341 | if$} 342 | if$ 343 | } 344 | FUNCTION {bbl.etal} % { "\bblof{}" } 345 | { curlanguage "english" = 346 | {"et~al."} 347 | { curlanguage "ukrainian" = 348 | {"{та~ін.}"} 349 | { curlanguage "russian" = 350 | {"{[и~др.]}"} 351 | {"language is not defined: " language "at al" * * warning$ "at al."} 352 | if$} 353 | if$} 354 | if$ 355 | } 356 | FUNCTION {bbl.nnumber} % { "\bblNumber{}" } 357 | { curlanguage "english" = 358 | {"Number"} 359 | { curlanguage "ukrainian" = curlanguage "russian" = or 360 | {"Номер"} 361 | {"language is not defined: " language "Number" * * warning$ "Number"} 362 | if$} 363 | if$ 364 | } 365 | FUNCTION {bbl.number} % { "\bblnumber{}" } 366 | { curlanguage "english" = 367 | {"number"} 368 | { curlanguage "ukrainian" = curlanguage "russian" = or 369 | {"{номер}"} 370 | {"language is not defined: " language "number" * * warning$ "number"} 371 | if$} 372 | if$ 373 | } 374 | FUNCTION {bbl.nr} % { "\bblno{}" } 375 | { curlanguage "english" = 376 | {"no."} 377 | { curlanguage "ukrainian" = curlanguage "russian" = or 378 | {"{№}"} 379 | {"language is not defined: " language "no." * * warning$ "no."} 380 | if$} 381 | if$ 382 | } 383 | FUNCTION {bbl.nnr} % { "\bblno{}" } 384 | { curlanguage "english" = 385 | {"No."} 386 | { curlanguage "ukrainian" = curlanguage "russian" = or 387 | {"{№}"} 388 | {"language is not defined: " language "No." * * warning$ "No."} 389 | if$} 390 | if$ 391 | } 392 | FUNCTION {bbl.in} % { "\bblin{}" } 393 | { curlanguage "english" = 394 | {"in"} 395 | { curlanguage "ukrainian" = curlanguage "russian" = or 396 | {"{в}"} 397 | {"language is not defined: " language "in" * * warning$ "in"} 398 | if$} 399 | if$ 400 | } 401 | FUNCTION {bbl.iin} % { "\bblIn{}" } 402 | { curlanguage "english" = 403 | {"In"} 404 | { curlanguage "ukrainian" = curlanguage "russian" = or 405 | {"В"} 406 | {"language is not defined: " language "In" * * warning$ "In"} 407 | if$} 408 | if$ 409 | } 410 | %% Поле page - номер страницы или диапазон, поле numpage - количество страниц 411 | FUNCTION {bbl.pages} % { "\bblpp." } 412 | { curlanguage "english" = 413 | {"pp."} 414 | { curlanguage "ukrainian" = curlanguage "russian" = or 415 | {"{C.}"} %%правлено 416 | {"language is not defined: " language "pp." * * warning$ "pp."} 417 | if$} 418 | if$ 419 | } 420 | FUNCTION {bbl.page} % { "\bblp." % 421 | { curlanguage "english" = 422 | {"p."} 423 | { curlanguage "ukrainian" = curlanguage "russian" = or 424 | {"{с.}"} 425 | {"language is not defined: " language "p." * * warning$ "p."} 426 | if$} 427 | if$ 428 | } 429 | FUNCTION {bbl.ppages}% { "\bblPp." } 430 | { curlanguage "english" = 431 | {"pp."} 432 | { curlanguage "ukrainian" = curlanguage "russian" = or 433 | {"{С.}"} 434 | {"language is not defined: " language "pp." * * warning$ "pp."} 435 | if$} 436 | if$ 437 | } 438 | FUNCTION {bbl.ppage} % { "\bblP." } 439 | { curlanguage "english" = 440 | {"P."} 441 | { curlanguage "ukrainian" = curlanguage "russian" = or 442 | {"{С.}"} 443 | {"language is not defined: " language "P." * * warning$ "P."} 444 | if$} 445 | if$ 446 | } 447 | FUNCTION {bbl.techrep} { "Tech. Rep." } 448 | FUNCTION {bbl.mthesis} { "Master's thesis" } 449 | FUNCTION {bbl.phdthesis} { "Ph.D. thesis" } 450 | %% ----- 451 | INTEGERS { nameptr namesleft numnames } 452 | %% Запись имен в прямом порядке: Фамилия И.О. 453 | %% У английских имен сокращает Имя до И. (у остальный вствляет как есть) 454 | FUNCTION {format.names} 455 | { 's := 456 | #1 'nameptr := 457 | s num.names$ 'numnames := 458 | numnames 'namesleft := 459 | { namesleft #0 > } 460 | { s nameptr 461 | curlanguage "ukrainian" = curlanguage "russian" = or 462 | { "{vv~}{ll}{~jj}{~ff}" format.name$ 't := } 463 | { curlanguage "english" = 464 | { "{vv~}{ll}{~jj}{~f.}" format.name$ 't := } 465 | { "language is not defined: " language "{vv~}{ll}{~jj}{~ff}" * * warning$ "{vv~}{ll}{~jj}{~ff}" } 466 | if$} 467 | if$ 468 | nameptr #1 > 469 | { 470 | nameptr #4 = 471 | numnames #3 > and 472 | { "others" 't := 473 | #1 'namesleft := } 474 | 'skip$ 475 | if$ 476 | namesleft #1 > 477 | { ", " * t * } 478 | { 479 | t "others" = 480 | t "~others" = 481 | or 482 | { " " * bbl.etal * } 483 | { ", " * t * } 484 | if$ 485 | } 486 | if$ 487 | } 488 | 't 489 | if$ 490 | nameptr #1 + 'nameptr := 491 | namesleft #1 - 'namesleft := 492 | } 493 | while$ 494 | } 495 | %% Запись имен в обратном порядке И.О. Фамилия 496 | %% У английских имен сокращает Имя до И. (у остальный вствляет как есть) 497 | FUNCTION {format.names.rev} 498 | { 's := 499 | #1 'nameptr := 500 | s num.names$ 'numnames := 501 | numnames 'namesleft := 502 | { namesleft #0 > } 503 | { s nameptr 504 | curlanguage "ukrainian" = curlanguage "russian" = or 505 | { "{ff}{~vv}{~ll}{, jj}" format.name$ 't := } 506 | { curlanguage "english" = 507 | { "{f.}{~vv}{~ll}{, jj}" format.name$ 't := } 508 | { "language is not defined: " language "{ff}{~vv}{~ll}{, jj}" * * warning$ "{ff}{~vv}{~ll}{, jj}" } 509 | if$} 510 | if$ 511 | nameptr #1 > 512 | { 513 | nameptr #4 = 514 | numnames #3 > and 515 | { "others" 't := 516 | #1 'namesleft := } 517 | 'skip$ 518 | if$ 519 | namesleft #1 > 520 | { ", " * t * } 521 | { 522 | t "others" = 523 | t "~others" = 524 | or 525 | { " " * bbl.etal * } 526 | { ", " * t * } 527 | if$ 528 | } 529 | if$ 530 | } 531 | 't 532 | if$ 533 | nameptr #1 + 'nameptr := 534 | namesleft #1 - 'namesleft := 535 | } 536 | while$ 537 | } 538 | FUNCTION {format.authors} 539 | { author empty$ 540 | { "" } 541 | { author format.names} 542 | if$ 543 | } 544 | FUNCTION {format.bookauthors} 545 | { bookauthor empty$ 546 | { "" } 547 | { bookauthor format.names} 548 | if$ 549 | } 550 | FUNCTION {format.authors.after} 551 | { author empty$ 552 | { "" } 553 | { author format.names.rev} 554 | if$ 555 | } 556 | FUNCTION {format.bookauthors.after} 557 | { bookauthor empty$ 558 | { "" } 559 | { bookauthor format.names.rev} 560 | if$ 561 | } 562 | FUNCTION {format.editors.after} 563 | { editor empty$ 564 | { "" } 565 | { bbl.edby editor format.names.rev * 566 | } 567 | if$ 568 | } 569 | FUNCTION {format.compiler.after} 570 | { compiler empty$ 571 | { "" } 572 | { bbl.cmplr compiler format.names.rev * 573 | } 574 | if$ 575 | } 576 | FUNCTION {format.title} 577 | { title empty$ 578 | { "" } 579 | { title 580 | } 581 | if$ 582 | } 583 | FUNCTION {format.date} 584 | { year empty$ 585 | { month empty$ 586 | { "" } 587 | { "there's a month but no year in " cite$ * warning$ 588 | month 589 | } 590 | if$ 591 | } 592 | { month empty$ 593 | 'year 594 | { year ". " " " month * * * } %%%%%%%%правлено 595 | if$ 596 | } 597 | if$ 598 | } 599 | FUNCTION {output.address.publisher.date} 600 | { 601 | address empty$ 602 | 'skip$ 603 | { address output 604 | publisher empty$ 605 | 'skip$ 606 | { new.column 607 | } 608 | if$ 609 | } 610 | if$ 611 | publisher output 612 | format.date output 613 | } 614 | %% Начало bibitem'а 615 | FUNCTION {output.bibitem} 616 | { newline$ 617 | "\bibitem{" write$ 618 | cite$ write$ 619 | "}" write$ 620 | newline$ 621 | language empty$ 622 | {"russian" 'curlanguage :=}%%%%%%%% правлено 623 | {language 'curlanguage :=} 624 | if$ 625 | "\selectlanguageifdefined{" write$ 626 | curlanguage write$ 627 | "}" write$ newline$ 628 | "" 629 | before.all 'output.state := 630 | } 631 | FUNCTION {n.dashify} 632 | { 't := 633 | "" 634 | { t empty$ not } 635 | { t #1 #1 substring$ "-" = 636 | { t #1 #2 substring$ "--" = not 637 | { "--" * 638 | t #2 global.max$ substring$ 't := 639 | } 640 | { { t #1 #1 substring$ "-" = } 641 | { "-" * 642 | t #2 global.max$ substring$ 't := 643 | } 644 | while$ 645 | } 646 | if$ 647 | } 648 | { t #1 #1 substring$ * 649 | t #2 global.max$ substring$ 't := 650 | } 651 | if$ 652 | } 653 | while$ 654 | } 655 | FUNCTION {word.in} 656 | { bbl.iin 657 | " " * } 658 | FUNCTION {format.btitle} 659 | { title 660 | } 661 | %% Вставка липкого пробела у коротких слов 662 | %% Один или два символа - ставит неразрывный пробел, три и больше - пробел 663 | FUNCTION {tie.or.space.connect} 664 | { duplicate$ text.length$ #3 < 665 | { "~" } 666 | { " " } 667 | if$ 668 | swap$ * * 669 | } 670 | FUNCTION {tie.connect} 671 | {"~" 672 | swap$ * * 673 | } 674 | FUNCTION {either.or.check} 675 | { empty$ 676 | 'pop$ 677 | { "can't use both " swap$ * " fields in " * cite$ * warning$ } 678 | if$ 679 | } 680 | FUNCTION {format.bvolume} 681 | { volume empty$ 682 | { "" } 683 | { volume bbl.vvol tie.connect 684 | series empty$ 685 | 'skip$ 686 | { bbl.of space.word * series emphasize * } 687 | if$ 688 | "volume and number" number either.or.check 689 | } 690 | if$ 691 | } 692 | FUNCTION {format.number.series} 693 | { volume empty$ 694 | { number empty$ 695 | { series field.or.null } 696 | { series empty$ 697 | { "there's a number but no series in " cite$ * warning$ 698 | bbl.nnr } 699 | { 700 | %new.dblslash 701 | new.sentence 702 | series 703 | bbl.nr 704 | tie.or.space.connect} 705 | if$ 706 | number tie.or.space.connect 707 | } 708 | if$ 709 | } 710 | { "" } 711 | if$ 712 | } 713 | FUNCTION {is.num} 714 | { chr.to.int$ 715 | duplicate$ "0" chr.to.int$ < not 716 | swap$ "9" chr.to.int$ > not and 717 | } 718 | FUNCTION {extract.num} 719 | { duplicate$ 't := 720 | "" 's := 721 | { t empty$ not } 722 | { t #1 #1 substring$ 723 | t #2 global.max$ substring$ 't := 724 | duplicate$ is.num 725 | { s swap$ * 's := } 726 | { pop$ "" 't := } 727 | if$ 728 | } 729 | while$ 730 | s empty$ 731 | 'skip$ 732 | { pop$ s } 733 | if$ 734 | } 735 | FUNCTION {convert.edition} 736 | { edition 737 | } 738 | FUNCTION {format.edition} 739 | { edition empty$ 740 | { "" } 741 | { output.state mid.sentence = 742 | { convert.edition " " * bbl.edition * } 743 | { convert.edition " " * bbl.edition * } 744 | if$ 745 | } 746 | if$ 747 | } 748 | INTEGERS { multiresult } 749 | FUNCTION {multi.page.check} 750 | { 't := 751 | #0 'multiresult := 752 | { multiresult not 753 | t empty$ not 754 | and 755 | } 756 | { t #1 #1 substring$ 757 | duplicate$ "-" = 758 | swap$ duplicate$ "," = 759 | swap$ "+" = 760 | or or 761 | { #1 'multiresult := } 762 | { t #2 global.max$ substring$ 't := } 763 | if$ 764 | } 765 | while$ 766 | multiresult 767 | } 768 | FUNCTION {format.pages}%%%%Поправлено (P вместо pp и p вместо pp) 769 | { pages empty$ 770 | { "" } 771 | { pages multi.page.check 772 | { bbl.ppage pages n.dashify tie.connect } 773 | % { bbl.page pages tie.connect } % поправлено 16.3.2012 774 | { bbl.ppage pages tie.connect } % поправлено 16.3.2012 775 | if$ 776 | } 777 | if$ 778 | } 779 | FUNCTION {format.pages.page}%%%%Поправлено (P вместо pp и p вместо pp) 780 | { pages empty$ 781 | { numpages empty$ 782 | { "" } 783 | { numpages bbl.page tie.connect } 784 | if$} 785 | { format.pages} 786 | if$ 787 | } 788 | FUNCTION {format.vol.num.pages} 789 | { volume field.or.null 790 | number empty$ 791 | 'skip$ 792 | { 793 | ", no." number tie.or.space.connect * 794 | volume empty$ 795 | { "there's a number but no volume in " cite$ * warning$ } 796 | 'skip$ 797 | if$ 798 | } 799 | if$ 800 | pages empty$ 801 | 'skip$ 802 | { duplicate$ empty$ 803 | { pop$ format.pages } 804 | { ": " * pages n.dashify * } 805 | if$ 806 | } 807 | if$ 808 | } 809 | FUNCTION {format.volume} 810 | { volume empty$ 811 | { "" } 812 | { bbl.vvol volume tie.or.space.connect } 813 | if$ 814 | } 815 | FUNCTION {format.number} 816 | { number empty$ 817 | { "" } 818 | { bbl.nr number tie.connect } %%%% правлено 819 | if$ 820 | } 821 | FUNCTION {empty.misc.check} 822 | { author empty$ title empty$ howpublished empty$ 823 | month empty$ year empty$ note empty$ 824 | and and and and and 825 | key empty$ not and 826 | { "all relevant fields are empty in " cite$ * warning$ } 827 | 'skip$ 828 | if$ 829 | } 830 | FUNCTION {format.thesis.type} 831 | { type empty$ 832 | 'skip$ 833 | { pop$ 834 | type 835 | } 836 | if$ 837 | } 838 | FUNCTION {format.tr.number}% выводим TYPE и NUMBER 839 | { type empty$ 840 | { bbl.techrep } 841 | 'type 842 | if$ 843 | number empty$ 844 | { "" } 845 | { number tie.or.space.connect } 846 | if$ 847 | } 848 | FUNCTION {format.tr.number1}% выводим только TYPE. Добавлено 849 | { type empty$ 850 | { bbl.techrep } 851 | 'type 852 | if$ 853 | } 854 | FUNCTION {format.tr.number2}% выводим только NUMBER. Добавлено 855 | { number empty$ 856 | { "" } 857 | { number } 858 | if$ 859 | } 860 | FUNCTION {author.before} 861 | { 862 | author empty$ 863 | 'skip$ 864 | {author num.names$ #4 < 865 | {format.authors output 866 | new.sentence} 867 | 'skip$ 868 | if$} 869 | if$ 870 | } 871 | FUNCTION {bookauthor.before} 872 | { 873 | bookauthor empty$ 874 | 'skip$ 875 | {bookauthor num.names$ #4 < 876 | {format.bookauthors output 877 | new.sentence} 878 | 'skip$ 879 | if$} 880 | if$ 881 | } 882 | FUNCTION {author.after} 883 | { 884 | author empty$ 885 | 'skip$ 886 | {author num.names$ #3 > 887 | {format.authors.after output 888 | new.semicolumn } 889 | 'skip$ 890 | if$} 891 | if$ 892 | } 893 | FUNCTION {bookauthor.after} 894 | { 895 | bookauthor empty$ 896 | 'skip$ 897 | {bookauthor num.names$ #3 > 898 | {format.bookauthors.after output 899 | new.semicolumn } 900 | 'skip$ 901 | if$} 902 | if$ 903 | } 904 | FUNCTION {editor.organization.after} 905 | { 906 | compiler empty$ 907 | {} 908 | { format.compiler.after output 909 | new.semicolumn 910 | } 911 | if$ 912 | editor empty$ 913 | {} 914 | { format.editors.after output 915 | new.semicolumn 916 | } 917 | if$ 918 | organization empty$ 919 | {} 920 | {organization output 921 | new.semicolumn 922 | } 923 | if$ 924 | } 925 | FUNCTION {format.url} 926 | { url empty$ 927 | { "" } 928 | { after.sentence 'output.state := 929 | "URL: " url * "" * 930 | } 931 | if$ 932 | } 933 | FUNCTION {format.annote} 934 | { annote empty$ 935 | { "" } 936 | { after.sentence 'output.state := 937 | "\BibAnnote{" annote * "}" * 938 | } 939 | if$ 940 | } 941 | FUNCTION {format.annoteurl} %%%%%%%% правлено 942 | { annote empty$ url empty$ or 943 | { "" } 944 | { after.sentence 'output.state := 945 | "URL:" "~" * url * " " * "\BibAnnote{" * annote * "}" * 946 | } 947 | if$ 948 | } 949 | FUNCTION {article} 950 | { output.bibitem 951 | author.before 952 | format.btitle "title" output.check 953 | new.slash 954 | author.after 955 | new.dblslash 956 | %%journal emphasize "journal" output.check%% правлено 957 | journal "journal" output.check 958 | new.block 959 | address output %%%%%%%% добавлено 960 | format.date output 961 | new.block 962 | format.volume output 963 | format.number output 964 | new.block 965 | format.pages.page output 966 | new.block 967 | note output 968 | new.sentence 969 | format.url output 970 | format.annote output 971 | fin.entry 972 | } 973 | FUNCTION {book} 974 | { output.bibitem 975 | author.before 976 | format.btitle "title" output.check 977 | new.slash 978 | author.after 979 | editor.organization.after 980 | new.sentence 981 | format.number.series output 982 | new.block 983 | format.edition output 984 | new.block 985 | output.address.publisher.date 986 | new.block 987 | format.bvolume output 988 | new.block 989 | format.pages.page output 990 | new.block 991 | note output 992 | new.sentence 993 | format.url output 994 | format.annote output 995 | fin.entry 996 | } 997 | FUNCTION {booklet} 998 | { output.bibitem 999 | author.before 1000 | format.title "title" output.check 1001 | new.slash 1002 | author.after 1003 | editor.organization.after 1004 | %%%%new.block%%%%%%%%%%убрано 1005 | new.column%%%%%%%%%%%%%добавлено 1006 | howpublished output 1007 | new.block%%%%%%%%%%%%%%добавлено 1008 | address output 1009 | format.date output 1010 | new.block 1011 | note output 1012 | new.sentence 1013 | format.url output 1014 | format.annote output 1015 | fin.entry 1016 | } 1017 | FUNCTION {inbook} 1018 | { output.bibitem 1019 | author.before 1020 | format.btitle "title" output.check 1021 | new.slash 1022 | author.after 1023 | new.dblslash 1024 | bookauthor.before 1025 | booktitle "booktitle" output.check 1026 | new.slash 1027 | bookauthor.after 1028 | editor.organization.after 1029 | new.block 1030 | format.edition output 1031 | new.block 1032 | format.number.series output 1033 | new.sentence 1034 | output.address.publisher.date 1035 | new.block 1036 | format.bvolume output 1037 | new.block 1038 | format.pages.page output 1039 | new.block 1040 | note output 1041 | new.sentence 1042 | format.url output 1043 | format.annote output 1044 | fin.entry 1045 | } 1046 | FUNCTION {incollection} 1047 | { output.bibitem 1048 | author.before 1049 | new.sentence 1050 | format.btitle "title" output.check 1051 | new.slash 1052 | author.after 1053 | new.dblslash 1054 | booktitle "booktitle" output.check 1055 | new.slash 1056 | editor.organization.after 1057 | new.block 1058 | format.number.series output%%%%%%%%%%%%%%%%%добавлено 1059 | new.block%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%добавлено 1060 | output.address.publisher.date 1061 | new.block 1062 | format.bvolume output 1063 | %format.number.series output%%%%%%%%%%%%%%%%%переставлено 1064 | new.block 1065 | format.pages.page output 1066 | new.block 1067 | note output 1068 | new.sentence 1069 | format.url output 1070 | format.annote output 1071 | fin.entry 1072 | } 1073 | FUNCTION {inproceedings} 1074 | { output.bibitem 1075 | author.before 1076 | new.sentence 1077 | format.title "title" output.check 1078 | new.slash 1079 | author.after 1080 | new.dblslash 1081 | booktitle "booktitle" output.check 1082 | new.slash 1083 | editor.organization.after 1084 | new.block 1085 | format.bvolume output 1086 | format.number.series output 1087 | new.block 1088 | address empty$ 1089 | { publisher output 1090 | format.date "year" output.check 1091 | } 1092 | { address output.nonnull 1093 | new.column 1094 | publisher output 1095 | format.date "year" output.check 1096 | } 1097 | if$ 1098 | new.block 1099 | format.pages.page output 1100 | new.block 1101 | note output 1102 | new.sentence 1103 | format.url output 1104 | format.annote output 1105 | fin.entry 1106 | } 1107 | FUNCTION {conference} { inproceedings } 1108 | FUNCTION {manual} 1109 | { output.bibitem 1110 | author empty$ 1111 | { organization empty$ 1112 | 'skip$ 1113 | { organization output.nonnull 1114 | address output 1115 | } 1116 | if$ 1117 | } 1118 | { format.authors output.nonnull } 1119 | if$ 1120 | new.block 1121 | format.btitle "title" output.check 1122 | new.block %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%вставлено 1123 | author empty$ 1124 | { organization empty$ 1125 | { 1126 | address new.block.checka 1127 | address output 1128 | } 1129 | 'skip$ 1130 | if$ 1131 | } 1132 | { 1133 | organization address new.block.checkb 1134 | organization output 1135 | address output 1136 | } 1137 | if$ 1138 | format.edition output 1139 | new.block%%%%%%%%%%%%%%%%%%%%%%%%%%вставлено 1140 | format.date output 1141 | new.block 1142 | note output 1143 | new.sentence 1144 | format.url output 1145 | format.annote output 1146 | fin.entry 1147 | } 1148 | FUNCTION {mastersthesis} 1149 | { output.bibitem 1150 | format.authors "author" output.check 1151 | new.block 1152 | format.btitle "title" output.check 1153 | %new.block%%%%%%%%%закомментировано 1154 | new.column%%%%%%%%%добавлено 1155 | bbl.mthesis format.thesis.type output.nonnull 1156 | new.column%%%%%%%%%%%%%%%добавлено 1157 | school "school" output.check 1158 | new.block%%%%%%%%добавлено 1159 | address output 1160 | format.date "year" output.check 1161 | new.block 1162 | note output 1163 | new.block 1164 | format.url output 1165 | format.annote output 1166 | fin.entry 1167 | } 1168 | FUNCTION {electronic} 1169 | { output.bibitem 1170 | format.authors output 1171 | title howpublished new.sentence.checkb 1172 | format.btitle output 1173 | howpublished new.block.checka 1174 | howpublished output 1175 | new.block 1176 | format.date output 1177 | new.block 1178 | note output 1179 | new.sentence 1180 | format.annoteurl output %%%%%%% правлено 1181 | fin.entry 1182 | } 1183 | FUNCTION {misc} 1184 | { output.bibitem 1185 | format.authors output 1186 | title howpublished new.sentence.checkb 1187 | format.btitle output 1188 | howpublished new.block.checka 1189 | howpublished output 1190 | new.block 1191 | format.date output 1192 | new.block 1193 | note output 1194 | new.sentence 1195 | format.url output 1196 | format.annote output 1197 | fin.entry 1198 | } 1199 | FUNCTION {phdthesis} 1200 | { output.bibitem 1201 | format.authors "author" output.check 1202 | new.sentence 1203 | format.btitle "title" output.check 1204 | %new.column 1205 | new.sentence 1206 | bbl.phdthesis format.thesis.type output.nonnull 1207 | %new.slash%%%%%%%%%%%%%%%%%%закомментировано 1208 | new.column%%%%%%%%%%%%%%%%добавлено 1209 | school "school" output.check 1210 | new.block 1211 | output.address.publisher.date 1212 | new.block 1213 | format.pages.page output 1214 | note output 1215 | new.sentence 1216 | format.url output 1217 | format.annote output 1218 | fin.entry 1219 | } 1220 | FUNCTION {proceedings} 1221 | { output.bibitem 1222 | format.btitle "title" output.check 1223 | new.slash 1224 | editor.organization.after 1225 | new.block 1226 | format.bvolume output 1227 | format.number.series output 1228 | address empty$ 1229 | { publisher output 1230 | format.date "year" output.check 1231 | } 1232 | { address output.nonnull 1233 | %format.date "year" output.check%%%%%%%%%%%%%%было 1234 | %new.sentence 1235 | %publisher output 1236 | new.column%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%стало 1237 | publisher output 1238 | format.date "year" output.check 1239 | } 1240 | if$ 1241 | new.block 1242 | note output 1243 | new.sentence 1244 | format.url output 1245 | format.annote output 1246 | fin.entry 1247 | } 1248 | FUNCTION {techreport} 1249 | { output.bibitem 1250 | author.before 1251 | new.sentence 1252 | format.title "title" output.check 1253 | new.column %%%%раскомментарено 1254 | %new.sentence %%%%закомментарено 1255 | %format.tr.number output.nonnull%%% заменено на отдельный вывод типа и номера 1256 | format.tr.number1 output.nonnull 1257 | new.column 1258 | format.tr.number2 output.nonnull%%% конец вставки 1259 | new.slash 1260 | author.after 1261 | editor.organization.after 1262 | new.block 1263 | address output 1264 | new.column 1265 | institution "institution" output.check 1266 | format.date "year" output.check 1267 | new.block 1268 | note output 1269 | new.sentence 1270 | format.url output 1271 | format.annote output 1272 | fin.entry 1273 | } 1274 | FUNCTION {unpublished} 1275 | { output.bibitem 1276 | author.before 1277 | format.btitle "title" output.check 1278 | new.slash 1279 | author.after 1280 | editor.organization.after 1281 | new.block 1282 | note "note" output.check 1283 | new.sentence 1284 | format.url output 1285 | format.annote output 1286 | fin.entry 1287 | } 1288 | FUNCTION {default.type} { misc } 1289 | MACRO {jan} {"\bbljan{}"} 1290 | MACRO {feb} {"\bblfeb{}"} 1291 | MACRO {mar} {"\bblmar{}"} 1292 | MACRO {apr} {"\bblapr{}"} 1293 | MACRO {may} {"\bblmay{}"} 1294 | MACRO {jun} {"\bbljun{}"} 1295 | MACRO {jul} {"\bbljul{}"} 1296 | MACRO {aug} {"\bblaug{}"} 1297 | MACRO {sep} {"\bblsep{}"} 1298 | MACRO {oct} {"\bbloct{}"} 1299 | MACRO {nov} {"\bblnov{}"} 1300 | MACRO {dec} {"\bbldec{}"} 1301 | MACRO {acmcs} {"ACM Computing Surveys"} 1302 | MACRO {acta} {"Acta Informatica"} 1303 | MACRO {cacm} {"Communications of the ACM"} 1304 | MACRO {ibmjrd} {"IBM Journal of Research and Development"} 1305 | MACRO {ibmsj} {"IBM Systems Journal"} 1306 | MACRO {ieeese} {"IEEE Transactions on Software Engineering"} 1307 | MACRO {ieeetc} {"IEEE Transactions on Computers"} 1308 | MACRO {ieeetcad} 1309 | {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"} 1310 | MACRO {ipl} {"Information Processing Letters"} 1311 | MACRO {jacm} {"Journal of the ACM"} 1312 | MACRO {jcss} {"Journal of Computer and System Sciences"} 1313 | MACRO {scp} {"Science of Computer Programming"} 1314 | MACRO {sicomp} {"SIAM Journal on Computing"} 1315 | MACRO {tocs} {"ACM Transactions on Computer Systems"} 1316 | MACRO {tods} {"ACM Transactions on Database Systems"} 1317 | MACRO {tog} {"ACM Transactions on Graphics"} 1318 | MACRO {toms} {"ACM Transactions on Mathematical Software"} 1319 | MACRO {toois} {"ACM Transactions on Office Information Systems"} 1320 | MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"} 1321 | MACRO {tcs} {"Theoretical Computer Science"} 1322 | READ 1323 | STRINGS { longest.label } 1324 | INTEGERS { number.label longest.label.width } 1325 | FUNCTION {initialize.longest.label} 1326 | { "" 'longest.label := 1327 | #1 'number.label := 1328 | #0 'longest.label.width := 1329 | } 1330 | FUNCTION {longest.label.pass} 1331 | { number.label int.to.str$ 'label := 1332 | number.label #1 + 'number.label := 1333 | label width$ longest.label.width > 1334 | { label 'longest.label := 1335 | label width$ 'longest.label.width := 1336 | } 1337 | 'skip$ 1338 | if$ 1339 | } 1340 | EXECUTE {initialize.longest.label} 1341 | ITERATE {longest.label.pass} 1342 | FUNCTION {begin.bib} 1343 | { "\begin{thebibliography}{" longest.label * "}" * write$ newline$ 1344 | "\def\selectlanguageifdefined#1{" write$ newline$ 1345 | "\expandafter\ifx\csname date#1\endcsname\relax" write$ newline$ 1346 | "\else\language\csname l@#1\endcsname\fi}" write$ newline$ 1347 | "\ifx\undefined\url\def\url#1{{\small #1}}\else\fi" write$ newline$ 1348 | "\ifx\undefined\BibUrl\def\BibUrl#1{\url{#1}}\else\fi" write$ newline$ 1349 | "\ifx\undefined\BibAnnote\long\def\BibAnnote#1{(#1)}\else\fi" write$ newline$ 1350 | "\ifx\undefined\BibEmph\def\BibEmph#1{\emph{#1}}\else\fi" write$ newline$ 1351 | preamble$ empty$ 1352 | 'skip$ 1353 | { preamble$ write$ newline$ } 1354 | if$ 1355 | } 1356 | EXECUTE {begin.bib} 1357 | EXECUTE {init.state.consts} 1358 | ITERATE {call.type$} 1359 | FUNCTION {end.bib} 1360 | { newline$ 1361 | "\end{thebibliography}" write$ newline$ 1362 | } 1363 | EXECUTE {end.bib} 1364 | %% 1365 | %% End of file `utf8gost705u.bst'. -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | CTF attack defense - platform for CTF competition. 635 | Copyright (C) 2017 Dmitry Mukovkin 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | CTF attack defense Copyright (C) 2017 Dmitry Mukovkin 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | --------------------------------------------------------------------------------