Monday, November 29, 2010

Allowing Facebook users to 'like' your webpage

It seems that every webpage out there now has a 'like' button on it so that you can share it with all your Facebook friends. Most webpage templates come with the 'like' button pre-installed, but if you are like me and actually write webpages free-hand, the following code may prove useful.

< src="http://www.facebook.com/widgets/like.php?href=http://www.example.com/" scrolling="no" frameborder="0" style="border:none; width:450px; height:80px">

Facebook provides tutorials for installing widgets and 'like' buttons, but the code is buried deep in their developer's documentation section...

Monday, November 1, 2010

How to Spoof an email by hand :)

Disclaimer: Be responsible. You can get into a lot of legal, professional and personal problems if you decide to misuse information found in this post.

Why tell people how to create a spoofed email in the FIRST place if it could be dangerous? Simple--knowledge is power. If you understand how a spoofed email is created--you are better prepared to spot one in your inbox, and less likely to fall for spamming tricks!

Have you ever gotten an email from a friend--which was REALLY from a spammer--and wondered: How did they DO that? How did they "take" his email address?

I accidentally discovered one method the other day, while trying to create a way to send myself automated reminder emails.

First, you need to find the gmail server to connect to. Why use gmail, you may ask? Because it does not bump you off of the server after 18 seconds, like Yahoo or some of the others do. I have found that http://centralops.net/co/ is a good place to locate email servers. Just click on the 'domains' link and the 'DNS records' box along with entering 'gmail.com' in the next page. What you are looking for in the resulting screen is a line beginning with 'MX' and the word 'exchange'.

For gmail, I have found the server to be: alt3.gmail-smtp-in.l.google.com (for me--it may vary for you, depending on where you live).

Next, open up a terminal and type 'telnet'. I am using Windows XP--I believe it comes with telnet. Once telnet engages, type 'o alt3.gmail-smtp-in.l.google.com 25'
Where 25 is the connection port. When that action completes type all in capitals 'HELO'. There is no backspace, so you have to get it right the first time. HELO is one of two protocols that gmail uses. It is the older form that does not show as much info in the header...

When the server confirms, enter MAIL FROM: < emailaddress@placeyouwantitfrom.com> Yes, the '<' are important! This is the email that the message will say the email originated from. Next, chose the email address you want the message to go to and type: RCPT: < target@mail.com >.

Next, type DATA. This begins the part that the recipiant will see. Type 'From: <emailyouwantitfrom@mail.com>' then enter and type 'To: <target@email.com>' then enter again and begin your message. After you are done typing stuff, type a period '.' and it will send itself to your target.

If it did not get the target inbox, it may be in spam box... It is not a perfect science--and can be traced by your ISP provider--so please use responsibly.

Useful Windows XP commands (from the prompt)

So, after countless hours re-researching Windows prompt commands (to manually remove all the viruses that Windows boxes are subject to), I have finally decided to compile a list of them. Yes--I am forgetful enough to need to consult notes

As some of you may already know--command screen can be entered by clicking the start button-->run-->and typing in the 'cmd'

