Code

White hat hacker tips for protecting IT projects from

White Hat Hacker Tips for Protecting IT Projects from Skillbox Media

Dive into Python: A Free Course for All Levels Create 4 Impressive Projects for Your Portfolio Live Interaction with a Speaker for Deep Learning

Learn More

Most information technology systems face insufficient data security. This leads to regular data leaks and service access issues due to cyberattacks. Even highly qualified specialists sometimes make mistakes and are not always able to assess the state of a system and the potential threats that may threaten it.

Security specialist Lev Prokopyev shared his experience in a broadcast for the Skillbox Code Experts community. In this article, we've compiled his advice on building secure projects and identified where to start working on protecting your service.

Contents

  • Prepare a list of assets and resources available to your company.
  • Model threats
  • Close accesses
  • Use the materials and tools provided by OWASP.
  • Ensure secure storage of your personal data.
  • Isolate the loop
  • Properly configuring a corporate VPN is essential.
  • Change your approach to recruiting.
  • What initiatives can be implemented currently with limited financial resources?

A security specialist engaged in independent research and testing for hacking resistance.

In his professional career, he worked for such companies as Solar Security, Kaspersky Lab, and BI.Zone. His expertise encompasses vulnerability analysis of both external and internal perimeters, as well as the development of software for attack purposes. He studies vulnerability exploitation, researches wireless network security, and develops methods for protecting against social engineering. His arsenal of skills includes programming languages, including Bash, Python, PowerShell, C/C++, JavaScript, and even Visual Basic.

Defining Organizational Resources

To create an effective security system, it is important to clearly understand what exactly needs to be protected. Therefore, the first step is to compile a comprehensive inventory of all company resources. This list should include not only those elements that directly contribute to profitability, but also all other assets, including both external and internal services. Next, you need to determine which of these services require internet access, and which can be successfully left isolated within the corporate network without negative consequences.

It is equally important to develop the habit of periodically reviewing your list to account for all potential threats and identify potential weaknesses in advance. Keep in mind that each new application or service entails additional risks.

At this stage, start-ups have the greatest advantage. Typically, they have only one business card website and do not face complex processes. Securing such an infrastructure is relatively easy. However, as the business grows, new services and systems are created, which complicates the implementation of security measures.

Model the threats

Once the list of the organization's resources is compiled, you can move on to the threat modeling stage. During this period, it is necessary to identify vulnerabilities and determine who could potentially have access to confidential information.

Start the analysis from the outer boundary. Whether you have an office, a local network, an Active Directory domain, 1C systems, Jira, or Confluence, it's important to document all possible risks. Treat each resource as a potential vulnerability, so devote time to its detailed investigation.

It's best to perform this task as part of a team. Security can't rest on the shoulders of just one person. At some point, they may burn out, which will lead to a decrease in their attention to work, and ultimately, everything may go awry. Therefore, it's important to include developers and administrators in the process so that everyone is responsible for their area. With proper distribution of responsibilities, the work will flow more smoothly.

Advice

Avoid unnecessary phone calls. Sometimes it's much more effective to discuss an issue with one person than to spend time on calls with the entire team. Record all necessary information in a knowledge base.

Don't forget the importance of the human element, as a mistake by one employee can pose a serious threat to the security of the entire system. Organize training events periodically to inform about possible types of attacks, the basics of cyber hygiene, and modern social engineering techniques.

Read also:

What should developers and organizations consider in the context of code security: an interview with Yuri Shabalin.

Close access

Imagine that you already have a list of your company's resources, you've formed a team, and identified potential threats. Now you can move on to practical steps and organize access. First, make a list indicating which employees have access to which systems. Then, analyze whether they really need these systems for their work.

For example, an organization employs a group of designers who have access to a user database. Perhaps this access was granted to them automatically, and they don't even realize they have such important information. Restricting access to critical data for such employees is entirely feasible. If any of them need to access information from the database, you can download the data or grant temporary access.

While you can fully trust your designers and be confident in their integrity, there is a risk from malicious actors. They can access one of your employees' accounts and steal confidential data.

We recommend implementing the zero trust concept. The essence of this approach is that no one should be automatically trusted, even within the corporate network. All access requests must be thoroughly verified and authorized.

