Brian

How Penetration Testing Tools Can IT Support Engineers

Photo by Christina @ wocintechchat.com on Unsplash

Nmap

Nmap, short for Network Mapper, is a reconnaissance tool that is widely used by ethical hackers to gather information about a target system. This information is key to deciding the proceeding steps to attack the target system. Nmap is cross-platform and works on Mac, Linux, and Windows. It has gained immense popularity in the hacking community due to its ease of use and powerful searching and scanning abilities.

Using Nmap you can:

  • Audit device security
  • Detect open ports on remote hosts
  • Network mapping and enumeration
  • Find vulnerabilities inside any network
  • Launch massive DNS queries against domains and subdomains

Wireshark

Wireshark is free open-source software that allows you to analyze network traffic in real-time. Thanks to its sniffing technology, Wireshark is widely known for its ability to detect security problems in any network, as well as for its effectiveness in solving general networking problems. While sniffing the network, you’re able to intercept and read results in a human-readable format, which makes it easier to identify potential problems (such as low latency), threats and vulnerabilities.

Main features:

  • Saves analysis for offline inspection
  • Packet browser
  • Powerful GUI
  • Rich VoIP analysis
  • Inspects and decompresses gzip files
  • Reads other capture file-formats including Sniffer Pro, Tcpdump, Microsoft network monitor, Cisco Secure IDS IP log, etc.
  • Exports results to XML, PostScript, CSV, or plain text

Wireshark supports up to 2000 different network protocols, and is available on all major operating systems including:

  • Linux
  • Windows
  • Mac OS X

Wapiti

Wapiti is a free open-source command-line based vulnerability scanner written in Python. While it’s not the most popular ethical hacking tool in this field, it does a good job of finding security flaws in many web applications. Using Wapiti can help you to discover security holes including:

  • XSS attacks
  • SQL injections
  • XPath injections
  • XXE injections
  • CRLF injections
  • Server-side request forgery

What are Best Practices for Data Security?

Photo by Dayne Topkin on Unsplash

Data security relies on defense-in-depth, so there are many parts to a best-in-class data security program. But what is sufficient in one industry may be criminally negligent in another.

Best practices should be adopted to achieve the industry’s minimal expected data security level.

1. Data Governance

Data governance is data management 101. Information is grouped into different buckets based on its sensitivity and legal requirements. To limit the risk of data exposure from leaked credentials, users should only have access to the least amount of data they need to do their job.

2. Secure Privileged Access Management

Secure Privileged Access Management (PAM) is integral to a data security strategy. PAM empowers organizations to control the permissions of all users so that sensitive data and intellectual property documentation are only accessible by those that absolutely require it. With a secure PAM strategy, cybercriminals will have difficulty accessing all sensitive data types if they breach an IT boundary. This is especially an important security control for highly regulated industries like healthcare.

3. Encryption

Encryption can protect against man-in-the-middle attacks and make it harder for potential attackers to gain unauthorized access to stored or in transit information. Never store sensitive data in plain text and avoid providing login credentials to websites that lack SSL certificates.

4. Education

Teach staff how to recognize common cyber threats to transform them into human firewalls Some of the most popular cyber threats staff should be aware of include: Phishing attacks, Email spoofing, Domain hijacking, Ransomware attacks, and Different forms of malware attacks, Social engineering attacks.

Besides cyberattacks, staff should also be trained in best cybersecurity practices such as avoiding public Wi-Fi networks and the basics of OPSEC and network security. The complexity of cyberattacks is rapidly rising, so it’s no longer acceptable to solely rely on antivirus programs to prevent malicious code injection. Cybersecurity train needs to become a standard inclusion in staff onboarding programs.

5. Data Security Testing

Test your organization’s data security by sending fake spearphishing campaigns and dropping USB traps around the office. Understand that it is easier to prevent data breaches than rely on digital forensics and IP attribution to understand what happened once a data breach has occurred. Once exposed, data can easily end up for sale on the dark web; many of the biggest data breaches end up there.

6. Incident Response Plan

When your security is compromised, the last thing your organization and your customers need is panic. An incident response plan can limit the amount of data exposed and outline clear next steps to recover lost data or close the attack vector.

7. Regular Data Backups

