Skip to content

Instantly share code, notes, and snippets.

@ghost-ng
ghost-ng / explode-opvn.sh
Created November 25, 2022 00:51 — forked from dleonard00/explode-opvn.sh
extract the certificate and key from an .ovpn file
#!/bin/bash
# This script will extract the certificate and key from an .ovpn file
# into their own files, which makes it possible to use them to configure
# the VPN using Ubuntu's network manager
# Usage example:
# >> ovpnconvert username.dev.ovpn
# You can keep following these instructions here:
@ghost-ng
ghost-ng / main.go
Created September 12, 2022 13:08 — forked from napicella/main.go
Companion code for the Linux terminals blog series
// Companion code for the Linux terminals blog series: https://dev.to/napicella/linux-terminals-tty-pty-and-shell-192e
// I have simplified the code to highlight the interesting bits for the purpose of the blog post:
// - windows resizing is not addressed
// - client does not catch signals (CTRL + C, etc.) to gracefully close the tcp connection
//
// Build: go build -o remote main.go
// In one terminal run: ./remote -server
// In another terminal run: ./remote
//
// Run on multiple machines:
@ghost-ng
ghost-ng / Service KMS
Created August 29, 2022 21:24 — forked from judero01col/Service KMS
Volume License Activation Key Service - KMS
## Find Available Target Editions
DISM.exe /Online /Get-TargetEditions
## Convert Server Standard 2019 Evaluation to Server Standard 2019
DISM /online /Set-Edition:ServerStandard /ProductKey:N69G4-B89J2-4G8F4-WWYCC-J464C /AcceptEula
## How To Activate
slmgr /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
slmgr /skms [server]:[port]
slmgr /ato
@ghost-ng
ghost-ng / tcpforward.go
Last active January 1, 2022 15:52
tcpforward.go
package main
import (
"fmt"
"io"
"log"
"net"
"os"
"github.com/akamensky/argparse"
#!/usr/bin/python
from socket import *
import sys
bufsize = 1024 # Modify to suit your needs
try:
listenHost = sys.argv[1].split(":")[0]
listenPort = int(sys.argv[1].split(":")[1])
connectHost = sys.argv[2].split(":")[0]
#!/usr/bin/env python
from __future__ import print_function
# Originally Taken From:
# https://raw.githubusercontent.com/Alamot/code-snippets/master/mssql/mssql_shell.py
# CHANGES:
# 1. I removed upload functionality - too clunky and depending on how you access the target, it can get complicated,
# also I strongly prefer to not use certuti if I don't have to. The user should alread know how to get files onto the system
# 2. I added script arguments (I opted to not use argparse)
# 3. I added support for different ports
# 4. I removed unnecessary imports
#!/bin/bash
#author: midnightseer
#location: https://gist.github.com/MidnightSeer/99f42947b41b9f51a1b15107ba8d5c07
#resources:
#https://www.exploit-db.com/exploits/50236
#https://www.exploit-db.com/papers/44139/
#https://github.com/mysqludf/lib_mysqludf_sys <-- this is the udf file I used
@ghost-ng
ghost-ng / tcpforward.py
Created December 26, 2020 22:18
Python port forwarder tcp
import socket
import threading
import sys
import argparse
import os
def handle(buffer):
return buffer
@ghost-ng
ghost-ng / tcpforward.pl
Created December 20, 2020 20:25
perl port forwarder
#!/usr/bin/perl
use Fcntl;
use Errno;
use IO::Socket::INET;
use Pod::Usage qw/pod2usage/;
use warnings;
use strict;
our $VERSION = 0.01;
@ghost-ng
ghost-ng / http-server.py
Created December 19, 2020 15:34
Simple python http server with upload and encryption
#!/usr/bin/env python3
"""Python Web Server with upload functionality and SSL.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
For initial version, see: https://gist.github.com/UniIsland/3346170
Updated by midnightseer to include the ssl wrapper and command line options