Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/app/tasks/import-supertasks/masks/masks.component.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<app-table>
<app-page-title
[title]="'Supertask Builder'"
></app-page-title>

<horizontalnav [menuItems]="menuItems"></horizontalnav>
<!-- Body -->
<grid-main>
Expand Down Expand Up @@ -29,3 +34,4 @@

</form>
</grid-main>
</app-table>
11 changes: 5 additions & 6 deletions src/app/tasks/import-supertasks/masks/masks.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import { Router } from '@angular/router';

import { JPretask } from '@models/pretask.model';

import { JCrackerBinaryType } from '../../../core/_models/cracker-binary.model';
import { ResponseWrapper } from '../../../core/_models/response.model';
import { SERV } from '../../../core/_services/main.config';
import { SERV } from '@services/main.config';

import { JCrackerBinaryType } from '@src/app/core/_models/cracker-binary.model';
import { ResponseWrapper } from '@src/app/core/_models/response.model';
import { JsonAPISerializer } from '@src/app/core/_services/api/serializer-service';

/**
Expand Down Expand Up @@ -46,7 +46,7 @@ export class MasksComponent implements OnInit, OnDestroy {

/** Select Options. */
selectBenchmarktype = benchmarkType;
selectCrackertype: any;
selectCrackertype = undefined;