These are the ones I use the most. You can find other more in depth lists online.

  • CONTROL: opens the terminal window. CMD works just as well
  • CONTROL ADMINTOOLS: opens a partition viewer among other things
  • CONTROL KEYBOARD: opens keyboard properties
  • CONTROL COLOR: opens display
  • CONTROL FOLDERS: allows you to adjust double or single click file opening and make all hidden folders visible system wide.
  • CONTROL FONTS: opens font screen
  • CONTROL INTERNATIONAL or INTL.CPL: allows you to change the default language of your computer
  • CONTROL MOUSE or MAIN.CPL: opens mouse properties
  • CONTROL USERPASSWORDS: opens User Accounts
  • CONTROL USERPASSWORDS2 or NETPLWIZ: User account details. Also where you can set up your Microsoft passport, if you are so inclined
  • CONTROL PRINTERS: opens faxes and printers available
  • APPWIZ.CPL: opens Add or Remove programs window--great if some virus has blocked access to the usual path through the control panel gui.
  • DESK.CPL: opens display properties theme tab--useful if you, say downloaded the Alienware GUI theme manager and the start button and everything you hold dear in the start menu became mysteriously invisible--but still functioned... been there--done that...
  • HDWWIZ.CPL: opens an add hardware wizard
  • MMSYS.CPL: opens Sound and Audio device Properties Volume
  • SYSDM.CPL: opens System properties
  • TELEPHON.CPL: Opens phone and Modem options--yes, Windows still has that feature
  • TIMEDATE.CPL: Date and Time access
  • WSCUI.CPL: opens Windows Security Center
  • ACCESS.CPL: opens Accessibility Options
  • WUAUCPL.CPL: opens Automatic Updates
  • POWERCFG.CPL: opens Power Options Properties
  • CERTMGR.MSC: opens certificate management tool
  • COMPMGMT.MSC: opens the Computer management tool
  • COMEXP.MSC or DCOMCNFG: opens the Computer Services management tool
  • DEVMGMT.MSC: opens Device Manager
  • EVENTVWR or EVENTVWR.MSC: opens Event Viewer
  • FSMGMT.MSC: opens Shared Folders
  • NAPCLCFG.MSC: NAP Client configuration utility tool
  • SERVICES.MSC: opens Service manager
  • CONTROL SCHEDTASKS: opens Schedule Tasks manager
  • LUSRMGR.MSC: opens Local Users and Groups
  • SECPOL.MSC: opens local security settings
  • CIADV.MSC: opens indexing service. Never used it--not sure of its total usefulness--but here it is...
  • NTMSMGR.MSC: removable storage manager
  • NTMSOPRQ.MSC: removable storage operator requests
  • WMIMGMT.MSC: opens (WMI) Window Management Instrumentation
  • PERFMON or PERFMON.MSC: opens the Performance monitor as a graph--super useful.
  • MMC: opens empty Console root
  • DXDIAG: opens DirectX diagnostics tools. It may ask you if you want to make sure your Direct X version is approved by Microsoft first, but I usually ignore that popup window ;)
  • ODBCAD32: opens ODBC Data source Administrator. As I understand it, ODBC is a database tool with SQL compatibilities.
  • REGEDIT: opens Registry Editor where you can change HKEYs... sort of dangerous if you do not know what you are doing
  • DRWTSN32: opens Dr. Watson, an error control utility
  • VERIFIER: opens Driver Verifier Manager
  • CLICONFG: opens SQL Server Client Network Utility
  • UTILMAN: opens Utility Manager--or you can click the 'Windows' button and the 'u' button to bring it up... Microsoft Sam will begin speaking to you--so be careful who is around you when you try this.
  • MSCONFIG: opens a utility to show you what programs are tied to startup
  • SYSEDIT: opens System Configuration Editor
  • SYSKEY: Windows Account Database Security management
And those are the known Windows XP commands that I am aware of... I will add more as I discover them (online and in through experience). I also hope to create a few example tutorials using them...

Saturday, October 9, 2010

Lost your USB BlueTooth driver? Hack the bth.inf!!!

Note: This solution is meant for Windows XP...

I have a BlueSoleil USB Bluetooth thumb-drive which I use to transfer pictures from my cellphone to my laptop. Usually, when I plug it into a machine, it automatically fetches its drivers from the web. However, recently it became obsolete and the drivers were taken down...

If you have found yourself in a similar situation, do NOT throw away the USB device--if you are running Windows XP, hack the bth.inf file instead.

1. You need to find the manufacturer and product ID of your USB device. This is done by going to the device manager. Start--> Control panel--> Performance and Maintenance--> System--> Hardware tab--> Device Manager.
You will see an unknown device (your USB) with yellow exclaimation mark. Right click it, then click properties. In the details tab where you will see something like:

Device instance id
USB\VID_0A5C&PID_2101\5&45EA3A5&0&1
or
Hardware ids
USB\Vid_1caa&Pid_0001&Rev_1915
USB\Vid_1caa&Pid_0001

The part after the "VID, " (0A5C in my case) is the manufacturer and the numbers after "PID" (2101 for me) is the product ID. Write these both down. We will need them to edit the bth.inf file.

2. Search for a file in c:\windows\inf\ You may not see the file if you have not made hidden files visible. If you cannot find it, try going to Start-->Search and typing in inf.

3. Once inside the inf file, locate the bth.inf file. If you have not enabled file extension visibility, all you may see is a file named simply "bth." Open it with Notepad or some other editing program.

4)Find [Manufacturer] tag in the bth.inf file. The section of file should look something like this:

[Manufacturer]
%Microsoft%=Microsoft
ALPS=ALPS, NT.5.1
Belkin=Belkin, NT.5.1
Brain Boxes=BrainBoxes, NT.5.1
Broadcom=Broadcom, NT.5.1
Cambridge Silicon Radio Ltd.=Cambridge, NT.5.1
Dell=Dell, NT.5.1
FIC=FIC, NT.5.1
GVC=GVC, NT.5.1
HP=HP, NT.5.1
IBM=IBM, NT.5.1
Microsoft=Microsoft, NT.5.1
Motion Computing=MotionComputing, NT.5.1
Silicon Wave=SiliconWave, NT.5.1
Sony=Sony, NT.5.1
TDK=TDK, NT.5.1
TOSHIBA=Toshiba, NT.5.1
Wistron NeWeb=Wistron, NT.5.1
Zeevo=Zeevo, NT.5.1

