pic10chiselclient2 Blog

Network Pivoting with Chisel

Network pivoting is a technique used by hackers to access parts of a network that aren't directly connected. Once a hacker gains access to one device, they use it to access other devices on the network that the first device couldn't communicate with. It's kind of like using a foothold in one area to leapfrog into another area that was originally out of reach.

In this guide we'll review how to pivot a network using the Chisel application. Chisel is a fast TCP tunnel over HTTP, that can be used to bypass firewall restrictions and access internal networks from the outside. Chisel uses the HTTP CONNECT method to create TCP tunnels, so it works with most HTTP proxies. It is a single executable with no dependencies and can be used for quickly bypassing firewalls in pentesting scenarios. I recently had the opportunity to work in a lab where multiple pivots were necessary, and Chisel made accomplishing this task easy. The Chisel network pivoting tool allows for the creation of secure tunnels over HTTP by utilizing the SSH Protocol. 

Now we'll walk you through the steps of how to effectively pivot a network using Chisel. I have drawn a mock network using a Kali Linux attacker machine and Windows hosts as the victim machines. I will demonstrate the commands to make two pivots: the first pivot will be in the DMZ subnet, and the second pivot will be into the Internal network. Let's dive in and learn how to pivot a network using Chisel!

networkdiagram Blog

 

We'll assume that we have compromised the victim web server and now want to use it as a stepping stone to move laterally through the organization's network. In order to see the other machines located in the DMZ subnet, we will use the compromised web server as our initial pivoting point.

First, lets configure the proxy server on our Kali Linux machine by using port 1080 as our SOCKS5 proxy port. We will add this configuration to the bottom of the proxychains4.conf file.

proxychains socks5 pic1 Blog

 

Next, we need to start the reverse Chisel server on our Kali machine and set it to listen on port 8080:

 

chiselserver8080pic2 Blog

The Chisel Server command structure is as follows:

chisel server -p <server_port> --reverse

  • server: This is the subcommand used to start the Chisel server.
  • -p <server_port>: This specifies the port on which the Chisel server will listen for incoming client connections. 
  • --reverse: This option is used to enable reverse connections, allowing clients to initiate connections to the server.

 

Now, we need to upload the Chisel application to the victim machine. It's important to run the same version of Chisel on both the server and client. You can upload the application using any method you prefer, but for this guide, we'll use a Python 3 HTTP server and Chisel version 1.7.3. When downloading Chisel, ensure that you select the appropriate machine type. In this case we will pivot on a Windows machine, so we need the 'chisel_1.7.3_windows_amd64.gz' file.