Ransomware attacks targeting data centers on-premises or accidental deletion devastated business continuity, but this can be avoided with regular backups and a Data Loss Prevention (DLP) program.

8. Secure Deletion

Avoid hoarding data no longer in use, including physical data like folders or paper documents. That said, comply with industry guidelines or regulations that dictate how long you must store data.

9. Third-Party and Fourth-Party Vendor Monitoring

Data breaches are often caused by poor security practices at third-party vendors; you need to monitor and rate your vendors’ security performance. An ideal solution should include a real-time automation component to security posture lapses to ensure that attack surface disturbances are rapidly addressed. According to the latest data breach report by IBM and the Ponemon Institute, automation controls could reduce data breach costs by up to 80%.

10. Accidental Data Exposures and Leaked Credentials Monitoring

Data isn’t always exposed on purpose; this is why it pays to continuously monitor your business for accidental data exposures and leaked credentials.

How to Store Data Securely on a USB Flash Drive

Photo by Lc on Unsplash

It is strongly advised that you avoid storing confidential information on a USB flash drive and choose more secure storage devices to ensure the safety of your data. The compact size of USB flash drives makes them convenient to carry but also increases the chances of losing or stealing them. This vulnerability poses a severe threat of data loss, leaks, and breaches, which can result in significant financial loss and damage to the reputation of organizations.

Using a flash drive, follow these 7 tips to secure your data.

  1. Buy an Encrypted USB.

Encryption secures sensitive data by making it accessible only to those with a decryption key. When purchasing a flash drive, opt for a military-grade one with 256-bit AES hardware encryption, the most robust algorithm.

Other features to look for in an encrypted USB flash drive include:

  • Tamper-proof protection
  • Anti-virus scanning
  • Brute-force protection
  • Password protection
  • TAA Compliance
  • Remote management capabilities
  • FIPS 140-2 Certification (Level 3)
  • Compliance with industry security standards, such as HIPAA, SOX, and GLBA.

2. Use USB Encryption Software.

Microsoft Windows users can use BitLocker to encrypt their flash drives instead of buying an encrypted flashdrive. Note that encryption hardware provides better security than software.

Microsoft’s instructions for enabling BitLocker are available below:

View instructions for enabling BitLocker in Windows 10
View instructions for enabling BitLocker in Windows 11‍

3. Have a Backup

You may only recover the stored data if your flash drive is recovered, stolen, or damaged. Even if a lost or stolen flash drive is returned, you shouldn’t use it again as it could potentially have ransomware or another type of malware installed. The best assurance of recovering the data on your flash drive is to have a backup of all files saved in another storage location, such as cloud storage.

4. Delete Data After Use.

After you have saved, edited, and transferred your data from a USB stick, it is recommended that you delete it immediately. You should then remove the flash drive from the USB port and store it securely to prevent any possibility of losing it or having it stolen.

5. Install Anti-Virus Protection

With different types of malware emerging daily, keeping your software up-to-date is crucial. Use antivirus software that offers malware protection across all endpoints, including hard drives, USB devices, and SD cards – one can infect all.

6. Keep Software Up to Date

Zero-day exploits take advantage of unpatched software vulnerabilities – a common attack vector that can have devastating consequences. Cybercriminals can easily access, edit, and steal data from vulnerable systems and devices, including USB storage. Installing software updates as soon as possible prevents cybercriminals from taking advantage of these vulnerabilities. Most operating systems, including Microsoft Windows, Mac OS / Apple iOS, and Linux, offer auto-updates to ensure you remain protected.

7. Use Alternative Storage Methods

Flash drives, there are better answers than not to take your data security seriously. Even the most secure USB drives differ from modern data storage methods, like cloud storage. Cloud services offer many innovative security features, such as the Secure Access Service Edge (SASE). SASE is a cloud security model that leverages firewalls, cloud access service brokers (CASBs), secure web gateways (SWG), and zero-trust network access (ZTNA). Cloud security mechanisms include Cloud Security Posture Management and Cloud Infrastructure Entitlement Management (CIEM).

Despite their strong security capabilities, like all third-party vendors, cloud services carry third-party risks and other risks specific to their functionality. Organizations and individuals must conduct due diligence to ensure their cloud providers are following appropriate data security requirements.

Why All Non-Profit’s Should Undergo Penetration Testing

