Як хакери отримують ваші паролі

Та як цьому запобігти

Більшість програм, які обробляють чи зберігають цінні дані, реалізують один з методів ідентифікації користувачів. Більшість з них використовує автентифікацію за іменем користувача та паролем, з якою знайомий кожен відвідувач інтернету. Інші методи ідентифікації користувачів можуть використовувати біометричні дані (відбиток пальця, сітківку ока, форму долоні та ін.), фізичні ключі (магнітні та смарт-картки, цифрові токени та ін.), або ж комбінацію з двох чи навіть усіх трьох факторів автентифікації.

Пропускаючи роздуми про надійність паролів як методу автентифікації, давайте одразу перейдемо до того місця, де хакери крадуть ваші паролі. Так, паролі є однією з найпопулярніших цілей кіберзлочинців з двох причин:

  1. По-перше, і це очевидно, отримання вашого паролю надає будь-кому доступ до цінних даних у відповідній системі — службі електронної пошти, соціальній мережі, чи корпоративній мережі вашого роботодавця — до яких у вас є легітимний доступ. Іншими словами, всі ваші дані, накопичені до цього часу, тепер не ваші й з цим фактом доведеться жити навіть після виявлення компрометації та зміни паролю.
  2. По-друге, і це для багатьох буває сюрпризом, отримавши доступ до вашого аккаунту, зловмисник може, видаючи себе за вас, використовувати довіру ваших рідних, друзів, колег та просто знайомих, для поширення шкідливих програм або нелегального вмісту. І під нелегальним вмістом я маю на увазі не DVD-ріпи чи музику в MP3, а бази даних викрадених кредитних карт та дитячу порнографію. Компрометація довіри може набувати катастрофічних масштабів для жертви та її оточення, включаючи роботодавців та бізнес-партнерів.

Отже, яким саме чином хакери можуть дізнатися ваш пароль, та наскільки складно це зробити? Забігаючи наперед, відповім на друге питання: це залежить лише від вас та адміністратора системи, до якої ви здійснюєте доступ з таким паролем. А методи отримання паролів ось такі:

1. Підбір пароля онлайн

Коли сервіс або програма дозволяє доступ мережею, а в наш час інакше майже не буває, хакер може спробувати підібрати ваш пароль, знаючи ваше ім’я користувача (що зазвичай не є великою таємницею) та озброївшись списком “популярних” паролів, які були вкрадені ним або іншими хакерами в минулому. Ця процедура досить тривіальна, до того ж до послуг нападника декілька ефективних та безплатних інструментів її автоматизації, тому атака підбору пароля “за словником” не вимагає якихось спеціальних знань та навичок.

Отже, якщо ваш пароль ненадійний та міститься в одній з “колекцій” паролів (а їх в інтернеті чимало та більшість — безплатні), від підбору його захищає лише час, потрібний для здійснення атаки. Цей час залежить від швидкості роботи системи, професіоналізму її адміністратора, пропускної здатності мережі тощо. Але в одному можна бути впевненим: з часом такий пароль обов’язково зламають.

2. Підбір пароля оффлайн

Коли сервіс або програма містить вразливості безпеки, які дозволяють хакеру здійснити несанкціонований доступ до їхніх нутрощів (наприклад, бази даних), це може призвести до викрадення паролів користувачів у зашифрованому, або точніше хешованому вигляді. На жаль, трапляються випадки, коли паролі зберігаються в базі в чистому вигляді, тоді компрометація системи рівнозначна їх викраденню. Але про це згодом.

Plain text password:	my5uperDup3r$ecurePWD
MD5 hash (old *NIX):	eea2f7abd226770f85fbf69f836a3caf
LM hash (old Win):	AAD3B435B51404EEAAD3B435B51404EE 
NTLM hash (new Win):	244936F66C0BFF1C222011AA6D41AC2F 
SHA1 hash:	2c3d59e5df90826f5dde14104ecaa708544da842 
SHA256 hash:	57b1c949176683545fd1f8b7e8a74ff6b08d1936da875000a0e5f5f23929d18f

