mirror of https://github.com/infosecn1nja/C3.git
Replace custom random function with Utils::GenerateRandomString
parent
59b55f11f7
commit
e8c2dca846
|
@ -113,12 +113,7 @@ std::string FSecure::AsanaApi::CreateSectionIdByName(std::string const& sectionN
|
||||||
std::string FSecure::AsanaApi::AddAttachmentToTask(std::string const& taskId, std::vector<uint8_t> const& attachmentBody, std::string const& attachmentFileName, std::string const& attachmentMimeType) {
|
std::string FSecure::AsanaApi::AddAttachmentToTask(std::string const& taskId, std::vector<uint8_t> const& attachmentBody, std::string const& attachmentFileName, std::string const& attachmentMimeType) {
|
||||||
std::string url = OBF("https://app.asana.com/api/1.0/tasks/") + taskId + OBF("/attachments");
|
std::string url = OBF("https://app.asana.com/api/1.0/tasks/") + taskId + OBF("/attachments");
|
||||||
// Generating body
|
// Generating body
|
||||||
const std::string boundary_prefix(OBF("------WebKitFormBoundary")); // Mimicking WebKit
|
std::string boundary = OBF("------WebKitFormBoundary") + Utils::GenerateRandomString(16); // Mimicking WebKit, generate random boundary string
|
||||||
const std::string alphabet(OBF("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"));
|
|
||||||
std::string boundary = boundary_prefix;
|
|
||||||
for (int i = 0; i < 16; i++) { // Generate random boundary string
|
|
||||||
boundary.push_back(alphabet[rand() % alphabet.size()]);
|
|
||||||
}
|
|
||||||
// Building the multipart body (prefix + attachment + suffix)
|
// Building the multipart body (prefix + attachment + suffix)
|
||||||
std::vector<uint8_t> body;
|
std::vector<uint8_t> body;
|
||||||
std::string bodyPrefix = OBF("\r\n");
|
std::string bodyPrefix = OBF("\r\n");
|
||||||
|
|
Loading…
Reference in New Issue