Photo by KeepCoding on Unsplash

While the number of organizations that have suffered a cyber attack goes up, the clock for when it’s your turn is ticking down. In fact, it’s likely that your clock has already run out, you just haven’t noticed it yet.

As each day passes, hacking is becoming a more automated process, allowing unskilled computer users to become successful cyber criminals. The effort required to download hacking software and get it up and running is worryingly low.

An effective form of defense against these automated cyber attacks is regular penetration testing. An organization that conducts regular penetration tests stands a much larger chance of blocking cyber attacks due to their knowledge of vulnerabilities.

Uncover Hidden System Vulnerabilities Before the Criminals Do

The most surefire way to measure your security level is by studying how it can be hacked. A penetration test offers an ability to safely test your system’s resistance to external hacking attempts. It models the actions of a potential intruder by trying to exploit the vulnerabilities caused by code mistakes, software bugs, insecure settings, service configuration errors and/or operational weaknesses.

The major difference between a penetration test and a real hacking experience rests in its safe and controlled manner. It simulates a real attack scenario and exploits the vulnerabilities only to showcase the potential harm of a malicious hacking attempt. Moreover, the client company can pre-define the scope and timing of a penetration test and is informed beforehand about any active exploitation of vulnerabilities in its IT infrastructure.

Organizations usually conduct penetration tests right after the deployment of new infrastructure and applications or after the introduction of major changes to their infrastructure (e.g. changes in firewall rules, firmware updates, patches and software upgrades). This service can help them identify and validate potential security loopholes in their IT systems before cyber criminals can make use of them and successfully bring new products to the market.

Preserve Non-Profits Image and Customer Loyalty

Security attacks may compromise your sensitive data, which leads to the loss of trusted customers and serious reputational damages. Penetration testing can help you avoid costly security breaches that put your organization’s reputation and customers’ loyalty at stake. Moreover, a pen test may grow in time and complexity if the system requires an additional scope. It may be also conducted in combination with vulnerability scanning to provide even more meaningful insights on vulnerabilities and potential breach points in your IT infrastructure.

Hacking has now become an automated process

Hacking tools have grown in popularity and a catalogue of exploitable vulnerabilities is readily available online. Such tools permit even novice hackers to gain access to complex exploits for opportunistic attacks.

COMPLY WITH SECURITY REGULATIONS

Pen testing will help protect your assets from potential hackers and keep you safe online. Regular pen tests follow standards such as PCI, HIPAA and ISO 27001. Following these standards will help you avoid fines. Moreover, it is advisable to stage regular penetration tests and security audits by taking the services, professional security analysts.

Failure to restrict URL access

Photo by visuals on Unsplash

As with many other web application vulnerabilities, this one also aligns with access control rights. Applications use URL restrictions to prevent non-privileged users from accessing privileged data and resources. Every clickable button in a web application directs to a URL. A failure to restrict access vulnerability means that while clicking the button in the application would prevent access, directly using the URL into the browser allows access. When an application fails to restrict URL access, malicious actors can use “forced browsing” for an attack.

For example, a web application might have a URL structure that looks like this:

www.insecurewebapp.com/failure… the attackers know that the last item in that URL is the data type, they can try to take guesses at the URL structure for a specific type of sensitive information.

www.insecurewebapp.com/failure… the application has a failure to restrict URL access vulnerability, plugging that URL directly into the browser gives the attacker access.

Automate Linux Tasks with Tools

Photo by Andrea De Santis on Unsplash

Let’s take a look at two tools that can make life easier for the Linux admins by automating his day to day tasks.

Puppet

Puppet is an open-source tool designed to make automation and reporting much easier for system administrators. It is basically a configuration management software that helps in configuring and maintaining your servers and other systems in your network. Generally, Server administrators spend a lot of time doing the same task again and again daily. They always wanted to automate these tasks, so as to get more time to work on other projects or learn new concepts and scripting languages. Tasks can be automated by writing scripts, but in companies with a larger network, scripts don’t come in handy. This is where Puppet comes to the rescue as with the help of Puppet one can:

  • Let’s you define unique configuration setting for every host on the network
  • Monitor the network continuously for any alterations
  • Helps in creating and managing users effectively
  • Helps you to manage every open-source tool’s configuration settings

Ansible

