Skip to content

Instantly share code, notes, and snippets.

AyrA

  • Switzerland
Block or report user

Report or block AyrA

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@AyrA
AyrA / GetWindowInfoEnum.cs
Created Jan 24, 2019
Flags for GetWindowInfo
View GetWindowInfoEnum.cs
//These are for the dwStyle and dwExStyle of WINDOWINFO
[Flags]
public enum WindowStyle : uint
{
/// <summary>
/// The window is an overlapped window.
/// An overlapped window has a title bar and a border.
/// Same as the WS_OVERLAPPED style.
/// </summary>
WS_TILED = 0x0,
@AyrA
AyrA / konami.js
Created Jul 8, 2018
JS Konami code script
View konami.js
//Small konami code script that doesn't uses the usual method of an integer array
//Either run this through a minifier or remove the comments,
//otherwise people can just search for "konami" or variable name combinations
//The string of the konami code itself is almost impossible to find by using search engines.
//Params:
//cb - required(function), called on complete sequence with all 3 parameters
//check - optional(function), checks if key presses should be evaluated, called with all 3 parameters.
//single - optional(bool), if set to something that evaluates to 'true' the secret can only be used once.
(function (cb, check, single) {
var d = "&&((%'%'BA";
@AyrA
AyrA / http.ps1
Last active Dec 15, 2018
Powershell HTTP Server
View http.ps1
# Portable HTTP file server
# Should be somewhat safe but please don't actually use it.
# You can't exit this with CTRL+C directly and need to use the shutdown command below a directory listing,
# or you can kill the powershell process of course, but this causes the port to stay used sometimes.
# Features
# - Directory Browser
# - Can handle UTF8 URLs
# - Delivers unknown file types
# - /../ attack prevention
@AyrA
AyrA / bfjsf.js
Last active Mar 15, 2018
Brainfuck interpreter in JSFuck
View bfjsf.js
//Brainfuck Interpreter in JSFuck by /u/AyrA_ch
(typeof(window)==="undefined"?global:window).bf=
//Put your code in the line below
'-[----->+<]>----.-[--->++<]>+.-[++>---<]>+.---[-->+++<]>-.----[->++<]>-.-------.+[->+++++<]>++.-[-->+++<]>-.++++.+++++.';
/*
Text input is done using 'prompt' function
Text output is shown at the end of the script, because console.log adds linebreaks
The interpreter has 1000000 bytes of memory
@AyrA
AyrA / KDF.cs
Created Feb 20, 2018
C# Custom Key derivation
View KDF.cs
using System;
using System.Linq;
using System.Security.Cryptography;
/*
I am in no way claiming that this is secure.
It merely serves as an example on how a key derivation function could work.
Features:
@AyrA
AyrA / search.js
Created Feb 18, 2018
Find and count multiple words on a website
View search.js
(function (x) {
var text = document.body.textContent;
return x.map(function (v) {
var m = text.match(new RegExp("\\s(" + v + ")[\\s.,!?]", "gi"));
return m ? m.length : 0;
});
})(["add", "all", "your", "words", "here"]);
@AyrA
AyrA / collection_count.cs
Created Nov 13, 2017
Length of any Collection in C#
View collection_count.cs
//#mode simple
using System;
using System.Collections;
using System.IO;
//This is a joke. Don't use
//https://redd.it/7ch739
public static int Main(string[] Args)
{
@AyrA
AyrA / where.bat
Created Nov 2, 2017
where command on Windows
View where.bat
@ECHO OFF
REM Store this anywhere in your PATH.
SETLOCAL
SET FULL=%~$PATH:1
IF "%FULL%"=="" GOTO NF
GOTO PRINT
:PRINT
ECHO %FULL%
GOTO END
@AyrA
AyrA / BypassCmdGpo.bas
Created Nov 2, 2017
Bypass GPO Restriction on CMD.exe with Excel
View BypassCmdGpo.bas
Option Explicit
'Copyright 2017 /u/AyrA_ch
'Open Excel, Press ALT+F11, add new "module" (not Class module) and paste this entire code in it.
'To use you can either place a button on your excel sheet and hook up these functions to it
'Or you place the cursor inside the Button function you want to use and press F5
'After one successful launch you find the executable on your Desktop.
'You then no longer need this file.
@AyrA
AyrA / guid.php
Last active Nov 1, 2017
PHP UUID Generator
View guid.php
<?php
//Generates cryptographically safe UUIDv4 (sometimes called GUID)
function guid()
{
$data=random_bytes(16);
assert(strlen($data)===16);
$data[6]=chr(ord($data[6])&0x0f|0x40); //set version to 0100
$data[8]=chr(ord($data[8])&0x3f|0x80); //set bits 6-7 to 10
You can’t perform that action at this time.