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
# Scan for CVE-2017-0143 MS17-010 | |
# The vulnerability used by WannaCry Ransomware | |
# | |
# 1. Use @calderpwn's script | |
# http://seclists.org/nmap-dev/2017/q2/79 | |
# | |
# 2. Save it to Nmap NSE script directory | |
# Linux - /usr/share/nmap/scripts/ or /usr/local/share/nmap/scripts/ | |
# OSX - /opt/local/share/nmap/scripts/ | |
# |
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 <Windows.h> | |
#include <wincrypt.h> | |
#include <stdio.h> | |
#pragma comment(lib, "advapi32.lib") | |
#define AES_KEY_SIZE 16 | |
#define IN_CHUNK_SIZE (AES_KEY_SIZE * 10) // a buffer must be a multiple of the key size | |
#define OUT_CHUNK_SIZE (IN_CHUNK_SIZE * 2) // an output buffer (for encryption) must be twice as big | |
//params: <input file> <output file> <is decrypt mode> <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
/// <summary> | |
/// Removes the Pkcs7 padding of an array. | |
/// </summary> | |
/// <param name="paddedByteArray">The padded array.</param> | |
/// <returns>The unpadded array.</returns> | |
/// <exception cref="OverflowException"></exception> | |
/// <exception cref="ArgumentOutOfRangeException"></exception> | |
/// <exception cref="ArgumentException"></exception> | |
/// <exception cref="ArgumentNullException"></exception> | |
public static byte[] RemovePkcs7Padding(byte[] paddedByteArray) |
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
<?php | |
/* | |
Note 1: All variables are unsigned 32 bits and wrap modulo 232 when calculating, except | |
ml the message length which is 64 bits, and | |
hh the message digest which is 160 bits. | |
Note 2: All constants in this pseudo code are in big endian. | |
Within each word, the most significant byte is stored in the leftmost byte position | |
*/ |
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
using System; | |
using System.Collections.Generic; | |
using System.Security.Cryptography; | |
using System.Text; | |
namespace OpenSslCompat | |
{ | |
/// <summary> | |
/// Derives a key from a password using an OpenSSL-compatible version of the PBKDF1 algorithm. | |
/// </summary> |