From 4c8ec8c3bb72ba0784c43d4541b86623526b736d Mon Sep 17 00:00:00 2001 From: jessevz Date: Thu, 19 Mar 2026 14:35:35 +0100 Subject: [PATCH 1/3] Fixed creation of task by using corretc parameter for cracker binary --- src/inc/apiv2/model/TaskAPI.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/inc/apiv2/model/TaskAPI.php b/src/inc/apiv2/model/TaskAPI.php index 7753ea0b2..ff92dd988 100644 --- a/src/inc/apiv2/model/TaskAPI.php +++ b/src/inc/apiv2/model/TaskAPI.php @@ -159,7 +159,7 @@ protected function createObject(array $data): int { $data[Task::PRIORITY], $data[Task::MAX_AGENTS], $this->db2json($this->getFeatures()['files'], $data["files"]), - $data[Task::CRACKER_BINARY_TYPE_ID], + $data[Task::CRACKER_BINARY_ID], $this->getCurrentUser(), $data[Task::NOTES], $data[Task::STATIC_CHUNKS], From d6c29a88e8e76b83eb4cf4f390ae055d9cef85f2 Mon Sep 17 00:00:00 2001 From: jessevz Date: Thu, 19 Mar 2026 14:45:14 +0100 Subject: [PATCH 2/3] Added enforce pipe to task creation in api --- src/inc/apiv2/model/TaskAPI.php | 3 ++- src/inc/utils/TaskUtils.php | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/inc/apiv2/model/TaskAPI.php b/src/inc/apiv2/model/TaskAPI.php index ff92dd988..6756e7459 100644 --- a/src/inc/apiv2/model/TaskAPI.php +++ b/src/inc/apiv2/model/TaskAPI.php @@ -163,7 +163,8 @@ protected function createObject(array $data): int { $this->getCurrentUser(), $data[Task::NOTES], $data[Task::STATIC_CHUNKS], - $data[Task::CHUNK_SIZE] + $data[Task::CHUNK_SIZE], + $data[Task::FORCE_PIPE] ); return $task->getId(); diff --git a/src/inc/utils/TaskUtils.php b/src/inc/utils/TaskUtils.php index c2ab206f5..5d4b60279 100644 --- a/src/inc/utils/TaskUtils.php +++ b/src/inc/utils/TaskUtils.php @@ -793,7 +793,7 @@ public static function updateMaxAgents($taskId, $maxAgents, $user) { * @return Task * @throws HttpError */ - public static function createTask($hashlistId, $name, $attackCmd, $chunkTime, $status, $benchtype, $color, $isCpuOnly, $isSmall, $usePreprocessor, $preprocessorCommand, $skip, $priority, $maxAgents, $files, $crackerVersionId, $user, $notes = "", $staticChunking = DTaskStaticChunking::NORMAL, $chunkSize = 0) { + public static function createTask($hashlistId, $name, $attackCmd, $chunkTime, $status, $benchtype, $color, $isCpuOnly, $isSmall, $usePreprocessor, $preprocessorCommand, $skip, $priority, $maxAgents, $files, $crackerVersionId, $user, $notes = "", $staticChunking = DTaskStaticChunking::NORMAL, $chunkSize = 0, $enforcePipe = 0) { $hashlist = Factory::getHashlistFactory()->get($hashlistId); if ($hashlist == null) { throw new HttpError("Invalid hashlist ID!"); @@ -842,6 +842,8 @@ public static function createTask($hashlistId, $name, $attackCmd, $chunkTime, $s } else if ($benchtype != 'speed' && $benchtype != 'runtime') { throw new HttpError("Invalid benchmark type!"); + } else if ($enforcePipe < 0 || $enforcePipe > 1) { + throw new HttpError("Invalid enforce pipe value"); } $benchtype = ($benchtype == 'speed') ? 1 : 0; if (preg_match("/[0-9A-Za-z]{6}/", $color) != 1) { @@ -892,7 +894,7 @@ public static function createTask($hashlistId, $name, $attackCmd, $chunkTime, $s $notes, $staticChunking, $chunkSize, - 0, + $enforcePipe, ($usePreprocessor > 0) ? $preprocessor->getId() : 0, ($usePreprocessor > 0) ? $preprocessorCommand : '' ); From 2384d08e53067a96351bd814ec11a6b6d7b9df11 Mon Sep 17 00:00:00 2001 From: jessevz Date: Thu, 19 Mar 2026 15:21:43 +0100 Subject: [PATCH 3/3] Made crackerBinaryTypeId not be required anymore --- src/dba/models/Task.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dba/models/Task.php b/src/dba/models/Task.php index 42e7dc550..5d4b139aa 100644 --- a/src/dba/models/Task.php +++ b/src/dba/models/Task.php @@ -104,7 +104,7 @@ static function getFeatures(): array { $dict['useNewBench'] = ['read_only' => True, "type" => "bool", "subtype" => "unset", "choices" => "unset", "null" => False, "pk" => False, "protected" => False, "private" => False, "alias" => "useNewBench", "public" => False, "dba_mapping" => False]; $dict['skipKeyspace'] = ['read_only' => True, "type" => "int64", "subtype" => "unset", "choices" => "unset", "null" => False, "pk" => False, "protected" => False, "private" => False, "alias" => "skipKeyspace", "public" => False, "dba_mapping" => False]; $dict['crackerBinaryId'] = ['read_only' => True, "type" => "int", "subtype" => "unset", "choices" => "unset", "null" => False, "pk" => False, "protected" => False, "private" => False, "alias" => "crackerBinaryId", "public" => False, "dba_mapping" => False]; - $dict['crackerBinaryTypeId'] = ['read_only' => True, "type" => "int", "subtype" => "unset", "choices" => "unset", "null" => False, "pk" => False, "protected" => False, "private" => False, "alias" => "crackerBinaryTypeId", "public" => False, "dba_mapping" => False]; + $dict['crackerBinaryTypeId'] = ['read_only' => True, "type" => "int", "subtype" => "unset", "choices" => "unset", "null" => True, "pk" => False, "protected" => False, "private" => False, "alias" => "crackerBinaryTypeId", "public" => False, "dba_mapping" => False]; $dict['taskWrapperId'] = ['read_only' => True, "type" => "int", "subtype" => "unset", "choices" => "unset", "null" => False, "pk" => False, "protected" => True, "private" => False, "alias" => "taskWrapperId", "public" => False, "dba_mapping" => False]; $dict['isArchived'] = ['read_only' => False, "type" => "bool", "subtype" => "unset", "choices" => "unset", "null" => False, "pk" => False, "protected" => False, "private" => False, "alias" => "isArchived", "public" => False, "dba_mapping" => False]; $dict['notes'] = ['read_only' => False, "type" => "str(65535)", "subtype" => "unset", "choices" => "unset", "null" => False, "pk" => False, "protected" => False, "private" => False, "alias" => "notes", "public" => False, "dba_mapping" => False];