CybrHost Demonstrates New Customer Portal at Conference

CybrHost, an e-commerce hosting provider, demonstrated their new customer portal at the Miva Merchant conference in San Diego last month. The new portal will allow CybrHost customers to conveniently access the most requested features directly from a single web page. Current features include full management of e-mail addresses, access to the CybrHost helpdesk, anti-spam control, and detailed utilization reports. Additional features are planned for Q3 2010.

The Conference, hosted by Miva Merchant (www.mivamerchant.com), was attended by partners, developers and customers. As a premier partner, CybrHost had the opportunity to participate in group discussions, training sessions and keynote presentations as a well as provide live demonstrations of their new customer portal developed specifically for CybrHost customers.

“The customer portal project has been a unique challenge for us,” said Matt Whitted, Hosting Director at CybrHost. “Many competing web hosts use pre-packaged control panel software. We quickly found that these products did not meet the specific needs of our e-commerce customers. To provide a tailored feature set while maintaining the highest levels of security and stability, it became obvious that building our own in-house solution was the only option.”

CybrHost Demonstrates New Customer Portal at Conference

CybrHost, an e-Commerce hosting provider, demonstrated their new customer portal at the Miva Merchant conference in San Diego last month. The new portal will allow CybrHost customers to conveniently access the most requested features directly from a single web page. Current features include full management of e-mail addresses, access to the CybrHost helpdesk, anti-spam control, and detailed utilization reports. Additional features are planned for Q3 2010.

Full story click here: http://www.pantek.com/about.php?subsect=pr10

Using nmap for basic troubleshooting and security auditing

One of the most basic tools and most useful tools in the network and security tool kit is nmap. Nmap is a tool designed to scan a remote host and tell you what services it has running, what operating system constructed the TCP packets on the host and what ports are being filtered by a firewall.

In its most simple form you can invoke nmap like this. (Note that I am running this via sudo because many nmap scans require root level access):

rweaver@core:~$ sudo nmap localhost

