RE: PHP MD5-SHA1 Cracker 04-05-2013, 11:12 AM
#9
(04-05-2013, 12:25 AM)1llusion Wrote: Hi,That's actually my bad, I didn't realize he was going to put it online.
I just couldn't help myself, you have 2 security issues in your script.
The first one is a confirmed reflected XSS which is due to no input validation at:
PHP Code:if (isset($_POST['submit'])) { $wordlist = $_POST['wordlist'];
You could fix it by using:
PHP Code:if (isset($_POST['submit'])) { $wordlist = htmlspecialchars($_POST['wordlist']);
The second security issue is by opening a file, that the user defines:
You don't use any protection here and this flaw could be used to brute-force file locations and names on your server.PHP Code:$wordlist = file($_POST['wordlist']);
I personally would take out the part where user enters the name of the dictionary by himself and instead, use a menu, where the user simply ticks which one he wants. Also, I'd use integer values for passing the choice of the user and on the server, I'd simply filter out everything except the integers. This way you:
1) Have no chance of XSS vulnerability
2) Have control over what the user can access.
When I have some time, I'll edit the script to the more secure solution
urprised:

![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)