Be sure to conduct a security audit of your offices, warehouses, and other areas where your employees are located. Ensure that processes are protected from external interference and sabotage to ensure your team's work is not put at risk. It is also important to ensure that employees have access only to the information necessary to complete their tasks. For example, warehouse workers should not be able to see data related to the sales department, and vice versa.

The basic rule is to limit employee access rights to the bare minimum. No employee should have more privileges than are necessary to perform their tasks. It is important to regularly audit and evaluate the access rights of employees. For example, if a person currently works in one department and is transferred to another in a month, it is worth reconsidering which systems they still need.

Use a zero-trust approach. This is based on the idea that trust should not be automatically granted to anyone, even when it comes to internal company networks. Every access request requires careful review and confirmation.

Using OWASP Tools and Best Practices

OWASP, or the Web Application Security Project, is a non-profit, open-access organization dedicated to improving the security of web applications. It offers a range of free tools and resources to help protect against a variety of threats.

OWASP offers a range of resources, including a list of the most serious security threats, a standard for assessing application security, and tools for identifying vulnerabilities.

Do you work with RFID and wireless networking? OWASP offers guides on these topics. Study the materials, absorb the information, and apply it. Security cannot be limited to individual measures - it must cover all aspects.

Read also:

OWASP Top 10 is a list of the most common vulnerabilities found in Web applications.

Keep your personal data secure

All information, especially sensitive information, should be stored in an encrypted or hashed format with salt. This will protect the data so that if it is stolen, attackers cannot use it.

Password hashing is the process of converting a password into a unique, fixed-length string, called a hash, using a special algorithm. This method provides security because it stores an encrypted representation of the password, not the password itself. When a new password is generated, the system applies the hash function and stores the resulting hash in the database.

When the user enters their password to log in, the system uses the same hash function again to convert the entered password into a hash and compare it with the already stored value. If both hashes match, access is granted. Thus, even if an attacker gains access to the database, they will not be able to recover the original passwords, since hashes cannot be reversed.

Modern hashing algorithms such as bcrypt, Argon2, and PBKDF2 include additional security measures, such as adding a salt—a random string that is appended to the password before it is hashed. This helps prevent rainbow table attacks and makes the cracking process significantly more difficult.

To begin the hashing process, a salt must be used—a set of data that is appended to the cryptographic key. This makes the task of brute-force password discovery more difficult.

Suppose we have the password "lolkekcheburek." We can append the character set "abcdef" to it, resulting in "lolkekcheburekabcdef." In this case, the appended sequence is the salt. If a hacker were to obtain such a password, they would be unable to use it without knowing what characters were added.

At this stage, you can begin hashing the password along with the salt. Hashing is a process that applies a reduction function to transform input data of any size according to a given algorithm. This is a one-way operation, meaning that it is impossible to recover the original password from the hash.

Imagine that we decided to encrypt our password using the salt "lolkekcheburekabcdef" and ended up with the character string "G5& f$7@rP". This way, only we would know what this means and how it could be used.

When choosing an algorithm for password hashing, it is recommended to give preference to options such as Argon2, PBKDF2, Bcrypt, and Scrypt. These algorithms offer a high level of security due to their computational complexity and the ability to adjust the number of hashing rounds. Additionally, you should avoid using outdated methods such as MD5 or SHA-1.

Also, it's a good idea to use a unique salt for each password. This means that if an attacker manages to guess one password, they won't be able to use that pattern for the others. Store salts and hashes in a safe, secure place and restrict access to this information.

Read also:

A hash function is an algorithm that converts input data of arbitrary size into a string of fixed length, called a hash. Such functions play a key role in various fields, including computer security, databases, and cryptography.

The main purpose of a hash function is to provide a unique representation of data. For example, it can be used to verify the integrity of files by allowing hashes to be compared to detect changes. If the hashes match, the data remains unchanged. If they differ, it can be concluded that the file has been modified.

Hash functions operate on the principles of mathematical algorithms. When using them, the input information goes through several stages of processing, resulting in a hash. Importantly, even a slight change in the original data will result in an entirely new hash, which ensures a high degree of sensitivity.