Starting Nmap 4.62 ( http://nmap.org ) at 2010-03-18 10:48 EDT
Interesting ports on localhost.localdomain (127.0.0.1):
Not shown: 1708 closed ports
PORT     STATE SERVICE
21/tcp   open  ftp
22/tcp   open  ssh
25/tcp   open  smtp
80/tcp   open  http
443/tcp  open  http
783/tcp  open  spamassassin

Nmap done: 1 IP address (1 host up) scanned in 5.680 seconds
rweaver@core:~$

What this does is scan the host using the defaults of the nmap program which are pretty good, if you wanted additional information you could invoke nmap like this:

rweaver@core:~$ sudo nmap -O -sV localhost

Starting Nmap 4.62 ( http://nmap.org ) at 2010-03-18 10:48 EDT
Interesting ports on localhost.localdomain (127.0.0.1):
Not shown: 1708 closed ports
PORT     STATE SERVICE      VERSION
21/tcp   open  ftp          ProFTPD 1.3.1
22/tcp   open  ssh           (protocol 2.0)
25/tcp   open  smtp         Exim smtpd 4.69
80/tcp   open  http         Apache httpd 2.2.9 ((Debian) mod_ssl/2.2.9 OpenSSL/0.9.8g)
443/tcp  open  http         Apache httpd 2.2.9 ((Debian) mod_ssl/2.2.9 OpenSSL/0.9.8g)
783/tcp  open  spamassassin SpamAssassin spamd

Device type: general purpose
Running: Linux 2.6.X
OS details: Linux 2.6.17 - 2.6.23
Uptime: 461.941 days (since Thu Oct 11 12:13:58 2008)
Network Distance: 0 hops
Service Info: Host: core.domain.tld; OS: Unix

OS and Service detection performed. Please report any incorrect results at http://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 11.680 seconds
rweaver@core:~$

This provides additional information on the versions of each of the services and attempts to the best of its ability to identify the operating system in use. This is useful for determining if you may be running an exploitable version of an application or if a service has been restarted after an update.

Now lets take a look at a device that denies this kind of scanning (note I altered the ip):

rweaver@core:~$ sudo nmap -sV -O 66.61.0.1

Starting Nmap 4.62 ( http://nmap.org ) at 2010-03-18 12:10 EDT
Note: Host seems down. If it is really up, but blocking our ping probes, try -PN
Nmap done: 1 IP address (0 hosts up) scanned in 3.118 seconds
rweaver@core:~$

So lets re-invoke nmap with the options to work around the router blocking our probes and see what we get:

rweaver@core:~$ sudo nmap -sV -O -PN 66.61.0.1

Starting Nmap 4.62 ( http://nmap.org ) at 2010-03-18 12:10 EDT
Interesting ports on cpe-66-61-0-1.neo.res.rr.com (66.61.0.1):
Not shown: 1713 filtered ports
PORT     STATE SERVICE VERSION
44/tcp   open  ssh     Dropbear sshd 0.51 (protocol 2.0)
8080/tcp open  http    Linksys wireless-G WAP http config (Name aker)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: WAP
Running: Asus embedded, Linux 2.4.X
OS details: Asus WL-500gP wireless broadband router, Buffalo WHR-HP-G54 WAP or Linksys WRT54GL WAP running DD-WRT Linux 2.4.20 - 2.4.34
Uptime: 68.916 days (since Fri Jan  8 13:13:52 2010)
Service Info: Device: WAP

OS and Service detection performed. Please report any incorrect results at http://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 110.097 seconds
rweaver@core:~$

Nmap did, in fact, accurately identify the device even while the device was attempting to prevent us from gathering information furthermore it showed the only running ports on it also.

If you want to limit nmap to certain ports are include certain ports its not scanning you can do so with the -p (portnumber or range) option, if you want to scan multiple hosts you can specify them in CIDR notation (eg: 192.168.0.0/16) or as a list. To exclude a specific host is as easy as specifying it with –exclude.

There are also several front ends to nmap which are typically included in the repository for your distribution (CentOS/Fedora and Debian/Ubuntu at least.) The commonly used ones are ‘nmap-frontend’ or ‘nmap-fe’ and if you’re running KDE there is knmap available also. One of the spectacular features of nmap-fe is that it shows you the command line version of the command you’re about to run which is often useful long term in teaching you the more advanced features of the CLI.

As always, if you need further assistance with this or any other open source software, contact Pantek at www.pantek.com, 877-LINUX-FIX, or info@pantek.com

Pantek Incorporated Earns 2010 NEO Success Award

Pantek Incorporated announces they have earned a 2010 NEO Success Award.  The NEO Success Award recognizes Northeast Ohio’s top-performing public and private companies.

Inside Business (www.inside-business.com) will recognize over 90 local businesses at an awards luncheon on March 25, 2010, at Executive Caterers at Landerhaven. The March/April issue of Inside Business will feature a list of this year’s NEO Success Award winners, along with profiles of a select group of award-winning companies.

“We are honored to be acknowledged at the NEO Success Awards by Inside Business,” said Barry Zack, President of Pantek. “Thanks to our dedicated staff, partners, and customers we remain successful and continue to grow even during uncertain economical times.”

Established in 1995 as a way to showcase the success of business in our region, the NEO Success Awards program annually recognizes the top-performing companies in Northeast Ohio. NEO Success Award winners reflect our region’s determination to expand and revitalize its economic status. The NEO Success Award is unique in its combined measurement of business success in sales, growth and profitability.

Learning the Basics of Vi & Vim

When you say ‘vi’ one of two things occur with users– a look of utter panic because they once got in the program and couldn’t get out without killing the terminal session and couldn’t figure out how to make changes to the files, or alternately, a grin as they remember taking some job that looked overwhelming and found finishing it was much easier because of vi. There are a couple strong cases for using vi as your primary editor, the first and most obvious of these is that some revision of vi is included in almost every *nix system under the sun. From BSD, to Solaris, to Linux, to SCO, to whatever… if it’s a *nix it’s likely got a copy of vi stashed on the drive for editing configuration files. Even MacOS X which is based on a heavily modified BSD core has a version of vi installed (vim). The functions of each version are amazingly similar, but do contain subtle differences in feature sets.

Introduction
The first thing to understand about vi and all of its descendants is that they are ‘modal editors’. What this means is that there is a distinct insert mode and a command mode and that the editor can be manipulated through a variety of means, most of which don’t involve removing your hands from the keyboard. For an experienced vi user who is also a touch typist this greatly increases the speed you can perform your editing in vi compared to a traditional non-modal editor since your fingers rarely need to leave the home row to perform editing.

For our purposes we’re going to assume if you’re going to seriously use vi as your daily editor you’re going to want portability, configurability, extendability and syntax highlighting. The choices include both a GUI version and command line version which brings us to the big brother of the vi world… Vim and GVim (VI iMproved, and Graphical VI iMproved). They’re the default on a large number of distributions and installable in all distributions of Linux. It is also the default on mac and is available on windows as well in both a CLI and graphical mode.

Basics
Lets start with the very basics: opening and closing files. Opening a file is as easy as calling vim with an argument, like: vim filename.txt. Once you have vim open you’ll be looking at a screen that is blank (if the file was empty) or contains the file you specified. From this point if you wish to quit the editor without saving it’s very easy to do. You can simply type: :q. If you’ve made changes to the document while having it open you will need to either write the changes out before exiting or tell vim that you’re sure you want to quit without saving changes. To write the changes before quitting you can either execute a: :w, or to write and immediately quit: :wq. If you wish to tell vim to quit without saving your changes it’s as easy as: :q!. Let’s say you want to open a file while you’re in vim. This is trivial: :e filename.txt. If you want to save your modifications to a new file you can do so with the w command, like so: :w filename.new.

Navigation
Navigation in vim is a bit strange for new users, but once you learn the basics it’s considerably easier. While in command mode you can use either the arrow keys or the following:

j(up)
k(down)
h(left)
l(right)

If that movement isn’t rapid enough for you then you can jump full pages by using:

[CTRL]d (down)
[CTRL]u (up)
[CTRL]f (forward – scroll right)
[CTRL] b (back – scroll left)

You can also skip to the beginning and end of a line using the ^ and $commands, although in the case of ^ it actually jumps you to the first non-white space character in the line. If you want to move to the actual first character of the line you use 0. Another useful way to move through a file especially when you’re using code is by line number to do that you can enter :linenumber. For example, :303 will take you to line 303. To move to the start of a file you can use the command 1G and to the end is simply G and this can also be used to take you to a direct line number202G for instance will take you directly to line 202.

Editing
Now let’s look at actually editing the contents of a file to enter insert mode. At your current cursor location you simply press i and from that point anything you type will be entered into the document until you hit[ESC] to go back to command mode. If you want to delete a character under the cursor you can hit x in command mode. If you want to delete a line it’s as easy as dd. Deleting 10 lines would be d10d. To delete from your current line to the end of the file is as easy as dG and from current line to beginning of file it would be d1G. To delete the current word you’re on you can use de. If you wish to change a single character you can hit r and type the new character and if you want to replace all remaining characters starting at the existing character you can use R. Need to change the case of a character? Try hitting ~ while on the character.

Search and Replace
That brings us to our final important piece of editing. Vim supports regular expressions so from inside the editor you can execute just about any regex without needing to rely on an external utility. A good example would be: :%s/domain.tld/mydomain.com/g, which says search for domain.tld and replace it with mydomain.com for all occurrences. If you want to search for something downward in the file you can type: /whattofind and it will show you the next occurrence of that expression in the file, while: ?whattofind will show you the previous occurrence. While these examples just skim the surface of regular expressions and search and replace features in vim, the subject is broad enough on regex alone to write an entire book, and I won’t delve into that in this article.

Locales and Encodings
One thing to be very careful of in mixing environments is watching your locales and character sets that you’re using or you can end up with white space character errors that can causing inexplicable issues that are hard to diagnose.

Vim will use the operating system’s locale by default. You can change this by doing: :set encoding (this setting determines what vim uses internally when editing), :set fileencoding (what the file currently open was encoded as, and what vim will save the current file as), :set fileencodings (a list of file encodings vim will try when opening a file), and :set tenc(the terminal encoding that will be used for display).

So when creating a new file, vim will use the server’s locale by default when editing the file, and will save the file to that encoding. When opening a file already created, vim will still use the encoding setting to edit internally, but will try to automatically determine the existing file’s encoding by trying the encodings listed in the fileencodings setting, in order until it finds one that encapsulates the document. All of these should be checked to ensure that your documents are being encoded and read the way that you need them to be. These settings can also be included in your .vimrc file to load every time.

Despite what you have set the encodings to, you will not actually see the correct encoding when viewing the file if the encoding does not either match the environment you are viewing in, or does not match the translation that putty is expecting (if you are using putty to connect). It does not matter what your encodings are stored and edited as, as long as you set the :set tenc value to what the viewer is expecting. Vim will handle translating from one to the other. I recommend setting Putty to UTF8, which is set under Windows/Translation. The font should also be set to a font that includes the unicode set, for which I recommend Courier New.

So if your operating system’s locale is UTF8 (try running the command locale to find out), you can set .vimrc session to have a encoding=utf-8, an tenc=cp1252 (or whatever your putty is set to), a fileencodings=utf-8,latin1 (the default), and you will be opening files correctly, seeing them translated to your putty encoding, and saving them as they were read. An important note here is that even if your terminal (putty) is receiving the data in the encoding it is expecting (cp1252 for example), and the data was converted from utf-8 by vim, if the font you have selected cannot display the full encoding (cp1252), then you will not see what you are expecting.

There is a problem with this setup. Although it is convenient (since you do not have to change putty back and forth), and you can just set the .vimrc with a proper tenc setting, the encoding you are using on the terminal will likely be a subset of utf-8. Therefore, you cannot guarantee you will see all of the characters properly. It is therefore best to set putty to Window/Translation UTF8, leave tenc unset in vim, ensure that the Linux locale is UTF8, and that the files are being read and written (or created) as utf-8 by checking the :set fileencoding and :set encoding settings, and choose a font in putty that has a full set of characters, such as Courier New, and while not in an active session, edit the Connection/Data/Terminal Details to linux instead of xterm. This should also correctly display UTF8 line characters as well as characters.

Further Reading
A resource I can’t recommend enough is the vi/vim book by O’Reily Publishing. It’s title is “Learning the Vi and Vim Editors” by Arnold Robbins, Elbert Hannah, and Linda Lamb. It’s a spectacular resource and excellent learning tool when it comes to vi/vim.
As always, if you need further assistance with this or any other open source software, contact Pantek at www.pantek.com, 877-LINUX-FIX, or info@pantek.com