Friday, November 28, 2008

bm.kkwen66.cn

I dont know how This virus attacked my PC on the first place. But, one day, when Firefox started to crash in regular fashion, I found that, every site I browse from FF, the browser sends some request to "bm.kkwen66.cn". Fishy. Even, when I visit google.com, browser communicates with "bm.kkwen66.cn".

My collegue (who's pc is also infected) reported me that, while visiting gmail, chrome prevented him. Saying that the site "bm.kkwen66.cn" is malicious. So, while accessing gmail, in background, browser was communicating with this site! (and chrome is affected too)

Antiviruses could do nothing. So, what I did is simple. I downloaded ghostwall (a free firewall for windows)

Then, I inquired the ip of bm.kkwen66.cn


Then, in ghostwall, I blocked all traffic to and from this IP.
Thats it! I am done. Though, Firefox still tries to communicate with the site, but the firewall blocks. :)



Why used ghostwall? Its free. And, windows build in firewall does not allow you to block specific IP (atleas in XP SP1)

So, if you are experiencing abnormal behaviour in you Firefox, try browsing several sites and keep eyes on you browser statusbar if it is communicating with malicious sites.

P.S.
- In the first screenshot, you see that while pingin to bm.kkwen66.cn, I get destinaton unreachable. Because, by the time I am writing this entry, I have already blocked that site, so ping packets are blocked

- Don't say that the better solution to this is to switching to linux, virus in linux is rare bla bla bla.

Friday, March 21, 2008

Reading files over NETBeui Protocol

I was trying to copy a file from LAN using NETBeui protocol. The destination workstation had TCP/IP and NETBeui, the source workstation only had NETBeui.

I tried Network.DownloadFile(...) in VB.NET and specified path as
"\\host\path\to\file\filename.ext"

but no luck.

Googled and googled, but found nothing.

Then atlast, I tried FileSystem.CopyFile(...) : guess what, it worked! Gosh!!! I rejected using this method on my first thought and now I found out this is the way to do it.

Ok, if you go through the same problem, simply try this.

Sunday, February 24, 2008

Upgrading phpBB3 RC1 to phpBB3 stable directly

This morning, I upgraded www.DBAnalyst.com (a leading forum on finance in Bangladesh) from phpBB3 RC1 to phpBB stable 3.0.0.

Well, let me explain a bit. In lst march, the forum was deployed using phpBB2. Then, after short time, it was upgraded to phpBB3 Release Candidate 1(RC1). Before phpBB3 stable version was published, there were 7 more release cadidates (upto RC8)

Now, when I was thinking of upgrading to stable version from RC1, then I found that no direct updating package is available from RC1. I had to upgrade by cahin: Rc1->RC2->..->RC8->Stable 3
That was quite unexpected. I didnt find any direct way for this. So, I made out a way.

Here are the steps (assume table prefix for my deployment (RC1) was phpbb_):

1. Deleted all files of previous forum
3. Downloaded and unzipped new version
3. Installed new version as fresh install (using different table prefix, say phpbb3_)
4. Did not delete the install folder
5. manually edited the config.php file, changed the table prefix to the old one (phpbb_)
6. Executed in web browser http://forum_url/install/database_update.php
7. Using phpMyAdmin, deleted all the tables created for the fresh install (phpbb3_), because we will be using the old tables prefixed phpbb_.

This process is safe. You can try this.

Thursday, February 14, 2008

MFC Print Preview problem solved

Today, I was adding Print Preview option in my current project. MFC has made this process very easy. But, the application tended to crash if I invoked the print preview. This was the flow:

>CView::OnFilePrintPreview()
>>AFXAPI _AfxCheckDialogTemplate(LPCTSTR lpszResource, BOOL bInvisibleChild)
>>>HINSTANCE hInst = AfxFindResourceHandle(lpszResource, RT_DIALOG) <<<----- Bingo!! this fails

lpszResource = 0X7803 which is for print preview dialog. But, my app seems
not being able to locate it!

The trace message was :
ERROR: Cannot find dialog template with IDD 30723.

By the by, my app uses MFC in static library. I googled, but found that many
others faced same questions, some found the reson (not being able to locate
the resource), but could not get any solution from the internet.

Then, after much R&D + thinking, I found the solution.

If you face the same problem, just follow these simple steps:

1. Open your project's resource file (*.rc) in text editor

2. find this (including the quotes)
"#include ""afxres.rc"" // Standard components\r\n"

3. Add the following line after that line (including the quotes)
"#include ""afxprint.rc"" // printing/print preview resources\r\n"

4. Find this
#include "afxres.rc" // Standard components

5. Add the following line after that line
#include "afxprint.rc" // printing/print preview resources


----------- You are all done ---------------

Happy programming!

By the way, I am using VS2005

Monday, February 11, 2008

Simple but useful tip for SQL Injection on MySQL

If you are trying SQL Injection on MySQL database, then keep in mind --

In MySQL, the -- ” (double-dash) comment style requires the second dash to be followed by at least one whitespace or control character (such as a space, tab, newline, and so on). This syntax differs slightly from standard SQL comment syntax

Best of luck...