Отримавши доступ до бази даних хешованих паролів, хакер починає підбирати їхні незашифровані значення. Умовно це можна уявити як перебір усіх можливих текстових рядків, їх хешування у вигляд, в якому зберігаються паролі в пограбованому сервісі, та порівняння отриманих результатів зі значеннями у викраденій базі даних. Отримавши збіг хешованих даних, хакер отримує відкрите значення паролю. Звісно, в реальності цей процес трохи складніший та набагато швидший завдяки сучасним методам оптимізації. І звичайно ж в десятки мільйонів разів швидший за онлайн-підбір.

3. Повторне використання пароля

Не секрет, що багато користувачів використовують один пароль в декількох системах. На жаль, це поширена практика, дехто навіть скрізь використовує всього один пароль та гордо називає його “улюбленим”. Погана новина в тому, що витоки баз даних паролів відбуваються щодня, після чого ці бази або стають доступними публічно, або продаються на чорному ринку. Тому знайшовши пароль користувача з логіном [email protected] у викраденій базі аккаунтів ВКонтакте, хакер перевірить, чи підходить він в Однокласниках, Facebook та на VPN-сервері його компанії-роботодавця.

Дізнатися про те, як часто та в яких масштабах трапляються витоки баз даних паролів, можна на вебсайті https://haveibeenpwned.com. Там же можна перевірити, які з ваших паролів в інтернеті вже було скомпрометовано та підписатися на повідомлення про майбутні злами.

4. Викрадення або підглядання пароля

Найбільш різноманітним методом отримання наших паролів є їх викрадення з систем, в яких вони зберігаються або застосовуються. Зробити це можна порівняно просто: піддивившись як користувач вводить пароль в форму автентифікації; трохи складніше: знайшовши та використавши програмну вразливість в відповідній системі; або ж скориставшись методами соціальної інженерії для захоплення контролю над комп’ютером цілі та пошуку паролів у пам’яті та на диску комп’ютера.

В результаті хакер може заволодіти або паролем в чистому вигляді, або його хешем, який він згодом підбере офлайн.

5. Відновлення пароля через email або SMS

Більшість гідних поваги інтернет-сервісів дозволяють користувачам відновити втрачений чи забутий пароль за допомогою email або номера телефону, який використовувався під час реєстрації. (Менш підковані використовують для цього відповіді на “секретні питання”, які зазвичай не є такими вже й секретними). Отже, отримавши доступ до номера телефону або, що значно легше, до електронної пошти користувача, хакер може скористатися легітимною процедурою відновлення пароля.

6. Перехоплення пароля мережею

Досить популярний колись метод перехоплення пароля шляхом прослуховування мережевого трафіку став тепер менш поширеним через масову адоптацію криптографії інтернет-сервісами. Тепер майже усі популярні вебсайти забезпечують доступ по HTTPS, причому більшість вимагає цього за замовчуванням. В таких умовах прямий перехват та аналіз мережевих пакетів стає неефективним.

Сподіваюся, мені вдалося скласти загальну картину того, як важко зберегти ваші паролі в таємниці, якщо не докладати до цього жодних зусиль. У наступному пості я розкажу про прості та надійні засоби захисту, які може використати будь-хто для збереження своїх паролів та захищених ними секретів.

Leveraging the Strongest Factor in Security (Part II)

Since I’ve written the first part of this post in May, several related articles have appeared in different well-known online resources. The most notable of them, in my opinion, is this piece on Fortune that is trying to bridge infosec and business as many tried (and most failed) before them. You don’t have to read all the article’s text in order to catch what it and others have in common: the very first paragraph ends with the statement we all have long got used to.

If your company is like most, you’re spending an awful lot of your information technology budget on security: security products to protect your organization, security consultants to help you understand where your weaknesses lie, and lawyers to sort out the inevitable mess when something goes wrong. That approach can work, but it fails to consider the weakest link in your security fence: your employees.

So, if you’ve read my first post on the topic, you have an idea that anything that follows in the article might be misled by this stereotype. I warned you last time, that anything that sounds similar to “humans are the weakest security link” should be followed or preceded by “by default”. And by “default” I mean “in case your company’s security management did nothing to change that”.

But easier said than done, right? So what could one do in order to, well, leverage the strongest factor in security — the human nature?

To understand that, it’s necessary to get an idea about how our brain functions. I’ve spent quite some time getting familiar with this topic through reading the results of contemporary scientific research. And I encourage you to do the same! However, for the sake of this blog post, I am going to summarize the strongest points, ones you have to embrace in order to, well, see the light.

