How To Protect C# Applications From Buffer Overflow Attacks

buffer overflow attack is once the user purposely enters an excessive amount of data in such the way that the program can spill the information across completely different memory locations which can cause bad  behavior like opening another vulnerability for the attack to use.

This works through the utilization of user input. If the information size isn't checked properly before process the information in sure ways in which, it will become prone to a buffer overflow attack.

Protecting from buffer overflow :
we will be using the c-sharp console application(CLI) as an example.

First create a byte array which we will use to store the user input in next, notice that we are giving it a fixed size of 255 bytes.

byte[] byt = new byte[255];

Now we will get some user input.

Console.Readline()

Now let's convert it to a byte array.

Encoding.Default.GetBytes(Console.ReadLine())


Now set it to our previously declared 'bytes' byte array with a fixed size of 255 bytes...

byt = Encoding.Default.GetBytes(Console.ReadLine());


The vulnerability here is that the user can be inputting a string of 256+ bytes or characters so once converted to bytes, it'll be rather more than the 'bytes'; byte array will handle - a most of 255.

To fix this, we are able to merely check the byte count 1st before setting it to the 'bytes' byte array...
string readLine = Console.ReadLine();
if (Encoding.Default.GetBytes(readLine).Length <= 255) {
byt = Encoding.Default.GetBytes(readLine); 

}


Now, if the user enters a string that once regenerate to byte is larger than the 'bytes' byte array will handle, it merely will not arrange to set the 'bytes' byte array to the new input.

Three Top Tips For Protecting Your Smartphone From Damage On Holiday

Three Top Tips For Protecting Your Smartphone From Damage On HolidayMost of us love our technology and spend lots of money on our favourite gadgets. Despite the fact that smart phones only hit the mainstream a few years ago, many people can no longer imagine life without them. The thought of not having permanent internet access and constant contact with friends on social media is unthinkable to so many people.

As we struggle to imagine life without our smartphones, many of us can’t even have a holiday without our favourite gadget. Nowadays, we see people on the beach and by the pool with their phones out. Smartphones aren’t cheap, therefore keeping them in good condition is important. Water damage can completely destroy a phone, so when on holiday, it is important to exercise some caution.

Be careful of the temperature
Smartphones feel the hot and cold and can be affected by extremes in temperature. When overheated or freezing, your phone’s battery and display is affected. Some phones even break completely when subjected to extreme temperatures. The best way to protect your phone from the elements is to ensure that you keep it in the shade when in hot temperatures. If your phone has become overheated, put it in a shaded area to cool naturally. Putting your phone in the fridge is not recommended.

If you take your phone on skiing holidays where conditions are freezing, be sure to keep your phone within an inner pocked where it can benefit from your body heat. Once again, allow your phone to return to its normal temperature at a natural pace, don’t try warming it up quickly with a hairdryer or other warm appliance.

Buy a completely waterproof cover
If you’re planning to take your smartphone to the beach, you’re subjecting it to a whole host of risks. Sand and water can both cause irreparable damage to a smartphone. The problem with sand and water is that these substances get everywhere. Simply having your phone in your bag can be a problem as it is all too easy for sand and water to get inside.

Luckily for technology loving holiday goers, a number of companies have developed completely waterproof cases for smartphones. Some cases are completely waterproof, featuring a ziplock feature and buoyancy aids which enable your trusty phone to rise to the surface rather than sinking. Many of these cases have such advanced technology that your device can be completely submerged, allowing you to take amazing underwater photographs of your holiday.

Purchase a waterproof sheath
 If you don’t want to splash out on a case which is 100% waterproof, you could opt for cheaper waterproof cover. These thermoplastic sheets wrap around your phone and protect all of your phone’s ports, preventing sand, dust and water droplets from damaging your phone. Of course, these sheaths don’t allow you to use your phone as an underwater camera, but it does provide you with additional protection whilst at the beach or at the poolside, assuring you that your all important smart phone won’t get damaged.


Protect Your Information from a Data Breach

Protect Your Information from a Data Breach
Database
If your company has been the victim of a data breach you know how frustrating and time consuming such an event can be. In addition to having to rebuild your databases and inform customers about the issues, there is also a monetary cost associated with replacing and reinforcing lost or stolen records. There are many commonalities that exist in data breaches that will help you anticipate and prevent any such attacks from occurring in your system. Over half of data breaches compromise the servers in a company’s infrastructure and nearly 80 percent happen when there are low security barriers. Lessons can be learned from some of the more extensive breaches in recent history so that you can protect your valuable information moving forward. For example, a cyber-security attack on Central Hudson Gas & Electric in New York impacted around 110,000 customers. Take a look at the infographic below to learn more about the nature of data breaches.

Written by IT Creations, a company an independent wholesale distributor of high-end servers and components in Los Angeles.