Monday, October 19, 2009

DNS Leak in Firefox 3.5.3 with Dynamic Proxy Switching Add-ons

The DNS leak problem in a simplified scenario: the domain name in the URL address has to be converted to an IP address before the http request can be made. The DNS conversion request and the http request are two separate process performed by different servers. If you have something to hide by using an http proxy, only the http request goes through the proxy. The DNS request may or may not go through the proxy. The implication is that, for example, someone monitoring your activities at your ISP knows approximately when and which websites you are visiting, even though your http requests are encrypted and your IP hidden by the proxy.

DNS leak should be a thing of the past ever since the preference network.proxy.socks_remote_dns was introduced in Firefox 3, the value of which should be set to true to avoid leaks via about:config. However there were some changes in around Firefox 3.5 that made DNS leak possible.

I suppose that the changes are: the DNS and http request are not synchronized or loosely synchronized. This should not affect anything if the proxy selection is static, like editing the Firefox proxy option by hand. DNS leak may occur in dynamic proxy switching add-ons like FoxyProxy. There were no leaks prior to around FF v3.5.

In dynamic switching add-ons, the proxy preference is switched for the http request, but revered to the previous Firefox setting after the request. I would think that the DNS request is made before the correct proxy is selected for the next http request. The previous FoxyProxy, the new Standard and Basic versions all leak DNS requests.

To avoid leaks in FoxyProxy, one must use a sock proxy, and check the global option to use the sock proxy for DNS.

However, one of the free and fast censorship circumvention system, ultrasurf, do not allow socks. In this case, simple and static switching should be used, such as Multiproxy Switch.

There is no DNS leak if you use a VPN - all network request goes through the VPN server. However, if you use a proxy on top of a VPN, any DNS leak from the proxy will be protected by the VPN, but not both.

I use Wireshark for testing. The simple capture filter should be set to "port 53" to capture DNS requests only.

Saturday, October 10, 2009

The Battle with Ants

With the right climate, if you live next to some large open space not under your control, you can't really get rid of all the ants, but only manage it.

If you go to the hardware store to get some ant control stuff, you may be OK for a while, but the labels don't tell you the whole story.

You can call a pest control company. Some gave up, while one company offer to spray every two months instead of three, with expensive "organic" chemicals. It's a waste of money because there are unlimited supply of ants.

You will need the following:
  1. ant spray (for attach to hose)
  2. ant spot treatment (with hand pump)
  3. ant bait
  4. ant poison
  5. sealant
Then you need to understand ant behavior:
  1. nest
  2. travel
  3. food & water
You need to use the right strategies for:
  1. setup environment hostile to ant
  2. emergency treatment
  3. regular control
Ant behavior

Ants live in cool dry places where they may also keep their nest moist. So if you have a yard the best is to cover all areas with working sprinklers, whether you have grass, plants or not.

Ants will find the shortest distance. Moist soil and dense grass or ground cover will take them forever to reach your house. They have eyes and they prefer to travel in the dark. Avoid fixtures in the yard that they can travel under, forcing them to be easily spotted.

Ants need food and water. You are nuts if you plant fruit trees when you live in a giant ant hill. The worst you can get is that ants live inside your house and go outside for food and water. You need to seal off your house. Ant colonies trapped inside the house can be eliminated sooner or later.

Ants are more active in spring due to reproduction cycle, or dry hot summer where they need shelter and water.

Environment

At outdoors, ants like to live in dry cracks like between garden walls and the pavement, between your house and concrete sidewalk, foundations for gate poles, voids in garden paving and ornaments. If you have these you need to seal off the cracks or pour in ant poison, otherwise you have to spray regularly every few months.

Ants may live in trees, typically the top, or under thick trees with loose skins. They are normally harmless but hosting large amounts of ants near your house is bad. It's easy to spray and get rid of them but it's hard to prevent ants from getting back if you have a fruit tree. Ant barriers don't work for me. Even for palm tree, you need to cut off the "fruits" before they become attractive to ants.

Ants are usually found traveling at the under side of external walls just above ground level. This means that you have nests near your house or inside. This part has also the most chance to have cracks for an older house. Avoid any plants or ornaments that make it difficult to spot the ants or any cracks.

For indoors, the most dangerous part is under the kitchen sink where there is moisture, and a lot of cracks and pipes. From there ants will travel all over the kitchen cabinets and beyond. If you can, check for perfect plumbing so your kitchen is completely dry. Seal off any voids due to piping and seal off cabinets from each other if possible. But the most important is to fix any cracks from your house to the outside.

In the kitchen place your stuff in groups such as food, eating utensils etc. Food not in the fridge should be placed in cabinets and shelves above the kitchen sink, but far from ceiling and corners. Under the kitchen sink is only suitable for stuffs that can be sprayed in an emergency, or there's no chance of chemicals getting into your body.

If ants are really desperate looking for shelter, they will enter through air vents in your drying machine, exterior exhaust fans, window frame draining holes and even cracks in the roofs. Try to make these weak points accessible to spot treatment if you have an emergency ant invasion.

Emergency Treatment

If you start treating ants and disturb the equilibrium, it may turn into an emergency at first. Ants living in your house may have to invade your kitchen once they are cut off from outside. When you destroyed an ant nest outside, the ants may have to find a new home inside your home.

If you are overwhelmed by ants inside or outside, it's likely it's time for a large area spray outside the house. Those spray bottles for attachment to a garden hose is easiest. Concentrates for dilution into large spray cans are more accurate. I always use chemicals suitable for plants and grass, unless you like to keep two separate bottles. I also use chemicals specially for ants rather than for multiple insects, unless you have other problems. Your local store usually will stock chemicals that is effective in your area, or most likely you can have a refund.

Most likely these chemicals are not instant kills. But when the chemical get to ant nests and then dry up, they are effective in repelling the ants or killing them.

Lawns in good conditions are rarely problems. Spray on gaps and cracks outside the house, dry areas at trees and brushes, foundations of paths and gates.

Emergency inside the house I use one gallon bottles with a rather powerful hand pump attached for so called spot treatment. I also use chemicals suitable for plants as that is all I need for outdoors other than emergencies. For spot treatment, the ants should die instantly, or at least act irrationally and fall off walls. Use chemical from major stores to make sure that they are safe.

You just need to spray at the corners where the ants travel, and at gaps where the ants come out. Once being forced to the open you can use a microfiber cloth or packing tape to kill the ants. A wet microfiber cloth trap more ants when you wipe at them, and more likely to kill them after you rinse and squeeze it in water.

Regular control

To avoid regular spraying with chemicals, you need to fix all the cracks in your house leading to the outside. And any outdoor fixtures that easily become ant nests. All you need is to watch and follow any long line of ants forming right outside of your house.

If there are large area of hidden voids and no plants, I would pour poison such as boric acid in the form of powder that you can get online. Boric acid is organic so it's rather safe for humans when it gradually get diluted.

If there are small cracks I would pour glue like those white glue for schools. If you cannot "pour", there are those caulk in the form of white glue, for all purpose outdoor sealing, which dries clear, non toxic too.

For larger areas of cracks you need to do proper mending, like speckling compounds for external walls. For outdoor dry areas you can seal it with sand, or sand like sealants that stick together.

Ant barrier granules are pretty useless time after time. I see ants walk straight over them.

Baiting ant outdoors is rather useless because they will just be replaced by another colony. But if your house is sealed off from ants outdoors, you can kill the ants trapped inside by baiting, instead of waiting for them to die slowing from hunger and thrust.

Baits are slow poisons that you allow the ants to bring back to their nests. It does not work for all species. So for some species you are just feeding them instead of killing them. I use boric acid powder mixed with honey and put drops of it on water proof paper under the kitchen sink and where ants are found. I guess it's effective as I can see ants that act like drunk, and have to rest before going home.