Posterous theme by Cory Watilo

Singnet Block Port 80?

Recently, I needed to access my home network from behind some restrictive networks. The only ports that were open was 80 and 443 (SSL), oh and I almost forgot to mention its through an internal proxy only. Yeah, not just any simple proxy such as squid. This proxy have the ability to terminate SSL traffic to inspect the contents and even actively make security decisions such as blocking the site if its cert is self signed. So this is where the problem lies. I usually connect back home using HTTPS and it works fine at most places. But this time round, it doesn't let me through unless my SSL cert back home is signed by some trusted CA. Of course I'm not willing to spend hundreds of dollars to get the SSL cert signed. 

So that leave me with port 80. I changed the inbound ports to 80 and... it can't work! From what I could recall, 1 or 2 years back it was working fine back then. So could my ISP be blocking port 80? Lets find out shall we?

1screen_shot_2011-06-16_at_am_1

I've configured the NAT to forward request from port 80.

0screen_shot_2011-06-16_at_am_1
So its blocked. Lets try incrementing the port number to 81 and see what happens.

Screen_shot_2011-06-16_at_am_1

The inbound port is set to 81.

3screen_shot_2011-06-16_at_am_1
aaaand.... success!

2screen_shot_2011-06-16_at_am_1

This is really Singet (I left the first 2 octets uncensored) as you can see. I wonder is there any ISP that dosen't block port 80? A few years back, I've heard people complaining that Starhub is blocking port 80 and some of them switched over to Singnet because of that. That is also a big reason why I've stayed with Singnet for so long. Dissapointed /sigh...

Ants Walking In Circles

(download)

WTF is with these ants LOL.

[UPDATE] Seems like the scale of circling ants on my kitchen table is small compared to this. When I was posting this video, the same thought crossed my mind. Why does the ants after millions of years of evolution still haven't solved this deadly problem?

iPhone Restore Woes

It's been a long time since I last jailbroken any iOS devices. There was a time where I thought I couldn't live without jailbreaking my iOS device. But over time, I started to get frustrated with the constant need to manually update apps not just when the developer pushes out a newer version of the app but also due to iOS platform updates. It's manageable if you only have a handful of cracked apps on your device but if you have a ton of cracked apps on it, and you didn't diligently update every single one of them, you'll end up with a bunch of useless apps that just crash upon launching. That's why I decided to go down the official/legit route quite sometime ago. 

Anyway this is how the main story goes. Today one of my aunt approached me for a favor; To restore her iPhone 3GS back to factory default. Of course I agreed, I thought to myself how hard could a firmware restore be? After she passed me the phone, I realized the phone is a jailbroken phone. It would be nice if I jailbreak the phone for her. Even though I haven't jailbroken a iOS device for more than a year and has already lost touch with developments in the jailbreaking scene. I thought to myself again, how hard can jailbreaking be? Having DFU mode in the iPhone, I thought iPhone is practically unbrickable, right? No! 

Restoring the iPhone's firmware back to factory default is easy. Done within 10 minutes! After I finished restoring iPhone back to  factory defaults, I attempted jailbreak it. I used redsn0w to jailbreak it. This is where I made the biggest mistake, maybe because I always had the misconception that the iPhone is unbrickable and if anything goes wrong, Just enter DFU mode to restore firmware. Or maybe I was a bit too greedy and naïve, I blindly checked the "install iPad baseband" option without fully understanding what that means.
Screen_shot_2011-02-03_at_pm_0
For some reason which until now I still don't understand. Cydia wasn't installed properly on the phone. Cydia just crashed immediately upon launching. So I thought to myself, maybe I should try again, just restore the firmware back to factory default and try the redsn0w jailbreak tool again. I went ahead to restore the firmware back to factory default by simply pressing the restore button in iTunes. For the most part of the process everything went smoothly until when the restore was just about to finish, I was greeted with this dreaded message.
6a0120a619c18e970c0128778560a3

