Attacks against women are one of the most problematic areas of law and order, especially in poorer countries. Most attacks that take place on a large scale also involve sexual attacks on the women (especially in situations where a community or members of one community attack one another). However, even otherwise, in poorer countries or poorer regions, the cause of law and order is never as serious as it would be in the more well off regions.
There are a much larger number of people in the same area, complaints made by women are not investigated with the same intensity and all this encourages such attacks. It is rare that women are able to get an upper hand; this incident shows a specific case where a lady managed to get the upper hand on the person who attacked her, and left him with a grievous wound. One does not encourage breaking of the law, but actions taken in self-defense are normally fine (link to article):
A 40-year-old Bangladeshi woman cut off a man's penis during an alleged attempted rape and took it to a police station as evidence, police in a remote part of Bangladesh said on Monday. The woman, a married mother of three, was attacked while she was sleeping in her shanty in Jhalakathi district, some 200 kilometres (120 miles) south of Dhaka, on Saturday night, officers said.
"As he tried to rape her, the lady cut his penis off with a knife. She then wrapped up the penis in a piece of polythene and brought it to the Jhalakathi police station as evidence of the crime," police chief Abul Khaer said.