Squid Proxy, and Adzapper in Windows

Browsing website on the internet with high speed data access is a separate pleasure for some people including me. To open a site with no waiting time to load the page of a website is always a dream. But sometimes we’re getting bad-mood if we face a situation where the website that we would like to open are taking too long to load, because it have to wait each elements on the website to download to our computer. Images, swift files and any other elements.

A web page made up-over elements such as images, text, swift files, and others. When we want to open a web page, elements are downloaded to our computer and placed in the temporary folder of the browser we use. We can enjoy a web page perfectly after all the elements that make up the page is finished to download.

We may have a habit to visit the same website every day, especially right now, the social community era, facebook, twitter, myspace, we visit these websites just to make status, commenting a status and other activities. The same images, swift files, will be downloaded every time we visit those websites. This is actually a routine that we can make a strategy about.
Proxy is a tool that we can use to create a strategy for this routine. The proxy has the ability to store images taken from a website that we have accessed before, so the browser no longer need to download the same images from its origin. Proxies are smart enough to recognize the latest content from a website that we access, so proxy will download the latest content and storing it into a place commonly called cache.
Advertising, sometimes we are very disturbed by the ads that float on a websites that we might not want to see it, and the ads usually created using the large size of images. We also can use a proxy to block ads from a website. In addition, the proxy can also be used to block sites.

On a computer network in a company, proxies are necessary nowadays, at least use to save bandwidth and to limit the access to few websites that considered can make the employees forget about work.
The computer network administrators usually install a proxy in linux machine, and for those of you who want to install a proxy on the linux machine, please look for it on Google, there’s a lot of articles around proxy and linux machine. This time we will try to install a proxy into Windows. OK, let’s live it.

Installing Squid Proxy

1.    Download squid proxy from this link http://squid.acmeconsulting.it/download/squid-2.6.STABLE23-bin.zip.
2.    Then extract it on to C:\
3.    And then rename the squid.conf.default file on the etc folder  to squid.conf
4.    Add this line http_access allow localhost exactly under the line http_access allow localnet
5.    Then open the windows console and got to C:\Squid\sbin\, and the type:   squid.exe  -z command just like picture below:

6.    And then run squid as a windows service by typing this command on the console: squid.exe -i. And then check if the squid are installed as a window service like picture below:

7.    And then start the Squid Service.

The next step is configuring the browser in order to use the squid as web proxy, the steps are:
1.    On firefox, simply click tools and then click option, there have to be a option window appear, and in the Advanced menu, click network tab and then click setting button just like the picture below:

2.    And the on the Connection Setting window that appear after the setting button clicked, modify the connection setting just like this picture:

3.    And then browse just like we usually do, for the first time the browsing activity will look like usual,  because the squid proxy will store the contents of the web onto the cache, and later then the browser will fetch the static content from the squid cache.

Installing Adzap
To block the advertisement on the web, we need a squid plug in, which is adzapper. The problem is adzapper is a perl script that only can be execute by using perl environment. So definitely we need to install perl on our windows system. I choose Strawberry Perl as a perl platform to be installed on my windows machine. Strawberry perl can be fetch for download from this url http://strawberry-perl.googlecode.com/files/strawberry-perl-
After finished download the strawberry perl, then please install the strawberry pearl on your own windows machine. I have installed Strawberry Perl on C:\Web\ on my windows machine. Please pay an attention that all setting of adzapper must match to the location of your Perl installation.
And the next step is download the adzapper script from this URL: http://adzapper.sourceforge.net/scripts/squid_redirect, open the link on your browser, and after all the text/script is appeared, save the script to the C:\squid\etc\ folder and name it as squid-redirect.pl.
And the next step is configuring this adzapper plug in into the squid the we have installed before. Open the squid.conf file, this file is located on C:\Squid\etc\ folder and then add this line on the end of row of the file

redirect_program C:/Web/strawberry/perl/bin/perl.exe c:/squid/etc/squid_redirect.pl

