Man in the middle

A man-in-the-middle attack occurs when someone eavesdrop remotely and undetected on unsecured chatter between people and website. To intercept or possibly alter the website traffic a hacker can set up an unsecure WiFi hotspot (evil twin attack), installing a malware on the user’s PC or using a sniffer to intercept the traffic (network sniffer).

Evil twin attacks can be prevented by carefully considering networks before connecting. Oddities like frequent disconnects, promises of fast WiFi networks or strange WiFi locations can signal an evil twin attack.

A network sniffer is used to monitor the network traffic, view details of unencrypted requests or detect network vulnerabilities.

Websites often communicate with web browser over HTTPS which uses cryptography. So, two important measures to use a secure connection would be:

  • connect to a familiar, secured WiFi network
  • ensure the website uses HTTPS

Path traversal

Path traversal attack exploits improper handling of filenames in a website’s query string. Typically, the hackers are looking for private files not intended for user browsing, files that may contain sensitive data (payment data, server configuration elements, etc).

A way to prevent this kind of attack is by segregation. Public and private files are kept in different locations. For examples, the public files are on server A, the private files would be either in a secure partition on server A or on a secure file on server B.

Another way to prevent is to restrict permissions on the server. The principle of least privilege – systems operate with the least amount of privilege necessary.

Other measures are: keeping the server OS up-to-date, sanitizing paths for illegal character patterns or not relying on user input for filenames.

Session hijacking

A session ID is used to identify the visit of an user when he logs into a website. This information is exchanged between the server and the browser.

Typically, the session ID must be lengthy, random, unique and difficult to guess. This will increase the time for those trying to hijack it. If the session ID is predictable any type of hackers (novices, black hats, elites) could write a script to guess it.

A weak session ID can lead to the exposure of the user’s profile and his payment information and allowing the hackers to access the website without authentication.

Hackers can use a script to enumerate potential session IDs and try to access the website with them.

Many websites rely on web frameworks to generate safe and strong session IDs. Some measures like: deactivating session IDs after a period of time, change session IDs after each request or prevent reuse of session IDs. Also, some web frameworks choose to sign the cookies (append some encoded text to the cookie data) that hold the session ID. This digital signature is an enciphered value that can only be deciphered by the website. Cryptography!

SQL Injection

SQL injection is a very common and straight-forward website attack that can help hackers to expose a website database. With SQL injection we can execute unintended commands against website databases (many websites use SQL databases). Using SQL injection a hacker can become the database administrator and tamper with user data.

Typically,  the hackers use input fields on website to inject SQL.  For example, a form uses SQL to check the user’s account in the database – login, checkout , registration or contact forms. Any form on a website can be exploited during the SQL injection attempts.

The website can reject the suspicious form data by cleaning/sanitizing the input. That means ensuring that inputs don’t contain certain symbols, rejecting whitespace characters and using regular expressions to validate data. There are many characters that a hacker can use to exploit input

The best defense against SQL injection is to use parameterized SQL (prepared SQL). Parameters are placeholders and ensure input is safely used in SQL. They are interpreted by the database drivers.

There a lot of scripts to automate the SQL injection attacks.

 

Passwords

Many users choose short and simple passwords. Easy to remember makes them easy to crack only by guessing them.

The strength of a password increases with its length. Adding just a few more characters to a password can increase the time to crack it by years.

A way to generate strong password is to string together some meaningful words (combine some words) into a password phrase. Adding some complexity by adding some special characters and numbers.  A strong password should contain all of these elements (uppercase letters, numbers, lowercase letters, symbols like !, @, #, $).

An online dictionary attack There are some programs trying to login on a website using a dictionary file containing a list of common passwords (leaked passwords from another websites, a vocabulary list with words in different languages). The website can prevent that by limiting the amount of login attempts or by using a CAPTCHA on the login form.

Cryptography is used to make the passwords harder to crack. Before storing a password it must be encrypted. It can be decrypted only by those who have the key.

An offline dictionary attack occurs when a program is used to decrypt an encrypted password. This way the hacker can decrypt it in the comfort of his hideout.

A website can protect its password by encrypting the stored passwords, limiting the unsuccessful login attempts and require users to change passwords often.

Cryptographic hashing

Cryptographic hashing is used for storing passwords due to its one-way transformation, meaning there is no way to reverse the enciphering. Passwords are disguised and can’t be reversed to their original form.

When hashing, the output is usually 32 characters or more in length, no matter how long the original input is.

Hashing maintains privacy by allowing us to compare if two inputs are the same without knowing the content of the original inputs (the same input will always generate the same output).

The avalanche effect means that the slightest change in the input generates a totally different output. For example, even if a one letter change the resulting hash will be unrecognizable from the original.

There are different types of cryptographic hashing such as SHA-1 and MD5 (not safe anymore), the output length and the method of transformation being the primary way hash functions differ. SHA-256 or bcrypt are more secure.

Securing written communication, hiding words and providing secrecy are the mainly goals of cryptography.

Humanism – Homo deus

The only source for artistic creation and aesthetic value  is human feeling. If it feels good do it.

Art is anything people think is art and beauty is in the eye of the beholder – Duchamp’s fountain – an important milestone in the modern humanist world.

In a free market the customer is always right.

In education, the students should think for themselves.

Medieval Europe:  Knowledge = Scriptures x Logic;

Scientific Revolution: Empirical Data x Mathematics;

Humanism: Experiences (sensations, emotions, thoughts) x Sensitivity.

You can’t experience something if you don’t have the necessary sensitivity and you cannot develop your sensitivity without undergoing a lot of experiences.

Humanism sees life as a gradual process of inner change – develop your knowledge through a wide variety of intellectual, emotional and physical experiences.

Science and humanism – yang and yin. The yang provides us with power while the yin provides us with meaning and ethical judgements.

 

Cryptography

Cryptography is the science of writing in secret code. It transforms plain text into disguised text and only the intended recipient can decipher it because he knows the key to the cipher.

Cryptography has been used for thousands of years but the computers reinvented it and led to strong encryption.

Caesar cipher (the shift cipher)

Atbash cipher (monoalphabetic substitution cipher)

Polybius square (translates letters into numbers)

 

 

 

Hacking

Hacking is about seeking vulnerabilities in software, searching for security holes. The reasons why a person would want to be a hacker are various including curiosity, personal challenge or stealing data.

The intentions choose the type of hacker a person want to be:

White-hat (ethical)

A white hacker acts in the legal zone and he has to follow the following steps:

  • get the permission of the owner of the system
  • hack the system
  • tell the owner about the vulnerabilities

White-hat hackers help keeping businesses, society and software that affects every life safe.

Black-hat (cracker)

A black hacker has malicious intentions and many people consider him as the classic  definition of hackers.

No matter what the intentions are hacking a system without getting the permission is illegal.  Hacking is just a tool. It is everyone’s responsibility to decide what to use it for.

 

Azure Functions C#

An Azure Function is a way to create a function that can run in the cloud and can handle/respond to different events that can happen in Azure. For example,  something was changed in a BLOB.

The developper doesn’t need to care about Virtual Machines or any infrastructure. You create the function, you deploy and you run it.

Azure Functions allows the developer to create serverless applications.

Azure Functions support triggers which is a way to start the execution of the code.

What can you do with Azure Functions?

  • building APIs and microservices
  • working with internet of things
  • task to run on a schedule (image/order processing, file maintenance)