(Note: Windows Defender will detect 'chisel.exe,' so you should utilize a packer if you need to bypass Defender. You can use a packer like AtomPePacker found at this link: https://github.com/NUL0x4C/AtomPePacker).

To upload Chisel to our victim Windows machine, we'll set up a Python HTTP server in the directory containing our Chisel.exe file.

pic3 chisel httpserver python Blog

 

Next, we'll download the file to our Windows machine using PowerShell.

 

pic4 powershell copy chisel Blog

 

The last step is to start the Chisel client on our Windows machine.

 

pic5 Blog

 

The proper command structure for the Chisel client is as follows:

chisel client <remote_domain>:<remote_port> <local_port>

  • client: This is the subcommand used to establish a client connection to the Chisel server.
  • <remote_domain>:<remote_port>: This specifies the domain and port of the Chisel server you want to connect to.
  • <local_port>: This specifies the local port on your machine that will be forwarded to the Chisel server. 

Now, we can use our proxy server to enumerate hosts on the DMZ network:

 

pic6nmapscanproxychains Blog

 

To configure your web browser to use the proxy server, you can use an extension called FoxyProxy. FoxyProxy is available for Firefox and can be downloaded from the Firefox add-ons store and will be configured like this:

 

pic7 foxyproxy Blog

 

When we discover a new target machine that grants us access to another segment of the network, we can repeat the steps by adding a second chain to Proxychains.  We add a second entry to our proxychains4.conf:

 

pic82ndproxychainentry Blog

 

Next we'll set up the a Chisel server on our compromised web server, we need to open a second window and create the server.

 

pic92ndchiselserver Blog

 

We need to download and configure the Chisel client on our new target machine that has access to another segment of the network. Here are the steps to follow:

 

pic10chiselclient2 Blog

 

Now we can enumerate the next segment of the organizations network.

 

In today's digital world, cyber threats are an ever-present danger. Protecting your data and infrastructure has never been more critical.  For affordable and comprehensive cyber security solutions, contact Bokeh Solutions today, our team of experts are standing by to address your needs and provide an unparalleled level of protection. I hope this tutorial was helpful, thanks for reading. If you have any questions feel free to drop us an email at This email address is being protected from spambots. You need JavaScript enabled to view it. .

 

References:

Chisel : https://github.com/jpillora/chisel/releases/tag/v1.7.3

Kali Linux : https://www.kali.org/get-kali/#kali-platforms

Windows 10 - https://www.microsoft.com/en-us/evalcenter/evaluate-windows-10-enterprise

Great Article for building an AD Lab - https://robertscocca.medium.com/building-an-active-directory-lab-82170dd73fb4

 

 

OWASP: The Ultimate Guide to Protecting Your Website from Hackers

Introduction

Website security is a critical aspect of online business and personal website ownership. With the increasing number of cyber attacks and data breaches, it's more important than ever to ensure that your website is secure. The consequences of a security breach can be devastating, ranging from loss of sensitive data to damage to your brand reputation.

One of the most valuable resources for website security is the Open Web Application Security Project (OWASP). OWASP is a non-profit organization dedicated to improving the security of software and web applications. It provides a wealth of resources, including security guidelines, tools, and best practices, to help website owners and developers protect their websites from cyber threats.

In this article, we will provide you with the ultimate guide to protecting your website from hackers using OWASP. We'll cover what OWASP is, its mission and goals, and how it can help you keep your website secure. We'll also discuss the most common web vulnerabilities and how OWASP's resources and tools can be used to identify and mitigate them. By the end of this article, you'll have a comprehensive understanding of how to use OWASP to ensure the security of your website.

What is OWASP?

OWASP stands for the Open Web Application Security Project. It is a non-profit organization that is dedicated to improving the security of software and web applications. OWASP provides a wealth of resources, including security guidelines, tools, and best practices, to help website owners and developers protect their websites from cyber threats.

OWASP was founded in 2001 and is maintained by a community of volunteers from around the world. The organization is funded through donations and sponsorships from individuals, corporations, and governments. OWASP is completely independent and does not endorse any specific products or services.

The mission of OWASP is to make software and web applications more secure by improving the security of software and web applications. The organization aims to do this by providing resources, tools, and best practices to developers, security professionals, and organizations. OWASP's goals include raising awareness of web application security, promoting open standards, and providing a platform for collaboration and knowledge sharing within the security community.

OWASP is an invaluable resource for anyone who is concerned about the security of their website. By following the guidelines and best practices provided by OWASP, website owners and developers can ensure that their web applications are secure and protected from cyber threats.

Common Web Vulnerabilities

OWASP identifies the following as the top ten most common web vulnerabilities that website owners and developers should be aware of:

  1. Injection flaws: Injection flaws occur when untrusted data is sent to an interpreter as part of a command or query. Hackers can exploit injection flaws to execute malicious code or steal sensitive data.

  2. Broken authentication and session management: Broken authentication and session management vulnerabilities occur when attackers are able to bypass authentication or hijack user sessions. This can allow hackers to gain access to sensitive data or perform actions on behalf of the user.

  3. Cross-site scripting (XSS): XSS vulnerabilities occur when attackers are able to inject malicious code into a web page that is then executed by the user's browser. This can allow hackers to steal sensitive data, such as login credentials or financial information.

  4. Broken access control: Broken access control vulnerabilities occur when attackers are able to access resources or perform actions that they should not be able to. This can allow hackers to view or modify sensitive data.

  5. Security misconfigurations: Security misconfigurations occur when web applications are not configured securely. This can allow hackers to exploit vulnerabilities and gain unauthorized access to sensitive data.

  6. Insecure cryptographic storage: Insecure cryptographic storage occurs when sensitive data, such as passwords or credit card numbers, is not stored securely. This can allow hackers to steal sensitive data and use it for malicious purposes.

  7. Insufficient logging and monitoring: Insufficient logging and monitoring can make it difficult for website owners and developers to detect and respond to security incidents. This can allow hackers to carry out attacks without being detected.

  8. Insecure communication: Insecure communication occurs when sensitive data is transmitted over unsecured channels, such as HTTP instead of HTTPS. This can allow hackers to intercept and steal sensitive data.

  9. Using components with known vulnerabilities: Using components with known vulnerabilities can make web applications vulnerable to attacks. Hackers can exploit these vulnerabilities to gain unauthorized access to sensitive data or perform other malicious actions.

  10. Insufficient authentication and authorization: Insufficient authentication and authorization can allow hackers to gain unauthorized access to sensitive data or perform actions on behalf of the user.

It's important for website owners and developers to be aware of these common web vulnerabilities and take steps to mitigate them. By following OWASP's guidelines and best practices, website owners and developers can ensure that their web applications are secure and protected from cyber threats.

How OWASP Can Help You Keep Your Website Secure

OWASP provides a wealth of resources and tools that website owners and developers can use to identify and mitigate vulnerabilities in their web applications. Here are some ways that OWASP can help you keep your website secure:

  1. OWASP Top Ten: The OWASP Top Ten is a list of the most critical web application security risks. By reviewing the Top Ten, website owners and developers can gain a better understanding of the most common web vulnerabilities and take steps to mitigate them.

  2. OWASP ZAP: OWASP ZAP is a free, open-source web application security scanner. It can be used to identify vulnerabilities in web applications, such as injection flaws and XSS vulnerabilities.

  3. OWASP ASVS: The OWASP Application Security Verification Standard (ASVS) is a set of guidelines for performing application security testing. By following the ASVS, website owners and developers can ensure that their web applications are secure and protected from cyber threats.

  4. OWASP Cheat Sheets: OWASP Cheat Sheets provide quick reference guides for various web application security topics, such as XSS prevention and password storage best practices. These cheat sheets can be used as a reference when developing and testing web applications.

  5. OWASP WebGoat: OWASP WebGoat is a deliberately insecure web application that can be used to learn about web application security. By using WebGoat, website owners and developers can gain hands-on experience with identifying and mitigating web vulnerabilities.

Overall, OWASP provides a wide range of resources and tools that website owners and developers can use to improve the security of their web applications. By following OWASP's guidelines and best practices, website owners and developers can ensure that their web applications are secure and protected from cyber threats.

Best Practices for Website Security

OWASP provides many guidelines and tools that can be used to assess the security of a website, but there are also some best practices that website owners and developers can follow to keep their web applications secure. Here are some tips for using OWASP to keep your website secure:

  1. Regular security testing: Regular security testing is essential for identifying and mitigating vulnerabilities in web applications. By using OWASP tools like ZAP and following the ASVS guidelines, website owners and developers can ensure that their web applications are secure and protected from cyber threats.

  2. Implementing a security-focused development process: Implementing a security-focused development process can help ensure that web applications are built with security in mind from the outset. This can include practices like threat modeling, secure coding practices, and regular security reviews.

  3. Keeping software up-to-date: Keeping software up-to-date is essential for maintaining the security of web applications. This includes not only the web application itself, but also any third-party components or libraries that it relies on.

  4. Using strong authentication and access controls: Using strong authentication and access controls can help prevent unauthorized access to web applications and sensitive data. This can include practices like multi-factor authentication and role-based access control.

  5. Educating users: Educating users about web application security best practices can help prevent common attacks like phishing and social engineering. This can include practices like regular security awareness training and clear communication about security policies and procedures.

By following these best practices and using OWASP's resources and tools, website owners and developers can ensure that their web applications are secure and protected from cyber threats. Regular security testing, a security-focused development process, software updates, strong authentication and access controls, and user education are all essential for maintaining the security of web applications.

Conclusion

In conclusion, website security is essential for protecting against cyber threats and ensuring the safety of sensitive data. By following best practices for website security and using resources like OWASP, website owners and developers can ensure that their web applications are secure and protected from hackers.

OWASP provides a wealth of resources and tools for website security, including the OWASP Top Ten, ZAP, ASVS, Cheat Sheets, and WebGoat. By using these resources and following OWASP's guidelines and best practices, website owners and developers can gain a better understanding of web vulnerabilities and take steps to mitigate them.

At Bokeh Solutions, we are passionate about delivering unparalleled CyberSecurity and IT Services to our clients. Our team members have numerous industry certifications and have worked with private, public, and government organizations. We offer a range of services, including Penetration Testing, Security Audits, and Ransomware Protection, as well as our Port & Vulnerability Scanner solution.

We understand the importance of website security and are committed to helping our clients protect their web applications from cyber threats. If you have any questions about website security or would like to learn more about our services and solutions, please don't hesitate to contact us at https://www.bokehsolutions.com/index.php/support/contacts. Our team is here to help you keep your website secure and protected from hackers.

How service vulnerability scanners can improve your organization’s cybersecurity posture

Introduction

The world of cybersecurity is evolving, and organizations need to protect themselves against the latest threats. As more businesses move their IT infrastructure to the cloud, it’s easy to assume that their IT services are protected by firewalls and other security measures. Unfortunately, that assumption is wrong. According to research by Forrester Consulting on cloud security strategies for 2020, "Most customers lack visibility into what data is being accessed and how secure it really is." This lack of visibility makes it difficult for businesses to determine if they are meeting compliance requirements or managing risk appropriately.

It's no secret that the cybersecurity landscape is rapidly changing.

It's no secret that the cybersecurity landscape is rapidly changing. Cybersecurity threats are increasing, but so are the tools to combat them. Vulnerability scanners are an essential part of this solution because they help organizations better manage their risk profile from a cybersecurity perspective.

Vulnerability scanners provide an accurate picture of how well their networks and systems are protected against known vulnerabilities, giving them visibility into where they need to improve their defenses or patch holes in order to reduce risk exposure.

All about Vulnerabilities

Vulnerabilities are weaknesses in software or hardware that can be exploited by attackers. They are often the result of a programming error, and they can be discovered by either manual review or automated scanning. Vulnerabilities may also be disclosed publicly through coordinated disclosure programs (e.g., the Zero Day Initiative), which allow vendors time to release patches before details about the vulnerability become public knowledge.

CVEs (Common Vulnerabilities and Exposures) are identifiers for publicly disclosed computer security vulnerabilities that have been assigned by CVE Numbering Authorities (CNAs). There are currently over 30 CNAs worldwide who manage their own databases of CVEs for their specific domains (e.g., Microsoft manages one set of CVEs for Windows operating systems). The National Institute of Standards and Technology maintains an official list with links to each CNA's respective database(s) on its website at https://nvd.nist.gov/vuln/. This site allows users searching for information about a particular CVE identifier or set thereof; however, it does not provide details regarding how those identifiers were generated (i..e., what methodology was used) nor do they indicate whether any changes were made since initial publication date listed on each record page."

The Common Vulnerability Scoring System (CVSS) is a framework used to assess the severity of security vulnerabilities in software systems. The CVSS score is a numerical representation of the severity of a vulnerability, ranging from 0 to 10, with higher scores indicating more severe vulnerabilities. The score is calculated based on metrics that assess the impact and exploitability of the vulnerability, which are grouped into three categories: base metrics, temporal metrics, and environmental metrics.

CVSS has evolved over time, with the most recent version being CVSS v3. The main differences between CVSS v2 and CVSS v3 include the addition of new metrics, changes to the formula used to calculate the score, and greater emphasis on environmental metrics. CVSS v3 is considered more comprehensive and accurate than CVSS v2, and it is recommended that organizations transition to using CVSS v3 to assess vulnerabilities in their systems.

Vulnerability scanners are an essential part of the solution, but they can't do it alone.

Service vulnerability scanners are software programs that scan your network for weak spots. They're typically used to identify security holes in services or applications (that are identified by a protocol and a port).

Service vulnerability scanners help you meet compliance requirements by finding vulnerabilities that could lead to a data breach or other types of cyberattacks. They can also help you manage risk by identifying weaknesses in your systems that could be exploited if they aren't fixed.

An organization's IT services exposed to the Internet are under more scrutiny and a frequent scan policy of those services will help with your security posture. The risk profile of your organization, as well as its culture, will determine how often you should scan for vulnerabilities. It may be daily or weekly, depending on your industry and size. In addition to having a service vulnerability scanner in place (and knowing how to use it), you should consider one with built-in reporting capabilities so that you can measure how well your scanning efforts are working over time.

But it is also true that vulnerability scanners are only one part of the solution to improving your organization's cybersecurity posture. To be effective, you need to have a comprehensive approach that includes:

  • Preventing attacks by using tools such as firewalls and intrusion detection systems (IDS) to block malicious traffic before it reaches your network

  • Detecting and responding to attacks by using IDSs and other monitoring tools like SIEM (security information and event management) or log analysis software

  • Recovering from attacks by having backups of critical systems so they can be restored quickly when needed

Choosing the Right Scanner: Enhancing Compliance and Cybersecurity for Your Organization

A service vulnerability scanner helps organizations better manage their risk profile from a cybersecurity perspective. It helps identify vulnerabilities to be fixed in order to prevent attacks, ensures compliance with security standards, ensures network availability and reduces risk of data loss.

A service vulnerability scanner is an automated tool that scans the services running on your servers or cloud instances to detect security issues such as:

  • Missing patches

  • Open ports with no firewall rules defined for them

  • Unused accounts with access privileges (e.g., root)

A service vulnerability scanner will help you meet security standards like ISO 27001/27002/27005 or NIST SP800-53 with their built-in checklists for assessing information security practices in accordance with industry best practices.

Conclusion

In conclusion, service vulnerability scanners can be a great tool for organizations looking to improve their cyber security. They allow you to identify and fix vulnerabilities before they are exploited by hackers or malicious actors allowing your organization's digital infrastructure remains strong and resilient against attack.

Bokeh Solutions offers a Vulnerability Scanner solution. This solution provides weekly scans of your Internet Edge services, which are constantly exposed to bad actors looking to exploit vulnerabilities for their personal gain. By identifying vulnerabilities and providing recommendations for remediation, Bokeh Solutions can help you mitigate the financial and reputation damages that can result from a security breach. You can find more information about their vulnerability scanner at https://www.bokehsolutions.com/services/online-service/port-vulnerability-scans.html.

In addition of our Vulnerability Scanner solution, Bokeh Solutions offers a range of professional services that can help your organization establish and maintain a strong security posture. Our security audits are comprehensive and cover any systems that your organization requires. By assessing your security posture, identifying risks, and providing actionable recommendations, Bokeh Solutions can help you improve your overall security. You can find more information about their security audit services at https://www.bokehsolutions.com/services/professional-services/security-audits.html.

The Dark Side of Open-Source Intelligence (OSINT): How Your Information is Being Exploited

Introduction

In today's digital age, open-source intelligence (OSINT) is becoming an increasingly important tool for gathering information about individuals and organizations. OSINT refers to the collection, analysis, and dissemination of information from publicly available sources, such as social media, online forums, and public records. While OSINT has many useful applications, there is also a dark side to its use. The purpose of this article is to explore the potential risks and dangers of OSINT and how it can be used to exploit individuals.

As more and more personal information is shared online, the potential for OSINT to be used for malicious purposes is increasing. From cyberstalking to identity theft, the risks associated with OSINT are numerous and varied. By examining these risks in detail, we hope to raise awareness about the potential dangers of OSINT and provide practical tips for protecting your personal information online.

In this article, we will provide an overview of what OSINT is, how it differs from other types of intelligence gathering, and the various sources of OSINT. We will then explore the potential risks and dangers of OSINT and provide practical tips for protecting your personal information online. By the end of this article, you will have a better understanding of how OSINT works and how you can protect yourself from potential exploitation.

What is OSINT?

Open-source intelligence (OSINT) is a method of intelligence gathering that involves the collection, analysis, and dissemination of information from publicly available sources. Unlike other types of intelligence gathering, which may rely on classified information or covert operations, OSINT relies on publicly available sources such as social media, public records, and online forums. This makes it a valuable tool for law enforcement, intelligence agencies, and private investigators, but also means that it can be used by individuals with malicious intent.

OSINT can be used to gather a wide range of information, including personal information about individuals, organizational data, and geopolitical intelligence. Some of the most common sources of OSINT include social media platforms like Facebook and Twitter, public records like court documents and property records, and online forums like Reddit and 4chan.

One of the key advantages of OSINT is that it is often freely available and can be accessed by anyone with an internet connection. However, this also means that the information gathered through OSINT is often incomplete or inaccurate, and it can be difficult to verify the authenticity of the information. In addition, the widespread availability of OSINT means that it can be used for both legitimate and illegitimate purposes.

How OSINT is used to collect and analyze data

OSINT tools and techniques are used to collect and analyze large amounts of data from publicly available sources. These tools and techniques can include web scraping, data mining, and social media monitoring. By using these methods, analysts can gather a vast amount of information about individuals and organizations, which can then be used to build a profile or develop insights.

One of the primary uses of OSINT is to build profiles of individuals or organizations. For example, an investigator might use OSINT to gather information about a person of interest in a criminal investigation. This could include information about their social media activity, employment history, and criminal record. By analyzing this information, investigators can develop a more complete picture of the individual and their activities.

Similarly, OSINT can be used to gather information about organizations, including their structure, financial information, and key personnel. This information can be used by competitors, journalists, or activists to gain insight into the organization's operations and activities.

Overall, the use of OSINT tools and techniques can provide valuable insights into individuals and organizations. However, it is important to be aware of the potential risks and dangers associated with OSINT and to take steps to protect your personal information online.

The potential risks and dangers of OSINT

Open-Source Intelligence (OSINT) is a powerful tool that can be used to gather information about organizations and individuals. However, it also comes with potential risks and dangers, as it can be used to exploit organizations in a variety of ways.

Identity theft is one of the most common risks associated with OSINT. By gathering personal information about an organization, such as their financial information or key personnel, cybercriminals can use this information to carry out various types of financial fraud, including wire fraud or business email compromise.

Cyberstalking is another risk associated with OSINT. By gathering information about an organization's employees, such as their job titles, email addresses, and phone numbers, cyberstalkers can use this information to carry out targeted attacks, such as phishing emails or phone scams.

Doxxing is a third risk associated with OSINT. Doxxing an organization involves the public release of sensitive information, such as their trade secrets, financial information, or confidential customer data. This information can be used to harm the organization's reputation, or to carry out further attacks, such as ransomware or data breaches.

Also, there are various other types of attacks that can be carried out against an organization using the information collected through OSINT. Some examples include:

  • Social engineering attacks: With the help of OSINT, attackers can gather information about key personnel within an organization, such as their job titles, email addresses, and phone numbers. This information can then be used to carry out social engineering attacks, such as phishing emails or phone scams, with the aim of tricking individuals into revealing sensitive information or granting access to secure systems.

  • Spear phishing attacks: OSINT can also be used to gather information about an organization's email infrastructure, such as the email addresses of key personnel and the email domains used by the organization. This information can be used to carry out targeted spear phishing attacks, where attackers send emails that appear to be from a trusted source in order to trick individuals into revealing sensitive information.

  • Physical attacks: With the help of OSINT, attackers can gather information about an organization's physical infrastructure, such as the location of its offices and data centers. This information can be used to carry out physical attacks, such as theft or vandalism.

  • Insider attacks: OSINT can also be used to gather information about an organization's employees and their job roles, which can be used to carry out insider attacks. For example, an attacker could use OSINT to identify an employee with access to sensitive information and then target them with a social engineering attack to gain access to this information.

It is important to note that these are just a few examples of the types of attacks that can be carried out using OSINT.

Real-life examples of how OSINT has been used to harm organizations include the 2013 Target data breach, where cybercriminals used OSINT to gather information about the company's payment systems and carry out a massive data breach that compromised the personal and financial information of millions of customers.

Another example is the 2017 Equifax data breach, where attackers used OSINT to gather information about the company's security vulnerabilities and carry out a data breach that exposed the personal and financial information of millions of customers.

While OSINT can be a valuable tool for intelligence gathering, it also comes with potential risks and dangers. It is important for organizations to be aware of these risks and to take steps to protect their sensitive information and infrastructure. This can include implementing strong security measures, providing training to employees on how to identify and respond to potential attacks, and monitoring for suspicious activity.

Tips for protecting your personal information online

In today's digital age, protecting your personal information online is more important than ever. Here are some practical tips to help you safeguard your sensitive information:

  1. Use strong passwords: Use a unique and complex password for each of your online accounts. Avoid using common words or phrases, and include a mix of letters, numbers, and symbols.

  2. Avoid public Wi-Fi: Public Wi-Fi networks are often unsecured and can be easily hacked. Avoid using them to access sensitive information, such as online banking or email accounts, if you have to use them protect yourself with a VPN.

  3. Limit the amount of personal information you share online: Be cautious about the information you share on social media and other online platforms. Avoid sharing sensitive information, such as your home address or phone number.

  4. Use two-factor authentication: Two-factor authentication adds an extra layer of security to your online accounts by requiring a second form of verification, such as a text message or fingerprint scan.

  5. Keep your software up-to-date: Install updates and patches for your operating system and software applications as soon as they become available. These updates often include security enhancements that can help protect your personal information.

In addition to these tips, it's also important to use tools that report the exposed information to help prepare against potential attacks. These tools can help you monitor your online presence and alert you to potential threats, such as phishing emails or data breaches. Examples of such tools include antivirus software, firewalls, and identity theft protection services.

By following these tips and using the right tools, you can help protect your personal information online and reduce the risk of falling victim to cyber attacks and exploitation through OSINT.

Conclusion

In this article, we discussed the various ways in which OSINT can be used to harm organizations and individuals, and provided practical tips for protecting your personal information online. We also emphasized the importance of using tools that report and expose information to help prepare against potential attacks.

It is crucial for organizations to be aware of the risks and dangers of OSINT, and to take steps to protect their sensitive information and infrastructure. This can include implementing strong security measures, providing training to employees on how to identify and respond to potential attacks, and monitoring for suspicious activity.

In addition, it's important to stay informed about the latest developments in OSINT and cybersecurity, and to use reporting tools that can give you an idea of how exposed your organization's information may be.

By taking these steps and being vigilant about your online presence, you can help protect yourself and your organization from the dark side of OSINT and other cyber threats.

At Bokeh Solutions, we offer a wide range of CyberSecurity and IT Services to help organizations protect their sensitive information. Our team of professionals has years of in-depth industry experience, with a background of working with private, public, and government organizations. We have numerous industry certifications and have worked in the US, Europe, and South America. Our team is committed to bringing assurance to each client and an awareness to the uniqueness of every project.

Our services include Penetration Testing, Security Audits, and Ransomware Protection to help organizations identify potential vulnerabilities and provide recommendations for improved security measures. We also offer a variety of solutions to help organizations safeguard their sensitive information, including Port & Vulnerability Scanner, which is a powerful tool for identifying potential security risks and vulnerabilities in an organization's network. With Bokeh Solutions, you can rest assured that your organization's information is in good hands.

Contact us today to learn more about our Services and Solutions. Our team is ready to help you protect your organization's sensitive information with our unparalleled CyberSecurity and IT Services. Contact Us to schedule a consultation with our experts today.

Creating Pods and Exposing Services with MetalLB on MicroK8s: A Beginner's Guide

Are you new to Kubernetes and looking for a way to create a pod using a custom image and expose it as a service using MetalLB on MicroK8s? In this beginner's guide, we'll show you how to do just that.

Kubernetes is the industry standard for container orchestration, and MicroK8s is a great way to get started with Kubernetes on your local machine. If you're not familiar with Kubernetes terminology, a pod is the smallest deployable unit that can run a container, while a service provides a stable IP address and DNS name for a set of pods.

In previous articles, we covered how to install MicroK8s on an Ubuntu Server and how to create a custom image using Docker and push it to a private container registry in our Kubernetes cluster. In this article, we'll tie those concepts together and use the image in our registry to create a pod and expose the service using MetalLB.

MetalLB is an open-source project that provides a layer-2 load balancer implementation for Kubernetes. When integrated with Kubernetes, it provides a way to expose services externally. MicroK8s is a lightweight, fast, and efficient Kubernetes distribution that runs natively on Linux machines, making it an ideal choice for local development or small-scale production environments.

By following the steps in this guide, you'll learn how to create a pod using a custom image and expose it as a service using MetalLB on MicroK8s. By the end of this article, you'll have a solid understanding of how to create pods and expose services with MetalLB on MicroK8s. So, let's get started!

Prerequisites

Before we get started, there are a few things that you will need in order to follow along with this tutorial:

  • An Ubuntu 22.04 LTS server with MicroK8s installed (if you don't have MicroK8s installed yet, you can follow our guide to get it set up).
  • A custom Docker image pushed to a private container registry (if you haven't done this yet, you can follow our guide to create and push an image).

If you have all of these prerequisites in place, then you're ready to move on to the next section and start creating your pod!

Checking custom images in our Private Registry

Before creating the pod, let’s verify which images we have in our private registry (Note that these steps are for the registry created in our previous articles). To list all the repositories you can browse to the following url “ http://<microk8s ip or hostname>:32000/v2/_catalog” or you can retrieve the json response using curl in the cli using the following command:

curl http://<microk8s ip or hostname>/v2/_catalog

You will see an answer like the following:

{"repositories":["custom-ubuntu"]}

Here you can see that there is one repository called “ custom-ubuntu” that we created in the previous article, now we can see which tags do we have inside the repository, and for that you can browse to the url “ http://<microk8s ip or hostname>:32000/v2/custom-ubuntu.tags/list” or from the cli using the command:

curl http://<microk8s ip or hostname>/v2/custom-ubuntu/tags/list

And you will see an answer like the following

{"name":"custom-ubuntu","tags":["latest"]}

At this point we know that the image is “ repository:tag” so in our case it will be “ custom-ubuntu:latest

How to create a Persistent Volume Claim

A Persistent Volume Claim (PVC) is a request for storage by a user in a Kubernetes cluster. It is used to dynamically provision a Persistent Volume (PV) for a pod. A PVC specifies the amount of storage requested, the access mode required (e.g. ReadWriteOnce, ReadWriteMany), and the storage class to be used.

The structure of a PVC YAML file is similar to that of a pod YAML file. It includes the kind, metadata, and spec sections. The spec section includes the accessModes, resources, and storageClassName fields.

Here is an example YAML file for a PVC:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
   name: my-pvc
spec:
   accessModes:
     - ReadWriteOnce
   resources:
     requests:
       storage: 1Gi

In this example, the PVC is requesting 1 gigabyte of storage using the local-storage storage class. The access mode is set to ReadWriteOnce, meaning that the volume can be mounted as read-write by a single node at a time.

To create the PVC resource in Kubernetes, you can run the following command:

microk8s kubectl apply -f my-pvc.yaml

This will create the PVC resource in your Kubernetes cluster and make it available to use by other resources, such as pods.

How to create a Kubernetes pod

In Kubernetes, a Pod is the smallest deployable unit that you can create and manage. A Pod represents a single instance of a running process in your cluster, which could be a container, a group of containers, or multiple processes on a node. You can define a Pod using a YAML file that specifies the Pod's metadata, its container specifications, and any associated configuration data.

The structure of a Pod YAML file consists of two sections: metadata and specification. The metadata section contains the name, namespace, and labels for the Pod. The specification section defines the Pod's container specifications, such as the image name, command, and volume mounts.

Here's an example of a simple Pod YAML file that specifies a single container:

apiVersion: v1
kind: Pod
metadata:
   name: my-pod
   namespace: my-namespace
spec:
   containers:
   - name: my-container
     image: my-custom-image:latest
     command: ["my-custom-command"]
     volumeMounts:
     - name: my-volume
       mountPath: /data
   volumes:
   - name: my-volume
     persistentVolumeClaim:
       claimName: my-pvc

You can find more info about how to define a pod  in the Kubernetes documentation, here.

Let's break down each section of this YAML file:

  • apiVersion : The version of the Kubernetes API used by this object.
  • kind : The type of object, which in this case is a Pod.
  • metadata : The metadata section contains the name, namespace, and any labels associated with the Pod.
  • spec : The spec section contains the Pod's configuration, including the containers, volumes, and other settings.

In the containers section, we define a single container called “ my-container”. We specify the image to use for the container, and we provide a custom command to run in the container using the command field.

In the volumes section, we define a single volume called “ my-volume”. We specify that this volume should be backed by a persistent volume claim (PVC) called “ my-pvc”.

Finally, in the “ volumeMounts” section of the container, we mount the “ my-volume” volume to the container's “ /data” directory.

To create a Pod using this YAML file, you can use the kubectl apply command:

microk8s kubectl apply -f pod.yaml

This will create a Pod called “ my-pod” in the “ my-namespace” namespace, using the configuration specified in the YAML file.

How to expose a service using MetalLB

A Kubernetes service is an abstraction layer that provides a stable endpoint for accessing a set of pods. The service decouples the pods from their consumers, allowing for better scalability and reliability. Services can be exposed internally within a cluster, or externally to the internet using an external load balancer, such as MetalLB.

To create a service, you need to create a YAML file that defines the service's properties, including the selector that matches the pods that the service targets. The service is identified by a unique name and a service type, which specifies how the service is exposed. The most common service types are ClusterIP, NodePort, and LoadBalancer.

Based on the previous pod YAML file, let's create a service YAML file to expose the pod using MetalLB in a specific IP address. Here's an example:

apiVersion: v1
kind: Service
metadata:
   name: my-service
spec:
   selector:
     app: my-app
   ports:
     - name: http
       port: 80
       targetPort: 8080
   type: LoadBalancer

In this example, we have created a service called “ my-service” in the “ my-namespace” namespace. The service targets pods with the label “ app: my-app”. The service type is “ LoadBalancer”, which means that it will be exposed externally using MetalLB. We have specified the IP address we want to use for the load balancer by setting the “ loadBalancerIP” field to “ 192.168.1.100”.

We have also defined a port called “ http” that maps to port “ 8080” on the pods. This means that when traffic is directed to port “ 80” on the service, it will be forwarded to port “ 8080” on the pods.

To create the service as in creating the pod, you can use the “ kubectl” apply command with the YAML file:

microk8s kubectl apply –f service.yaml

This will create the service in your cluster, and MetalLB will allocate an external IP address for the service. You can use the “ kubectl get services” command to check the status of the service and retrieve the external IP address:

microk8s kubectl get services my-service -n my-namespace

This will display information about the service, including its type, cluster IP, and external IP address. You can use the external IP address to access the service from outside the cluster.

Tying everything together

Configuring MetalLB Address Pool

Before creating the Pod we will configure MetalLB, for this, you will need to create a ConfigMap in your Kubernetes cluster. The ConfigMap should contain the IP address range that MetalLB can use to allocate IP addresses for your services. like this:

apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
  name: custom-addresspool
  namespace: metallb-system
spec:
  addresses:
    - <start ip>-<end ip>

And apply it with:

microk8s kubectl apply -f ipaddresspool.yaml

You can verify that the configuration was successful by retrieving the configuration with the command:

microk8s kubectl get ipaddresspools.metallb.io -n metallb-system -o yaml

Creating a namespace

In Kubernetes, a namespace is a virtual cluster inside a physical cluster. It provides a way to partition and isolate resources within the cluster, allowing multiple teams or projects to use the same physical cluster without interfering with each other.

The benefits of using namespaces include:

  1. Isolation : Namespaces provide a way to isolate resources within the same cluster, preventing conflicts between different teams or projects.
  2. Resource Management : Namespaces help manage resources such as CPU, memory, and storage more efficiently by allowing them to be shared among different services and applications.
  3. Access Control : Namespaces enable fine-grained access control, allowing administrators to grant specific users or groups access to resources in a particular namespace.

To create a namespace in MicroK8s, you can use the kubectl create namespace command followed by the name of the namespace you want to create. We are going to create a namespace called “ dev”, you can use the following command:

microk8s kubectl create namespace dev

Creating a L2 Advertisement

After you created the address pool, you need to configure the L2Advertisement this will allow that the ip addresses of the pool answer to ARP requests, because the ip addresses are not associated to any interface, to do this use the following yaml file:

apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
   name: example
   namespace: metallb-system

And apply it with:

microk8s kubectl apply -f advertisement.yaml

Creating Persistent Volume Claim

Now it is the time to create the Persistent Volume Claim with the following file:

apiVersion: v1
  kind: PersistentVolumeClaim
  metadata:
   name: my-pvc
   namespace: dev
  spec:
    accessModes:
      - ReadWriteOnce
    resources:
      requests:
        storage: 10Gi

And apply it with:

microk8s kubectl apply -f my-pvc.yaml

Creating the Pod

We can create the pod now using the persistent volume claim created before, to do that you can create the following yaml:

apiVersion: v1
kind: Pod
metadata:
    name: dev-podun
    namespace: dev
    labels:
      app: dev-app
spec:
    containers:
    - name: dev-container
      image: <microk8s ip or hostname>:32000/custom-ubuntu:latest
      ports:
        - name: ssh
          containerPort: 22
      command: ["/usr/sbin/sshd", "-D"]
      volumeMounts:
      - name: dev-volume
        mountPath: /mnt/data
    volumes:
    - name: dev-volume
      persistentVolumeClaim:
        claimName: my-pvc

and apply the configuration with:

microk8s kubectl apply -f my-pod.yaml

Exposing the service with MetalLB

To expose the service you will need to create the following yaml file, that will tie together the container with the ip address of the load balancer:

apiVersion: v1
kind: Service
metadata:
   name: dev-service
   namespace: dev
   annotations:
     metallb.universe.tf/address-pool: <name of the pool>
spec:
   selector:
     app: dev-app
   ports:
     - name: ssh
       port: 22
       targetPort: 22
   type: LoadBalancer
   loadBalancerIP: <ip address from the pool>

And apply it with:

microk8s kubectl apply –f service.yaml

 Note: That the label “app” in the pod must match the selector section of the service configuration, with this the Load Balancer will know that the container to match is the one created by your pod configuration.

Test the deployment

In a previous article, we created a custom image of an Ubuntu container with SSH service exposed. Now, we deployed the image to our microk8s cluster by creating a pod and a persistent volume with a size of 10 GB. Additionally, we created a load balancer service that is exposing port 22 (SSH) to the outside world and bridge it to the container. Once these resources are deployed, we will have an Ubuntu server installed and ready to be accessed via SSH using the IP address specified in the load balancer service definition. Note that only port 22 (SSH) is exposed, so pinging the IP address exposed by the load balancer service will not be successful.

The ultimate test is that you can connect to the container using SSH.

Monitor the deployment

Monitoring your deployed applications and infrastructure is a crucial aspect of maintaining their health and availability. Kubernetes provides several tools and techniques for monitoring, including built-in metrics and logging. In this section, we'll explore how to monitor the application we just deployed using the Kubernetes dashboard and command-line tools. We'll cover how to access the Kubernetes dashboard, view logs, and check the status of our application using the “microk8s kubectl” command-line tool.

Using the CLI

To monitor the deployment created in the previous steps, you can use the following command in the MicroK8s CLI:

microk8s kubectl get pods –namespace=dev

This command will display the list of pods running in the specified namespace, including the pod that was created using the custom image and exposed using MetalLB.

To monitor the service exposed with MetalLB, you can use the following command:

microk8s kubectl get services –namespace=dev

This command will display the list of services running in the specified namespace, including the service that was exposed using MetalLB.

You can also use the following command to get more detailed information about a specific pod or service:

microk8s kubectl describe <pod-or-service-name-from-previous-commands> –namespace=dev

This command will display detailed information about the specified pod or service, including its status, configuration, and any events related to it, while to check the logs for a pod, you can use the “microk8s kubectl logs” command followed by the name of the pod:

microk8s kubectl logs <pod-name> –namespace=dev

Using the Dashboard

To use the dashboard like in previous articles the first step is to generate the token to authenticate us, to do this, use the command:

microk8s kubectl create token default

Copy the token and go to the dashboard page “https://<microk8s ip or hostname>/” and you will see the following authentication page:

microk8s-dashboard-login Blog

Paste the token and click “ Sign In”, you will be presented with the dashboard page:

microk8s-dashboard Blog

Select the “ dev” namespace to limit the resources and searches to that namespace, and as soon as you do that you will start seeing the different pods and workloads status.

microk8s-dashboard-namespace-services Blog

Clicking in the pod “ dev-pod” you can see all the information about the pod like in the screen capture below.

microk8s-dashboard-namespace-pod Blog

Here you can see all the information of the pod, including the persistent volumes (that you can click on it to get more info), status of the pod, internal ip address and memory and cpu usage, to see the load balancer and the connection with the pod, on the left panel click in “ Services” inside the “ Service” section, and you will be presented with the following screen.

microk8s-dashboard-namespace-services Blog

Click on the “ dev-service” service to get more information, but in this screen you can have a nice summary of the service, like the external ip address and port, the internal ip address and port, the type of service, etc… If you get more info by clicking in the service you will be presented with the following screen.

microk8s-dashboard-namespace-service-detail Blog

Where you will see the pod “ dev-pod” attached to the service and more information related to the service.

Conclusion

In conclusion, Kubernetes is a powerful tool for managing containerized applications and microservices. Microk8s is an excellent way to run a lightweight, single-node Kubernetes cluster on your local machine, enabling developers to create, deploy, and manage applications quickly and efficiently. In this article, we have covered the basics of deploying a custom image to a pod, exposing it with a service, and configuring it to use a persistent volume using PVC. We have also explored how to use the Metallb addon to expose services to external IP addresses and how to monitor and troubleshoot using various CLI tools and the Microk8s dashboard. With these fundamental concepts, developers can easily create and deploy complex microservices applications using Microk8s.

Bokeh Solutions

Focused Results!


Empowering Businesses with Comprehensive Security Solutions!

Contact Us