Hash functions have several important properties: they must be fast to compute, collision-resistant (meaning the probability of obtaining the same hash for different data should be minimal), and irreversible (the original data cannot be restored from its hash). These characteristics make them indispensable in modern information security systems.

Isolate the Circuit

During penetration testing or vulnerability analysis, the main goal of a cybercriminal is to gain access to users' personal data. Therefore, it is important to carefully consider the mechanisms for protecting this critical information to prevent its unauthorized extraction. One solution may be to create an isolated segment that only certain employees, rather than the entire staff, can access.

Network segmentation should be based on the level of data importance. This will protect the system from the transfer of threats between different segments. To achieve this, it is recommended to use firewalls, access control lists (ACLs), and ensure encryption of all communication channels, both for internal and external web services.

Imagine a situation where a new employee joined your team, came into the office, launched Wireshark on their laptop, and was able to intercept logins and passwords. Worse yet, they could have captured PhpMyAdmin or 1C system administrator credentials in network traffic, gaining access to your entire database. To prevent such incidents, it's essential to properly segment your network and isolate critical data to a separate, isolated network. Keep in mind that security threats aren't limited to sophisticated hackers. They could also come from disgruntled employees, disgruntled contractors, competitors, laid-off employees, or even someone who has gained access to your office Wi-Fi. Therefore, it is crucial to develop security measures on all fronts.

Image: Skillbox Media

Optimal configuration of corporate VPN

A VPN, or virtual private network, is a technology that provides a secure and reliable connection between employees and an organization's internal systems over the internet. This is especially important for protecting key processes, such as access to the corporate network, databases, and internal applications.

The most unwise decision is to set up services without due consideration and broadcast them to all network interfaces using the IP address 0.0.0.0. This is similar to leaving the doors of your house open and going for a walk, hoping an intruder won't come in. Often, administrators who act this way also fail to change default passwords.

To prevent such situations, configure the database server to use the IP address of the VPN interface for data transfer. Designate the IP address exclusively for the internal network and restrict access only to administrators. Ensure a configuration that prevents access to company resources without an active VPN connection.

Benefits of using a VPN in business:

  • Information security. When using a VPN, all transmitted data is encrypted. If intercepted, it becomes unusable.
  • Protection of key processes. Using a VPN ensures access to important systems is limited to users with appropriate rights, helping to reduce the likelihood of attacks on critical infrastructure.
  • Remote work. Employees can securely connect to the corporate network from anywhere in the world, while minimizing the risk of information leakage.

However, simply installing a VPN and teaching employees how to use it is not enough. Employees' devices remain at risk. For example, an attacker could hack a developer's laptop, steal passwords, and thus gain access to corporate systems via a VPN.

To prevent this, you need to:

  • Educate employees about the need to avoid clicking on suspicious links that may be found in instant messengers and emails.
  • Encourage them to generate strong and original passwords.
  • Make sure that all devices that connect to the VPN have antivirus software installed and are regularly updated.
  • Using password managers both improves ease of use and increases security.
  • Vendor software should be updated periodically to patch possible vulnerabilities.
  • Monitor VPN sessions to detect abnormal activity.

Read also:

Nine best everyday password managers

Transforming the approach to hiring

In a number of organizations, the recruitment process leaves much to be desired. Managers focus on documentation and often evaluate specialists without practical experience in this area. As a result, they hire employees who are unable to perform even a simple task, such as parsing JSON, and who struggle to solve initial problems.

Optimally, technical interviews should be conducted by qualified experts who understand what skills should be assessed and what aspects should be discussed. During the interview, it is important to provide space for candidates to express their thoughts and reasoning, rather than forcing them to memorize and repeat definitions from textbooks or cheat sheets designed for successful interviews.

Ideas for Implementation with Limited Financial Resources Today

If you have decided to ensure reliable protection of your company's or project's information, in this material we present a number of tools and methods that you can begin using immediately. We've carefully selected solutions to keep your initial security costs low.

SIEM (Security and Event Management) is a system designed to collect, analyze, correlate, and manage security data coming from various sources on the network. It acts as your eyes and ears. If you're not aware of what's happening on your network, you've already lost the battle.

As a first step, consider using Wazuh—a free platform designed for integrity monitoring and incident management. It will help you stay informed about events occurring on your system and proactively identify potential threats.

