Exploit databaseDownload repository ZIP
GH-ea821316336f01071e5d83d15c2dd13b
opsxcq/exploit-cve-2017-7494
Sources for CVE-2017-7494
38 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files37
opsxcq/exploit-cve-2017-7494Revision 4d0bde4f1a7d
- ↑..Parent directory
- REQUIREMENTS
- aes.c
- aes.h
- aes_ccm_128.c
- aes_ccm_128.h
- aes_ccm_128_test.c
- aes_cmac_128.c
- aes_cmac_128.h
- aes_cmac_128_test.c
- aes_gcm_128.c
- aes_gcm_128.h
- aes_gcm_128_test.c
- aes_test.h
- arcfour.c
- arcfour.h
- crc32.c
- crc32.h
- crypto.h
- hmacmd5.c
- hmacmd5.h
- hmacmd5test.c
- hmacsha256.c
- hmacsha256.h
- md4.c
- md4.h
- md4test.c
- md5.c
- md5.h
- md5test.c
- rijndael-alg-fst.c
- rijndael-alg-fst.h
- sha256.c
- sha256.h
- sha512.c
- sha512.h
- wscript_build
- wscript_configure
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
src/lib/crypto/arcfour.c
C · 2,418 bytes/*
Unix SMB/CIFS implementation.
An implementation of the arcfour algorithm
Copyright (C) Andrew Tridgell 1998
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "replace.h"
#include "../lib/crypto/arcfour.h"
/* initialise the arcfour sbox with key */
_PUBLIC_ void arcfour_init(struct arcfour_state *state, const DATA_BLOB *key)
{
size_t ind;
uint8_t j = 0;
for (ind = 0; ind < sizeof(state->sbox); ind++) {
state->sbox[ind] = (uint8_t)ind;
}
for (ind = 0; ind < sizeof(state->sbox); ind++) {
uint8_t tc;
j += (state->sbox[ind] + key->data[ind%key->length]);
tc = state->sbox[ind];
state->sbox[ind] = state->sbox[j];
state->sbox[j] = tc;
}
state->index_i = 0;
state->index_j = 0;
}
/* crypt the data with arcfour */
_PUBLIC_ void arcfour_crypt_sbox(struct arcfour_state *state, uint8_t *data,
int len)
{
int ind;
for (ind = 0; ind < len; ind++) {
uint8_t tc;
uint8_t t;
state->index_i++;
state->index_j += state->sbox[state->index_i];
tc = state->sbox[state->index_i];
state->sbox[state->index_i] = state->sbox[state->index_j];
state->sbox[state->index_j] = tc;
t = state->sbox[state->index_i] + state->sbox[state->index_j];
data[ind] = data[ind] ^ state->sbox[t];
}
}
/*
arcfour encryption with a blob key
*/
_PUBLIC_ void arcfour_crypt_blob(uint8_t *data, int len, const DATA_BLOB *key)
{
struct arcfour_state state;
arcfour_init(&state, key);
arcfour_crypt_sbox(&state, data, len);
}
/*
a variant that assumes a 16 byte key. This should be removed
when the last user is gone
*/
_PUBLIC_ void arcfour_crypt(uint8_t *data, const uint8_t keystr[16], int len)
{
uint8_t keycopy[16];
DATA_BLOB key = { .data = keycopy, .length = sizeof(keycopy) };
memcpy(keycopy, keystr, sizeof(keycopy));
arcfour_crypt_blob(data, len, &key);
}