Ansible is an open-source configuration management and IT enterprise automation software from Red Hat and it comes with a simple programming language enabling system administrators to effectively handle the automation and configuration process easily and effectively. Ansible consists of a controlling machine and the nodes being controlled by the controlling machine. The nodes are controlled over SSH. One of the main features of Ansible is that agents are not deployed to the nodes, but only communication is done through SSH. A low learning curve, consistency, high reliability and security are other features that make Ansible stand ahead of the competition. The only limitation of Ansible is that provisioning of bare metal and a virtual machine is not possible.

Nagios

Nagios, now known as the Nagios Core and it is an open-source automation and monitoring tool to manage all systems in your infrastructure. It also offers to alert services to alert the system administrators when it smells something fishy in your network. With the help of SNMP with Nagios, the system admins may also control and manage printers, routers and switches. Nagios allows us to create an event handler that can restart the faulty application and its services automatically whenever application and its services go down.

Preventing Cross-Site Scripting Attacks

Photo by Pawel Czerwinski on Unsplash

Implementing HTTP security headers are an essential way to keep your site and your visitors safe from attacks and hackers. In a previous post, we dove into how the X-Frame-Options header and frame-ancestors directive can help combat click jacking. In today’s post, we want to go more in-depth with the X-XSS-Protection header, as well as the newer CSP Reflected-XSS directive, and how they can help prevent cross-site scripting (XSS) attacks.

What is X-XSS Protection?

The x-xss-protection the header is designed to enable the cross-site scripting (XSS) filter built into modern web browsers. This is usually enabled by default, but using it will enforce it. It is supported by Internet Explorer 8+, Chrome, and Safari. The recommended configuration is to set this header to the following value, which will enable the XSS protection and instruct the browser to block the response in the event that a malicious script has been inserted from user input, instead of sanitizing.

x-xss-protection: 1; mode=block

Cross-site Scripting (XSS)

Cross-site scripting, also known as XSS, is basically a way to inject code that will perform actions in the user’s browser on behalf of a website. Sometimes this is seen by the user and sometimes it can go totally unnoticed in the background. There are many different types of XSS vulnerabilities, below are two of the most common.

Reflective XSS: These are usually the most common types. Typically these are within HTTP query parameters and are used by server-side scripts to parse and display a page of results for the user.

Persistent XSS: These are when the data from the attacker is actually saved on the server and then displayed to the user, mimicking a normal page.

Other XSS vulnerabilities include DOM-based, stored server, reflected server, stored client, reflected client, and the subset of a client. Below is an example of how an XSS attack works.

X-XSS-Protection Directives

0 value disables the XSS Filter, as seen below.

x-xss-protection:0;

1 value enables the XSS Filter. If a cross-site scripting attack is detected, in order to stop the attack, the browser will sanitize the page.

x-xss-protection:1; mode=block

Enabling X-XSS Protection Header

The x-xss-protection the header is easy to implement and only requires a slight web server configuration change. You might also want to check to make sure you don’t already have the header enabled. Here is a couple of easy ways to quickly check.

  1. Open up the network tab in Chrome DevTools and if your site is using a security header it will show up on the Headers tab. You can see below that even we are using this security header on the KeyCDN blog.
  2. Another quick way to check your security headers is to quickly scan your site with a free tool, securityheaders.io, created by Scott Helme. This gives you a grade based on all of your security headers and you can see what you might be missing.

Enable in Nginx

add_header x-xss-protection "1; mode=block" always;

Enable in Apache

header always set x-xss-protection "1; mode=block"

Enable on IIS

To enable on IIS simply add it to your site’s Web.config file.

<httpProtocol>
    <customHeaders>
        <add name="X-XSS-Protection" value="1; mode=block" />
    </customHeaders>
</httpProtocol>
    .......
</system.webServer>

Reflected-XSS Directive

An important thing to keep in mind is that the X-XSS-Protection header is pretty much being replaced with the new Content Security Policy (CSP) Reflected-XSS directive. The reflected-xss directive instructs a user agent to activate or deactivate any heuristics used to filter or block reflected cross-site scripting attacks. Valid values are allowblock, and filter. This directive is not supported in the <meta> element.

However, it is not supported in all browsers yet, and so it is still recommended to use the x-xss-protection header. However, you could use both the x-xss-protection and reflected-xss together.