;------------- Device section - Start -----------------------

Add the line "%Unknown%=Unknown, NT.5.1" before the "----Device section -Start---" line
I used unknown because my device had no name or manufacturer. If your device had a name, then rename "Unknown" with that.

5. After the " ;------------- Device section - Start ----------------------- " all the devices are listed. Before the end of the device section, i.e. the line ";------------- Device section - End -----------------------" add these lines:

[Unknown.NT.5.1]
USB Bluetooth Radio= BthUsb, USB\Vid_0A5C&Pid_2101

Replace "0A5C" and "2101" with your own manufacturer and product numbers. If your device name is known, replace the word "unknown" as well.

6. Save the file and plugin your bluetooth device. It should be detected and begin working.

Monday, July 12, 2010

Cloud computing for the REST of us

By now, I am sure you have ALL heard the buzzword "Cloud computing," how it will revolutionize the way we work and play on the internet. I am also relatively safe in assuming that many of you have thrown the phrase into your presentations without complete knowledge of its full implications. Cloud computing really is the future.

So what is cloud computing? In a nutshell, it means that all the data that is currently on your work computer or personal laptop--is going to be migrated out to a server, so that you can access everything from any computer terminal. Some computer scientists speculate that sometime in the near future, the personal computer will be little more than a window into this cloud of pooled information.

Instead of idle banter around the water cooler about the companies' new Cloud integration plans--why not set yourself apart by actually demonstrating proficiency instead? If you would like to "get in" on Cloud computing--without parting with a goodly amount of cash, the EyeOS is a perfectly serviceable option.

EyeOS is an open source Linux distribution Cloud OS that resides in your browser. You log into it as if it were a computer. It possesses all the applications that one typically would expect to find in Linux. You can upload documents, download them, view, create and maintain documents. Also, the Eye has an internal messaging system, ftp options and an email client.

I personally use it as a semi secure place to store my resume, work history, files for my work, and other data. It was a life saver this past morning when my Alienware finally died... Stay tuned for the Alienware autopsy...

The EyeOS can be found at http://classic.my.eyeos.org/

I suggest you give a try--if anything, it will at least give you some hands on experience with real life Cloud computing... ;)

Monday, June 28, 2010

PHP's mail function

Assuming you have gotten to this tutorial, then you have successfully installed PHP, MySQL and Apache on your computer. I am also assuming you remember to turn the services ON before you try this tutorial.

In this tutorial, we will write a simple automated PHP emailer... it is the simplest PHP mail function code I could come up with.

Open Komodo. Select 'file' and create a new PHP file. Remember that in order to work, you need to save your PHP files in /Applications/MAMP/htdocs (for MAC) and C:/XAMPP/htdocs/xampp/ (for Windows). See my older tutorials on configuring your PC or Mac for PHP if you are unfamiliar with either environment or are just starting out.

Once you have your blank PHP file open, type in the following: (due to security restrictions of this site I have to leave spaces between ">","<","?" and "php". Please be sure to OMIT those spaces in your final code).

< ? php

$message = "Take me to your leader. This message was generated by PHP code";
$reply_email = "youremail@gmail.com";
$target_email = "yourtarget@gmail.com";

mail($target_email, "Greetings Earthings", $message, "From: $reply_email");

? >

I would recommend setting the target email to an email address you have access to until you are certain that your code is working correctly. Save it as something like emailer.php in /Applications/MAMP/htdocs (for MAC) and C:/XAMPP/htdocs/xampp/ (for Windows)

To actually execute this little program (on a Mac), go to http://localhost:8888/ to get to the index directory. Click on the name of your file. To execute this code (on a PC) go to http://localhost/xampp/emailer.php or whatever you named it.

If it executes, all you will see is a blank white screen. You will have to check your target email to REALLY know if your code is working properly. Please do not jump into this code until you know for SURE that you have your PHP environment working properly FIRST!

Sunday, June 27, 2010

Your first REAL PHP editor

So, you have managed through much study and prayer to install and configure your PC or Mac for PHP... that is all fine and dandy--but now what? Your computer has become a very small server from which you can connect to some BIGGER more POWERFUL server, if only you could get your code together...

