RE: Creating Basic Email Spoofer 08-08-2014, 06:51 PM
#7
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..
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.
4] In PHP true and false are constants and should be in all caps.
5] Use classes instead of style tags.
6] Break up long lines with new lines or clever concatenations.
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:
example:
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') {![[Image: iQ3pcQu.png]](http://i.imgur.com/iQ3pcQu.png)
BTC Address: 1DCKgDaWcmc9dxBkhe9qrTQtrQpoFUzXdn
![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)