Created
May 25, 2018 07:14
-
-
Save xiispace/74989747aece9c3ba307f3cec6082130 to your computer and use it in GitHub Desktop.
python kernel crypt
This file contains hidden or 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
from socket import socket, AF_ALG, SOCK_SEQPACKET, SOL_ALG, ALG_SET_KEY | |
from binascii import hexlify | |
with socket(AF_ALG, SOCK_SEQPACKET, 0) as alg: | |
alg.bind(('hash', 'hmac(sha512)')) | |
alg.setsockopt(SOL_ALG, ALG_SET_KEY, b'key') | |
op, _ = alg.accept() | |
with open('/etc/passwd', 'rb') as f: | |
op.sendfile(f) | |
print(hexlify(op.recv(64))) | |
op.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment