mirror of
https://github.com/phishingclub/phishingclub.git
synced 2026-08-11 13:10:28 +02:00
add option to add data to webhook events
Signed-off-by: Ronni Skansing <rskansing@gmail.com>
This commit is contained in:
@@ -497,6 +497,7 @@ export class API {
|
||||
* @param {string} campaign.templateID uuid
|
||||
* @param {string} campaign.name
|
||||
* @param {boolean} [campaign.saveSubmittedData]
|
||||
* @param {boolean} [campaign.saveBrowserMetadata]
|
||||
* @param {boolean} [campaign.isAnonymous]
|
||||
* @param {boolean} [campaign.isTest]
|
||||
* @param {boolean} [campaign.obfuscate]
|
||||
@@ -511,6 +512,7 @@ export class API {
|
||||
* @param {string} campaign.denyPageID uuid
|
||||
* @param {string} campaign.evasionPageID uuid
|
||||
* @param {string} campaign.webhookID uuid
|
||||
* @param {boolean} [campaign.webhookIncludeData]
|
||||
* @param {Array} [campaign.constraintWeekDays]
|
||||
* @param {string} [campaign.constraintStartTime]
|
||||
* @param {string} [campaign.constraintEndTime]
|
||||
@@ -536,6 +538,7 @@ export class API {
|
||||
denyPageID,
|
||||
evasionPageID,
|
||||
webhookID,
|
||||
webhookIncludeData,
|
||||
constraintWeekDays,
|
||||
constraintStartTime,
|
||||
constraintEndTime
|
||||
@@ -560,6 +563,7 @@ export class API {
|
||||
denyPageID,
|
||||
evasionPageID,
|
||||
webhookID,
|
||||
webhookIncludeData,
|
||||
constraintWeekDays,
|
||||
constraintStartTime,
|
||||
constraintEndTime
|
||||
@@ -567,11 +571,11 @@ export class API {
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {object} campaign
|
||||
* @param {string} campaign.id
|
||||
* @param {Object} campaign
|
||||
* @param {string} campaign.id uuid
|
||||
* @param {string} campaign.name
|
||||
* @param {boolean} [campaign.saveSubmittedData]
|
||||
* @param {boolean} [campaign.saveBrowserMetadata]
|
||||
* @param {boolean} [campaign.isAnonymous]
|
||||
* @param {boolean} [campaign.isTest]
|
||||
* @param {boolean} [campaign.obfuscate]
|
||||
@@ -581,12 +585,13 @@ export class API {
|
||||
* @param {string} campaign.sendEndAt
|
||||
* @param {string} [campaign.closeAt]
|
||||
* @param {string} [campaign.anonymizeAt]
|
||||
* @param {string} campaign.templateID uuid
|
||||
* @param {string} campaign.templateID uuid
|
||||
* @param {string[]} campaign.recipientGroupIDs []uuid
|
||||
* @param {string[]} campaign.allowDenyIDs []uuid
|
||||
* @param {string} campaign.denyPageID uuid
|
||||
* @param {string} campaign.evasionPageID uuid
|
||||
* @param {string} campaign.webhookID uuid
|
||||
* @param {boolean} [campaign.webhookIncludeData]
|
||||
* @param {Array} [campaign.constraintWeekDays]
|
||||
* @param {string} [campaign.constraintStartTime]
|
||||
* @param {string} [campaign.constraintEndTime]
|
||||
@@ -594,6 +599,7 @@ export class API {
|
||||
*/
|
||||
update: async ({
|
||||
id,
|
||||
templateID,
|
||||
name,
|
||||
saveSubmittedData,
|
||||
saveBrowserMetadata,
|
||||
@@ -606,17 +612,18 @@ export class API {
|
||||
sendEndAt,
|
||||
closeAt,
|
||||
anonymizeAt,
|
||||
templateID,
|
||||
recipientGroupIDs,
|
||||
allowDenyIDs,
|
||||
denyPageID,
|
||||
evasionPageID,
|
||||
webhookID,
|
||||
webhookIncludeData,
|
||||
constraintWeekDays,
|
||||
constraintStartTime,
|
||||
constraintEndTime
|
||||
}) => {
|
||||
return await postJSON(this.getPath(`/campaign/${id}`), {
|
||||
templateID,
|
||||
name,
|
||||
isAnonymous,
|
||||
isTest,
|
||||
@@ -629,12 +636,12 @@ export class API {
|
||||
sendEndAt,
|
||||
closeAt,
|
||||
anonymizeAt,
|
||||
templateID,
|
||||
recipientGroupIDs,
|
||||
allowDenyIDs,
|
||||
denyPageID,
|
||||
evasionPageID,
|
||||
webhookID,
|
||||
webhookIncludeData,
|
||||
constraintWeekDays,
|
||||
constraintStartTime,
|
||||
constraintEndTime
|
||||
|
||||
@@ -258,7 +258,8 @@
|
||||
isTest: false,
|
||||
obfuscate: false,
|
||||
selectedCount: 0,
|
||||
webhookValue: null
|
||||
webhookValue: null,
|
||||
webhookIncludeData: false
|
||||
};
|
||||
|
||||
let modalError = '';
|
||||
@@ -636,7 +637,8 @@
|
||||
constraintWeekDays: weekDaysAvailableToBinary(formValues.constraintWeekDays),
|
||||
constraintStartTime: contraintStartTimeUTC,
|
||||
constraintEndTime: contraintEndTimeUTC,
|
||||
webhookID: webhookMap.byValueOrNull(formValues.webhookValue)
|
||||
webhookID: webhookMap.byValueOrNull(formValues.webhookValue),
|
||||
webhookIncludeData: formValues.webhookIncludeData
|
||||
});
|
||||
|
||||
if (!res.success) {
|
||||
@@ -699,7 +701,8 @@
|
||||
allowDenyIDs: allowDenyIDs,
|
||||
denyPageID: denyPageMap.byValueOrNull(formValues.denyPageValue),
|
||||
evasionPageID: denyPageMap.byValueOrNull(formValues.evasionPageValue),
|
||||
webhookID: webhookMap.byValueOrNull(formValues.webhookValue)
|
||||
webhookID: webhookMap.byValueOrNull(formValues.webhookValue),
|
||||
webhookIncludeData: formValues.webhookIncludeData
|
||||
});
|
||||
|
||||
if (!res.success) {
|
||||
@@ -824,7 +827,8 @@
|
||||
isTest: false,
|
||||
obfuscate: false,
|
||||
selectedCount: 0,
|
||||
webhookValue: null
|
||||
webhookValue: null,
|
||||
webhookIncludeData: false
|
||||
};
|
||||
scheduleType = 'basic';
|
||||
allowDenyType = 'none';
|
||||
@@ -929,7 +933,8 @@
|
||||
isTest: campaign.isTest,
|
||||
obfuscate: campaign.obfuscate || false,
|
||||
template: templateMap.byKey(campaign.templateID),
|
||||
webhookValue: webhookMap.byKey(campaign.webhookID)
|
||||
webhookValue: webhookMap.byKey(campaign.webhookID),
|
||||
webhookIncludeData: campaign.webhookIncludeData || false
|
||||
};
|
||||
|
||||
if (copyMode) {
|
||||
@@ -1595,6 +1600,24 @@
|
||||
options={Array.from(webhookMap.values())}>Webhook</TextFieldSelect
|
||||
>
|
||||
</div>
|
||||
{#if formValues.webhookValue}
|
||||
<div class="mb-6">
|
||||
<label class="flex items-center gap-2 cursor-pointer">
|
||||
<input
|
||||
type="checkbox"
|
||||
bind:checked={formValues.webhookIncludeData}
|
||||
class="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"
|
||||
/>
|
||||
<span class="text-sm font-medium text-gray-700 dark:text-gray-300">
|
||||
Include captured data in webhook
|
||||
</span>
|
||||
</label>
|
||||
<p class="mt-1 ml-6 text-xs text-gray-500 dark:text-gray-400">
|
||||
When enabled, captured data (credentials, cookies, etc.) will be included in the
|
||||
webhook payload
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div class="mb-6">
|
||||
<SelectSquare
|
||||
@@ -1948,6 +1971,10 @@
|
||||
<span class="text-grayblue-dark font-medium">Webhook:</span>
|
||||
<span class="text-pc-darkblue dark:text-white">{formValues.webhookValue}</span
|
||||
>
|
||||
<span class="text-grayblue-dark font-medium">Include Data:</span>
|
||||
<span class="text-pc-darkblue dark:text-white"
|
||||
>{formValues.webhookIncludeData ? 'Yes' : 'No'}</span
|
||||
>
|
||||
{/if}
|
||||
|
||||
{#if formValues.denyPageValue}
|
||||
|
||||
Reference in New Issue
Block a user