{"action":"created","issue":{"url":"https://api.github.com/repos/magnumripper/JohnTheRipper/issues/1747","labels_url":"https://api.github.com/repos/magnumripper/JohnTheRipper/issues/1747/labels{/name}","comments_url":"https://api.github.com/repos/magnumripper/JohnTheRipper/issues/1747/comments","events_url":"https://api.github.com/repos/magnumripper/JohnTheRipper/issues/1747/events","html_url":"https://github.com/magnumripper/JohnTheRipper/issues/1747","id":106020158,"number":1747,"title":"Dynamic ad-hoc formats: Constants with colons etc.","user":{"login":"frank-dittrich","id":2026819,"avatar_url":"https://avatars.githubusercontent.com/u/2026819?v=3","gravatar_id":"","url":"https://api.github.com/users/frank-dittrich","html_url":"https://github.com/frank-dittrich","followers_url":"https://api.github.com/users/frank-dittrich/followers","following_url":"https://api.github.com/users/frank-dittrich/following{/other_user}","gists_url":"https://api.github.com/users/frank-dittrich/gists{/gist_id}","starred_url":"https://api.github.com/users/frank-dittrich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frank-dittrich/subscriptions","organizations_url":"https://api.github.com/users/frank-dittrich/orgs","repos_url":"https://api.github.com/users/frank-dittrich/repos","events_url":"https://api.github.com/users/frank-dittrich/events{/privacy}","received_events_url":"https://api.github.com/users/frank-dittrich/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/magnumripper/JohnTheRipper/labels/enhancement","name":"enhancement","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":19,"created_at":"2015-09-11T14:19:23Z","updated_at":"2015-09-12T15:53:34Z","closed_at":null,"body":"```\r\n$ ./john --single 2M --format=dynamic='md5(lc($u).$c1.lc($p)),c1=::'\r\n[...]\r\n61278g 0:01:27:07 DONE (2015-09-11 16:04) 11.72g/s 245492p/s 245492c/s 245492C/s girlyfun991907..girlyfun991900\r\nUse the \"--show\" option to display all of the cracked passwords reliably\r\nSession completed\r\n(bleeding-jumbo)run $ ./john --show 2M --format=dynamic='md5(lc($u).$c1.lc($p)),c1=::' \r\n0 password hashes cracked, 1999999 left\r\n```\r\nThe reason is that colons as part of a hash break loading cracked hashes:\r\n`@dynamic=md5(lc($u).$c1.lc($p)),c1=::@...`\r\n\r\nI think it would be even better to convert\r\n```\r\n@dynamic=md5(lc($u).$c1.lc($p)),c1=::@\r\n```\r\ninto\r\n```\r\n@dynamic=md5($s.$p)@\r\n```\r\nand convert the constant and the user name (after conversion to lower case) into a salt (using hex if there are any illegal characters).\r\n\r\nOf course, this is not trivial, because for `md5(lc($u).lc($p).$c1)` you'd need two salts etc.\r\n\r\nBut storing colons as part of the hash must be fixed."},"comment":{"url":"https://api.github.com/repos/magnumripper/JohnTheRipper/issues/comments/139790595","html_url":"https://github.com/magnumripper/JohnTheRipper/issues/1747#issuecomment-139790595","issue_url":"https://api.github.com/repos/magnumripper/JohnTheRipper/issues/1747","id":139790595,"user":{"login":"jfoug","id":1270024,"avatar_url":"https://avatars.githubusercontent.com/u/1270024?v=3","gravatar_id":"","url":"https://api.github.com/users/jfoug","html_url":"https://github.com/jfoug","followers_url":"https://api.github.com/users/jfoug/followers","following_url":"https://api.github.com/users/jfoug/following{/other_user}","gists_url":"https://api.github.com/users/jfoug/gists{/gist_id}","starred_url":"https://api.github.com/users/jfoug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfoug/subscriptions","organizations_url":"https://api.github.com/users/jfoug/orgs","repos_url":"https://api.github.com/users/jfoug/repos","events_url":"https://api.github.com/users/jfoug/events{/privacy}","received_events_url":"https://api.github.com/users/jfoug/received_events","type":"User","site_admin":false},"created_at":"2015-09-12T15:53:34Z","updated_at":"2015-09-12T15:53:34Z","body":"The lc($p) IS magic, and must be preserved. As has been mentioned, it vastly reduces the input wordspace.  But the rest should be proply build INTO the salt, from the start. You have 100% of the exact data to properly build it. It will speed up the format, 5-10% or more anyway, by simply reducing the operations overhead.  The lc(u) is not an issue.  It is done (I think) at prepare() time.  But true canonization like this really should be done by the user, who KNOWS enough to look into the problem."}}