I tried to restore several times. Time and time without fail, I would be greeted by this dreaded message. By then I'm starting to panic as the iPhone seems to be be stucked permanently in recovery mode! I just can't get the firmware on the phone!
Iboot
After several hours of googling, I've started to understand what's the problem. I should have paid more attention to redsn0w's warning dialog in the first place which states that after updating iPhone's baseband with iPad's baseband and starting with iOS firmware 4.2.1. I'll need to restore the iPhone using custom firmware if there's ever a need to. 

If I had read the warning carefully and knew that custom firmware is needed to restore the phone in the future, I would not have checked that option. Anyway installing iPad baseband is just to unlock the phone from cellphone carriers. I actually don't need that feature. But, I must say that using iPad's baseband firmware in iPhone is a very clever method to undermine Apple's effort to lockdown phones to carriers by using another Apple product. The baseband processor is a dedicated processor for processing digital communication signals (telephony, 3G, EDGE, etc..). The baseband processor also have its own firmware. Apple locks the phone to certain carriers by programming the baseband processor to only talk to certain carrier's base stations. But iPad is sold from Apple retail store and not tied directly to any telco. Customers can choose to get 3G service from whichever telco they wish therefore iPad's baseband processor can talk to any carrier base station as long as the proper SIM card is inserted. The hackers realized (not surprisingly) that iPhone and iPad is using the same baseband chip. So to "upgrade iPhone's baseband to iPad" means loading iPad's baseband processor firmware onto iPhone in a way reprogramming the iPhone's baseband processor into iPad baseband processor. I guess with a different baseband firmware loaded, iPhone 3GS's iOS probably doesn't recognize the baseband processor anymore (probably by design) as iPhone 3GS iOS v4.2.1 dosen't contain the faux iPad baseband processor "driver". So this explains the need for a custom firmware (that probably contains the iPad baseband processor "driver").

But wait... the story dosen't end here just yet! If you are designing iPhone, a device that allows the end user to update its firmware. You'll definitely want to make sure there are safeguards in place to ensure if the user uploaded a corrupted firmware, the device will not accept and run it. So you'll want the device to run integrity and authenticity checks on the the firmware before accepting it. This is where pwned DFU mode comes in. In pwned DFU mode, those safeguards to ensure firmware integrity and authenticity are gone so custom firmwares can be loaded. 

This is how a simple firmware restore that usually takes 10 minutes ended up taking hours.

Arduino

Img_2365

After seeing lots of cool Arduino based projects on Engadget and Gizmodo, I decided to get one myself to get into hardware programming. I bought this off sgbotic.com. The kit cost $136.90. 
The best thing about the Arduino is its straightforward development environment. The Java based IDE, is very clean and simple, totally idiot proof. There is only one row of buttons on top, compile, stop, new file, open file, save file, upload to Arduino and serial monitor. The language used is actually C/C++. Arduino's standard library is very useful and easy to use.

Screen_shot_2010-12-12_at_pm_11

After going through some of the tutorial exercises in the booklet that was bundled in the package, I felt confident enough to start building something rudimentary but original. I ended up building a row of LED controlled by 2 buttons. Although there's enough digital pins on Arduino for 8 LED's, I thought it would be more challenging to use a shift register to control 8 LED by using just 3 input pins on Arduino. 
Img_2362
Just 3 pins to...
Img_2364
8 pins! The shift register is kinda like a demultiplexer. It receives serial data and converts it into parallel outputs which drives these LEDs.
Img_2358
Each of these LEDs are connected to one of the output leg of the 74hc595 shift register. So for example if the shift register receives a binary byte 10101010 (which is equivalent to 170 decimal), the first, third, fifth and so on... LED will light up. Anyway, to light up individual LED means some calculation is required, not as straightforward  as turning it on directly from Arduino. So turning on the 4th LED from the left means 0001000 (16 decimal) have be sent to the shift register and turning on the 3rd means 00100000 (32 decimal) needs to be sent to the shift register. See a pattern? So to switch on the left LED and switch off the right LED just have to x2.

