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
// https://medium.com/@hadfiabdelmoumene/change-value-of-wp-bit-in-cr0-when-cr0-is-panned-45a12c7e8411 | |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0) | |
inline void write_cr0_new(unsigned long cr0) | |
{ | |
asm volatile("mov %0,%%cr0" : "+r"(cr0), "+m"(__force_order)); | |
} | |
#else | |
#define write_cr0_new write_cr0 | |
#endif |
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 resources physical memory map VM detection trick | |
// written by Graham Sutherland (@gsuberland) for Nettitude | |
// based on prior work done as part of the al-khaser project | |
// https://github.com/LordNoteworthy/al-khaser/ | |
// ref: https://blog.xpnsec.com/total-meltdown-cve-2018-1038/ | |
// ref: https://gist.github.com/xpn/3792ec34d712425a5c47caf5677de5fe | |
// compile: |
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
setTimeout(() => { | |
document.querySelectorAll("textarea").forEach(e => { | |
e.addEventListener("keydown", ev => { | |
if (ev.ctrlKey) { | |
ev.stopPropagation(); | |
} | |
}) | |
}) | |
}, 2000) |
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
package main; | |
import java.io.*; | |
import java.nio.*; | |
import java.nio.file.*; | |
import org.apache.bcel.classfile.Utility; | |
public class Main { | |
public static void help() { | |
System.out.println( |
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
#!/bin/bash | |
if [ ! -f "vmlinux-3.2.0-4-4kc-malta" ]; then | |
wget https://people.debian.org/~aurel32/qemu/mipsel/vmlinux-3.2.0-4-4kc-malta | |
fi | |
if [ ! -f "debian_wheezy_mipsel_standard.qcow2" ]; then | |
wget https://people.debian.org/~aurel32/qemu/mipsel/debian_wheezy_mipsel_standard.qcow2 | |
fi | |
sudo qemu-system-mipsel -m 1024M -M malta \ |
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
function _fillUp(value, count, fillWith) { | |
var l = count - value.length; | |
var ret = ""; | |
while (--l > -1) | |
ret += fillWith; | |
return ret + value; | |
} | |
function hexdump(arrayBuffer, offset, length) { | |
offset = offset || 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
// Original post | |
// https://0x00-0x00.github.io/research/2018/11/06/Recovering-Plaintext-Domain-Credentials-From-WPA2-Enterprise-on-a-compromised-host.html | |
function Get-String | |
{ | |
Param( | |
[Parameter(Mandatory = $true, Position = 0)] | |
[byte[]]$InputStream | |
) | |
[byte[]]$Output = @(); |
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
class Test: | |
async def notify_async(): | |
await asyncio.sleep(1) | |
def notify(self): | |
loop = None | |
try: | |
loop = asyncio.get_running_loop() | |
except RuntimeError: |
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 itertools | |
def expand_ip_range(ipstr): | |
parts = ipstr.split('.') | |
param = [] | |
for part in parts: | |
if '-' in part: | |
tmp = part.split('-') | |
start = 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
#!/bin/bash | |
installed=( $(dpkg-query -W --showformat='${Package}\n' | grep -oP '^linux-image-\K\d.*' | sort -r) ) | |
running=$(uname -r) | |
echo Installed versions: ${installed[@]} | |
if [[ ${#installed[@]} -le 1 ]]; then | |
echo Nothing to do | |
exit | |
fi |
NewerOlder