Summary

Hopefully, now you understand a little more about what the x-xss-protection HTTP response header does and how it can help prevent cross-site scripting (XSS) attacks. As seen above, this is very easy to implement. We use security headers on our websites and we encourage you to do the same. Together we can make the web a more secure place and help boost the security header usage numbers.

How to Secure Your PostgreSQL Database – 5 Tips

Photo by Caspar Camille Rubin on Unsplash

PostgreSQL may be the world’s most advanced open source database, but its 82 documented security vulnerabilities per the CVE database also make it highly exploitable. The popular object-relational database is considered superior to others regarding out-of-the-box security. However, proper measures are still required to protect web applications and underlying data. The following are 5 common ways to secure your PostgreSQL implementation from cyber attacks.

1. Do Not Use Trust Security.

When using Trust security, PostgreSQL assumes that anyone connected to the server is authorized to access the database with the database username specified (i.e., the DB trusts that they are who they say they are). To lock this down, edit your pg_hba.conf to use a non-trust authentication method like MD5. Additionally, template1 and PostgreSQL default databases should be revoked remote login access.

2. Use Hash-Based Column encryption for values that don’t need to be decrypted

Encryption methods such as AES are two-way—they can be decrypted—while hash-based encryption methods such as MD5 are one-way. For values that only need to be checked for a match, such as passwords, use one-way encryption for an added layer of security if table data is compromised.

3. Use Physical Separation to Isolate Datasets that Need to be Kept Apart

Using pg_hba and RBAC to control access to physically disparate databases ensures that data in two tables cannot be accessed/viewed simultaneously. Of course, this will break SQL joins, so only use in appropriate scenarios that require physical access separation during the life of a login session.

4. Consider Disabling Remote Access to PostgreSQL

This action alone eliminates a host of substantial attack vectors. Again, this can be set in the pg_hba.conf. If remote access to the database is required, SSH to the server housing the database and use a local connection afterward. Alternatively, you can set up tunnel access to PostgreSQL through SSH, effectively giving client machines access to remote databases as if they were local.9. Assign a Distinct Role for Each Application.

5. Use pg_hba.conf to Specify Which Hosts Can Use SSL-Encrypted and Unencrypted Connections

This can be accomplished by adding and removing the appropriate entries in the pg_hba.conf file. Generally speaking, all clients should be forced to connect with SSL by adding the necessary hostel entries. Using this model, all host entries should be removed (aside from localhost).

What are Web Shell Attacks? How to Protect Web Servers

Photo by Glenn Carstens-Peters on Unsplash

What is Web Shell?

A web shell is a malicious script written in popular web application languages – PHP, JSP, or ASP. They are installed on a web server operating system to facilitate remote administration. When weaponized, a web shell could allow threat actors to modify files and even access the root directory of the targeted web server. Both internet-facing and non-internet-facing servers (such as resource hosting servers) could fall victim to web shell attacks. Web shell attacks are a convenient cyber attack tactic because their execution doesn’t require additional programs. A communication channel can be simply achieved through the HTTP protocol in web browsers – this is why it’s so important to prefer HTTPS protocols.

How Do Web Shell Attacks Work?

Cyber attackers first locate servers with exposures vulnerable to web shell attacks through scanning software, such as Shodan.io. Shodan surfaces all internet-connected devices, including web servers and endpoints, that could be attack vectors for hidden web servers. Once a vulnerability is discovered, cyberattackers launch a web shell attack before installing a patch for the exposure. Exploiting vulnerability CVE-2020-5902 is an example of how fast cybercriminals use exposures that facilitate web shell injections. On June 30, 2020, F5 Networks released a patch for its Traffic Management User Interface (TMUI). The vulnerability facilitated Remote Code Execution (RCE) – a type of cyber attack involving the remote injection of malicious codes into a targeted system. After publishing the vulnerability on June 30, on July 4 (just four days later), an exploit code used to abuse the exposure was discovered.

CVE-2020-5902 exploit code – Source: Microsoft.com

