Featured image of post Kali Linux VPS for Free: A Segfault Tutorial That Makes It Possible

Kali Linux VPS for Free: A Segfault Tutorial That Makes It Possible

VPS Freeeeee

Original Article in Medium: https://sondt1337.medium.com/kali-linux-vps-for-free-it-appears-so-segfault-tutorial-6c9dd0642ff0

Segfault, created by The Hacker’s Choice, is a complimentary application for Cyber Security Researcher. It provides an unlimited server with Root access. With each new server that is generated, SSH connection is established for communal use.

SSH Connection

LOGIN Server

To connect to Segfault via SSH, use the following command:

1
ssh [email protected] # The password is 'segfault'

When initially connecting to Segfault to open a root and SSH server, a 60-second wait is required. However, this duration is not typical for subsequent connections (probably less).

Once successfully connected to the server, it will provide details such as SSH and IP address. (It’s important to save this information for future reference.)

Connection info

Later, to log in again, simply execute the SSH command provided below.

SSH COMMAND

1
ssh -o "SetEnv SECRET=YOUR_KEY_PRIVATE" [email protected]

Once logged in, this Kali server can be utilized as a virtual machine equipped with a comprehensive suite of tools for security and networking, … (Segfault’s homepage for more details).

Working with Kali Linux VPS

To log out of the server, simply use the exit command.

TUNNEL Server - Argo Tunnel (Cloudflare Tunnel)

Although the server we have is nearly identical to a real Kali Linux virtual machine, it can initiate connections from the inside, but external connections cannot reach it using common protocols like HTTP, TCP, etc. For this, I will need to utilize a powerful Cloudflare feature called Tunnel.

Initially, you must establish a tunnel from Cloudflare to the Kali Linux server using Zero Trust.

Create a tunnel

Create a tunnel from Cloudflare

Name your tunnel

Name your tunnel

Install and run connectors

In the “Choose your environment” options, select Debian — 64-bit.

1
2
3
4
5
curl -L --output cloudflared.deb https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb

sudo dpkg -i cloudflared.deb 

sudo cloudflared service install "YOUR_TOKEN_CLOUDFLARE" # Replace YOUR_TOKEN_CLOUDFLARE

Upon a successful connection, Connectors will display both ID and Status.

Route Traffic

Config Localhost & Domain

In “Route Traffic,” you must fill in the Domain (at least one domain is required) and the method + URL (localhost).

Use http.server in background to tunnel from machine to cloudflare.

When the http.server is running in the background, a Cloudflare tunnel can be configured to a domain, allowing access via: https://segfault.sondt.id.vn

(If you’re still able to access this page, it indicates that the article remains accurate. LOL)

You can create an HTML file in the background to display a welcome page :>

Welcome Page

UPTIME Server

However, if the requirement is to establish a connection that remains active indefinitely, allowing applications to run continuously, what should be done?

According to the segfault announcement, the server will remain up as long as you are logged into the Segfault. This means your progress will be preserved as long as you maintain an SSH connection to segfault.net.

So we need to make something that can automatically connect “ssh” to the segfault server.

Github Actions

GitHub Actions is a complimentary service offered by GitHub that facilitates the automation of the CI/CD process. It enables users to create workflows that automate tasks within the software development lifecycle.

When you create a repository in Github, you can choose Actions to start Github Actions, choose the simple workflow.

I have created a YAML script to automate the process of repeatedly establishing an SSH connection with a set interval.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
name: SEGFAULT

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]
  schedule:
    - cron: '*/20 * * * *' # Restart each 20 minutes

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Install sshpass
        run: sudo apt-get install -y sshpass

      - name: Connect to SSH and run command
        # automatic connect ssh from github actions
        run: |
          sshpass -p "segfault" ssh -o "SetEnv SECRET=YOUR_KEY" -o "StrictHostKeyChecking=no" [email protected] "ls"          

This rules will make automatically connect to SSH every 20 minutes, making the SSH connection process uninterrupted for too long.

Connect to SSH and run command

We have successfully established a continuous SSH connection to the server, ensuring it remains active for our needs.

CONCLUSION

This article demonstrates how to establish a connection to a Segfault, create a tunnel from the Segfault server to an external destination with domain, and maintain it with 100% uptime.

If you find this guide helpful, please consider sharing it with your friends.

Thank you for visting!

Buy me a coffee ☕: https://www.buymeacoffee.com/spid3r