/** Select Options Mapping */
selectCrackertypeMap = {
Expand Down Expand Up @@ -78,7 +78,6 @@ export class MasksComponent implements OnInit, OnDestroy {
private serializer: JsonAPISerializer
) {
this.buildForm();
titleService.set(['Import SuperTask - Mask']);
}

/**
Expand Down Expand Up @@ -106,7 +105,7 @@ export class MasksComponent implements OnInit, OnDestroy {
isSmall: new FormControl(false),
isCpuTask: new FormControl(false),
optFlag: new FormControl(false),
useNewBench: new FormControl(false),
useNewBench: new FormControl(true),
crackerBinaryId: new FormControl(1),
masks: new FormControl('')
});
Expand Down
129 changes: 67 additions & 62 deletions src/app/tasks/import-supertasks/wrbulk/wrbulk.component.html
Original file line number Diff line number Diff line change
@@ -1,66 +1,71 @@
<horizontalnav [menuItems]="menuItems"></horizontalnav>
<!-- Body -->
<div fxLayout="row" fxLayoutAlign="start stretch" fxLayout.lt-md="column">
<div fxFlex="70" fxFlex.lt-md="100">
<grid-main>
<app-page-subtitle [subtitle]="'Wordlist/Rule Bulk'"></app-page-subtitle>
<form [formGroup]="createForm" (ngSubmit)="onSubmit()">
<input-text title="Name" formControlName="name" [isRequired]="true"></input-text>
<div fxLayout="row wrap" fxLayoutAlign="start center" fxLayoutGap="10px">
<input-number title="maxAgents" formControlName="maxAgents"></input-number>
</div>
<div fxLayout="row wrap" fxLayoutAlign="start center" fxLayoutGap="10px">
<input-select title="Benchmark Type" formControlName="useNewBench"
[items]="selectBenchmarktype"></input-select>
<input-select title="Binary type to run task" formControlName="crackerBinaryId"
[items]="selectCrackertype"></input-select>
</div>
<div fxLayout="row wrap" fxLayoutAlign="start center" fxLayoutGap="10px">
<input-check title="Small Tasks" formControlName="isSmall"></input-check>
<input-check title="CPU" formControlName="isCpuTask"></input-check>
</div>
<input-text-area title="Base Command" formControlName="attackCmd"></input-text-area>
<blacklist-attack [value]="createForm.get('attackCmd').value"></blacklist-attack>
<fixed-alert
message="IMPORTANT: You must include the 'FILE' placeholder in your Base Command. When you mark files as 'Iterate' in the panels on the right, the system will create a separate subtask for EACH selected file, replacing 'FILE' with the actual file path. This allows for sequential execution of different wordlists or rule files in your attack strategy."></fixed-alert>
<grid-buttons>
<button-submit name="Cancel" [disabled]="false" type="cancel"></button-submit>
<button-submit [name]="'Create'"></button-submit>
<div *ngIf="isLoading">
<mat-spinner diameter="24" color="accent"></mat-spinner>
<app-table>
<app-page-title
[title]="'Supertask Builder'"
></app-page-title>
<horizontalnav [menuItems]="menuItems"></horizontalnav>
<!-- Body -->
<div fxLayout="row" fxLayoutAlign="start stretch" fxLayout.lt-md="column">
<div fxFlex="70" fxFlex.lt-md="100">
<grid-main>
<app-page-subtitle [subtitle]="'Wordlist/Rule Bulk'"></app-page-subtitle>
<form [formGroup]="createForm" (ngSubmit)="onSubmit()">
<input-text title="Name" formControlName="name" [isRequired]="true"></input-text>
<div fxLayout="row wrap" fxLayoutAlign="start center" fxLayoutGap="10px">
<input-number title="maxAgents" formControlName="maxAgents"></input-number>
</div>
</grid-buttons>
</form>
</grid-main>
</div>
<div fxFlex="40" fxFlex.lt-md="100">
<mat-accordion multi>
<mat-expansion-panel>
<mat-expansion-panel-header>
<span><b>Wordlists</b></span>
</mat-expansion-panel-header>
<app-files-attack-table [fileType]="0" [bulkWordlistRule]="true" [formData]="getFormData()"
(updateFormEvent)="onUpdateForm($event)" [cmdPrepro]="true"
[customLabel]="customLabel"></app-files-attack-table>
</mat-expansion-panel>
<div fxLayout="row wrap" fxLayoutAlign="start center" fxLayoutGap="10px">
<input-select title="Benchmark Type" formControlName="useNewBench"
[items]="selectBenchmarktype"></input-select>
<input-select title="Binary type to run task" formControlName="crackerBinaryId"
[items]="selectCrackertype"></input-select>
</div>
<div fxLayout="row wrap" fxLayoutAlign="start center" fxLayoutGap="10px">
<input-check title="Small Tasks" formControlName="isSmall"></input-check>
<input-check title="CPU" formControlName="isCpuTask"></input-check>
</div>
<input-text-area title="Base Command" formControlName="attackCmd"></input-text-area>
<blacklist-attack [value]="createForm.get('attackCmd').value"></blacklist-attack>
<fixed-alert
message="IMPORTANT: You must include the 'FILE' placeholder in your Base Command. When you mark files as 'Iterate' in the panels on the right, the system will create a separate subtask for EACH selected file, replacing 'FILE' with the actual file path. This allows for sequential execution of different wordlists or rule files in your attack strategy."></fixed-alert>
<grid-buttons>
<button-submit name="Cancel" [disabled]="false" type="cancel"></button-submit>
<button-submit [name]="'Create'"></button-submit>
<div *ngIf="isLoading">
<mat-spinner diameter="24" color="accent"></mat-spinner>
</div>
</grid-buttons>
</form>
</grid-main>
</div>
<div fxFlex="40" fxFlex.lt-md="100">
<mat-accordion multi>
<mat-expansion-panel>
<mat-expansion-panel-header>
<span><b>Wordlists</b></span>
</mat-expansion-panel-header>
<app-files-attack-table [fileType]="0" [bulkWordlistRule]="true" [formData]="getFormData()"
(updateFormEvent)="onUpdateForm($event)" [cmdPrepro]="true"
[customLabel]="customLabel"></app-files-attack-table>
</mat-expansion-panel>

<mat-expansion-panel>
<mat-expansion-panel-header>
<span><b>Rules</b></span>
</mat-expansion-panel-header>
<app-files-attack-table [fileType]="1" [bulkWordlistRule]="true" [formData]="getFormData()"
(updateFormEvent)="onUpdateForm($event)" [cmdPrepro]="true"
[customLabel]="customLabel"></app-files-attack-table>
</mat-expansion-panel>
<mat-expansion-panel>
<mat-expansion-panel-header>
<span><b>Rules</b></span>
</mat-expansion-panel-header>
<app-files-attack-table [fileType]="1" [bulkWordlistRule]="true" [formData]="getFormData()"
(updateFormEvent)="onUpdateForm($event)" [cmdPrepro]="true"
[customLabel]="customLabel"></app-files-attack-table>
</mat-expansion-panel>

<mat-expansion-panel>
<mat-expansion-panel-header>
<span><b>Other</b></span>
</mat-expansion-panel-header>
<app-files-attack-table [fileType]="2" [bulkWordlistRule]="true" [formData]="getFormData()"
(updateFormEvent)="onUpdateForm($event)" [cmdPrepro]="true"
[customLabel]="customLabel"></app-files-attack-table>
</mat-expansion-panel>
</mat-accordion>
<mat-expansion-panel>
<mat-expansion-panel-header>
<span><b>Other</b></span>
</mat-expansion-panel-header>
<app-files-attack-table [fileType]="2" [bulkWordlistRule]="true" [formData]="getFormData()"
(updateFormEvent)="onUpdateForm($event)" [cmdPrepro]="true"
[customLabel]="customLabel"></app-files-attack-table>
</mat-expansion-panel>
</mat-accordion>
</div>
</div>
</div>
</app-table>
18 changes: 4 additions & 14 deletions src/app/tasks/import-supertasks/wrbulk/wrbulk.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,13 @@ import { UnsubscribeService } from '@services/unsubscribe.service';

import { CRACKER_TYPE_FIELD_MAPPING } from '@src/app/core/_constants/select.config';
import { benchmarkType } from '@src/app/core/_constants/tasks.config';
import { PageTitle } from '@src/app/core/_decorators/autotitle';
import { transformSelectOptions } from '@src/app/shared/utils/forms';

@Component({
selector: 'app-wrbulk',
templateUrl: './wrbulk.component.html',
standalone: false
})
@PageTitle(['Import SuperTask - Wordlist/Rules Bulk'])
export class WrbulkComponent implements OnInit, OnDestroy {
/**
* Horizontal menu and redirection links.
Expand All @@ -46,7 +44,7 @@ export class WrbulkComponent implements OnInit, OnDestroy {

/** Select Options. */
selectBenchmarktype = benchmarkType;
selectCrackertype: any;
selectCrackertype = undefined;

/** Select Options Mapping */
selectCrackertypeMap = {
Expand Down Expand Up @@ -95,7 +93,7 @@ export class WrbulkComponent implements OnInit, OnDestroy {
maxAgents: new FormControl(0),
isSmall: new FormControl(false),
isCpuTask: new FormControl(false),
useNewBench: new FormControl(false),
useNewBench: new FormControl(true),
crackerBinaryId: new FormControl(1),
attackCmd: new FormControl(this.uiService.getUIsettings('hashlistAlias').value, [Validators.required]),
baseFiles: new FormControl([]),
Expand Down Expand Up @@ -192,8 +190,7 @@ export class WrbulkComponent implements OnInit, OnDestroy {
if (this.createForm.valid) {
const formValue = this.createForm.value;
const attackCmd: string = formValue.attackCmd;
const crackerBinaryId: any = formValue.crackerBinaryId;
const baseFiles: [] = formValue.baseFiles;
const crackerBinaryId: number = formValue.crackerBinaryId;
const iterFiles: [] = formValue.iterFiles;

const attackAlias = this.uiService.getUIsettings('hashlistAlias').value;
Expand Down Expand Up @@ -221,13 +218,6 @@ export class WrbulkComponent implements OnInit, OnDestroy {
hasError = true; // Set error flag
}

// Check if at least one base file is selected
if (!baseFiles || baseFiles.length === 0) {
const warning = 'You need to select at least one base file!';
this.alert.showErrorMessage(warning);
hasError = true; // Set error flag
}

// Check if at least one iter file is selected
if (!iterFiles || iterFiles.length === 0) {
const warning = 'You need to select at least one iteration file!';
Expand Down Expand Up @@ -286,7 +276,7 @@ export class WrbulkComponent implements OnInit, OnDestroy {
* Updates the form based on the provided event data.
* @param event - The event data containing attack command and files.
*/
onUpdateForm(event: any): void {
onUpdateForm(event): void {
if (event.type === 'CMD') {
this.createForm.patchValue({
attackCmd: event.attackCmd,
Expand Down
Loading