Please make an attention that my perl installation located on C:\Web\ folder, please adjust the setting to the path of your own perl installation.
And after that, restart the proxy squid by using a window service just like the picture before, or maybe by using the command line by typing squid.exe –k reconfigure. And we have finished the adzapper script installation on squid. Now it’s time to check that the adzapper is working properly or not. Open the browser and then open the web site that you knew it have full of ads. The adzapper will block the ads juts like this picture below, and if it does, then the adzapper is working properly.

Actually there are a lot of things that we can do with squid and adzap to fill up our needs about the web-caching problems, please visit the official site of squid on http://squid-cache.org and adzapper http://adzapper.sourceforge.net/ to have a guide to maximize the both function.


I Hope this will helpfull



Installing Squid Proxy

Managing Authentication in Tomcat with JDBC Realms

After few times ago, we have used session to managing authorization for accessing Jsp pages, now let’s try to make another authentication for a web application by using Realms.

On Apache or any similar web server, we use Realms authentication by include a file called .htaccess to a directory, so only the listed users can access the content of those directory.

Just like the Apache, Realm is a feature of Tomcat which handles an authentication for the user who would like to access all the resources on a web application. Realm controls the roles of each listed user, these roles are references for tomcat to rule out which users can access which web application. By default Realms is flexibility supported by Tomcat. This flexibility mean is Tomcat is supporting this authentication with several ways that we can use as use as we like. The Realms authentication methods already supported by Tomcat are:

  1. File based authentication (The Memory Realms). With this method, the authentication processed by reading a file called tomcat-users.xml that exist on <Tomcat-Folder>/conf/tomcat-users.xml, this file contains a list of users with their roles.
  2. Database (JDBC) authentication(The JDBC Realms). This method is using database as storage of user list and its roles. On Tomcat 5.5, by default, there’s a few database software which is already supported for this JDBC Realms methods. In order to use this method we have to install the database connector by copying the database connector library such as mysql-connector.jar onto <Tomcat-Folder>/common/lib/.
  3. JNDI authentication (JNDI Realms). On this authentication method, Tomcat will validate user and its roles by reading the web directoryservice, such as LDAP. When using this authentication method the JNDI providers have to installed to Tomcat by copying the libraries on to <Tomcat-Folder>/common/lib/ folder.

From those above Realms authentication, we will try the second method which is Database (JDBC) authentication(The JDBC Realms) as out try-it-out now. We will use mysql database as storage of users list and its roles. While the scenarios of our try-it-out today are bellows:

  • Create a database as a storage which can hold users list and its roles.

  • Create a mysql username and password, this username is dedicated for a database that we have created on first step, and this username only had read privileges.

  • Activate Realm JDBC configuration on Tomcat.

  • Create web application configuration in order to make this web application support Realms.

On above scenarios, actually we only do once from step 1 to step 3, means the configuration from step 1 to step 3 will became permanent on Tomcat environment. While the step 4 is optional, means every web application that we will deploy later is may to use this Realm authentication, and may not use too, so it’s depends on us to decide whether a web application will using Realm authentication or not. And then if we want to add user with its roles, so the modification will only do inside mysql database.

And now let’s run out one by one the scenarios above. For the first scenario, please create a database and its tables on mysql database, just like mysql query bellows:

create database tomcat_server;
use tomcat_server;
-- Table structure for table `user_auth` --
  ( `USERNAME` varchar(30) NOT NULL default '',
  `PASSWORD` varchar(30) NOT NULL default '',
-- Dumping data for table `user_auth` --
INSERT INTO `user_auth` (`USERNAME`, `PASSWORD`) VALUES ('admin', 'admin99'), ('mojo', '7mono7');
-- Table structure for table `user_role` --
  ( `ROLE_NAME` varchar(30) NOT NULL,
    `USERNAME` varchar(30) NOT NULL )
-- Dumping data for table `user_role` --
INSERT INTO `user_role` (`ROLE_NAME`, `USERNAME`) VALUES ('tomcat', 'mojo'), ('manager', 'admin'), ('admin', 'admin');

These Query, can also directly executed by copy-paste onto mysl console, just remember the database, tables, users, and roles for the next configuration or scenarios.

Let’s continue with the 2nd scenario which is creating dedicated mysql username and password which only have read only privileges access. Why read-only privileges access? Because we have to be careful to give an access privileges on database user, especially the context of this Realms is related with the access of our whole web application. For this 2nd scenario, these is only my suggestion, but if you want to make a database user with more access privileges than this scenario for your next development, go a head (All by your own risk). Below is a sample query which can accommodate the 2nd scenario.

grant select on tomcat_server.* to 'tomcat-user'@'localhost' identified by 'tomcat55';

On above query, we make a user named tomcat-user and the password is tomcat55, grant select is a command of mysql database that this user have the read-only access to tomcat_server database.

And then let’s continue to the 3rd scenario, which in this scenario, we will activate the Realm configuration with JDBC methods on Tomcat. Realm configuration placed on servlet.xml file which is located on <Tomcat-Folder>/conf/ folder. So we have to modify this file in order to activate Realm with JDBC method. There are two steps to do in this 2nd scenario. The steps are:

  1. Activate Realm Configuration.

    Find and modify the servlet.xml just like bellow:

    <Realm className="org.apache.catalina.realm.UserDatabaseRealm" 
  2. Activate and modify the JDBC Realm configuration refers to 1st scenario that we did before. Modify the server.xml file just like below:

     <Realm className="org.apache.catalina.realm.JDBCRealm" 
               connectionName="tomcat" connectionPassword="tomcat55" 
               userTable="user_auth" userNameCol="USERNAME" 
               userCredCol="PASSWORD" userRoleTable="user_role" 
               roleNameCol="ROLE_NAME" /> 

    Lets discuss a bit for our review of above configuration, in this configuration we are using com.mysql.jdbc.Driver for mysql-connector driver, and the we are using tomcat as a name for database username and for the database password we are using tomcat55 to create connection into mysql database as we have created before on the previous scenarios. Please make sure that the value on this configuration is correct as we create the data on database at the previous scenario.

And then now we can run 4th scenario which is applying JDBC Realms authentication to our web application. Just create or use the existed web application to applying this Realms authentication. We can apply this Realms Authentication by modifying web.xml file which is located on <Tomcat-Folder>/webapps/<your’s-application>/WEB-INF/ folder.

The modification can be do by adding few lines just like below on our web.xml file:

<?xml version="1.0" encoding="UTF-8"?> 
<web-app xmlns="http://java.sun.com/xml/ns/javaee" 
<!--Access Configuration based on Realms--> 
         <web-resource-name>All Page</web-resource-name> 


On those lines above, all the authentication will be applied to whole resources on this web application, marked by line <url-pattern>/*</url-pattern>, and then for the authorization methods we are using BASIC.

That’s all, our try-it-out, using JDBC Realm on Tomcat as a validation for user to our web application resources. Please don’t you ever have a doubt to more explore for your own need and your own desires.


Menteng, Januari 26th 2008.


Windows Delayed Write Failed On Maxtor One Touch 4 Mini

maxtoronetouch4miniOn December 26th 2008, I bought a external hard-drive, Maxtor One Touch 4 Mini with 160 GB capacity and it cost about 750.000 IDR. At the first time I use this external hard-drive I was very disappointed, I cannot use this external hard-drive at all. When I plugged in USB device to my laptop, my Windows XP cannot recognize this new hardware. At first time, I suspected this Windows XP cannot recognize this hardware, then I switch my operating system into Linux Open Suse, the other operating system that I‘ve been choose for my own computer, but the fact, I got one more disappointed feel, this Open Suse also cannot recognize this new hardware.

Well I think there’s nothing wrong with my laptop or the operating system. It must be this external hard-drive got some error when it comes out from its vendor. Anything broken maybe or I don’t know, obviously this is about this external hard-drive and its not about my chosen operating system, so I decide to returning back to the shop where this external hard-drive have been bought by me. At the shop, this hard-drive checked by the technician of the shop. And the result of this checking is make feel better, indeed this external hard-drive had something broken that can make it can be used. Then the shop replaces this external hard-drive with the other new external hard-drive that was still same type and same capacity with the broken one.

Before I took home this new external hard-drive, the technician makes sure that this new hardware is on good condition by trying first by him self. Indeed this one is on good condition and ready to use, so I agreed to take it home with me as a replacement of the broken one.

At home, I started to use this hard-drive to save the data which is very important to me. Because, indeed, I bought this external hard-drive in order to backing up all the important data. Backing up the data became a part of my computer activity.

Actually, I want to split this external hard-drive into two partitions, but I can only do that 2 days after, because I didn’t have a software on my laptop that have an ability to split the partition of this external hard-drive. Well as a customer I thought, I want to know the quality of the stuff that I bought rite? So I planned to do some test on this external hard-drive. My first simple test is copying the large size of files from my laptop into this external hard-drive. So I try to test it by copying a file that have 500 MB of its size with one single copy and one single paste, the result is not bad, this new external hard-drive capable to receive the data directly from a single copy-paste for 500 MB size of files. Actually this test is goes to USB cable, to find out whether this USB cable is capable or not to transferring the 500 MB file size.

And then I try to copy-paste a data file that have 1GB of size, and the result is still good, but when I try to copy-paste a data file that have 2GB file size, this hardware is apparently showing its weakness. When the data copying into this external hard-drive, and the progress just reached 45% of copied file, there’s an alert balloon showing up at the bottom-corner of my desktop windows, “Windows Delayed Write Failedand bla..bla..bla… now I can found out that this external hard-drive was cannot resist for transferring data file that large then 2 GB file size. And then I try to delete the failed copied file, but I feel so disappointed, this failed copied file cannot be deleted, when I try to delete, there’s a windows dialog showed up, telling that this failed copied file cannot be deleted. So I try to delete the file using Dos Console, and it still cannot delete. I try to switch to Linux open suse, and its still same, its still cannot be delete, so I left this failed copied file. I will remove it by formatting this external hard-drive and split its partition into 2 partitions. So this external hard-drive will have clean storage.

Two days later, I split this external hard-drive into 2 partitions with same size, each of this partition have 80 GB capacity. And then I try to do above test again, this test was failed the windows still have this windows delayed write failed.

And then I format again, and do the splitting once again, and do the test once again, but now I’ll test this external hard-drive using Linux operating system. Its little weird, the result that goes with Linux, found there’s none of this external hard-drive had some error, the copy of 2GB of file size was run properly, there’s no corrupted file found.

Hmm, I started to think, maybe there’s a problem with my Windows XP when the 1GB file size or above being copy to the external hard-drive. I tried to find out by browse Microsoft web site on FAQ and Bugs page. And I also search another web site or articles in the internet. By these browsing, I can make some statement that there are problems on the Windows system cache when we copy the data with a large size onto external hard-drive. Even the answer of Microsoft website about this problem focused on the failed of the external hard-drive connector, such as USB cable, etc, I still keep the statement that this is all about Windows XP system cache problem.

Then I try to find out once more by browse the internet, the possibility of any one else having same problem like me and how he or she solve the problem. After two days, finally I found a related article, and in these article also written how to solve these problem. Unfortunately, I forgot the link, but the important thing is, this link is not the Microsoft website or this external hard-drive vendor web site, but some one else which have same problem with me.

Ok, the focus of this problem fixing process is, by enlarging Windows system cache. I used software to change to change this windows system cache. I know this software also from the article that I’ve read before. This software name is Cacheman made by Outer Technologies. This software is not free, and I used version 5.0. I used this version because we can still use this software even we don’t do any registration. :P

After the installation of this software is successful on my Windows XP, refer to the article I made some changes on my Windows XP system cache, and then I restart my Windows XP and make some test again just like before.

The test by copying 2GB file size to the external hard-drive running well, there’s no more Windows Delayed Write Failed, I’m happy. Then I try to copy file that larger then 2GB of file size and its still have no problem at all. After do test by copying 5GB file size onto this external hard-drive and its success, I stop the test, and I think the test is finish.

I’ve planned to test for a week, before I can make a decision that this test is really-really passed. And when this article written I still cannot found a same problem with before. Then I decide that Windows Delayed Write Failed that happen on my external hard-drive is solved, I can use this external hard-drive normally.

Below are the steps, when I’m using Cacheman5.0 to change my Windows XP system cache in order to solve the Windows Delayed Write Failed problem that happen on my brand new Maxtor One Touch 4 Mini 160 GB.

On show wizard menu, I choose all, and for the entire window that showed up, here are the details:

1.Disk Cache: choose Balance
2.Icon Cache: choose Set large maximum Icon Cache size
3.Unload DLLs from Memory: choose Enable
4.Disable Paging Executive: choose Enable
5.IO Page Lock Limit: choose Large IO page lock limit value
6.Disable NTFS last access update: choose Enable
7.Disable creation of short filenames: choose Enable
8.Reserve more space for the Master File Table: not enable (don’t check)
9.Defragment hard disk when idle: choose Enable
10. Hung App Timeout: choose Optimize
11. Wait to Kill App / Service Timeout: choose Optimize
12. Menu Show Delay: choose Optimize
13. Filename Completion: not enable (don’t check)

That’s it, Windows system cache setting using Cacheman on my Windows XP, to prevent Windows Delayed Write Failed problem.

Menteng, January 4th, 2009

I Hope this will helpful


Konsep mengamankan Flash Disk dari Sengatan Virus

Pada dasarnya virus adalah sebuah executable program yang berjalan dengan sendirinya atau di-trigger oleh program lainnya, tanpa sepengetahuan kita atau user yang menjalankan komputer. Dalam perkembangannya pembuat virus melindungi virus buatannya dengan menyisipkan perintah-perintah pada tubuh virus tsb yang sifatnya membuat virus tsb seakan-akan kebal. Misal kita sudah tahu dalam flashdisk kita ada sebuah virus dengan nama a.exe, ketika menghapusnya dengan cara mendelete, sebentar kemudian muncul lagi sebuah file yang bernama b.exe, untuk kemudian kita delete lagi virus b.exe tsb, lalu kemudian muncul lagi sebuah file dengan nama c.exe, demikian seterusnya sampai kita lelah sendiri mendelete virus tsb.

Jika keadaan demikian sebenarnya bukan a.exe, atau b.exe atau c.exe atau lainnya yg menjadi program utama virus tsb. Ada sebuah program lain yang berjalan dibelakang tanpa kita atau user ketahui diam-diam memeriksa jika a.exe tidak ada maka buatlah b.exe, jika tidak ada juga maka buatlah lagi c.exe dstnya, begitu kasarnya. Inilah yang dinamakan thread dalam istilah programming atau daemon. Kesimpulannya, sebenarnya si pembuat virus akan membuat virusnya jadi sebuah thread atau daemon atau service istilahnya.

Pertanyaannya adalah apa yang menjalankan thread atau daemon atau service ini. Seperti yang sama-sama kita ketahui bahwa jika kita memiliki operating system windows XP maka ada beberapa service yang dijalankan ketika windows selesai mem-boot up Operating Systemnya, kita bisa melihat service atau thread apa saja yang dijalankan oleh windows selesai ia mem-boot up mesinnya dengan cara melihat System Configuration pada windows itu sendiri (Klik start -> Run -> ketik msconfig pada kotak yang disediakan lalu tekan enter). Pada System Configuration Utility tsb, tab startup, kita bisa melihat item-item program apa saja yang dijalankan pada saat windows selesai memboot-up mesinnya.

Jika virus adalah sebuah thread atau daemon, bagaimana cara menjalankan virus tsb untuk kemudian virus tsb menjadi sebuah thread yang akhirnya dapat menulari komputer kita dengan virus yang ada pada flashdisk tsb?.

Untuk menjawab pertanyaan ini, coba perhatikan cd yang bootable entah itu cd-driver, cd-program atau cd lainya yang bootable(masukkan cd nya kemudian cd tsb akan mentrigger sebuah program yang dalam pada cd tsb). Dalam CD tsb pasti ada sebuah file yang bernama autorun.inf, coba buka file ini dengan menggunakan notepad, maka akan kita temukan baris-baris yang memerintahkan Operating System untuk menjalankan suatu file.

File autorun.inf pada dasarnya adalah sebuah file yang dikenali akrab oleh windows untuk kemudian mengeksekusi baris demi baris kalimat yang ada pada file tsb dengan beberapa kata yang memang sudah ditentukan seperti OPEN, RUN dan lain-lain. Jadi sebenarnya ketika kita memasang sebuah CD dalam optical drive kita seperti CD-ROM, DVD-ROM dan lain-lain, windows memang akan mencari file autorun.inf tsb. Jika file itu tidak ada maka windows tidak akan melakukan apa-apa, jika ada, windows akan memeriksa baris-baris demi baris untuk kemudian mengeksekusi baris demi baris yang ada pada file tsb. Demikian halnya dengan flashdisk atau media penyimpanan lainnya. Jika windows mendapati ada file tsb, windows akan segera mengeksekusi baris demi baris yang ada dalam file tsb.

Namun karena si pembuat virus memang tidak ingin kegiatan programnya(red: Virusnya) diketahui oleh user maka dengan sengaja si pembuat virus mengeset file autorun.inf ini dengan attribut hidden dan read-only. Attribut hidden gunanya agar file ini tidak bisa dilihat oleh kita atau user (kecuali dengan mengeset folder option kita menjadi show hidden files) sementara file read-only berguna untuk membuat file autotun.inf ini tidak bisa di-edit ataupun di-delete.

Bagaimana caranya si virus atau si pembuat virus membuat file autorun.inf ini ke dalam flashdisk kita?. Ini adalah salah satu feature(kemampuan) si Virus tsb. Jika anda mau membuat virus, ini adalah kemampuan mutlak yang anda harus miliki supaya virus anda dapat tersebar dengan luas. File autorun.inf yang merasuki flashdisk kita dibuat oleh virus itu sendiri. Bisa anda bayangkan? sebuah virus akan membuat file autorun.inf dalam media penyimpanan yang writeable(dapat ditulisi file) dalam hal ini flash disk. Itu akan menjelaskan kenapa jarang ada virus yang menyebar lewat CD, karena CD adalah media yang tidak mutlak writeable, sebab untuk menulis dalam CD kita harus burning CD tsb dengan menggunakan software burning seperti NERO dan lain-lain atau windows default burning media. Sementara FlashDisk, adalah media yang memang writeable.

Selain kemampuan membuat file autorun.inf, biasanya virus juga mempunyai kemampuan untuk men-disable REGISTRY TOOLS (regedit), men-disable folder option, membuat entry dalam System Configuration Utility, mengedit value-value dalam registry windows, dan lain-lain, yang semuanya itu bertujuan seakan-akan membuat virus itu jadi kebal, hilang atau tidak bisa di-delete dengan tujuan utamanya agar virus itu tetap bisa hidup dalam media penyimpanan kita. Kita akan bahas feature-feature virus ini dalam kesempatan yang lain.

Kembali ke tema tulisan ini. Jadi intinya ketika kita tidak menancapkan flashdisk kita ke dalam komputer sebenarnya virus ini tidak beraktifitas(thread), dia sedang tidur, virus ini akan bangun dan beraktifitas kembali jika ada yang membangunkan, siapa yang membangunkan ? Ya file autorun.inf tadi, yang pasti akan di eksekusi oleh windows kita ketika kita menancapkan flashdisk kita ke dalam komputer.

Sekarang mari kita balik teorinya, jika virus dijalankan lewat autorun.inf dalam flashdisk kita, bagaimana kalo kita dahului si virus tsb, kita buat file autorun.inf dalam flashdisk kita yang masih bersih dan kita setting file tsb dengan attribut hidden dan read-only, sehingga virus atau program lain tidak akan bisa membuat file autorun.inf dalam flashdik kita, karena memang sudah ada file tsb dan memiliki attribut yang read-only(hanya bisa dibaca saja). Masuk akal kan…?

Bagaimana isi file autorun.inf yang kita akan kita buat nantinya, silahkan buka notepad anda dan ketik [autorun] saja dalam file tsb. Lalu simpan ke dalam flashdisk anda dengan nama autorun.inf, jangan lupa untuk mengeset Save as type menjadi All files ketika kita hendak menyimpannya ke dalam flashdisk kita. Setelah itu jangan lupa untuk mengeset file autorun.inf yang baru saja kita buat dengan cara klik kanan dan pilih properties pada file tsb, kemudian centang kotak Read-Only dan Hidden pada bagian attribut properties file tsb. Dengan demikian kita sudah mematikan salah satu langkah virus untuk menulari flashdisk kita dengan virusnya.

Sebagai tambahan, ketika virus menulari flashdisk kita, biasanya virus cuma akan meng-copy dirinya langsung kedalam flashdisk kita tanpa membuat folder, seandainya flashdisk anda dikenali oleh windows adalah G:\ , maka si virus akan mengkopinya langsung ke dalam G:\ sehingga keberadaan virus itu jadi jelas buat kita. Kemudian virus juga biasanya mempunyai ekstension exe, scr, cmd.

Dari sini kita bisa bikin rencana, kita tidak akan membiarkan file dengan ekstension-ekstension tsb mendek dalam flashdisk kita, ketika kita membuka flashdisk kita file tsb harus sudah tidak ada dalam flashdisk kita. Bagaimana caranya ?

Untuk aksi macam ini, rencana kita adalah membuat sebuah file yang dapat dieksekusi oleh autorun.inf tadi, file mudah yang bisa kita buat adalah bat file. Bat file ini akan berfungsi menghapus semua file ber-ekstension exe, scr, atau cmd, setelah sebelumnya bat-file ini mengeset attribut file-file yang mempunyai ekstension-eksetension tsb diatas menjadi tidak hidden dan tidak read-only, bagaimana cara membuatnya? Ikuti langkah-langkah ini:

Buka notepad anda dan ketikkan seperti dibawah ini :

@echo off
ATTRIB -R -H -S *.exe
ATTRIB -R -H -S *.scr
ATTRIB -R -H -S *.cmd

del *.exe
del *.scr
del *.cmd

Penjelasan : perintah ATTRIB akan merubah semua file dengan tiga ekstention tadi jadi tidak Hidden(-H), tidak Read-Only(-R) dan tidak System (-S), sementar perintah del akan menghapus semua file dengan tiga ekstension tadi, ingat perintah del ini akan menghapus semua file dengan akhiran tsb, maka jangan secara sengaja anda meletakkan file ber-ekstension tsb yang memang anda perlukan sama letaknya dengan file run.bat ini, resikonya file anda akan hilang. Simpanlah semua file yang anda perlukan dalam suatu folder yang telah anda buat sebelumnya.

Simpan file tsb dengan nama run.bat dengan lokasi yang sama dimana anda meletakkan autorun.inf. Kemudian rubah attribut file autorun.inf tadi jadi archieve biasa dengan cara mengosongkan centangan Read-Only dan Hidden pada properties file autorun.inf tsbedit file autorun.inf yang telah anda buat tadi. Tambahkan baris ini :


simpan kembali file ini, lalu rubah lagi attribut filenya menjadi Read-Only dan Hidden kembali.

Secara logika setiap anda akan membuka flashdisk anda, windows akan menjalankan file autorun.inf dimana didalam file autorun.inf tsb akan mengeksekusi file run.bat, dan file run.bat ini akan menghapus semua file yang ada langsung dalam flashdisk anda tanpa folder setelah sebelumnya mengeset attribut semua file dengan akhiran tsb dengan settingan tidak read-only, tidak hidden, dan tidak system. Sehingga tidak akan pernah ada file exe, scr, dan cmd, dalam flasdisk anda.

Kekurangan dalam trik ini adalah anda tidak bisa men-double-klick langsung flashdisk anda dalam Explorer My Computer untuk membuka flashdisk anda. Anda harus mengarahkan pointer mouse anda ke address bar windows explorer, baru kemudian membuka flashdisk anda dengan cara meng-klik flashdisk anda yang ada pada address bar tsb. Atau anda mengetik nama flashdisk anda dalam start->run->ketik drive letter flashdisk anda (misal g:\) kemudian tekan enter. Sebab ketika anda double klik maka file run.bat yang dijalankan dan file ini lah yang mencegah anda tidak bisa mendouble-klik flashdisk anda.

Atau mungkin anda ingin coba memecahkan kekurangan ini, silahkan saja, semua terbuka buat anda jika anda mau kreatif dan mempunyai jiwa eksplorasi yang tinggi.

Demikian, semoga bermanfaat.