Img_2366

 

(download)

Akamai State of the Internet Report

Going through Akamai's 2010 State of the Internet report on this chilly Sunday morning. I've noticed some rather interesting points in the report.

  1. Port 445 (Microsoft-DS) is the most attacked port
  2. Singapore's average network speed is 2722 Kbps


Screen_shot_2010-12-07_at_pm_09

In reviewing observed attack traffic originating in known mobile networks, Port 445 was, for most network providers, far and away the most targeted port, likely indicating user populations with insufficiently patched systems running Microsoft Windows OS variants that are connecting to mobile networks, as opposed to malware running on smart- phones and similar mobile devices.

This reminds me of 2001 - 2003 days where broadband internet was starting to gain popularity in Singapore and blaster worm was going crazy. Most families only had 1 PC that was connected directly to the internet via the modem. But as time passed, households started to have more computers more people needed to be connected to the internet so "home routers" started to come into the picture. Network Address Translation (NAT) function of these routers provided good protection against attacks as attacker can't try to access any port on your PC anymore (unless they are explicitly port forwarded). Because of the protection NAT offered at home, most users don't bother about firewalls on their machines. Fast forward to today. Today with cheap mobile internet plans (yay!), more people are connecting directly to the internet again, this time its via USB 3G modem. 

Screen_shot_2010-12-07_at_pm_09

This is from 2 years back (2008). Even then when RPC DCOM exploit was all the rage, attack traffic targeting it was just 29.96%

Screen_shot_2010-12-07_at_pm_09

So our average network speed is just 2722Kbps? Just 11% have 5 meg+ connections? Makes me wonder who is buying 100 meg. NVM, we are on the verge of complete fiber rollout. I guess we'll have to wait for OpenNET to finish installing FTTH and then we'll see how much improvement it makes. 

SSD

Well, yesterday I took the plunge and bought an SSD. After some research, I was deciding between Intel X25M 2nd gen 120GB or OCZ Vertex 2 120GB. Eventually I went with OCZ purely because better performance and newer tech (SSD is *NOT* just a bigger version of your USB thumb drive). There was a time where Intel SSD was the only SSD on the market that wasn't crap and worth buying but with the introduction of SandForce based SSD, things have changed. Anyway, I got this for SGD388. It's definitely still very expensive compared to traditional spinning drives. 

Img_2338-w1024

Sticker Shock!!! That's the old pricing. Shows how fast the price drops.

Img_2335-w1024

The packaging is really small. About the size of a typical CD album.

Img_2341-w1024

Img_2344-w1024
Img_2343-w1024

The underside...

So nuff pics. The most important question is how well it performs? My desktop is actually quite old probably around 3 years old. Still using AMD Athlon 64bit X2 5000+ with just 2 gigs of RAM running on Asus n2npv-vm, a 4 year old MB! 
Disk_benchmark
Quite impressive eh? Benchmarks are benchmarks how about real world performance? I'd say the difference between this SSD and my old HDD is day and night. Everything is so much snappier, I don't need to take out a stopwatch to time much faster apps launch, it definitely feels much, much faster. The system is also much more responsive, especially multitasking where several IO intensive apps compete against each other for the HD. One example would be playing games while AV is doing a complete system scan. On my old spinning drive, running AV scans while playing games is essentially a no go. Now I can even run AV scan while installing apps and watching HD movies at the same time and the system is still responsive. I think its the SSD's extremely high random read speed that allows the system to stay responsive even under heavy IO loads. For now, IMO its better to spend money upgrading your spinning drive to a good SSD rather than upgrading processor (unless your processor is really old, then in that case you'll have to rebuild a whole new system right?). Either way I think SSD is the future. Once you tried (good) SSD you'll never want to go back to HDD again.