Imagine that inside every human brain there are three animals: a crocodile, a monkey, and an actual human being. If you are familiar with the brain’s structure, you already know that: different parts of it have grown during different evolutionary periods. Thus the croc is an impersonation of our reptile brain, the monkey is our mammal or limbic brain, and the human is our neocortex. Each of them is doing its job and there is a strong hierarchy between them.

The croc is the boss by default although he doesn’t micromanage. He is responsible for only three basic instincts –

  • Keeping safe from harm, including predators, natural disasters, and other crocs like himself;
  • Finding something to eat in order to not starve to death;
  • Finding a partner, if you know what I mean.

As you see, the crocodile brain executes the most important roles: the preservation of individual humans and the species overall.

The monkey trusts the croc with its life. It’s sometimes afraid of the croc too, but still, there are little chances it’s going to stay alive for long if croc falls asleep of is simply gone, so yeah, the monkey trusts the croc.

The monkey’s work is more complicated. Protected by the crocodile, it can dedicate some of its time training and learning from recurring experience. In other words, the monkey can be taught things if it does them enough times. There are many words to represent that ability, but we are going to stick to ‘the habit’. Using habits, we simplify our life as much as possible, for better or worse, but certainly — for easier.

And the human is normally much different from them both, because, well, you know, abstract thinking, complex emotions, ethical frameworks, cosmology, and sitcom TV shows. With all that, human brain optimizes its job as much as possible, so if there is a chance that the monkey can do something it has to do, the human will take that chance. Going through the different procedures over and over, we train the monkey, and once it’s ready we hand over the task to it. How many times your missed the turn and drove along your usual route to the office even on weekends? The monkey took over and the habit worked instead of your human reasoning that was busy with something else at that moment.

To some it may sound counterintuitive or even scary, but that’s how it is. If we thought out every decision we make, we wouldn’t be able to develop as a species and a society. Too much thinking at the moments of crisis would kill us: deciding on the tactics of dealing with a saber-tooth tiger would simply take all the time needed to run towards the cave or a nearest tree. Humans tend to shortcut and rely on their instincts and reflexes as much as possible. And in general it’s a good strategy, given that the humanity spent many centuries training the monkey and adjusting the croc’s input data.

But then… boom! cyber!

The recent development in technology and communications has changed our lives. Now we have to do many old things the new way and as a result it’s not easy for our brain to apply the tricks evolution taught us for millennia. The monkey’s old habits and the croc’s even older instincts are not triggered by the new signs of danger. We are used to dealing with danger tête-à-tête, not in front of a computer screen. Centuries old fraud tactics find new life online with the humans not able to resist them because of the scale of anonymity and ease of impersonation on the internet.

So what can we do? Not much, really. I don’t believe in technology when it comes to human nature. So I prefer to focus on the human (and the monkey, and the crocodile) instead. Having read and discussed much of what contemporary science can teach on behavioral economics, irrationality of decision making, and most importantly — habits, I have come to conclusion that people can be taught to effectively resist modern cyber-threats the same way they have learned to survive other hazards: by leveraging the instincts, installing new reflexes, and transforming the habits.

In the next post we’ll wrap it up with me presenting the method of transforming individuals and groups from a vulnerability to a countermeasure. Hope this sounds intriguing enough for you to stay tuned.

Leveraging the Strongest Factor in Security (Part I)

In January 2013, Gary McGraw has written an excellent piece on 13 secure design principles that summarize the high level ideas any security engineer or architect should be familiar with in order to be called so. Dr McGraw is of course that smart gentlemen from Cigital who wrote the “Software Security” book, records the “Silver Bullet” podcast, and has played his role in many career choices in the security industry. The first principle he explains is quite logical and intuitive: “Secure the weakest link”. This principle spans over many disciplines, such as project management and logistics, and is obvious to many: there hardly is other way to dramatically improve something than taking its worst part and fixing it. Pretty simple, right?