The first stage of a server infection is to penetrate the outer layer of its ecosystem. This is usually achieved by pushing corrupted web shells through file upload web pages. After this, a Local File Include (LFI) vulnerability connects the web shell to a selected web application page. There are many other web shell injection strategies, including the detection and compromise of Exposed Admin Interfaces, Cross-Site Scripting (XSS), and SQL injections. After the web shell has been installed, a backdoor is naturally established, giving cybercriminals direct remote access to the compromised web server at any time. The efficiency of back door creation with web shells is why web shell attacks are primarily used as persistence mechanisms – establishing a long-term malicious internal network presence. Because of this, data breaches and ransomware injections rarely immediately follow a web shell attack. Hackers usually establish an access channel for a future attack or reconnaissance mission.

How to Block Web Shell Injections

It’s much easier to address the vulnerabilities that facilitate web shell injection than to intercept attacks. The following suggested controls and security tools should be used to locate and remediate all possible web shell injection points in your IT ecosystem.

1. Stay Updated with the Latest Security Patches

Security vulnerabilities are the most common pathways for web shell attacks. To block these entry points, keep all web applications, Content Management Systems, web server software, and third-party software updated with the latest security patches.

2. Disable Unnecessarily Web Server Functions

If a web shell is injected, its execution could be blocked if the functions that communicate with web server scripts are disabled in php.ini.Such web server functions include:

  • exec ()eval()shell _exec()assert()

3. Modify the Names of Sensitive Directories

To prevent the upload of corrupted image files, the directories that facilitate such uploads should ideally be completely disabled.If such an upload mechanism is necessary, the default names of these sensitive directories should be modified to make them harder to discover. Only privileged users should have permission to access these modifications to mitigate insider threat attacks.In addition to this, specify a filter for the permitted file types that can be uploaded to your web server.

4. Disable All Unnecessary WordPress Plugins

WordPress plugins are common attack vectors because anyone can develop them – even cybercriminals. To secure these vectors, only install plugins from trusted developers and uninstall all unnecessary plugins.

5. Implement a Firewall

A Web Application Firewall (WAF) is designed to prevent web shells and malicious payloads from being injected into an ecosystem by filtering all network traffic. Like antivirus software, keeping your firewall updated with the latest cybersecurity patches is important.

6. Implement File Integrity Monitoring

A file integrity monitoring solution will compare directory updates against the timestamps of clean directory scripts. If a discrepancy is detected, the requested installation on the code directory of the targeted web server will either be blocked or activate a security alert.

7. Monitor Your Attack Surface

An attack surface monitoring solution completes vulnerability scans of the entire attack surface – both internally and throughout the vendor network. This allows security teams to remediate exposure before cyber attackers discover and exploit them.

Best Practices for Sock Puppets

Creating research accounts can be a challenging task, and it often requires a lot of effort and experimentation to get it right. Trial and error is often the key to success in this process. There is no step-by-step process when setting up accounts, but these are some considerations before creating a research account; some points may seem basic but are equally important.

The best approach is to create an account as a regular user. Quick entry of email and password is critical.

  • IP Address: To avoid getting flagged by social media platforms, it’s best not to use a Virtual Private Network (VPN) when creating a sock account. After making the account, signing in from different locations using free Wi-Fi connections (like those available at coffee shops) is essential, as this will show the platform that you are a legitimate user. By using a variety of IP addresses, you’ll be less likely to get flagged.
  • Name: Use fictional details when considering a name for your sock account. Avoid using your real identity. Consider what name would blend in with your target group because you want to make sure your account stands out if you are suggested as a friend.
  • Email address: You have several email provider options (Mail.com, Gmail.com, Yandex.com, Outlook.com). Do not use a previously created email address – always start fresh and create a new email that has not been once used.
  • Phone verification: If you cannot bypass the verification, use a burner phone and SIM card to create accounts.
  • Profile photo: When choosing images to post on social media, it’s best to use generic landscapes like mountains, beaches, etc. It’s important to avoid using someone else’s identity or photos. Stock images can be helpful in some cases, but you should always crop the photo to delete any previously stored data before uploading. Social media platforms have algorithms that can detect the use of stock images, and your account may be flagged if this is seen.
  • Activity: Once your account is created, you must start interacting naturally, such as posting links, liking pages, etc. The main objective is to mimic how a natural person would use a new account and convince the platform that you are a natural person.
  • Setting/Privacy settings: Immediately review and set the privacy settings for the platform and choose the most secure privacy settings that will allow people to see as little information as possible.