-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Task: Added Hashcat Command Validation #672
base: master
Are you sure you want to change the base?
Changes from 5 commits
585e4ba
8c411bb
73f266b
d4e2f9c
5fbe86c
5e4b955
6ea1fe3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ src/files/* | |
*.phpproj | ||
*.sln | ||
*.phpproj.user | ||
.DS_Store |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
{%TEMPLATE->struct/menu%} | ||
<h2>New task</h2> | ||
{%TEMPLATE->struct/messages%} | ||
<form class='form-inline' action="tasks.php{{IF [[orig]] > 0 && [[origType]] == 2}}?new=true©Pre=[[orig]]{{ENDIF}}" method="POST" enctype="multipart/form-data"> | ||
<form class='form-inline' action="tasks.php{{IF [[orig]] > 0 && [[origType]] == 2}}?new=true©Pre=[[orig]]{{ENDIF}}" method="POST" enctype="multipart/form-data" id="frm_task"> | ||
<div class="row" style="width: 110%"> | ||
<div class='col-md-8'> | ||
<input type='hidden' name='action' value='[[$DTaskAction::CREATE_TASK]]'> | ||
|
@@ -19,7 +19,7 @@ <h2>New task</h2> | |
<tr> | ||
<td>Name:</td> | ||
<td> | ||
<input type="text" class='form-control full-width' name="name" value="[[copy.getTaskName()]]"> | ||
<input type="text" class='form-control full-width' name="name" value="[[copy.getTaskName()]]" required> | ||
</td> | ||
</tr> | ||
<tr> | ||
|
@@ -36,8 +36,9 @@ <h2>New task</h2> | |
<td>Command line:</td> | ||
<td> | ||
<textarea name="cmdline" class='form-control my-1 full-width' id="cmdLine" title="Cmd Line" {{IF ![[accessControl.hasPermission([[$DAccessControl::CREATE_TASK_ACCESS]])]]}} readonly{{ENDIF}}>[[copy.getAttackCmd()]]</textarea> | ||
Use <b>[[config.getVal('hashlistAlias')]]</b> for hash list and assume all files in current directory.<br> | ||
If you have Linux agents, please mind the filename case sensitivity! | ||
<div class="invalid-feedback" id="cmdLineError">Invalid command</div> | ||
<p>Use <b>[[config.getVal('hashlistAlias')]]</b> for hash list and assume all files in current directory.<br> | ||
If you have Linux agents, please mind the filename case sensitivity!</p> | ||
</td> | ||
</tr> | ||
<tr> | ||
|
@@ -382,4 +383,37 @@ <h2>New task</h2> | |
</div> | ||
</div> | ||
</form> | ||
<script src="https://cdn.jsdelivr.net/gh/shivanraptor/[email protected]/lib/optparse.js"></script> | ||
<script src="https://cdn.jsdelivr.net/gh/shivanraptor/[email protected]/lib/optparse.hashtopolis.js"></script> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. external library might need to be made internal? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right, the author said so too. I'm going to update the pull request. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added the changes at commit 5e4b955 |
||
<script> | ||
$('#cmdLine').on('change', function(event) { | ||
$('#cmdLine').removeClass('is-invalid is-valid'); | ||
$('#cmdLineError').html(''); | ||
}); | ||
$('#frm_task').submit(function(event) { | ||
event.preventDefault(); | ||
// resetting options | ||
$('#cmdLine').removeClass('is-invalid is-valid'); | ||
$('#cmdLineError').html(''); | ||
|
||
var cmd = $('#cmdLine').val(); | ||
if(cmd.length > 200) { // Check Command Length (DB is VARCHAR(256)) | ||
$('#cmdLine').addClass('is-invalid'); | ||
$('#cmdLineError').html('The command is too long'); | ||
return false; | ||
} else { | ||
var response = startParse($('#cmdLine').val(), true); | ||
if(response.result === false) { | ||
$('#cmdLine').addClass('is-invalid'); | ||
$('#cmdLineError').html(response.reason); | ||
return false; | ||
} else { | ||
$('#cmdLine').addClass('is-valid'); | ||
$('#cmdLineError').html(''); | ||
$('#frm_task').unbind('submit').submit(); | ||
return true; | ||
} | ||
} | ||
}); | ||
</script> | ||
{%TEMPLATE->struct/foot%} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this not yield the same results?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are typos. In both lines within the
if
clause, thereturn
should be$return
instead. No offence, but your suggested code works exactly the same as my code, isn't it?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot less math is involved and it's in line with other code, using the same functions