Sunday, May 13, 2012

DNSChanger Check up

Internet is one of the main sources for malwares which damage our computers. Since last few months 'DNSChanger' which is kind of a Trojan, has ruled the world of malwares. Thus, FBI, America has repeated the warning that as many as half a million computers still infected with the malware could lose their Internet connections on July 9 because the agency is shutting down an expensive workaround to the problem.
This DNSChanger virus affects the Windows and MAC systems and it was around the Internet since 2007. What it basically does is changing the DNS settings used by the system. DNS (Domain Name System) is an Internet service that converts user-friendly domain names (www.google.lk) into the numerical Internet protocol (IP) addresses (192.232.134.52) that computers use to talk to each other. First, DNSChanger changes the computer’s DNS server settings to replace the ISP’s good DNS servers with rogue DNS servers operated by the criminal. Second, it attempts to access devices on the victim’s small office/home office (SOHO) network that run a dynamic host configuration protocol (DHCP) server (eg. a router or home gateway). Further, this virus can spread itself into other machines if you are using a LAN by changing the settings of the router. Making it worse, this will block you from accessing anti virus softwares too.
The Bottnet network which was used to spread this DNSChanger was disabled in last November by FBI, USA through their special mission called 'Ghost Click'. Moreover, most of the anivirus software companies have updated their products against this malware. Even though several actions took placed, it was found that about half a million affected computers are still have access to internet as its users are not aware about this malicious software. Thus, FBI has announced that these computers will lose their Internet connection from July 9 onwards.

Fortunately, there are no infected computers reported from Sri Lanka yet. But still you can have a check up for your computer for this DNSChanger at http://dns-ok.us/. If you get DNS Resolution = GREEN in green, you are safe. Else, if you get  DNS Resolution = RED in red, it is better to have a complete system scan and remove DNSChanger via an updated antivirus software.

Source : http://www.fbi.gov/news/stories/2011/november/malware_110911 

Thursday, May 10, 2012

Populating a Drop-Down list using PHP and MySQL

In web based applications you may need to develop a drop-down list using elements taken from a database table. This code will help you to easily populate a drop-down list from a field of a database table.

 function get_dropdown($user){
         connect_to_db();
                if (!mysql_select_db('cars'))
                {
                    echo "could not select ('db')";
                }
                            $add_query = "SELECT names
                           FROM cars 
                             WHERE owner = '$user'
                            ";
                    $res = mysql_query($add_query);
               <select name="car" class="dropdownmenus" value="Select me">
     <option selected> Select Car </option>
     <?
           while ($row = mysql_fetch_array($res)) {
         extract($row);
           echo "<option value='$row'>$row[names]</option>";
           }
     ?>
     </select>
     }

Friday, May 4, 2012

Creating a horde module

After successfully configuring horde a new application can be easily created.

1. Working horde packs can be downloaded via, ftp://ftp.horde.org/pub/horde-webmail/.

2. Next download the horde skeleton module using GIT repository.

     $ git clone --depth 1 git://github.com/horde/horde.git
   $ cd horde
   $ cp -R skeleton/ /your/install/path/to/horde/


3. Move the new module to /var/www/html/horde directory.( Full installation guide including moving the folder and renaming the module is available at http://wiki.horde.org/CreatingYourFirstModule?referrer=HowTo )

4. Then Open /var/www/html/horde/config/registry.php. Add the following entry to the file.
(module name = skeleton)

 $this->applications['skeleton'] = array(
             'fileroot' => dirname(__FILE__) . '/../skeleton',
             'webroot' => $this->applications['horde']['webroot'] . '/skeleton',
             'name' => _("Skeleton"),
             'icon' => $this->applications['horde']['webroot'] . '/skeleton/themes/graphics/me.png',
             'status' => 'active',
             'menu_parent' => 'horde'     );

Tuesday, May 1, 2012

Installing Horde in Fedora 10

As an open source project Horde will work better on Linux platform. This will guide you to install horde together will http server, MySql, PostFix SMTP server and Dovecot IMAP server.

Horde version - 3.3.8
PHP version - 5.2.9
Dovecot version - dovecot v1.1.20

1. Installing Apache  server
        $ yum install apache server

2. Installing MySql server
        $ yum install mysql-server

3. Install PostFix and Dovecot servers
        $ yum install postfix
        $ yum install dovecot

4. Configure PosFix SMTP server and Dovecot IMAP server
         http://workaround.org/ispmail/etch

5. Move /hordre folder to /var/www/html/ folder

6. Start servers.
        $ service httpd start
        $ service mysqld start
        $ service postfix start
        $ service dovecot start

6. Run the setup.php file
         $ php horde/scripts/setup.php

7. Check whether horde is working
         http://localhost/horde

8. Can use the users in the virtual_users table to login into horde. But have  to use the full domain names as,

    john---> john@example.com