Picture credit: SC Magazine (https://www.scmagazine.com/defending-data-the-knowledge-factor/article/269211/)

The vast majority of information security professionals agree that human factor is the weakest element in any security system. Moreover, most of us promote this idea and don’t miss a chance to “blame the user” or address human stupidity as an infinite source of security problems. However, when you start challenging this idea and ask what in fact did they attempt to do in order to change the situation, the answers are few. Just try it yourself: every time you hear someone says “… you cannot fight phishing/social engineering/human error etc.”, kindly ask them: “And have you tried to?…” I do it all the time and believe me, it’s a lot of fun.

The uncomfortable truth is that human brain is very efficient in detecting and dealing with threats. In fact, it spends the majority of its computing time and calories burned to maintain this “situational awareness” that allows us to step on breaks long before we solve the equation system that represents the speeds and trajectories of our car and that one approaching from the side. Our brain, if trained properly, can serve as an effective security countermeasure that could outrun any security monitoring tool in detection or response. The problem is that we as an industry didn’t have as much time to train the humanity to monitor for, detect, and respond to technology threats as nature had for training us to avoid open fire, run from a tiger, and not jump from the trees. And even bigger problem is that we don’t seem to start doing it.

So, what’s wrong with us really? Why don’t we combine the common knowledge of human weakness in front of cyber threats and the maxim of securing the weakest link? I frankly have no idea. Maybe it’s because the knowledge domains that deal with human “internals”, such as neuroscience, psychology, and behavioral economics, are very different from what security people are used to deal with: networks, software, walls, and fences, — I don’t know. However, I have tried (harder ©) to improve the way people that are not security experts deal with cyber threats. And you know what? It’s more fun than blaming the user. But, I guess that’s enough for one post, to be continued…

This post has been originally posted on LinkedIn on May 25, 2016.

Personal infosec tips for 2016

(This post has been originally posted on LinkedIn on Dec 31, 2015).

It’s no secret that the computer security threat landscape changes constantly for both private individuals and corporations. Wannabe cybercriminals, as well as the real ones, compete with nation state sponsored intelligence agencies to get the most of our sensitive data. Their toolkits and modus operandi aren’t static and neither should be ours.

Considering the ever changing personal security agenda, I have decided to update my advise on personal computer security, or personal cybersecurity if you like (however, I assume this term is irrelevant in a private setting). It may look like I am biased towards Apple stuff at several points below, but there are at least two reasons for that. First, the company has made huge progress in protecting their customers privacy lately; and second, I am a long term Apple user myself so these things are just closer to my experience. So, let’s go shopping 🙂

1. Use less software and regularly update what you use

The principal idea here is that the more software you use the more vulnerable you are. If you don’t need it or start it once a year just to remind yourself what’s it doing on your computer, remove it now. If you still use Java or Flash you should consider removing them right now. There is no reasonable explanation for keeping Flash in your system and Java is getting there too. So, unless your employer still runs some piece of enterprise crapware that requires Java for workstation clients, remove it as well. And if you can’t at least consider forbidding it from running in your browser. A lot’s been said about keeping all your code up to date, so just do it. Pay most attention to your OS and web browser and review the possibility to automate third party apps updates by using Secunia PSI or MacInformer. (Most Linux users are lucky since software updating is an essential function of all modern distros.)

2. Use a VPN service or setup your own

VPNs are getting cheaper each day because you know… NSA has made it a highly competitive market lately. You can get a single subscription for all your devices from FreedomeVPN by F-Secure or PrivateVPNAccess. Both are affordable if connection privacy is of importance to you. You can even setup your own server on Amazon or DigitalOcean and run it for the cost of one virtual instance (DO price is $5 per month + $1 if you want backups). OpenVPN AS is much easier to install and configure than a true opensource openvpn, and it has a free license for 2 concurrent users and easy to use client software for all contemporary environments (no WinMobile though).

3. Use secure communications software

There are plenty of means for secure talks and messaging nowadays. On your smartphone, OpenWhisperSystems Signal does its job of protecting your VoIP calls and text messages. It’s free and runs smoothly on iOS and Android (no luck for those three WinMobile fans I can think of). If you decide to use something else, make sure its architecture is server-less, meaning your messages are encrypted peer-to-peer and not stored anywhere in between. iMessage, although limited to Apple users, is one of plausible examples and Facebook Messenger is not.

For email, use good old PGP. GPGTools allows using it with Apple Mail easily and transparently. I am sure there is a way of installing GnuPG with your email client on Windows and Linux has been providing its users with this capability for years. GMail fans who still rely on webmail interface can do it too. So it looks like there is no excuse left for those who say email crypto is hard: it’s absolutely not for quite a while now. GPGTools is free but I’m sure you’re going to donate once you see its value.

4. Use a password manager

There is no need to remember more than a few passphrases these days. Get a password manager that synchronizes between your devices, protect it with a strong password, and generate unique, random, virtually unbreakable authentication keys for everything else. Personally I recommend using 1Password if Apple ecosystem is your friend, otherwise you can take a look at Keepass. 1Password can be free unless you need iCloud sync, and Keepass is free and opensource.

5. Encrypt your files before putting them into the cloud

Boxcryptor encrypts your stuff before your Dropbox, iCloud, Google Drive etc. synchronizes it to their servers and gets ahold of your content. There is no reason to share your precious files with someone you don’t even know personally, so encrypt them before you upload them. Boxcryptor allows you to share files securely too by adding other users to encrypted shares and granularly managing their permissions. I suppose there are other services like that, just make sure they don’t have easy access to your keys and encrypt files locally before uploading. Boxcryptor is free to use with just one cloud storage.

6. Backup everything and backup frequently

Offline storage space gets less and less expansive each year. Buy a 1 or 2 TB USB hard drive and backup your valuable files at least once a month. Most importantly, encrypt your backups and backup your encryption keys, such as PGP keys and password database. Again, Apple users are the luckiest ones since the platform allows for seamless full and incremental backups protected by contemporary crypto.

That’s it for now. Be safe in 2016.

Updated 7/01/16 — This is a really nice guide on how you can make your work with OS X more secure. It collides with some points I’ve highlighted in my post and I believe every Mac user can find lots of good advice in there.

Як видалити аккаунт з ВКонтакте і Однокласники

та перенести Mail.Ru та Yandex Mail на GMail

В минулому пості я спробував пояснити, чому користуватися інтернет-сервісами, розташованими на території РФ, це проти людської природи. Сподіваюся, на вас це подіяло, тому ось декілька порад щодо того, як позбутися цих шкідливих звичок.

По-перше, все виявилося навіть гірше, ніж я думав. Ні в ВКонтакте, ні в Однокласниках я не знайшов можливості експортувати дані користувача. Які, до речі, є в усіх популярних сервісах з часів заснування Facebook. Таким чином, еволюція зазначених вище сервісів зупинилася десь на рівні MySpace, в якому такої кнопки ще не було.

Щоправда, для ВКонтакте є якийсь скрипт дворічної давнини на GitHub, сумніваюся, що він працює. В будь-якому разі, якщо можливість експорту існує, то вона реалізована третіми постачальниками.

Щодо електронної пошти, тут ситуація набагато краща. Через те, що пошта працює по стандартним протоколам та RFC, мігрувати будь-яку поштову скриньку у Google Mail зовсім просто користуючись ось цими порадами: 3 ways to move email from other accounts to Gmail. Для повного перенесення даних треба обрати перший варіант, а після міграції налаштувати у старому поштовому сервісі безумовне переправлення на нову адресу без збереження копій у старій поштовій скриньці. Ще можна налаштувати автовідповідач, в якому повідомити відправникам нову адресу електронної пошти та попросити в майбутньому використовувати саме її. Після двох-трьох місяців в такому режимі, коли всі ваші контакти вже будуть в курсі змін, що відбулися, стару поштову скриньку можна буде видалити назавжди.

З видаленням аккаунтів в поштових сервісах все більш-менш зрозуміло, а от знайти посилання, за якими можна видалитися з Однокласників та ВКонтакте, з першої спроби мені не вдалося. Дякувати Гуглу, багато часу пошук не забрав: очевидно, це популярна тема. Отже, видалитися з зазначених сервісів можна ось так:

  • Видалитися з Однокласників. Ідемо на умови надання сервісу та натискаємо на посилання про видалення аккаунту в самому кінці сторінки. Після відповіді на питання що ж нам у них не сподобалось та введення паролю все закінчиться.
  • Видалитися з ВКонтакте. Переходимо на таку адресу — https://vk.com/settings?act=deactivate, обираємо причину, і все — тепер ви вільна людина.

Якщо в когось з читачів є інформація щодо методів експорту котиків та листування з колишніми з ОК та ВК — прошу поділитися з метою покращення КПД цього посту. Дякую заздалегідь.