- Mac на службе у хакера. Часть 8 – Установка Kali Linux на виртуальной машине
- Почему операционная система Linux безопаснее Windows и Mac OS
- Не очень безопасный Windows
- Более безопасная macOS X
- Победитель в категории безопасности — Linux
- Why Linux is better than Windows or macOS for security
- Decisions made years ago about which operating system to roll out can affect corporate security today. Of the big three in widespread use, one can credibly be called the most secure.
- How we got here
- Does the OS really matter?
- Windows, the popular choice
- macOS X and security through obscurity
- And the winner is …
- Building security momentum
Mac на службе у хакера. Часть 8 – Установка Kali Linux на виртуальной машине
Мы практически закончили настройку Mac для хакерских нужд. Если вы еще не ознакомились с предыдущими частями этой серии, рекомендую это сделать.
Автор: Barrow
Мы практически закончили настройку Mac для хакерских нужд. Если вы еще не ознакомились с предыдущими частями этой серии, рекомендую это сделать.
Несмотря на то, что macOS совместима со стандартом POSIX, некоторые Linux-утилиты в этой операционной системе работать не будут. Иногда для того, чтобы все заработало, требуется небольшие телодвижения, иногда – серьезные усилия. Кроме того, существуют утилиты, которые не будут работать в macOS ни при каких условиях. Например, те, которые задействуют файловую систему proc, или многие хакерские утилиты, предназначенные для работы с беспроводными сетями.
В качестве одного из решений этой проблемы, можно попробовать портировать нужные инструменты, но это длительный процесс. Когда у нас возникает задача, необходимые приложения требуются «здесь и сейчас».
Поскольку в большинстве случаев у вас будут дедлайны без возможности приостановки текущего проекта, я рекомендую настроить Kali Linux в качестве виртуальной машины как один из инструментов вашего арсенала. В составе Kali есть огромное количество предустановленных утилит, которые пригодятся во время пентестов. Кроме того, этот дистрибутив легко устанавливается.
В этой статье мы рассмотрим установку и запуск виртуальной машины в macOS. Если вы, по каким-то причинам, не хотите иметь дело с виртуальными машина, можно либо купить отдельный недорогой компьютер, либо использовать USB флешку. Кроме того, вы можете установить Kali в отдельный раздел жесткого диска.
Шаг 1: Установка VirtualBox
Перед запуском Kali нам потребуется программное обеспечение, на базе которого будет работать виртуальная машина. На рынке есть множество подобного софта, как, например, VMware, но я предпочитаю бесплатное приложение VirtualBox от компании Oracle. Именно VirtualBox мы и будем рассматривать в этой статье.
После загрузки подключите дисковый образ, а затем дважды кликните на иконке VirtualBox.pkg:
Рисунок 1: Стартовый экран установочного образа
Установка VirtualBox не составляет особого труда. Просто следуйте инструкциям, которые будут появляться на экране. Возможно, в процессе установки потребуется ввод пароля один или два раза.
Рисунок 2: Последовательность шагов при установке VirtualBox
После завершения установки запустите VirtualBox из папки Applications.
Шаг 2: Загрузка Kali
Вы можете загрузить тот образ, который наиболее соответствует вашим нуждам. Кроме того, на сайте компании Offensive Security доступны предустановленные образы в том числе и для VirtualBox. Вам нужно лишь загрузить нужный образ, дважды кликнуть по файлу и следовать инструкциям для импорта образа в систему.
Несмотря на то, что предустановленные образы просты в установке (возможно, вы захотите установить набор расширений для корректной работы USB-устройств), у ISO-образа больше настроек. Я предпочитаю образы с XFCE, поскольку люблю легковесные графические среды, и далее будет показана процедура установки подобной системы с нуля. В стандартном образе используется среда Gnome, которая хоть и обладает массой возможностей, но требует много ресурсов.
Рисунок 3: Список доступных образов
Шаг 3: Создание новой виртуальной машины
В левом верхнем углу интерфейса приложения VirtualBox кликните на кнопку New.
Рисунок 4: Создание новой виртуальной машины
Далее появится несколько опций. Я решил назвать свою машину «Kali Linux», выбрал тип «Linux» и версию «Debian 64-bit». После того как все параметры установлены, нажмите «Continue».
Рисунок 5: Выбор параметров новой машины
Затем нужно установить размер памяти. Здесь все зависит от размеров памяти вашей основной системы. Слишком большой объем RAM виртуальной машины может привести к замедлению операционной системы хоста. Я установил размер 2 Гб, что более чем достаточно для Kali Linux. После установки размера памяти нажмите «Continue».
Рисунок 6: Установка размера памяти, используемой виртуальной машиной
Теперь нужно выбрать тип жесткого диска, который будет использоваться виртуальной машиной:
- Donotaddavirtualharddisk(не добавлять виртуальный жесткий): Kali Linux будет работать в интерактивном режиме без жесткого диска. Этот режим эквивалентен загрузке с USB флешки. Внесенные изменения сохраняться не будут.
- Createavirtualharddisknow(создать новый виртуальный жесткий диск): Будет создан новый жесткий диск, на который будет установлен Kali Linux. Я предпочитаю использовать виртуальный жесткий диск, поскольку в этом случае обновления и вся собранная информация (например, о целевых системах) сохраняются на виртуальной машине. Например, Metastploit использует базу данных для отслеживания учетных записей.
- Useanexistingvirtualharddiskfile(использовать существующий файл виртуального жесткого диска): эта опция используется в том случае, если вы хотите загрузить уже созданный жесткий диск. Например, если у нас есть готовый образ жесткого диска, мы можем подключить этот файл, используя данный параметр.
Выбор конкретной опции зависит от ваших нужд. Работа в интерактивном режиме допустима, однако в некоторых случаях вы будете работать с файлами и захотите, чтобы изменения были сохранены. Поэтому я создаю виртуальный жесткий диск. После выбора нужного параметра нажмите «Create».
Рисунок 7: Создание виртуального жесткого диска
Поскольку я решил создать новый жесткий диск, мне нужно настроить дополнительные параметры. В качестве типа файла я выбрал VDI, поскольку совместимость с другими приложениями для виртуализации мне не критична. Если вам нужна совместимость, необходимо выбрать соответствующий тип файла. После выбора нужной опции нажмите «Continue».
Рисунок 8: Выбор типа файла для жесткого диска
Следующий шаг – выбор типа размещения жесткого диска. Здесь возможно два варианта:
- Fixedsize(фиксированный размер): Будет создан фиксированный жесткий диск того размера, который мы установим.
- Dynamicallyallocated(динамическое размещение): Файл жесткого диска будет увеличиваться и уменьшаться в зависимости от нужд гостевой операционной системы.
Динамическое размещение помогает использовать дисковое пространство хоста более рационально. Фиксированный размер дает небольшой выигрыш в скорости. Я установил фиксированный размер, поскольку на моей машине много места. После выбора нужной опции нажмите «Continue».
Рисунок 9: Выбор типа размещения виртуального жесткого диска
Затем нужно установить размер жесткого диска. Для Kali Linux требуется объем не менее 10 Гб, и я думаю, что 15 Гб будет вполне достаточно. Кроме того, нужно указать местонахождение жесткого диска, кликнув на иконку с изображением папки рядом с полем, где указывается имя. Обычно я храню подобные файлы в директории Documents, хотя выбор папки особо ни на что не влияет. Далее нажмите на кнопку «Create».
Рисунок 10: Выбор размера виртуального жесткого диска
В моей системе с современным оборудованием новая виртуальная машина создалась за 12 секунд. Более старым системам может потребоваться больше времени.
Шаг 4: Установка и запуск Kali Linux
Если все прошло по плану, у вас должна появиться новая виртуальная машина в списке VirtualBox Manager:
Рисунок 11: Список виртуальных машин
Выберите виртуальную машину Kali Linux и нажмите на кнопку «Start». Появится окно для выбора установочного образа. Кликните на небольшую иконку с папкой и укажите путь к ISO образу, который вы загрузили в Шаге 2. Затем нажмите «Start».
Рисунок 12: Выбор установочного образа
Затем нужно выбрать режим установки в меню загрузчика GRUB и установить дистрибутив.
Рисунок 13: Загрузочное меню установочного образа
Заключение
Теперь, имея в арсенале настроенный macOS и виртуальную машину с Kali Linux, вы сможете решить практически любую задачу, связанную с пентестами. В следующих статьях мы рассмотрим другие утилиты для macOS.
Оставайтесь на связи.
Почему операционная система Linux безопаснее Windows и Mac OS
Для начала не забывайте о базовых правилах безопасности в компании.
- Не используйте рутовый пароль.
- Учите пользователей использовать сложные пароли и пользоваться такими инструментами, как LastPass.
Все решения, которые вы принимаете для компьютерных систем в компании, влияют на безопасность. Поэтому ОС также на нее влияет.
Не очень безопасный Windows
По оценкам cтатистики NetMarketShare, 88% компьютеров в сети используют Windows.
Компания Microsoft продолжает повышать безопасность системы. Среди улучшений: компания переписала код ОС, добавила свой антивирус, улучшила файерволы, ввела архитектуру песочницы, где программы не могут получить доступ к памяти ОС и другим приложениям.
Но основная проблема безопасности в том, что Windows — cамая популярная ОС. Безопасность ОС зависит в основном от количества людей, которые ее устанавливают себе на компы. Windows дает производителям вредоносного ПО простор для действий. Cамые громкие атаки вредоносного ПО — WannaCry, Melissa, — были направлены именно на Windows-системы.
Трой Вилкинсон, гендиректор компании Axiom Cyber Solutions говорит:
«ОС Windows всегда будет в конце рейтинга безопасности — в основном, из-за количества людей, которые ей пользуются».
Более безопасная macOS X
Если самая популярная ОС — самая частая мишень для атак, логично предположить, что менее распространенный вариант будет более безопасным.
Трой Вилкинсон говорит, что macOS X «в целом безопаснее, чем Windows. Раньше macOS считалась полностью безопасной с небольшим риском уязвимостей. Но за последние годы появились хакеры, которые научились делать вредоносное ПО, направленное против macOS».
Вывод: macOS X более безопасна, чем Windows, но не неуязвима, как было раньше.
Победитель в категории безопасности — Linux
Эксперты соглашаются, что Linux — самая безопасная ОС. Это самая популярная ОС на серверах. Но если говорить о корпоративном использовании, то компании не торопятся ее внедрять для сотрудников.
Если вы решите использовать Linux, нужно будет выбрать определенный дистрибутив. Пользователи в вашей компании будут хотеть более-менее понятный интерфейс, а вы будете ратовать за безопасность. Проблема в том, что чтобы пользоваться Linux, нужно быть более-менее продвинутым пользователем — эта ОС не для всех.
Отличительная черта безопасности Linux — открытый код. То, что программисты могут читать и комментировать код друг друга, может показаться небезопасным. Но это не так. Именно то, что у Linux открытый код, делает его самой безопасной ОС. Каждый может просмотреть код и удостовериться, что в нем нет багов или секретных ходов — все сообщество технарей обеспечивает безопасность Linux .
Katherine Noyes в статье PC World объясняет: «Microsoft может сколько угодно хвалиться своей армией нанятых программистов, но вряд ли их команда сравнится со всемирной базой программистов-пользователей Linux».
Другой фактор безопасности Linux, о котором говорит PC World: у Linux лучше настроена модель разрешений. На Windows пользователям обычно дают админский доступ по умолчанию. На Linux наоборот: там рутовый доступ сильно ограничен.
Третий фактор безопасности Linux — количество дистрибутивов. Некоторые из них специально разработаны таким образом, чтобы противостоять специфическим атакам.
Why Linux is better than Windows or macOS for security
Decisions made years ago about which operating system to roll out can affect corporate security today. Of the big three in widespread use, one can credibly be called the most secure.
Enterprises invest a lot of time, effort and money in keeping their systems secure. The most security-conscious might have a security operations center. They of course use firewalls and antivirus tools. They probably spend a lot of time monitoring their networks, looking for telltale anomalies that could indicate a breach. What with IDS, SIEM and NGFWs, they deploy a veritable alphabet of defenses.
But how many have given much thought to one of the cornerstones of their digital operations: the operating systems deployed on the workforce’s PCs? Was security even a factor when the desktop OS was selected?
This raises a question that every IT person should be able to answer: Which operating system is the most secure for general deployment?
We asked some experts what they think of the security of these three choices: Windows, the ever-more-complex platform that’s easily the most popular desktop system; macOS X, the FreeBSD Unix-based operating system that powers Apple Macintosh systems; and Linux, by which we mean all the various Linux distributions and related Unix-based systems.
How we got here
One reason enterprises might not have evaluated the security of the OS they deployed to the workforce is that they made the choice years ago. Go back far enough and all operating systems were reasonably safe, because the business of hacking into them and stealing data or installing malware was in its infancy. And once an OS choice is made, it’s hard to consider a change. Few IT organizations would want the headache of moving a globally dispersed workforce to an entirely new OS. Heck, they get enough pushback when they move users to a new version of their OS of choice.
Still, would it be wise to reconsider? Are the three leading desktop OSes different enough in their approach to security to make a change worthwhile?
Certainly the threats confronting enterprise systems have changed in the last few years. Attacks have become far more sophisticated. The lone teen hacker that once dominated the public imagination has been supplanted by well-organized networks of criminals and shadowy, government-funded organizations with vast computing resources.
Like many of you, I have firsthand experience of the threats that are out there: I have been infected by malware and viruses on numerous Windows computers, and I even had macro viruses that infected files on my Mac. More recently, a widespread automated hack circumvented the security on my website and infected it with malware. The effects of such malware were always initially subtle, something you wouldn’t even notice, until the malware ended up so deeply embedded in the system that performance started to suffer noticeably. One striking thing about the infestations was that I was never specifically targeted by the miscreants; nowadays, it’s as easy to attack 100,000 computers with a botnet as it is to attack a dozen.
Does the OS really matter?
The OS you deploy to your users does make a difference for your security stance, but it isn’t a sure safeguard. For one thing, a breach these days is more likely to come about because an attacker probed your users, not your systems. A survey of hackers who attended a recent DEFCON conference revealed that “84 percent use social engineering as part of their attack strategy.” Deploying a secure operating system is an important starting point, but without user education, strong firewalls and constant vigilance, even the most secure networks can be invaded. And of course there’s always the risk of user-downloaded software, extensions, utilities, plug-ins and other software that appears benign but becomes a path for malware to appear on the system.
And no matter which platform you choose, one of the best ways to keep your system secure is to ensure that you apply software updates promptly. Once a patch is in the wild, after all, the hackers can reverse engineer it and find a new exploit they can use in their next wave of attacks.
And don’t forget the basics. Don’t use root, and don’t grant guest access to even older servers on the network. Teach your users how to pick really good passwords and arm them with tools such as 1Password that make it easier for them to have different passwords on every account and website they use.
Because the bottom line is that every decision you make regarding your systems will affect your security, even the operating system your users do their work on.
Windows, the popular choice
If you’re a security manager, it is extremely likely that the questions raised by this article could be rephrased like so: Would we be more secure if we moved away from Microsoft Windows? To say that Windows dominates the enterprise market is to understate the case. NetMarketShare estimates that a staggering 88% of all computers on the internet are running a version of Windows.
If your systems fall within that 88%, you’re probably aware that Microsoft has continued to beef up security in the Windows system. Among its improvements have been rewriting and re-rewriting its operating system codebase, adding its own antivirus software system, improving firewalls and implementing a sandbox architecture, where programs can’t access the memory space of the OS or other applications.
But the popularity of Windows is a problem in itself. The security of an operating system can depend to a large degree on the size of its installed base. For malware authors, Windows provides a massive playing field. Concentrating on it gives them the most bang for their efforts.
As Troy Wilkinson, CEO of Axiom Cyber Solutions, explains, “Windows always comes in last in the security world for a number of reasons, mainly because of the adoption rate of consumers. With a large number of Windows-based personal computers on the market, hackers historically have targeted these systems the most.”
It’s certainly true that, from Melissa to WannaCry and beyond, much of the malware the world has seen has been aimed at Windows systems.
macOS X and security through obscurity
If the most popular OS is always going to be the biggest target, then can using a less popular option ensure security? That idea is a new take on the old — and entirely discredited — concept of “security through obscurity,” which held that keeping the inner workings of software proprietary and therefore secret was the best way to defend against attacks.
Wilkinson flatly states that macOS X “is more secure than Windows,” but he hastens to add that “macOS used to be considered a fully secure operating system with little chance of security flaws, but in recent years we have seen hackers crafting additional exploits against macOS.”
In other words, the attackers are branching out and not ignoring the Mac universe.
Security researcher Lee Muson of Comparitech says that “macOS is likely to be the pick of the bunch” when it comes to choosing a more secure OS, but he cautions that it is not impenetrable, as once thought. Its advantage is that “it still benefits from a touch of security through obscurity versus the still much larger target presented by Microsoft’s offering.”
Joe Moore of Wolf Solutions gives Apple a bit more credit, saying that “off the shelf, macOS X has a great track record when it comes to security, in part because it isn’t as widely targeted as Windows and in part because Apple does a pretty good job of staying on top of security issues.”
And the winner is …
You probably knew this from the beginning: The clear consensus among experts is that Linux is the most secure operating system. But while it’s the OS of choice for servers, enterprises deploying it on the desktop are few and far between.
And if you did decide that Linux was the way to go, you would still have to decide which distribution of the Linux system to choose, and things get a bit more complicated there. Users are going to want a UI that seems familiar, and you are going to want the most secure OS.
As Moore explains, “Linux has the potential to be the most secure, but requires the user be something of a power user.” So, not for everyone.
Linux distros that target security as a primary feature include Parrot Linux, a Debian-based distro that Moore says provides numerous security-related tools right out of the box.
Of course, an important differentiator is that Linux is open source. The fact that coders can read and comment upon each other’s work might seem like a security nightmare, but it actually turns out to be an important reason why Linux is so secure, says Igor Bidenko, CISO of Simplex Solutions. “Linux is the most secure OS, as its source is open. Anyone can review it and make sure there are no bugs or back doors.”
Wilkinson elaborates that “Linux and Unix-based operating systems have less exploitable security flaws known to the information security world. Linux code is reviewed by the tech community, which lends itself to security: By having that much oversight, there are fewer vulnerabilities, bugs and threats.”
That’s a subtle and perhaps counterintuitive explanation, but by having dozens — or sometimes hundreds — of people read through every line of code in the operating system, the code is actually more robust and the chance of flaws slipping into the wild is diminished. That had a lot to do with why PC World came right out and said Linux is more secure. As Katherine Noyes explains, “Microsoft may tout its large team of paid developers, but it’s unlikely that team can compare with a global base of Linux user-developers around the globe. Security can only benefit through all those extra eyeballs.”
Another factor cited by PC World is Linux’s better user privileges model: Windows users “are generally given administrator access by default, which means they pretty much have access to everything on the system,” according to Noyes’ article. Linux, in contrast, greatly restricts “root.”
Noyes also noted that the diversity possible within Linux environments is a better hedge against attacks than the typical Windows monoculture: There are simply a lot of different distributions of Linux available. And some of them are differentiated in ways that specifically address security concerns. Security Researcher Lee Muson of Comparitech offers this suggestion for a Linux distro: “The Qubes OS is as good a starting point with Linux as you can find right now, with an endorsement from Edward Snowden massively overshadowing its own extremely humble claims.” Other security experts point to specialized secure Linux distributions such as Tails Linux, designed to run securely and anonymously directly from a USB flash drive or similar external device.
Building security momentum
Inertia is a powerful force. Although there is clear consensus that Linux is the safest choice for the desktop, there has been no stampede to dump Windows and Mac machines in favor of it. Nonetheless, a small but significant increase in Linux adoption would probably result in safer computing for everyone, because in market share loss is one sure way to get Microsoft’s and Apple’s attention. In other words, if enough users switch to Linux on the desktop, Windows and Mac PCs are very likely to become more secure platforms.