Skip to content
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 attack mode: Association attack #95

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

Duke-of-Karamel
Copy link

Changes in Webadmin, Generator, Runner.
No changes to Database models.

@Duke-of-Karamel
Copy link
Author

Sorry for spam of pull requests....

@davidbolvansky
Copy link
Contributor

Cool, thanks!

I will do code review this weekend.

Copy link
Contributor

@davidbolvansky davidbolvansky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initial comments.

"all_hashes" should be explained more.

Otherwise I will wait until your thesis is available, so I can better understand your implementation.

There are no tests, so please atleast create some and put them to @ihranicky's manual testing spreadsheet.

# Entrypoint
RUN ["chmod", "+x", "/srv/fitcrack/entrypoint-fitcrack.sh"]
ENTRYPOINT ["/srv/fitcrack/entrypoint-fitcrack.sh"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we need these changes?

@@ -0,0 +1,3 @@
(boinccmd --project 127.0.0.1/fitcrack/ detach || true) &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed for our repo.

# Configuration of the build context
build:
context: .
dockerfile: Dockerfile
args:
- COMPILER_THREADS=1 # Higher values may cause linker race conditions

command: ./entrypoint-fitcrack.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly bad merge of dev branch?

virtual bool requiresDicts() const override {return true;}

virtual bool hasStickyLeftDict() const override {
return m_job->getDistributionMode() == 1 || m_job->getDistributionMode() == 2;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to put these constants to enum

/**
* @brief enum for distribution mode options readability
*/
enum DistributionMode {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have them here, so move this declaration somewhere else, into some more general header, so we can use these named constants everywhere.

@@ -112,6 +112,33 @@ std::vector<std::string> CAbstractGenerator::getStickyFiles(PtrJob &job) {
std::to_string(job->getId())+".dict");
break;

case Config::AttackMode::AttackAssoc:
if (job->getDistributionMode() == 0){ //
if (job->getAttackSubmode() == 1) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use enum instead of numbers, as explained above.

@@ -32,6 +32,14 @@ echo "============================================================"
# Check if project exists. If not, create it.
if [ -d "$BOINC_PROJECT_DIR" ]; then
echo "Project already exists."

usermod -d /var/lib/mysql/ mysql
# Fix MySQL socket permissions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bad merge?

job['keyspace'] = job['hc_keyspace'] * ruleFileMultiplier

# in case of rule distribution hashcat keyspace is defined by rules
if job['attack_settings']['distribution_mode'] == 2:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create same "enum" also in python, so you can use it here, instead of "2".

@@ -670,6 +670,8 @@ def keyspace(self):
if self.job.rulesFile:
rules = self.job.rulesFile.count
return self.hc_keyspace * rules if rules else self.hc_keyspace
elif self.job.attack_mode == 10 and self.job.distribution_mode == 2:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here and everywhere where you use magic constants.

@@ -158,6 +158,8 @@ export default {

// All ok!
return true
case 'association':
return state.leftDicts.reduce((total, current)=>total+current.keyspace, 0) == state.validatedHashes.length
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please format properly.

@davidbolvansky davidbolvansky force-pushed the dev branch 2 times, most recently from 35da608 to 3c6de50 Compare July 16, 2023 21:46
@alpatron alpatron self-assigned this Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants