This fragment is about to be reported (you'll remain on this page):

You can enter a comment to clarify the mistake if you would like to:

Posts tagged “in English” RSS20 RSS20

You do not want too long nicknames

The small story of a sneaky XSS. “Hello, Mr. <!--\">”

You do not want too long nicknames

There is a fair share of web applications written without minding any industry standards. Ironically enough, such software quite often beats state of the art pieces – usually because they spend more efforts on actually promoting their product rather than making it overly shiny.

However, this popularity only adds to their potential security impact.

This is a story of one small and indirect XSS I found in a popular PHP gallery engine. I’m not going o disclose the details but I will give them enough to follow me along so you can check if your software isn’t affected.

Long story short: let’s say we have an application tha lets you upload pictures and share them with people. Let’s say it allows registration and that the rules for usernames are quite relaxed. In particular:

«…»

No comments yet | Read rest of this entry »

MS Office 2007 messing up Firefox icons

MS Office 2007 messing up Firefox icons

When people ask me why I don’t like Office 2007 one immediate answer coming to my mind is, of course, ribbon. But today I’ve figured another one – a cause/solution to the problem bugging my system for months.

Generally, after you install Firefox, you get pretty icons on all saved HTMLs and URLs in Windows Explorer. But if you have also installed MS Office (before or after, doesn’t matter) you will get them all wrong like on the picture on the left.

I have tried adding/deleting File Type Associations and looked all over the Registry for the possible cause and couldn’t identify it until today, randomly, I have been wandering there again and decided to compare FirefoxURL (handler for .url that appears with proper icon) and FirefoxHTML. As it turns out Office has registered its own icon handler that, for some reason, doesn’t even work (might be because my XP is 64-bit) and causes Explorer to display standard «unknown file type» icon. What’s more, File Type Associations dialog lets us neither change that handler nor see it’s even registered so all icon changes you can do via that dialog will not be reflected.

So, the solution:

  1. Open regedit.exe from Start → Run
  2. Open HKEY_CLASSES_ROOT and find and open FirefoxHTML entry
  3. You should see ShellEx entry – open it and there should be IconHandler entry
  4. Select IconHandler and confirm that it indeed belongs to MS Office – copy the value of key (the only one) and run Find with that value (check only to look at keys)
  5. Once the Editor finds it you can expand it and open InprocServer32 – on the right pane you should see something like C:\Program Files\MICROS~1\Office12\MSOHEVI.DLL
  6. If everything is fine – go back to FirefoxHTMLShellEx and delete or rename IconHandler
  7. Restart

This should fix the problem and you will be able to once again see proper Firefox icons for saved web pages.

No comments yet | Show this entry »

Upgrading XDove to fix undelivered messages

Upgrading XMail from 1.25 to 1.27 on QNAP fixes quite serious bugs!

A few weeks ago I have posted my guide on Setting up XDove on QNAP QTS 4.0.2. However, since then I’ve ran into a very strange problem: messages to certain domains were not delivered. What’s more, error reports were not delivered to me either! I had no idea something’s going on until I actually learned that the messages were never received. Particularly, gmx.com and qip.ru would reject the messages.

XDove contains XMail Server – open source POP3/SMTP *nix mail server. However, it has no -v flag that you’d expect of a sendmail command so you can’t see commands XMail exchanges with the remote SMTP server. The best way to debug this is to run XMail in debug mode (-Md) that will produce more output in the console. Still, the messages are far from complete:

We now know there’s a syntax error somewhere in the sequence of SMTP commands but where? XMail, as strange as it sounds (for a *nix program especially), provides us with no way of logging all commands it exchanges with remote servers (or they exchange with itself). But even if it did it looks more like a bug then misconfiguration, especially if you google for this error message.

The solution

«…»

One comment already | Read rest of this entry »

Setting up XDove on QNAP QTS 4.0.2

A working guide to successful installation of IMAP-enabled mail server on a QNAP NAS with recent firmware.

QNAP is a company that makes very nice NASes. Their particular niceness is that they have lots of so-called QPKG, or QNAP Packages, to add to their QTS (the name of QNAP NAS OS, something like QNAP Turbo System). Many of them are official – like Video Station (sort of your own YouTube), some of them are 3rd party – like XDove which I’m going to describe here. The main difference is level of support you get.

For some obscure reason all currently up-to-date QPKG that turn your NAS into a mail server are POP3-only. Basically, the only maintained package right now is XMail, which is great and all but doesn’t handle IMAP which is a big step in the 90s in my opinion.

To amend this we will be using XDove – an old package (last updated several years ago) but still working even on the latest QTS firmware version. You only need to apply some fixes. Internally XDove is a combination of XMail and Dovecot that connects to the former to serve IMAP from XMail’s folders.

This guide won’t attempt to fix RoundCube as the problem seems to be somewhat substantial. However, it explains how to fix Uebimiau.

«…»

Popular post (13 comments) | Read rest of this entry »

A fix to Windows XP losing all settings on reboot

Strange enough sometimes my precious XP x64 starts to act in a funny way out of the blue. Today it decided to give me two nonsensical windows when I’ve went to Control Panel to tweak a few things.

First, I’ve discovered that Sound and Audio Devices window looked like this:

As you can see it has lost all system sounds (Windows startup, etc.).

Second, my Power Options looked like this:

«…»

No comments yet | Read rest of this entry »

Reading FreeBSD UFS partitions on Windows

Recently I needed to read FreeBSD’s disk from XP while migrating my old mail server to QNAP NAS. I’ve tried some fancy tools until I’ve found an old but good ufs2tools. There are just two very basic (in terms of usage) command line tools:

  • shbsdlabel.exe 1 – the only argument is path to your drive. This can be retrieved from Disk Management page of Computer Management control panel applet – if attached UFS disk is second in the list its index is 1, etc.
  • shufs2tool 1/1/1 -g /var/ to/here – save the content of /var/ directory into to/here from disk #2 (0-based), slice #1 (slices are 1-based), partition #2 (0-based). Replace -g with -l and omit to/here to just list the content.
No comments yet | Show this entry »

Bypassing interprocess protection for CreateRemoteThread

Ways to cross the session barrier from Windows XP to Windows 7 (and 8?).

That’s a very interesting topic I’ve come across. Recently I had to make an app that injects a DLL into another process. Normal procedure was to use CreateRemoteThread to initiate a thread that loads the library and calls its initial functions with our data placed into that thread’s memory with VirtualAllocEx.

However, this method doesn’t work if our target is running under another user session.

First of all, the method I’ve used to list the processes (to find out the PID) – EnumProcesses – lists only our user’s processes. This was easily fixed by using CreateToolHelp32SnapShot.

Next came the actual access. I have to get process handle by its PID and OpenProcess works great – for my own user. This was overcome by elevating the rights of the loader (my user is administrator and for this I have used Run as Administrator from Explorer’s context menu; alternatively you can rename your .exe so it contains either install or setup which will cause UAC popup when it’s ran).

«…»

No comments yet | Read rest of this entry »

Khan Online: Server emulator notes

Notes on the general structure and initial packets of Khan Online: The Absolute Power by Mirinae.

Khan Online: Server emulator notes

Someone has asked me to create a server emulator for this Mirinae’s MMORPG, shut down in 2008. I have done some preliminary work but the person has lost interest in this project so I’m posting my notes here in case they help somebody else.

All work was done on the client version $12C (dec. 300, which probably stands for 3.0) – taken from the version field of the first packet. KhanClient.exe info for the reference:

Data structures below follow Lightpath notation and use the following common contexts:

Numbers prefixed with dollar symbol ($) are in hexadecimal notation, i.e. $40 equals 0x40 (dec. 64).

«…»

Popular post (6 comments) | Read rest of this entry »