And that is where the Komodo Editor can be a real life saver. It helps you take your PHP code from its location in Applications\MAMP\htdocs\ (for Mac) or C:\XAMPP\htdocs\xampp\ (for Windows) and sends it out to your real server somewhere far far away...

After downloading Komodo:

1. Click file

2. Select PHP as the code type from the right hand list

3. Write your PHP code... mine will be for attachment stripping if I can get it to load (stay tuned)

4. Name your file with the .php extension. Note that you can also open files from your server, provided you have authorized access to them.

5. You can now save your files to your server by entering your server info at the prompt screens

The joy of what to actually WRITE in your php file, I will address in my next short little blog...

Configuring the PC for PHP, MySQL and Apache

When we last left off, I had just configured a Mac for PHP, MySQL and Apache. Since my personal computer runs Windows XP, it only seems fitting that our next tutorial be geared towards the PC...

You will need XAMPP. It contains PHP, MySQL and Apache in one package.

1. Install XAMPP, being careful to note where it is storing itself in your directory. We are going to assume you left it at its default setting...

2. Click the XAMPP Control Panel icon that should have installed on your desktop.

3. When it opens, check the Apache and MySQL boxes.

4. Click Admin. You will be taken to the default splash.php screen.

5. To modify this default screen, go to: C:\XAMPP\htdocs\xampp\splash.php

6. Using a text editor like notepad, open splash.php and add the line: < ? php echo "hello"; ? > and save it. (please note that their is NO space between the "<", ">", "php" and the " ?" The spaces were added to over-ride some security features of this blog page)

7. Your changes should be visible by opening your browser and typing: http://localhost/xampp/splash.php

You should note that all php files you create need to be stored in the htdocs\xampp folder in order to function properly...

Configuring the Mac for PHP programming

Ok, so I get it--there are a LOT of tutorials about how to activate your PHP on the Mac 10.6 OS... but none of them REALLY helped me in the lab so I poked around until I found my own way to set up a good programming environment for PHP, Apache and MySQL environment...

Basically, one needs three pieces of software for this: Cyberduck for ftp client, Text Wrangler to edit PHP and MAMP to act as a local server. Some websites tell you that a better way is to modify your computers config files, but I was not able to get ANYTHING to work that way.

After you download the three above programs:

1. Open Text Wrangler and type: < ? php infophp(); ? > (please note that their is NO space between the "<", ">", "php" and the " ?" The spaces were added to over-ride some security features of this blog page)
2. Save as 'info.php' in Applications>MAMP>htdocs
3. Open Firefox or some other web browser and type http://localhost:8888/
it should bring up your index page. The 8888 is your Apache port that you will need in future
4. Click on info.php

If all goes well...

A page should pop up with details about your PHP... if not, something else has gone horribly awry...

Setting up CyberDuck is my next big adventure... I need to get the server info from the client...

Monday, June 14, 2010

My morning Toast and problem...

Last night in the labs, I had one of those interesting situations arise that SHOULD have been a "no brainer" to solve, yet actually caused me a great deal of unexpected Toast Titanium oddities.

It all started when a non-Apple using student entered my lab to copy a DVD--and not just ANY DVD, but a portfolio/movie/super-important DVD that needed to be submitted by the next morning... He had only one DVD-R to write this copy to...

"Will Toast burn a DVD?" "We can always try!" I had burned CD's with Toast before--what was the worst that could happen? Toast popped up and demanded admin username and password.... It asked for my email.... It asked to do updates--THEN it decided to burn the DVD. Three minutes later, the lab computer spat forth its unholy creation... The resulting DVD had separated out the audio from the video into two separate files and was rendered unplayable...

Feeling utter ashamed at my bad advice and apparent lack of Toast Titanium knowledge, I copied his DVD to a file on the computer, told him to return in the morning FIRST THING, and skittered off to Walmart to get some extra DVD's... Why, oh why--did Toast burn DVD's differently and where did I go wrong?

The next morning, I arrived with ten extra DVD's, used ARP to drag the students folder to my workstation and began experimenting. The Toast Titanium online help was not really helpful... Google search resulted in a number of helpful movie hacking ideas, but not much for the law-abiding among us...

Toast it has a fascinating feature. One can take a file and convert it to an ISO-like object assigned with a .toast extension. You can access it by opening Toast and selecting the little icon with two DVD's on it. Once there, select "Image File." I drug the copied file into the resulting screen and clicked "save as disk image." I then selected the resulting .toast file and drug it back in and hit the record button... A simple burn later, I had a DVD in hand when my student arrived at the lab...
He was happy--I was happy... and now I carry extra DVD's with me.