Skip to content

Instantly share code, notes, and snippets.

View slayerlab's full-sized avatar
🐞

Slayer slayerlab

🐞
View GitHub Profile
@slayerlab
slayerlab / histogram.c
Created October 21, 2018 10:36
ANSI C K&R: Horizontal & Vertical Histogram
#include <stdio.h>
/* *
* Exercise 1-13. Write a program to print a histogram of the lengths of words in
* its input. It is easy to draw the histogram with the bars horizontal; a vertical
* orientation is more challenging.
* ----
* ANSI C K&R - CHARACTER INPUT AND OUTPUT: PAGE 15
* The quantities IS_LOWER, IS_UPPER, IS_ALPHA, MAXLEN, OUT and IN (macros)
* are symbolic constant, not variables, so they do not appear in declarations.
@slayerlab
slayerlab / cvs_system.sh
Last active November 11, 2021 00:06
Check the "Common Vulnerability Scoring System" (CVSS) and "Vector Calculation" through National Vulnerability Database (nvd.nist.gov)
#!/bin/bash
#coded by sl4y3r 0wn3r
#uncomment below for debug
#set -x
# + and this to execute line by line (hit enter)
#trap read debug
# Color bash
RED='\033[1;31m'
GREEN='\033[1;32m'
@slayerlab
slayerlab / newpost.sh
Created November 1, 2021 01:39
This script helps to create a new Jekyll post quickly.
#!/bin/bash
JEKYLL_PATH="YOUR_JEKYLL_PATH"
POST_DATE=$(date +%Y-%m-%d)
TITLE=$1
FILENAME="$POST_DATE-${TITLE//\ /-}" || ""
[[ -z "$TITLE" ]] \
&& {
echo >&2 "[!] Filename not set." \
&& exit 1;
@slayerlab
slayerlab / CVE-2021-41773.go
Last active October 7, 2021 05:01
A collection to exploit and assess the CVE-2021-41773 vulnerability regardless of your OS.
package main
import (
"fmt"
"flag"
"net/http"
"io/ioutil"
"strings"
"os"
)
@slayerlab
slayerlab / linux-definitions-vulnerability-oval.xml
Last active March 6, 2021 19:54
OVAL Language for detect CVE-2018-7187 vulnerability on Linux environment. This PoC was made to answer this question: https://security.stackexchange.com/questions/194557/how-to-discover-known-vulnerabilities-cves-in-go-executables
<?xml version="1.0" encoding="UTF-8"?>
<oval_definitions
xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5"
xmlns:oval="http://oval.mitre.org/XMLSchema/oval-common-5"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://oval.mitre.org/XMLSchema/oval-common-5 oval-common-schema.xsd http://oval.mitre.org/XMLSchema/oval-definitions-5 oval-definitions-schema.xsd">
<generator>
<oval:product_name>Security StackExchange Question - 194557</oval:product_name>
<oval:schema_version>5.10</oval:schema_version>
@slayerlab
slayerlab / .zshrc
Created March 5, 2021 12:20
Fix Kali Linux terminal display
# Check your environment locale:
# $ env | grep 'LANG'
# GDM_LANG=en_US.utf8
# LANG=en_US.UTF-8
# LANGUAGE=en_US.UTF-8
# Adjust ~/.zshrc
# [snippet]
if [[ "$color_prompt" = yes ]]; then
PROMPT=$'%F{%(#.blue.green)}┌──${debian_chroot:+($debian_chroot)──}(%B%F{%(#.red.blue)}%n%(#.💀.💣)%m%b%F{%(#.blue.green)})-[%B%F{reset}%(6~.%-1~/…/%4~.%5~)%b%F{%(#.blue.green)}]\n└─%B%(#.%F{red}#.%F{blue}$)%b%F{reset} '
@slayerlab
slayerlab / bad_sequel.py
Created March 6, 2020 17:36 — forked from 3xocyte/bad_sequel.py
PoC MSSQL RCE exploit using Resource-Based Constrained Delegation
#!/usr/bin/env python
# for more info: https://shenaniganslabs.io/2019/01/28/Wagging-the-Dog.html
# this is a rough PoC
# requirements for RCE:
# - the attacker needs to either have or create an object with a service principal name
# - the MSSQL server has to be running under the context of System/Network Service/a virtual account
# - the MSSQL server has the WebClient service installed and running (not default on Windows Server hosts)
# - NTLM has to be in use
@slayerlab
slayerlab / .tmux
Created June 8, 2019 12:25
My marginally `TMUX(1)` configuration file: ~/.tmux.conf
# List of plugins
# Reference: https://github.com/tmux-plugins/tpm
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# Personal plugins
set -g @plugin 'tmux-plugins/tmux-logging'
# Remap prefix to screens
set -g prefix C-q
@slayerlab
slayerlab / linuxprivchecker3.py
Last active May 21, 2019 18:37
From Python2 "linuxprivchecker.py" to Python 3 – credits to: https://github.com/sleventyeleven/linuxprivchecker
#!/usr/env python3
###############################################################################################################
# [Title]: linuxprivchecker.py -- a Linux Privilege Escalation Check Script
# [Author]: Mike Czumak (T_v3rn1x) -- @SecuritySift
# [Edited]: Slayer @ May 17, 2019
# -------------------------------------------------------------------------------------------------------------
# [Details]:
# This script is intended to be executed locally on a Linux box to enumerate basic system info and
# search for common privilege escalation vectors such as world writable files, misconfigurations, clear-text
@slayerlab
slayerlab / localvimrc.vim
Last active December 5, 2018 01:36
Making the BASH dive into 'Shell Style Guide' for better readability.
" Making the BASH dive into 'Shell Style Guide' for better readability.
" https://lug.fh-swf.de/vim/vim-bash/StyleGuideShell.en.pdf
" https://google.github.io/styleguide/shell.xml
syntax on " set syntax highlight turned on;
set tabstop=4 " set tabstop to tell vim how many columns a tab counts for. Linux kernel code expects each tab to be 8 columns wide. Visual studio expects each tab to be four columns wide. This is the only command here that will affect how existing text displays;
set expandtab " convertt tabs to spaces;
set shiftwidth=2 " indent is 2 spaces;
set softtabstop=2 " untab size of, instead single space;
set autoindent " always set autoindenting on;
" extras: