Brute-force password cracker
There are some things I've seen that may help you improve your code.

Pass references where practical

The dfs() routine doesn't really need to create a duplicate string.  Instead, it could simply reuse a passed string.  We do that by changing the prototype to this:

void dfs(std::string &amp;s) 


And then call it like this:

int main() {
    std::string s;
    dfs(s);
    std::cout &lt;&lt; "Finished Time : " &lt;&lt; clock() / (double) CLOCKS_PER_SEC;
}


On my machine, the original code takes 6.3 seconds, but when modified like this, takes 4.7 instead, making a very easy improvement.

Prefer iterations to recursion

Recursive functions are often a good way to approach a programming task, but there is a tradeoff in terms of memory and time.  Specifically, one can often reduce or eliminate the computational cost of a function call and reduce or eliminate the memory overhead as well by converting from a recursive to an interative function.  In this case, I'd advise altering the code so that the prototype is something like this:

bool brute(const std::string &amp;alphabet, size_t len)


It's then a simple matter of calling the function with increasing sizes until either the password is found or you run out of combinations.  For generating the combinations, I'd suggest using std::next_permutation something like this SO question shows.  

Look at similar questions here

Another nice source of advice is other similar questions.  For example, this question is very similar and the answers are generally applicable to your code.