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
# | |
# _payload: | |
# 00002014 B8DAFFFECD mov eax, 0xcdfeffda ; Move the initialisation vector (IV) into EAX. This is the initial key, XREF=_main+13 | |
# 00002019 DAD3 fcmovbe st0, st3 ; (Not sure) Conditional move ST0 to ST3 (floating point). Not sure why this is necessary | |
# 0000201b D97424F4 fnstenv dword [ss:esp-0xc] ; Places the floating point memory into designated location in memory. This includes EIP. Note the offset to ESP (Stack Pointer). This makes sure that ESP will point to stored EIP. | |
# 0000201f 5B pop ebx ; Get EIP from the stack. This was saved by FSTENV | |
# 00002020 29C9 sub ecx, ecx ; Zero out ECX | |
# 00002022 B10E mov cl, 0xe ; ECX is loop counter | |
# |
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
# Nasm code for the stub. | |
# ________ | |
# | |
# global start | |
# | |
# | |
# section .text | |
# | |
# start: | |
# mov rax, 0x0123456789ABCDEF ; set the key. |
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
; nasm -f macho64 test.asm -o test.o \ | |
; && ld -o test -segprot __DATA rwx rwx test.o | |
global start | |
section .text | |
start: | |
mov rax, 0x0123456789ABCDEF ; Set the initial key (IV) | |
lea rbx, [rel $] ; Place current instruction pointer RIP in RBX |
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 random | |
import struct | |
import re | |
import ctypes | |
class ShellcodeGenerator: | |
__QWORD_SIZE = 8 | |
__iv = 0x0000000000000000 | |
__payload = "" |
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
from scapy.all import * | |
from scapy.contrib.dtp import * | |
FLAG_TRUNK = 0x80 | |
RETRY = 10 | |
SEND_WAIT = 5 | |
iface = 'en0' | |
dtpmac = "01:00:0c:cc:cc:cc" | |
mymac = get_if_hwaddr(iface) |
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
$charset = @() | |
$charset += ([char]'0'..[char]'9') |% {[char]$_} | |
$charset += ([char]'a'..[char]'z') |% {[char]$_} | |
$charset += ([char]'A'..[char]'Z') |% {[char]$_} | |
$charset = $charset | Select-Object -uniq | |
function Get-NextPassword() { | |
param( | |
$Password | |
) |
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 | |
# | |
# Modification from: | |
# https://unix.stackexchange.com/questions/6267/how-to-re-load-all-running-applications-from-swap-space-into-ram/6271 | |
# | |
# For non-root check 'cat /proc/sys/kernel/yama/ptrace_scope' = 0 | |
# Reference: https://www.kernel.org/doc/Documentation/security/Yama.txt | |
# | |
import re | |
import sys |
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
$DebugPreference = "Continue" | |
function Create-Base64Payload() | |
{ | |
param( | |
$Filename | |
) | |
$content = (Get-Content -Path $Filename | Out-String) | |
$command = [Convert]::ToBase64String([System.Text.Encoding]::Unicode.GetBytes($content)) | |
Write-Debug "[+] Mind the newlines!" | |
Write-Debug "[+] Powershell.exe -EncodedCommand $command" |
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
[System.Security.Cryptography.CngKey]$aliceKey = [System.Security.Cryptography.CngKey]::Create([System.Security.Cryptography.CngAlgorithm]::ECDiffieHellmanP256) | |
[System.Security.Cryptography.CngKey]$bobKey = [System.Security.Cryptography.CngKey]::Create([System.Security.Cryptography.CngAlgorithm]::ECDiffieHellmanP256) | |
[Byte[]]$alicePubKeyBlob = $aliceKey.Export([System.Security.Cryptography.CngKeyBlobFormat]::EccPublicBlob) | |
[Byte[]]$bobPubKeyBlob = $bobKey.Export([System.Security.Cryptography.CngKeyBlobFormat]::EccPublicBlob) | |
[System.Security.Cryptography.ECDiffieHellmanCng]$aliceAlgorithm = New-Object System.Security.Cryptography.ECDiffieHellmanCng($aliceKey) | |
[System.Security.Cryptography.CngKey]$bobPubKey = [System.Security.Cryptography.CngKey]::Import($bobPubKeyBlob, [System.Security.Cryptography.CngKeyBlobFormat]::EccPublicBlob) | |
[Byte[]]$aliceSymKey = $aliceAlgorithm.DeriveKeyMaterial($bobPubKey) | |
OlderNewer