Web Dev

Apparently, I’m a Web Ninja

Posted in Puzzlers, Web Dev on December 11th, 2009 by Scott Weaver – 1 Comment
nailed it

nailed it

You almost had me on step 3, but other than that – cake! Cool idea though.

Here are some hints for those less skilled-

  1. View the source
  2. Firebug, Edit
  3. View the source of the page you’re trying to get to (if you know how); notice any evil javascript?
  4. View the source, scroll right
  5. TWSIWTPVSK? Yikes! Hint: “_ _ _ _ _ N I N J A” (the rest is trial and error, buddy)

And that’s all I have to say about that.

Good luck.

TheseDays.com Web Ninja Test

-Scott

Convert Email Address To Image

Posted in PHP, Web Dev on February 27th, 2009 by Scott Weaver – 16 Comments

As a measure against spam bots and things of that nature, I’ve seen a site or two displaying e-mail addresses as images.

So to make things extremely simple, I made a very quick script to do this dynamically-


/***********************************************
* Email Address Image
* by Scott Weaver
*
* Last updated: February 27th, 2009 @ 2:30pm
*
* Converts an e-mail address to an image to
* prevent spam bots and scrapers from stealing
* it.
*
***********************************************/

/*
Requires two inputs:

u : is the username part of the email address
d : is the domain part of the email address
*/
if( !isset($_GET['u']) || !isset($_GET['d']) )
die('Please enter a valid e-mail address.');

$email = $_GET['u'] . '@' . $_GET['d'];

/*
For this font, the width is 6X the character length,
plus 1 for padding.
*/
$width = (strlen( $email )*6)+1;

// Create image w/ color
$im = imagecreate($width, 14)
or die('Cannot initialize new GD image stream');
$white = imagecolorallocate($im, 255, 255, 255);
$black = imagecolorallocate($im, 0, 0, 0);

// Write email address to image
imagestring($im, 2, 1, 0, $email, $black);

// Output & destroy
header('Content-type: image/png');
imagepng($im);
imagedestroy($im);

Of course, you’ll notice that anyone who mods a script to look for email addresses matching the script’s parameters would be able to circumvent this little trick, but overall it should work.

What’s cool is that the script will auto-adjust the image for the width of the e-mail and it doesn’t take up much space by itself (just enough to display uppercase and lowercase letters).

Instructions

Just name the file something like ‘emailimg.php’ and upload it to your server. Once uploaded, you can reference it just like so:

<img src=”emailimg.php?u=johntheripper&d=hacker.net” />

That’s it. You’re done.

Demo

Here’s a working example:

Requirements

The only required functions are: imagecreate(), imagecolorallocate(), imagestring(), imagepng() and imagedestroy(). Basically, you just need the GD library enabled for PHP.

Improvements

I think the only improvements you could add to this script would be the ability to use different fonts, and to change the background/foreground colors. Well, that and a way to better hide the email address parameters. Maybe you can think of some that I can’t.

Photoshop Goldmine

Posted in Scott, Web Dev on January 30th, 2009 by Scott Weaver – 4 Comments

Wow.

I just discovered an amazing source of Photoshop wizardy: Vandalay Design’s Photoshop Tutorials.

I’m no expert in Adobe Photoshop, but I do love to mess around and I use it to create designs and interfaces for my various web sites and web applications.

Here’s a little something I came up with just using one of the tutorials on the site-

Oooo.. Magic!

This took me about 10 minutes to create just messing around with different techniques and the like.

Here’s another I did later on-

When Earth Becomes A Star

And again later on-

ScottMW.com

I’m still checking out the various tips and tricks on the site, but I wanted to let the people know!

-Scott