{"id":17011,"date":"2020-07-09T15:15:15","date_gmt":"2020-07-09T11:15:15","guid":{"rendered":"https:\/\/me-en.kaspersky.com\/blog\/fairy-tales-ali-baba\/17011\/"},"modified":"2020-07-09T15:15:15","modified_gmt":"2020-07-09T11:15:15","slug":"fairy-tales-ali-baba","status":"publish","type":"post","link":"https:\/\/me-en.kaspersky.com\/blog\/fairy-tales-ali-baba\/17011\/","title":{"rendered":"Ali Baba and the forty cyberthreats"},"content":{"rendered":"<p>As we never tire of saying, fairy tales are thinly veiled reports on information security. And it wasn\u2019t only the European storytellers who tried to warn their descendants about cyberthreats \u2014 they were equally prescient in the East. For example, Scheherazade, the protagonist of the classic 1001 Nights, kept what can only be described as a daily infosec blog with video podcasts. True, he had an ulterior motive for doing so \u2026<\/p>\n<p>\u2026 but today we\u2019re looking at some cases added to <a href=\"https:\/\/en.wikipedia.org\/wiki\/One_Thousand_and_One_Nights\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Scheherazade\u2019s blog<\/a> much later, in the 18th century: in particular, the incident known as Ali Baba and the Forty Thieves. Even those who don\u2019t know the story are surely familiar with the magical phrase, \u201cOpen sesame!\u201d<\/p>\n<p>Indeed, the entire plot is built around the idea of using a password to protect against unauthorized access. But that is far from the only information security tip in the fairy tale. It\u2019s just the most obvious.<\/p>\n<h2>Password transfer through an insecure channel<\/h2>\n<p>Here\u2019s a quick story refresher: A gang of robbers hides some loot in a cave that can only be accessed using the password open sesame. The protection mechanism harbors a number of serious flaws.<\/p>\n<p>At the very start of the tale, the leader of the thieves stands at the entrance and shouts loudly: \u201cOpen sesame!\u201d Several issues are immediately apparent. First, the password is too simple. Second, there is no two-factor authentication \u2014 or even a username!<\/p>\n<p>Even worse, the password is transmitted over an open channel. Ali Baba, who is collecting firewood nearby, inadvertently overhears the robber. In fact, it\u2019s only out of curiosity, with no malicious intent, that he later tries the password. When the cave opens, however, he enters the cave and expropriates some of the treasure inside.<\/p>\n<h2>Spyware module<\/h2>\n<p>On his return home, Ali Baba gives the gold coins to his wife to count. She tries to do it manually, but there are so many she loses count and instead borrows a measuring  instrument from her sister-in-law, the wife of Ali Baba\u2019s brother, Kasim.<\/p>\n<p>Some translations specify kitchen scales, some say that it was a pot of some kind, but it\u2019s not a weighty detail, so to speak. What\u2019s important is that the curious Kasim\u2019s wife smears the bottom of the instrument with honey (suet in some translations) to find out why her relative needs it all of a sudden. And when it\u2019s returned, lo and behold, a gold coin is stuck to the bottom \u2014 which means that her sister-in-law was using it to count gold!<\/p>\n<p>Even a cyberdunce can see that the author is describing a spyware module integrated into a legitimate product. Kasim\u2019s wife provides a device (under the Measure-as-a-Service model) and spies on the activity of the client. The clear moral of the story is: Use tools from trusted sources \u2014 and check them for vulnerabilities and malicious implants.<\/p>\n<h2>Forgotten passwords<\/h2>\n<p>What happens next seems a little far-fetched to me. Ali Baba confesses everything to Kasim and tells him the password. The latter enters the cave. Inside, he manages to forget the password (which is also needed to get out), gets trapped, and has his head chopped off when the thieves find him there. The marketing message is clear: \u201cDon\u2019t lose your head over a forgotten password,\u201d or something along those lines.<\/p>\n<p>I suspect that back in the day, this part of the story contained a product pitch for some ancient password manager used by Sasanid techies, but the original message has been erased through endless retelling. To compensate, we\u2019ll insert our own: <a href=\"https:\/\/me-en.kaspersky.com\/password-manager?icid=me-en_kdailyplacehold_acq_ona_smm__onl_b2c_kasperskydaily_wpplaceholder____kpm___\" target=\"_blank\" rel=\"noopener\">Kaspersky Password Manager<\/a> securely stores passwords and other confidential information.<\/p>\n<input type=\"hidden\" class=\"category_for_banner\" value=\"kpm-download\">\n<h2>Never-changing password<\/h2>\n<p>But let\u2019s be-heading back to the story. After Kasim fails to come home, his relatives take off to look for him. Ali Baba goes back to the cave, finds his brother\u2019s body, and takes him home for burial.<\/p>\n<p>In the process, the reader is shown another example of a pitiful password policy: The robbers don\u2019t change the password after the incident. The exact reason isn\u2019t clear. It might be plain negligence, or the initially ill-conceived architecture of the authentication system.<\/p>\n<p>At the same time, it\u2019s possible that they simply don\u2019t have administrator rights. If they hijacked the cave (they\u2019re thieves, after all), they probably have only a user password. The real owner would\u2019ve taken his admin credentials to the grave.<\/p>\n<h2>Attack through a contractor<\/h2>\n<p>Because Ali Baba wants to keep the story secret, he can\u2019t bury a corpse with a severed head. So he and his brother\u2019s widow, plus her handmaid, Marjaneh, do all that they can to obfuscate what\u2019s going on. Marjaneh makes several trips to a pharmacist for medicine, making it seem that Kasim is getting sicker and sicker, and eventually reports that he has died a natural death.<\/p>\n<p>In the meantime, she brings a cobbler to the house to stitch Kasim\u2019s body back together. Moreover, she blindfolds the cobbler and leads him on a circuitous route so that he doesn\u2019t know where he is.<\/p>\n<p>The robbers, trying to source the information leak, close in on the cobbler. Promising him gold, they too blindfold the old man and force him to retrace his steps to the house.<\/p>\n<p>This example demonstrates that even if you work with contractors over a secure encrypted channel, sensitive information can still leak to intruders. Perhaps Marjaneh should have signed a nondisclosure agreement with the cobbler.<\/p>\n<h2>Honeynet<\/h2>\n<p>One of the gang members marks the gate of Kasim\u2019s house, where Ali Baba now lives, and returns with his associates that night to slaughter its occupants. However, the cunning Marjaneh spots the sign and marks the gates of all of the other houses on the street in exactly the same way, thereby foiling the attack.<\/p>\n<p>Essentially, Marjaneh turns the street into a kind of network of <a href=\"\/\/encyclopedia.kaspersky.com\/glossary\/honeypot\/\" target=\"_blank\" rel=\"noopener noreferrer\">honeypot<\/a> hacker traps. In theory, it works as follows: intruders in the network mistake one of the honeypots for the target, start to attack it, and thus reveal their intentions and methods. In the time it takes them to realize their error, experts from a government cyberresponse unit swoop down and stop the attack.<\/p>\n<p>All that remains is the question of how ethical it is to use the homes of innocent users as honeypots. In any case, no real harm is done; the robbers spot the ruse in time and call off the attack.<\/p>\n<h2>Containerization<\/h2>\n<p>The captain of the thieves decides to take personal charge of the attack. He acquires 40 huge jars (a possible reference to .JAR \u2014 the Java ARchive file format), two filled with oil, the rest empty. The jars with oil are there to fool a superficial scan; the robbers hide in the empty ones.<\/p>\n<p>With this cargo, he shows up at the house of Ali Baba. The plan is for the captain, disguised as an oil seller, to charm his way inside as a guest with the intention of releasing the robbers later, when everyone is asleep.<\/p>\n<p>On the whole, this is a description of an infrastructure attack using malware hidden in containers. Because the scanners at the entrance do not check inside the containers, the threat sneaks through the security perimeter. The insider captain then activates the malware.<\/p>\n<p>But Marjaneh again saves the day by overhearing a thief in one of the jars. She checks each container, determines which of them contain bandits, and then pours in boiling oil, thus eliminating the threat. In other words, even back then she had a tool for scanning the contents of containers. Our <a href=\"https:\/\/me-en.kaspersky.com\/enterprise-security\/devops-security?icid=me-en_kdailyplacehold_acq_ona_smm__onl_b2b_kasperskydaily_wpplaceholder_______\" target=\"_blank\" rel=\"noopener\">Kaspersky Hybrid Cloud Security<\/a> solution has the same technology \u2014 only 1,500 years more up-to-date.<\/p>\n<p>In the end, justice prevails. The leader of the thieves is killed; Marjaneh marries Ali Baba\u2019s son (who appears out of nowhere at the end of the tale); and Ali Baba remains the only one with the password to the treasure-filled cave.<\/p>\n<h2>The moral of the story<\/h2>\n<ul>\n<li>When designing an authentication system, keep security in mind. Using a hard-coded password transmitted over an unencrypted channel without multifactor authentication is simply asking for trouble.<\/li>\n<li>Choose suppliers and subcontractors carefully. If possible, check their tools and services for vulnerabilities and malicious implants, and do not forget to have all parties sign nondisclosure agreements (NDAs).<\/li>\n<li>Use a <a href=\"https:\/\/me-en.kaspersky.com\/enterprise-security\/devops-security?icid=me-en_kdailyplacehold_acq_ona_smm__onl_b2b_kasperskydaily_wpplaceholder_______\" target=\"_blank\" rel=\"noopener\">security solution<\/a> that scans the contents of containers when they are loaded to prevent malicious code from getting into your project from a compromised repository.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>It turns out that the tale of Ali Baba is a collection of stories from ancient Persia about \u2026 cyberthreats?<\/p>\n","protected":false},"author":700,"featured_media":17012,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1318,1916,1917],"tags":[2319,2320,187,489,1393,2047],"class_list":{"0":"post-17011","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-business","8":"category-enterprise","9":"category-smb","10":"tag-containers","11":"tag-fairy-tale","12":"tag-passwords","13":"tag-social-engineering","14":"tag-spies","15":"tag-truth"},"hreflang":[{"hreflang":"en-ae","url":"https:\/\/me-en.kaspersky.com\/blog\/fairy-tales-ali-baba\/17011\/"},{"hreflang":"en-in","url":"https:\/\/www.kaspersky.co.in\/blog\/fairy-tales-ali-baba\/21548\/"},{"hreflang":"ar","url":"https:\/\/me.kaspersky.com\/blog\/fairy-tales-ali-baba\/8410\/"},{"hreflang":"en-us","url":"https:\/\/usa.kaspersky.com\/blog\/fairy-tales-ali-baba\/22784\/"},{"hreflang":"en-gb","url":"https:\/\/www.kaspersky.co.uk\/blog\/fairy-tales-ali-baba\/20880\/"},{"hreflang":"es-mx","url":"https:\/\/latam.kaspersky.com\/blog\/fairy-tales-ali-baba\/19615\/"},{"hreflang":"es","url":"https:\/\/www.kaspersky.es\/blog\/fairy-tales-ali-baba\/23464\/"},{"hreflang":"it","url":"https:\/\/www.kaspersky.it\/blog\/fairy-tales-ali-baba\/22287\/"},{"hreflang":"ru","url":"https:\/\/www.kaspersky.ru\/blog\/fairy-tales-ali-baba\/28706\/"},{"hreflang":"tr","url":"https:\/\/www.kaspersky.com.tr\/blog\/fairy-tales-ali-baba\/8568\/"},{"hreflang":"x-default","url":"https:\/\/www.kaspersky.com\/blog\/fairy-tales-ali-baba\/36284\/"},{"hreflang":"fr","url":"https:\/\/www.kaspersky.fr\/blog\/fairy-tales-ali-baba\/15240\/"},{"hreflang":"pl","url":"https:\/\/plblog.kaspersky.com\/fairy-tales-ali-baba\/13708\/"},{"hreflang":"de","url":"https:\/\/www.kaspersky.de\/blog\/fairy-tales-ali-baba\/24660\/"},{"hreflang":"zh","url":"https:\/\/www.kaspersky.com.cn\/blog\/fairy-tales-ali-baba\/11699\/"},{"hreflang":"ja","url":"https:\/\/blog.kaspersky.co.jp\/fairy-tales-ali-baba\/28802\/"},{"hreflang":"nl","url":"https:\/\/www.kaspersky.nl\/blog\/fairy-tales-ali-baba\/25660\/"},{"hreflang":"ru-kz","url":"https:\/\/blog.kaspersky.kz\/fairy-tales-ali-baba\/22575\/"},{"hreflang":"en-au","url":"https:\/\/www.kaspersky.com.au\/blog\/fairy-tales-ali-baba\/27828\/"},{"hreflang":"en-za","url":"https:\/\/www.kaspersky.co.za\/blog\/fairy-tales-ali-baba\/27668\/"}],"acf":[],"banners":"","maintag":{"url":"https:\/\/me-en.kaspersky.com\/blog\/tag\/truth\/","name":"truth"},"_links":{"self":[{"href":"https:\/\/me-en.kaspersky.com\/blog\/wp-json\/wp\/v2\/posts\/17011","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/me-en.kaspersky.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/me-en.kaspersky.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/me-en.kaspersky.com\/blog\/wp-json\/wp\/v2\/users\/700"}],"replies":[{"embeddable":true,"href":"https:\/\/me-en.kaspersky.com\/blog\/wp-json\/wp\/v2\/comments?post=17011"}],"version-history":[{"count":0,"href":"https:\/\/me-en.kaspersky.com\/blog\/wp-json\/wp\/v2\/posts\/17011\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/me-en.kaspersky.com\/blog\/wp-json\/wp\/v2\/media\/17012"}],"wp:attachment":[{"href":"https:\/\/me-en.kaspersky.com\/blog\/wp-json\/wp\/v2\/media?parent=17011"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/me-en.kaspersky.com\/blog\/wp-json\/wp\/v2\/categories?post=17011"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/me-en.kaspersky.com\/blog\/wp-json\/wp\/v2\/tags?post=17011"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}