Russia has a highly effective antivirus solution—Kaspersky—and, frankly, this is a source of national pride. However, it's important to remember that this isn't a panacea that can solve all your problems. It's simply a means of identifying suspicious activity on devices. You will be responsible for analyzing the collected data, identifying threats, and verifying and updating signatures.

It is recommended to use tools for static and dynamic code analysis, such as Semgrep. Unexpected situations may arise during code execution. Dynamic analysis allows you to evaluate application performance in real time, detecting vulnerabilities that may go undetected by static analysis. It is important to incorporate this process into your CI/CD.

An IDS, or intrusion detection system, is a tool that monitors network traffic and detects attacks in real time. With it, you can promptly receive notifications about unauthorized access attempts to your services. When starting out, you can consider using the open-source software Suricata. This system is supported by an active community ready to help beginners understand all the nuances.

To ensure the security of web applications and the external perimeter, it is crucial to use a WAF, and one of the most suitable solutions is ModSecurity. This tool has a wide range of configuration options, allowing you to effectively protect against various threats, including SQL injections and XSS. Furthermore, it can be adapted to the specific needs of a company.

If your specialist cannot configure ModSecurity correctly, this may indicate a lack of web security expertise. A true expert should be able to effectively use this tool and provide reliable protection. In this situation, it is worth paying attention to paid WAF solutions, including high-quality products from Russian developers that can guarantee a high level of security.

Read also:

Common security mistakes in software development and how to avoid them

Tools like reNgine, Nuclei, Amass, and Nmap can be your trusted partners in assessing external threats. These tools allow you to analyze external infrastructure just like an attacker would.

It's best to host these tools on secure external servers to prevent data leaks. It's important to pay close attention to reNgine's settings. I recommend setting up the web panel so that it's only accessible on the local address 127.0.0.1, with the only external access being the SSH port using ed25519 authentication. After completing these steps, your team will be able to securely connect via SSH using a single command:

Once you've established a connection, you should specify a proxy server in your browser settings in the format socks5://localhost:4444. This action will provide access to the reNgine web panel through a secure tunnel.

Service protection should cover not only external threats but also potential risks arising within the corporate network. Regular audits, for example, using tools such as ADExplorer, BloodHound, PingCastle, AD Miner, and ADSpider, can significantly improve security. This will allow for the timely identification of vulnerabilities and the elimination of weaknesses. Issues related to BloodHound setup can be resolved by referring to the relevant documentation.

Screenshot: Pentester’s Promiscuous Notebook

For To stay up to date with the latest developments and changes in cybersecurity, it's worth checking out these interesting, though not very popular, Telegram channels:

  • Caster;
  • CyberSecrets;
  • RedTeam brazzers.

The Bottom Line

  • Make a complete inventory of all the systems and services you use. Be sure to specify who has access to what resources. Missing any items could lead to difficulties.
  • Try to identify potential threats to determine your vulnerabilities and who could exploit them. Involve the entire team in this process, because if one member doesn’t do their part, the consequences could affect everyone.
  • Access to information and resources should be limited to those who are actually authorized to do so. Each person should have only the privileges necessary. Anything that is not regularly reviewed will ultimately become your responsibility.
  • The OWASP Top Ten is not only a list of vulnerabilities, but also a guideline that helps avoid serious mistakes. It is important to have all aspects under control.
  • All critical data must be reliably protected. Use salted hashing. Legacy methods should be abandoned. If someone still uses MD5, it's time to take action. WPA2-Enterprise without client certificates? That's not an option either.
  • All important systems should be accessible exclusively via VPN. Multi-factor authentication, strong passwords, and regular updates are non-negotiable.
  • Technical interviews should be conducted by real experts. Remove bureaucratic barriers and empower technical experts to choose their colleagues. This approach is the key to success.

If you're interested in learning more about programming and coding, join our Telegram channel. We're waiting for you!

Read also:

  • A guide to cybersecurity for programmers and those new to the field.
  • Challenge: Determine where a hacker attack actually happened and where it didn't.
  • Offensive cybersecurity: A comprehensive guide from a white hat hacker.

If you're curious to learn more about programming and coding, join our Telegram channel. We will be glad to see you among our subscribers!