RE: Creating Basic Email Spoofer 08-08-2014, 06:54 PM
#8
(08-08-2014, 06:51 PM)h3r0 Wrote: Nice little tool, email spoofers are a lot of fun, using the same techniques you can send emails as text messages to phones, at least that's how it worked before smart phones.
Review time:
I could go on about coding standards etc, but it's not totally worth it (adding @file, and functions everywhere etc) but I will point out bigger things.
1] Your comments should be in a multiline comment formatted like this..
Code:/** * Mail Imposter * Created by: Autonomous * August 6th 2014 11:30 PM - Created * Last Update: August 6th 2014 11:30 PM * www.HackersHelpdesk.net **/
2] You have incorrect HTML formatting. Your CSS should be in its own file, in the head of the document.
3] You use double quotes in your define. Use either single quotes or double, try to not use both (for readability). Also after commas and after concatenation (a period) you need a space.
Code:define("PASSWORD","Auto365420!"); // Turns into.. define('PASSWORD', 'Auto365420!');
4] In PHP true and false are constants and should be in all caps.
Code:$var = TRUE; $foo = FALSE;
5] Use classes instead of style tags.
Code:<style> .error { color: #FF0000; } </style> <p class="normal-classes for-this error">Yupp</p>
6] Break up long lines with new lines or clever concatenations.
PHP Code:if(isset($_POST['to']) && isset($_POST['from']) && isset($_POST['fromname']) && isset($_POST['replyto']) && isset($_POST['subject']) && isset($_POST['message']) && $validpw) { $headers = 'From: ' . $_POST['fromname'] . ' <' . $_POST['from'] . '>' . "\r\n" . 'Reply-To: ' . $_POST['replyto'] . "\r\n"; $mail = mail( $_POST['to'], $_POST['subject'], $_POST['message'], $headers );
7] The biggest one of them all INDENT. Indenting in PHP is standard and is two spaces (not TAB for the love of god not TAB).
I hope this helps, I wish I learned coding standards when I was early in on PHP but I didn't so life can be difficult sometimes.
Random Tips:
- Coding statndards can be sleightly different for different CMSs or projects so check stying guides before coding with them
- In if statements compare your value to your var instead of var to value it allows you to avoid errors by assignment (see example bellow)
- With developer tools there is no such thing as "protect source" when it comes to HTML. http://i.imgur.com/JExLyPm.png
- Hack the planet.
example:
Code:// Do this... if ('string' == $var) { // Instead of this.. if ($var == 'string') { // To prevent this... if ($var = 'string') {
Wow. excellent feedback! I really appreciate that. I'll be sure to take your advice in my next project. This was the first PHP project I've done from scratch, so its a learn'n'teach kind of deal, so you have no idea how much this response helps.
Now, to decide what to work on next..
![[Image: Free_Logo_autonomous..png]](https://dl.dropboxusercontent.com/u/18833908/Free_Logo_autonomous..png)
![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)