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

Complete test suite #3

Open
CPunch opened this issue Sep 29, 2023 · 3 comments
Open

Complete test suite #3

CPunch opened this issue Sep 29, 2023 · 3 comments

Comments

@CPunch
Copy link
Collaborator

CPunch commented Sep 29, 2023

it'd also be pretty cool to have a workflow validate each commit against go test. more info for github workflows can be found https://docs.github.com/en/actions/examples/using-scripts-to-test-your-code-on-a-runner

@CPunch
Copy link
Collaborator Author

CPunch commented Dec 15, 2023

testsuite is currently generated via testgen/generate_tests.go. This file uses hashes scraped from hashcat's examples to generate test cases of the hashes we currently support. the following testcases currently fail:

> go test -v ./test | grep FAIL:--- FAIL: TestORACLE_H__TYPE__ORACLE_7__ (0.00s)
--- FAIL: TestBCRYPT__2____BLOWFISH__UNIX_ (0.00s)
--- FAIL: TestSHA1_SHA1__SALT__PASS__SALT__ (0.00s)
--- FAIL: TestCISCO_IOS_TYPE_4__SHA256_ (0.00s)
--- FAIL: TestAIX__SMD5_ (0.00s)
--- FAIL: TestAIX__SSHA256_ (0.00s)
--- FAIL: TestAIX__SSHA512_ (0.00s)
--- FAIL: TestAIX__SSHA1_ (0.00s)
--- FAIL: TestFORTIGATE__FORTIOS_ (0.00s)
--- FAIL: TestSHA256CRYPT__5___SHA256__UNIX__2 (0.00s)
--- FAIL: TestSAP_CODVN_B__BCODE_ (0.00s)
--- FAIL: TestSAP_CODVN_F_G__PASSCODE_ (0.00s)
--- FAIL: TestDRUPAL7 (0.00s)
--- FAIL: TestRACF (0.00s)
--- FAIL: TestLOTUS_NOTES_DOMINO_6 (0.00s)
--- FAIL: TestSCRYPT (0.00s)
--- FAIL: TestLOTUS_NOTES_DOMINO_8 (0.00s)
--- FAIL: TestCISCO_IOS__8___PBKDF2_SHA256_ (0.00s)
--- FAIL: TestCISCO_IOS__9___SCRYPT_ (0.00s)
--- FAIL: TestMS_OFFICE___2003__0__1__MD5___RC4__COLLIDER__2 (0.00s)
--- FAIL: TestMS_OFFICE___2003__3__SHA1___RC4__COLLIDER__2 (0.00s)
--- FAIL: TestDJANGO__PBKDF2_SHA256_ (0.00s)
--- FAIL: TestCRAM_MD5 (0.00s)
--- FAIL: TestSAP_CODVN_H__PWDSALTEDHASH__ISSHA_1 (0.00s)
--- FAIL: TestPBKDF2_HMAC_SHA256 (0.00s)
--- FAIL: TestJUNIPER_NETSCREEN_SSG__SCREENOS_ (0.00s)
--- FAIL: TestNSLDAP__SHA_1_BASE64___NETSCAPE_LDAP_SHA (0.00s)
--- FAIL: TestNSLDAPS__SSHA_1_BASE64___NETSCAPE_LDAP_SSHA (0.00s)
--- FAIL: TestPEOPLESOFT (0.00s)
--- FAIL: TestEPISERVER_6_X____NET_4 (0.00s)
--- FAIL: TestEPISERVER_6_X_____NET_4 (0.00s)
--- FAIL: TestSSHA_512_BASE64___LDAP__SSHA512_ (0.00s)

I've yet to investigate if this is a failure on our rules, or if the test generator is somehow scuffing the hashes in unit tests, although I've reason to believe it's the former

@CPunch
Copy link
Collaborator Author

CPunch commented Dec 18, 2023

after some investigation and many dumb hotfixes, I've settled on a much better solution. the internal wrapper function checkRegex now prepends a case-insensitive flag for each regex. this has fixed majority of the hashes, yet these still remain:

> go test ./test | grep FAIL:
--- FAIL: TestORACLE_H__TYPE__ORACLE_7__ (0.00s)
--- FAIL: TestSHA1_SHA1__SALT__PASS__SALT__ (0.00s)
--- FAIL: TestMS_OFFICE___2003__0__1__MD5___RC4__COLLIDER__2 (0.00s)
--- FAIL: TestMS_OFFICE___2003__3__SHA1___RC4__COLLIDER__2 (0.00s)
--- FAIL: TestPBKDF2_HMAC_SHA256 (0.00s)

they're taunting me...

@CPunch
Copy link
Collaborator Author

CPunch commented Jan 4, 2024

with this commit the testsuite is now complete for all of our supported hashes, with no failures. hooray!

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

No branches or pull requests

1 participant