Thứ Bảy, 30 tháng 6, 2012

Driver Genius 10: Cập nhật driver mới theo lịch hẹn

Với Driver Genius 10.0, việc cập nhật driver cho các thiết bị sẽ được thực hiện với độ an toàn cao, kèm theo đó là tính năng tự động tải phiên bản driver mới theo lịch hẹn.

Những tính năng mới của Driver Genius Professional 10.0:

- Hỗ trợ tải driver theo thời điểm định trước.

- Cho phép người dùng lựa chọn thư mục chứa driver tải về.

- Kiểm tra các driver tải về để đảm bảo không bị lỗi khi sử dụng.

- Tự động xóa các driver cũ trong kho driver đã tải.

- Tốc độ quét nhanh và độ chính xác cao hơn.

- Cài toàn bộ driver "quá đát" chỉ bằng một cú nhấp chuột.

Bạn tải Driver Genius Professional 10.0 tại đây (dung lượng 6,51MB, tương thích mọi Windows). Từ giao diện chính của chương trình, bạn nhấn Start Scan để kiểm tra nhanh các driver đang sử dụng.

Các driver "quá đát" sẽ hiển thị dưới trường Out of date drivers . Bạn nhấp vào dấu + bên cạnh từng thiết bị để xem chi tiết phiên bản và ngày phát hành của driver đang sử dụng ( Current Driver Version và Current Driver Date ), phiên bản và ngày phát hành của driver mới nhất ( Lastest Driver Version và Lastest Driver Date ). Bạn đánh dấu vào các thiết bị cần cập nhật driver rồi nhấn Fix now .

Trên hộp thoại Driver Download Manager , bạn nhấn Download All và chờ chốc lát để chương trình kết nối với kho driver trên server và tải về giúp bạn. Tốc độ tải của Driver Genius vẫn còn khá chậm và thỉnh thoảng bị "đứt gánh giữa chừng". Vì thế, để tải nhanh hơn (kết hợp với trình tăng tốc tải file), bạn nhấn View driver update details . Trong trang web hiện ra, bạn nhấn Download Now để tải driver về máy.

Xong, bạn nhấn Install để tiến hành cài đặt. Muốn tránh gặp rủi ro sau khi nâng cấp driver, bạn nhấn Yes trong hộp thoại Do you want to create a restore point now để tạo điểm sao lưu hệ thống.

Hẹn lịch tải driver tự động

Driver Genius 10 được bổ sung thêm tính năng tải driver theo lịch hẹn, giúp bạn đỡ mất thời gian tự tay thực hiện.

Bạn nhấn vào mục Options phía trái và chọn Schedule . Tại đây, bạn đánh dấu vào ô Run a schedule driver update scan và thiết lập khoảng thời gian cụ thể phía dưới hộp Period : Daily (hàng ngày), Weekly (hàng tuần), Monthly (hàng tháng), rồi nhấn OK . Khi đến thời điểm đã hẹn, chương trình sẽ tự động "quét" driver mới.

Chọn thư mục lưu driver

Mặc định, các driver tải về được lưu trong thư mục C:\Documents and Settings\Admin\My Documents\DriverGenius (với Windows XP). Để thay đổi sang thư mục khác, bạn nhấn Options , chọn mục Update . Tại trường Download Folder , bạn nhấn Browse , tìm đến thư mục khác rồi nhấn OK .

Sao lưu, phục hồi driver

Để sao lưu toàn bộ driver đang cài trên hệ thống, bạn nhấn mục Back Up Drivers phía trái. Tại hộp thoại Select the drivers you want to back up , bạn đánh dấu chọn hết tất cả driver cần sao lưu rồi nhấn Next .

Tiếp đến, bạn nhấn mũi tên xổ xuống tại trường Select the backup type và chọn một trong các định dạng file sao lưu: Default (lưu dưới dạng thư mục), ZIP Archive (nén thư mục sao lưu thành file .zip), Self-Extracting Archive (nén dưới dạng file .zip có thể tự động xả nén khi nhấp đôi chuột vào file), A uto-Installer Archive (gom toàn bộ driver vào một file .exe duy nhất). Bạn nhấn Browse tại trường Choose a place to save your driver backup files để chọn thư mục chứa file sao lưu. Xong, bạn nhấn Next để tiến hành sao lưu và chọn Finish khi hoàn tất.

Khi cài lại Windows và có nhu cầu khôi phục driver cho các thiết bị, bạn khởi động Driver Genius Professional 10.0 và chọn Restore Drivers . Tại mục Choose a place where you have saved the backup files , bạn nhấn Browse , chọn thư mục đã sao lưu driver và nhấn Next . Với các file sao lưu driver dạng .exe, hoặc .zip tự bung, bạn có thể nhấp đôi vào chúng để khôi phục

Phục hồi driver thông qua file .exe

Thứ Sáu, 29 tháng 6, 2012

Sử dụng NMAP

Nội dung sẽ thực hiện: Ping Sweeps, Port Scans, IP Spoofing và thu thập thông tin.

Part 1/2

Part 2/2

Nguồn videos: Youtube.com
Kimlinh.dt@baomathethong.blogspot.com

Thứ Năm, 28 tháng 6, 2012

Tích hợp Nikto với Nessus

Video hướng dẫn cách chạy Nikto cùng với Nessus



Nguồn video: Youtube.com
Kimlinh.dt@baomathethong.blogspot.com

imollo: Gửi, nhận file từ xa trên desktop

Ứng dụng imollo sẽ tạo cầu nối thật tiện lợi để người dùng hai máy tính có thể chia sẻ và nhận file từ xa ngay trên desktop.

imollo 1.65 hoạt động dựa trên nền Adobe AIR, được cung cấp miễn phí tại http://www.imollo.com/cms/imollo/imollo1_6.air (dung lượng 1,4MB, tương thích Windows XP/Vista/7, Linux, Mac). Nếu máy tính chưa cài Adobe AIR, bạn tải tại http://get.adobe.com/air .

Từ giao diện chính imollo, bạn nhấn nút Create account để khởi tạo tài khoản miễn phí. Xong, bạn dùng tài khoản vừa đăng ký nhập vào hai ô Username , Password rồi nhấn Log in .

Lưu ý: Để trao đổi file với người khác, bạn và người đó đều phải cài đặt imollo và đăng ký tài khoản riêng.

Sau khi đăng nhập, bạn nhấn vào biểu tượng , nhập tên của người cần chia sẻ file vào ô Insert User Name rồi nhấn Add . Sau đó, bạn cần chờ cho đối phương đồng ý kết bạn thì cả hai mới có thể chia sẻ file cho nhau.

Khi đăng nhập imollo, người được mời kết bạn sẽ nhận được thông báo Do you want to add xyz this contact và cần nhấn OK để chấp nhận.

Khi đã trở thành bạn bè, bạn sẽ thấy tên người kia được liệt kê phía phải giao diện imollo. Bạn chỉ việc nhấp chọn tên người cần chia sẻ file, rồi kéo thả file vào ô màu đen phía trái. Nếu muốn chèn thêm ghi chú vào file, bạn nhập nội dung ghi chú vào ô INSERT NOTE rồi nhấn Send . Các file được chọn sẽ nằm phía dưới giao diện, dung lượng và tiến trình upload từng file được hiển thị khá chi tiết.

Để xóa file khỏi danh sách file cần chia sẻ, bạn nhấp chọn file đó và nhấn Remove .

Khi đăng nhập vào tài khoản imollo, người nhận file sẽ thấy hộp thoại thông báo ở góc phải màn hình. Lúc này, người đó chỉ cần nhấn YES để tải file về.

Các file tải về sẽ nằm trong thư mục imollo trên desktop. Các file đã nhận từ nhiều tài khoản imollo khác nhau cũng được phân chia theo từng thư mục khác để bạn dễ quản lý.

Thứ Tư, 27 tháng 6, 2012

Firefox 4.0 Beta 10 lặng lẽ xuất hiện

Bản Firefox 4.0 Beta cuối cùng âm thầm xuất hiện vào sáng nay (26/1) với một vài cải tiến như: vận hành mượt mà hơn, giảm tài nguyên bộ nhớ bị chiếm dụng, cải thiện tính tương thích và ổn định khi dùng Adobe Flash trên Mac OS X, tái hỗ trợ một trình điều khiển đồ họa trong "danh sách đen"  nhằm gia tăng sự ổn định.

Bên cạnh đó, "quá trời" lỗi có trong bản Firefox 4.0 Beta 9 cũng đã được Mozilla xử lý.

Qua kiểm tra với dịch vụ Acid3 , điểm số về khả năng tương thích với các chuẩn web mới nhất của Firefox 4.0 Beta 10 nay đã tăng thêm hai điểm so với bản Beta 9, đạt 97/100.

Trong khi đó, kết quả chẩn đoán với dịch vụ  SunSpider Benchmark  lại cho thấy tốc độ xử lý JavaScript của Firefox 4.0 Beta 10 chậm hơn bản Beta 9 đôi chút. Hy vọng "thành tích bất hảo này" sẽ chấm dứt khi Firefox 4.0 chính thức trình làng vào tháng 2 tới.

Và để chuẩn bị cho sự kiện quan trọng này, Mozilla quyết định khôi phục nút Feedback phía trên góc phải giao diện, tạo điều kiện cho người dùng phản hồi với hãng về những tính năng và thiếu sót còn tồn tại trong các bản Firefox 4.0 Beta. Điều này cho thấy Mozilla mong muốn có bản Firefox 4.0 chính thức thật hoàn hảo để gửi đến cộng đồng.

Hội nghị Black Hat 2012/DEFCON 20 sẽ diễn ra tại Las Vegas

Hội nghị Black Hat năm nay sẽ được tổ chức tại khách sạn Caesar Palace ở Las Vegas, quận Nevada, từ ngày 21 - 26 tháng 7.

Hội nghị năm nay sẽ là nơi gặp gỡ của các nhà lãnh đạo an ninh thông tin, các nhà nghiên cứu bảo mật hàng đầu thế giới đến từ các khối chính phủ và doanh nghiệp.

Sự kiện năm nay sẽ có sự góp mặt đặc biệt của Jared DeMott. Ông sẽ giới thiệu với các bạn về chính khóa học mà ông thiết kế dành cho các nhà nghiên cứu bảo mật, kỹ sư phần mềm quản lý chất lượng và các nhà phát triển bảo mật. Khóa học có tên: "Application Security: For Hackers and Developers."

Bản thân Demott cũng là một nhà nghiên cứu bảo mật cao cấp tại tập đoàn Harris. Tại phiên điều hành hội nghị ông sẽ đưa ra  "bốn kỹ năng kỹ thuật" cần thiết cho các chuyên gia bảo mật:

  1. Kỹ thuật dịch ngược
  2. Kiểm toán mã nguồn
  3. Fuzzing
  4. Kỹ thuật khai thác 

Như chúng ta đã biết Jeff Moss là người sáng lập ra Blackhat đồng thời cũng là người sáng lập ra DEFCON. Năm nay DEFCON 20 sẽ được tổ chức tại khách sạn Rio, Las Vegas, Nevada, Mỹ. Thời gian diễn ra sự kiện kéo dài từ ngày 26 - 29/7/2012.

Danh sách các team tham gia thuyết trình tại DEFCON 20: http://ddtek.biz/qualsDC20scoreboard.html

Tham khảo:

1. http://www.drdobbs.com
2. https://www.blackhat.com
3. https://www.defcon.org

Tác giả bài viết: Hoàng Quốc Vinh, Vương L. Kiều
Nguồn: http://baomathethong.blogspot.com/

Thứ Ba, 26 tháng 6, 2012

Thay ‘áo mới’ cho Windows ngày Xuân

Tết đến, bên cạnh việc trang hoàng mái ấm của mình, bạn cũng nên nhờ Magic Desktop thay luôn "áo mới" cho "người bạn" Windows để không khí Xuân trên máy tính rộn ràng hơn.

Magic Desktop có dung lượng 15,2 MB, tương thích với Windows 7/Vista/XP (tương thích tốt nhất với Windows 7), tải về miễn phí tại đây . Sau khi cài đặt, bạn khởi động lại máy để thay đổi có hiệu lực..

Trên giao diện chính của chương trình, bạn sẽ thấy danh sách các thẻ chức năng, mỗi thẻ đảm nhận một nhiệm vụ "làm đẹp" khác nhau, cụ thể:

- Theme: Cung cấp các "bộ cánh" mới cho Windows, được phân loại theo từng chủ đề như New, Brand, Trend, Fun, Scenery,… Muốn xem danh sách và tải về những "bộ cánh" mới nhất, bạn mở thẻ New , chọn giao diện yêu thích từ bảng Online , nhấn nút Download nằm bên dưới hình minh họa giao diện. Nếu muốn tải cùng lúc nhiều giao diện, bạn chỉ việc đánh dấu chọn trước các giao diện muốn tải về từ bảng Online và nhấn nút Download nằm cuối bảng.

Tải xong, bạn mở bảng Local nằm ngay bên cạnh, chọn "bộ cánh" muốn "khoác" lên Windows từ danh sách rồi nhấn nút Apply .

- Wallpaper: Cung cấp hình nền đẹp mắt cho Windows. Thay vì phải tải về lần lượt từng giao diện và trích xuất hình nền bên trong những giao diện đó, bạn có thể tải trực tiếp hình nền bằng cách chọn nhóm giao diện tại cột bên trái, nhấn chuột lên từng hình nền bên dưới bảng Online để xem minh họa, sau đó đánh dấu chọn trước hình nền muốn tải về rồi nhấn nút Download . Hình nền sẽ lưu trữ trong bảng Local, bạn chọn hình nền muốn "dán" lên desktop từ danh sách và nhấn Apply .

- Visual Style: Chức năng tương tự như Theme, song Visual Style chỉ chứa giao diện thuần, không chứa các thành phần bổ trợ như hình nền, âm thanh, con trỏ chuột.

- Icon: Chứa nhiều biểu tượng lạ mắt cho hệ thống. Mỗi bộ biểu tượng gồm năm biểu tượng chính: My Computer, My Document, Network, Recyle Bin (lúc đầy "rác" và lúc "sạch" rác). Bạn chọn nhóm biểu tượng theo màu sách từ cột bên trái, nhấn chuột lên bộ biểu tượng bên dưới bảng Online để xem minh họa, đánh dấu trước bộ biểu tượng muốn tải rồi nhấn nút Download . Cách áp dụng biểu tượng mới cho Windows tương tự như trên.

- Cursor: Gồm các bộ trỏ chuột theo trạng thái: Static (trỏ chuột tĩnh), Dynamic (trỏ chuột động). Bạn nhấn chuột lên từng bộ trỏ chuột từ bảng Online để xem minh họa, nếu ưng bộ nào thì đánh dấu chọn trước bộ đó rồi nhấn nút Download để tải về.

- My Suits: Tự tạo "bộ cánh" mới theo phong cách của riêng bạn. Bạn chỉ việc áp dụng và kết hợp các thành phần thay đổi giao diện Windows đã hướng dẫn ở trên (gồm Visual Style, Wallpaper, Icon, Cursor ) lại với nhau, nhấn nút Create a suit , đặt tên cho "bộ cánh" mới tại mục Title , giới thiệu về "bộ cánh" made in… "tự tui" tại mục Comments , rồi nhấn nút Capture để chụp hình minh họa. Xong, bạn nhấn nút Save để lưu lại.

Nếu tự tin với "bộ cánh" mới do mình tự tạo, bạn có thể chia sẻ với những người cùng sử dụng Magic Desktop bằng cách nhấn nút Upload tương ứng với giao diện muốn chia sẻ. Sau khi xét duyệt, giao diện của bạn có thể sẽ được xuất hiện trong danh sách những "bộ cánh" mới của Magic Desktop để mọi người có thể tải về

Thứ Hai, 25 tháng 6, 2012

Hash Data với Salt (C#/VB.NET)

Mã dưới đây mô tả cách thức hashing data và kiểm tra hashes, các thuật toán được sử dụng để thực hiện bao gồm: MD5, SHA-1, SHA-256, SHA-384 và SHA-512. 

Để giảm thiểu những kiểu tấn công từ điển nguy hiểm (dictionary attacks), code sẽ gắn thêm các bytes ngẫu nhiên (còn gọi là salt) cho plain text ban đầu trước khi tạo hashes. Hãy nhớ rằng "salt" chỉ giúp các bạn ngăn chặn được kiểu tấn công từ điển dựng sẵn. Nếu 1 kẻ truy cập bất hợp pháp vào hệ thống của bạn và sử dụng phương thức tấn công brute force (brute force attack), "salt" không giúp ích được nhiều cho bạn. Mẫu code cần phải thay đổi để tạo hiệu quả cao hơn cho những ứng dụng trong thực tế. Ví dụ thay vì gắn các giá trị "salt" để tạo hash, bạn có thể lưu trữ chúng vào từng nơi riêng biệt. 

Lưu ý quan trọng: Data hashes không thể giải mã thành dạng plain text.

Sử dụng ngôn ngữ lập trình C#  và Visual Basic.NET để coding

C# code

///////////////////////////////////////////////////////////////////////////////
// SAMPLE: Hashing data with salt using MD5 and several SHA algorithms.
//
// To run this sample, create a new Visual C# project using the Console
// Application template and replace the contents of the Class1.cs file with
// the code below.
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
// EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
//
// Copyright (C) 2002 Obviex(TM). All rights reserved.
//

using System;
using System.Text;
using System.Security.Cryptography;

/// <summary>
/// This class generates and compares hashes using MD5, SHA1, SHA256, SHA384,
/// and SHA512 hashing algorithms. Before computing a hash, it appends a
/// randomly generated salt to the plain text, and stores this salt appended
/// to the result. To verify another plain text value against the given hash,
/// this class will retrieve the salt value from the hash string and use it
/// when computing a new hash of the plain text. Appending a salt value to
/// the hash may not be the most efficient approach, so when using hashes in
/// a real-life application, you may choose to store them separately. You may
/// also opt to keep results as byte arrays instead of converting them into
/// base64-encoded strings.
/// </summary>

public class SimpleHash
{
/// <summary>
/// Generates a hash for the given plain text value and returns a
/// base64-encoded result. Before the hash is computed, a random salt
/// is generated and appended to the plain text. This salt is stored at
/// the end of the hash value, so it can be used later for hash
/// verification.
/// </summary>
/// <param name="plainText">
/// Plaintext value to be hashed. The function does not check whether
/// this parameter is null.
/// </param>
/// <param name="hashAlgorithm">
/// Name of the hash algorithm. Allowed values are: "MD5", "SHA1",
/// "SHA256", "SHA384", and "SHA512" (if any other value is specified
/// MD5 hashing algorithm will be used). This value is case-insensitive.
/// </param>
/// <param name="saltBytes">
/// Salt bytes. This parameter can be null, in which case a random salt
/// value will be generated.
/// </param>
/// <returns>
/// Hash value formatted as a base64-encoded string.
/// </returns>

public static string ComputeHash(string plainText,
string hashAlgorithm,
byte[] saltBytes)
{
// If salt is not specified, generate it on the fly.
if (saltBytes == null)
{
// Define min and max salt sizes.
int minSaltSize = 4;
int maxSaltSize = 8;

// Generate a random number for the size of the salt.
Random random =
new Random();
int saltSize = random.Next(minSaltSize, maxSaltSize);

// Allocate a byte array, which will hold the salt.
saltBytes =
new byte[saltSize];

// Initialize a random number generator.
RNGCryptoServiceProvider rng =
new RNGCryptoServiceProvider();

// Fill the salt with cryptographically strong byte values.
rng.GetNonZeroBytes(saltBytes);
}

// Convert plain text into a byte array.
byte[] plainTextBytes = Encoding.UTF8.GetBytes(plainText);

// Allocate array, which will hold plain text and salt.
byte[] plainTextWithSaltBytes =
new byte[plainTextBytes.Length + saltBytes.Length];

// Copy plain text bytes into resulting array.
for (int i=0; i < plainTextBytes.Length; i++)
plainTextWithSaltBytes[i] = plainTextBytes[i];

// Append salt bytes to the resulting array.
for (int i=0; i < saltBytes.Length; i++)
plainTextWithSaltBytes[plainTextBytes.Length + i] = saltBytes[i];

// Because we support multiple hashing algorithms, we must define
// hash object as a common (abstract) base class. We will specify the
// actual hashing algorithm class later during object creation.

HashAlgorithm hash;

// Make sure hashing algorithm name is specified.
if (hashAlgorithm ==
null)
hashAlgorithm =
"";

// Initialize appropriate hashing algorithm class.
switch (hashAlgorithm.ToUpper())
{
case "SHA1":
hash =
new SHA1Managed();
break;

case "SHA256":
hash =
new SHA256Managed();
break;

case "SHA384":
hash =
new SHA384Managed();
break;

case "SHA512":
hash =
new SHA512Managed();
break;

default:
hash =
new MD5CryptoServiceProvider();
break;
}

// Compute hash value of our plain text with appended salt.
byte[] hashBytes = hash.ComputeHash(plainTextWithSaltBytes);

// Create array which will hold hash and original salt bytes.
byte[] hashWithSaltBytes = new byte[hashBytes.Length +
saltBytes.Length];

// Copy hash bytes into resulting array.
for (int i=0; i < hashBytes.Length; i++)
hashWithSaltBytes[i] = hashBytes[i];

// Append salt bytes to the result.
for (int i=0; i < saltBytes.Length; i++)
hashWithSaltBytes[hashBytes.Length + i] = saltBytes[i];

// Convert result into a base64-encoded string.
string hashValue = Convert.ToBase64String(hashWithSaltBytes);

// Return the result.
return hashValue;
}

/// <summary>
/// Compares a hash of the specified plain text value to a given hash
/// value. Plain text is hashed with the same salt value as the original
/// hash.
/// </summary>
/// <param name="plainText">
/// Plain text to be verified against the specified hash. The function
/// does not check whether this parameter is null.
/// </param>
/// <param name="hashAlgorithm">
/// Name of the hash algorithm. Allowed values are: "MD5", "SHA1",
/// "SHA256", "SHA384", and "SHA512" (if any other value is specified,
/// MD5 hashing algorithm will be used). This value is case-insensitive.
/// </param>
/// <param name="hashValue">
/// Base64-encoded hash value produced by ComputeHash function. This value
/// includes the original salt appended to it.
/// </param>
/// <returns>
/// If computed hash mathes the specified hash the function the return
/// value is true; otherwise, the function returns false.
/// </returns>

public static bool VerifyHash(string plainText,
string hashAlgorithm,
string hashValue)
{
// Convert base64-encoded hash value into a byte array.
byte[] hashWithSaltBytes = Convert.FromBase64String(hashValue);

// We must know size of hash (without salt).
int hashSizeInBits, hashSizeInBytes;

// Make sure that hashing algorithm name is specified.
if (hashAlgorithm == null)
hashAlgorithm =
"";

// Size of hash is based on the specified algorithm.
switch (hashAlgorithm.ToUpper())
{
case "SHA1":
hashSizeInBits =
160;
break;

case "SHA256":
hashSizeInBits =
256;
break;

case "SHA384":
hashSizeInBits =
384;
break;

case "SHA512":
hashSizeInBits =
512;
break;

default: // Must be MD5
hashSizeInBits =
128;
break;
}

// Convert size of hash from bits to bytes.
hashSizeInBytes = hashSizeInBits /
8;

// Make sure that the specified hash value is long enough.
if (hashWithSaltBytes.Length < hashSizeInBytes)
return false;

// Allocate array to hold original salt bytes retrieved from hash.
byte[] saltBytes = new byte[hashWithSaltBytes.Length -
hashSizeInBytes];

// Copy salt from the end of the hash to the new array.
for (int i=0; i < saltBytes.Length; i++)
saltBytes[i] = hashWithSaltBytes[hashSizeInBytes + i];

// Compute a new hash string.
string expectedHashString =
ComputeHash(plainText, hashAlgorithm, saltBytes);

// If the computed hash matches the specified hash,
// the plain text value must be correct.

return (hashValue == expectedHashString);
}
}

/// <summary>
/// Illustrates the use of the SimpleHash class.
/// </summary>

public class SimpleHashTest
{
/// <summary>
/// The main entry point for the application.
/// </summary>

[STAThread]
static void Main(string[] args)
{
string password = "myP@5sw0rd"; // original password
string wrongPassword = "password"; // wrong password

string passwordHashMD5 =
SimpleHash.ComputeHash(password,
"MD5", null);
string passwordHashSha1 =
SimpleHash.ComputeHash(password,
"SHA1", null);
string passwordHashSha256 =
SimpleHash.ComputeHash(password,
"SHA256", null);
string passwordHashSha384 =
SimpleHash.ComputeHash(password,
"SHA384", null);
string passwordHashSha512 =
SimpleHash.ComputeHash(password,
"SHA512", null);

Console.WriteLine(
"COMPUTING HASH VALUES\r\n");
Console.WriteLine(
"MD5 : {0}", passwordHashMD5);
Console.WriteLine(
"SHA1 : {0}", passwordHashSha1);
Console.WriteLine(
"SHA256: {0}", passwordHashSha256);
Console.WriteLine(
"SHA384: {0}", passwordHashSha384);
Console.WriteLine(
"SHA512: {0}", passwordHashSha512);
Console.WriteLine(
"");

Console.WriteLine(
"COMPARING PASSWORD HASHES\r\n");
Console.WriteLine(
"MD5 (good): {0}",
SimpleHash.VerifyHash(
password,
"MD5",
passwordHashMD5).ToString());
Console.WriteLine(
"MD5 (bad) : {0}",
SimpleHash.VerifyHash(
wrongPassword,
"MD5",
passwordHashMD5).ToString());
Console.WriteLine(
"SHA1 (good): {0}",
SimpleHash.VerifyHash(
password,
"SHA1",
passwordHashSha1).ToString());
Console.WriteLine(
"SHA1 (bad) : {0}",
SimpleHash.VerifyHash(
wrongPassword,
"SHA1",
passwordHashSha1).ToString());
Console.WriteLine(
"SHA256 (good): {0}",
SimpleHash.VerifyHash(
password,
"SHA256",
passwordHashSha256).ToString());
Console.WriteLine(
"SHA256 (bad) : {0}",
SimpleHash.VerifyHash(
wrongPassword,
"SHA256",
passwordHashSha256).ToString());
Console.WriteLine(
"SHA384 (good): {0}",
SimpleHash.VerifyHash(
password,
"SHA384",
passwordHashSha384).ToString());
Console.WriteLine(
"SHA384 (bad) : {0}",
SimpleHash.VerifyHash(
wrongPassword,
"SHA384",
passwordHashSha384).ToString());
Console.WriteLine(
"SHA512 (good): {0}",
SimpleHash.VerifyHash(
password,
"SHA512",
passwordHashSha512).ToString());
Console.WriteLine(
"SHA512 (bad) : {0}",
SimpleHash.VerifyHash(
wrongPassword,
"SHA512",
passwordHashSha512).ToString());
}
}
//
// END OF FILE
///////////////////////////////////////////////////////////////////////////////

VB.NET code

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' SAMPLE: Hashing data with salt using MD5 and several SHA algorithms.
'
' To run this sample, create a new Visual Basic.NET project using the Console
' Application template and replace the contents of the Module1.vb file with
' the code below.
'
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
' EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
' WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
'
' Copyright (C) 2002 Obviex(TM). All rights reserved.
'

Imports System
Imports System.Text
Imports System.Security.Cryptography

Module Module1

' <summary>
' This class generates and compares hashes using MD5, SHA1, SHA256, SHA384,
' and SHA512 hashing algorithms. Before computing a hash, it appends a
' randomly generated salt to the plain text, and stores this salt appended
' to the result. To verify another plain text value against the given hash,
' this class will retrieve the salt value from the hash string and use it
' when computing a new hash of the plain text. Appending a salt value to
' the hash may not be the most efficient approach, so when using hashes in
' a real-life application, you may choose to store them separately. You may
' also opt to keep results as byte arrays instead of converting them into
' base64-encoded strings.
' </summary>

Public Class SimpleHash

' <summary>
' Generates a hash for the given plain text value and returns a
' base64-encoded result. Before the hash is computed, a random salt
' is generated and appended to the plain text. This salt is stored at
' the end of the hash value, so it can be used later for hash
' verification.
' </summary>
' <param name="plainText">
' Plaintext value to be hashed. The function does not check whether
' this parameter is null.
' </param>
' < name="hashAlgorithm">
' Name of the hash algorithm. Allowed values are: "MD5", "SHA1",
' "SHA256", "SHA384", and "SHA512" (if any other value is specified
' MD5 hashing algorithm will be used). This value is case-insensitive.
' </param>
' < name="saltBytes">
' Salt bytes. This parameter can be null, in which case a random salt
' value will be generated.
' </param>
' <returns>
' Hash value formatted as a base64-encoded string.
' </returns>

Public Shared Function ComputeHash(ByVal plainText As String, _
ByVal hashAlgorithm As String, _
ByVal saltBytes() As Byte) _
As String

' If salt is not specified, generate it on the fly.
If (saltBytes Is Nothing) Then

' Define min and max salt sizes.
Dim minSaltSize As Integer
Dim maxSaltSize As Integer

minSaltSize =
4
maxSaltSize =
8

' Generate a random number for the size of the salt.
Dim random As Random
random =
New Random()

Dim saltSize As Integer
saltSize = random.Next(minSaltSize, maxSaltSize)

' Allocate a byte array, which will hold the salt.
saltBytes =
New Byte(saltSize - 1){}

' Initialize a random number generator.
Dim rng As RNGCryptoServiceProvider
rng =
New RNGCryptoServiceProvider()

' Fill the salt with cryptographically strong byte values.
rng.GetNonZeroBytes(saltBytes)
End If

' Convert plain text into a byte array.
Dim plainTextBytes As Byte()
plainTextBytes = Encoding.UTF8.GetBytes(plainText)

' Allocate array, which will hold plain text and salt.
Dim plainTextWithSaltBytes() As Byte = _
New Byte(plainTextBytes.Length + saltBytes.Length - 1){}

' Copy plain text bytes into resulting array.
Dim I As Integer
For I = 0 To plainTextBytes.Length - 1
plainTextWithSaltBytes(I) = plainTextBytes(I)
Next I

' Append salt bytes to the resulting array.
For I = 0 To saltBytes.Length - 1
plainTextWithSaltBytes(plainTextBytes.Length + I) = saltBytes(I)
Next I

' Because we support multiple hashing algorithms, we must define
' hash object as a common (abstract) base class. We will specify the
' actual hashing algorithm class later during object creation.

Dim hash As HashAlgorithm

' Make sure hashing algorithm name is specified.
If (hashAlgorithm Is Nothing) Then
hashAlgorithm =
""
End If

' Initialize appropriate hashing algorithm class.
Select hashAlgorithm.ToUpper()

Case "SHA1"
hash =
New SHA1Managed()

Case "SHA256"
hash =
New SHA256Managed()

Case "SHA384"
hash =
New SHA384Managed()

Case "SHA512"
hash =
New SHA512Managed()

Case Else
hash =
New MD5CryptoServiceProvider()

End Select

' Compute hash value of our plain text with appended salt.
Dim hashBytes As Byte()
hashBytes = hash.ComputeHash(plainTextWithSaltBytes)

' Create array which will hold hash and original salt bytes.
Dim hashWithSaltBytes() As Byte = _
New Byte(hashBytes.Length + _
saltBytes.Length -
1) {}

' Copy hash bytes into resulting array.
For I = 0 To hashBytes.Length - 1
hashWithSaltBytes(I) = hashBytes(I)
Next I

' Append salt bytes to the result.
For I = 0 To saltBytes.Length - 1
hashWithSaltBytes(hashBytes.Length + I) = saltBytes(I)
Next I

' Convert result into a base64-encoded string.
Dim hashValue As String
hashValue = Convert.ToBase64String(hashWithSaltBytes)

' Return the result.
ComputeHash = hashValue
End Function

' <summary>
' Compares a hash of the specified plain text value to a given hash
' value. Plain text is hashed with the same salt value as the original
' hash.
' </summary>
' <param name="plainText">
' Plain text to be verified against the specified hash. The function
' does not check whether this parameter is null.
' </param>
' < name="hashAlgorithm">
' Name of the hash algorithm. Allowed values are: "MD5", "SHA1",
' "SHA256", "SHA384", and "SHA512" (if any other value is specified
' MD5 hashing algorithm will be used). This value is case-insensitive.
' </param>
' < name="hashValue">
' Base64-encoded hash value produced by ComputeHash function. This value
' includes the original salt appended to it.
' </param>
' <returns>
' If computed hash mathes the specified hash the function the return
' value is true; otherwise, the function returns false.
' </returns>

Public Shared Function VerifyHash(ByVal plainText As String, _
ByVal hashAlgorithm As String, _
ByVal hashValue As String) _
As Boolean

' Convert base64-encoded hash value into a byte array.
Dim hashWithSaltBytes As Byte()
hashWithSaltBytes = Convert.FromBase64String(hashValue)

' We must know size of hash (without salt).
Dim hashSizeInBits As Integer
Dim hashSizeInBytes As Integer

' Make sure that hashing algorithm name is specified.
If (hashAlgorithm Is Nothing) Then
hashAlgorithm =
""
End If

' Size of hash is based on the specified algorithm.
Select hashAlgorithm.ToUpper()

Case "SHA1"
hashSizeInBits =
160

Case "SHA256"
hashSizeInBits =
256

Case "SHA384"
hashSizeInBits =
384

Case "SHA512"
hashSizeInBits =
512

Case Else ' Must be MD5
hashSizeInBits =
128

End Select

' Convert size of hash from bits to bytes.
hashSizeInBytes = hashSizeInBits /
8

' Make sure that the specified hash value is long enough.
If (hashWithSaltBytes.Length < hashSizeInBytes) Then
VerifyHash =
False
End If

' Allocate array to hold original salt bytes retrieved from hash.
Dim saltBytes() As Byte = New Byte(hashWithSaltBytes.Length - _
hashSizeInBytes -
1) {}

' Copy salt from the end of the hash to the new array.
Dim I As Integer
For I = 0 To saltBytes.Length - 1
saltBytes(I) = hashWithSaltBytes(hashSizeInBytes + I)
Next I

' Compute a new hash string.
Dim expectedHashString As String
expectedHashString = ComputeHash(plainText, hashAlgorithm, saltBytes)

' If the computed hash matches the specified hash,
' the plain text value must be correct.

VerifyHash = (hashValue = expectedHashString)
End Function
End Class

' <summary>
' The main entry point for the application.
' </summary>

Sub Main()

Dim password As String ' original password
Dim wrongPassword As String ' wrong password

password =
"myP@5sw0rd"
wrongPassword =
"password"

Dim passwordHashMD5 As String
Dim passwordHashSha1 As String
Dim passwordHashSha256 As String
Dim passwordHashSha384 As String
Dim passwordHashSha512 As String

passwordHashMD5 = _
SimpleHash.ComputeHash(password,
"MD5", Nothing)
passwordHashSha1 = _
SimpleHash.ComputeHash(password,
"SHA1", Nothing)
passwordHashSha256 = _
SimpleHash.ComputeHash(password,
"SHA256", Nothing)
passwordHashSha384 = _
SimpleHash.ComputeHash(password,
"SHA384", Nothing)
passwordHashSha512 = _
SimpleHash.ComputeHash(password,
"SHA512", Nothing)

Console.WriteLine(
"COMPUTING HASH VALUES")
Console.WriteLine(
"")
Console.WriteLine(
"MD5 : {0}", passwordHashMD5)
Console.WriteLine(
"SHA1 : {0}", passwordHashSha1)
Console.WriteLine(
"SHA256: {0}", passwordHashSha256)
Console.WriteLine(
"SHA384: {0}", passwordHashSha384)
Console.WriteLine(
"SHA512: {0}", passwordHashSha512)
Console.WriteLine(
"")

Console.WriteLine(
"COMPARING PASSWORD HASHES")
Console.WriteLine(
"")
Console.WriteLine(
"MD5 (good): {0}", _
SimpleHash.VerifyHash( _
password,
"MD5", _
passwordHashMD5).ToString())
Console.WriteLine(
"MD5 (bad) : {0}", _
SimpleHash.VerifyHash( _
wrongPassword,
"MD5", _
passwordHashMD5).ToString())
Console.WriteLine(
"SHA1 (good): {0}", _
SimpleHash.VerifyHash( _
password,
"SHA1", _
passwordHashSha1).ToString())
Console.WriteLine(
"SHA1 (bad) : {0}", _
SimpleHash.VerifyHash( _
wrongPassword,
"SHA1", _
passwordHashSha1).ToString())
Console.WriteLine(
"SHA256 (good): {0}", _
SimpleHash.VerifyHash( _
password,
"SHA256", _
passwordHashSha256).ToString())
Console.WriteLine(
"SHA256 (bad) : {0}", _
SimpleHash.VerifyHash( _
wrongPassword,
"SHA256", _
passwordHashSha256).ToString())
Console.WriteLine(
"SHA384 (good): {0}", _
SimpleHash.VerifyHash( _
password,
"SHA384", _
passwordHashSha384).ToString())
Console.WriteLine(
"SHA384 (bad) : {0}", _
SimpleHash.VerifyHash( _
wrongPassword,
"SHA384", _
passwordHashSha384).ToString())
Console.WriteLine(
"SHA512 (good): {0}", _
SimpleHash.VerifyHash( _
password,
"SHA512", _
passwordHashSha512).ToString())
Console.WriteLine(
"SHA512 (bad) : {0}", _
SimpleHash.VerifyHash( _
wrongPassword,
"SHA512", _
passwordHashSha512).ToString())
End Sub

End Module
'
' END OF FILE
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Code Output

COMPUTING HASH VALUES

MD5 : SC4LSYSAkKILp2rPW1ZVpOP1WK7g
SHA1 : E0CfoAleTy9lDL8PmqLlY76jg3k/as3G5DPe
SHA256: p4OqMcDW33DzkGR7+UskcFv75yq/Jb7K49mRwRYHLdw0+HTwq3sS
SHA384: Tq6F1p1Hhan+tGPLOS+T6ltPh7wvTtPqgvgd4BKCTPEGnXCOEQpcrm0IELEjnobkWKY9...
SHA512: UjtzgRAx4BWpMKYb1Qnrhn3Nlj84MrKNX1zJbNW33saM9IEtRmpzn4Ny6Y5oITg3TkSZ...

COMPARING PASSWORD HASHES

MD5 (good): True
MD5 (bad) : False
SHA1 (good): True
SHA1 (bad) : False
SHA256 (good): True
SHA256 (bad) : False
SHA384 (good): True
SHA384 (bad) : False
SHA512 (good): True
SHA512 (bad) : False

Tham chiếu: http://www.obviex.com/samples/hash.aspx
Copyrighted Content: Obviex.com

Tác giả bài viết: Vương Lan Kiều
Source: http://baomathethong.blogspot.com/

Lỗ hổng trên CPU của Intel cho phép attacker kiểm soát hệ thống

US-CERT (trung tâm ứng cứu khẩn cấp máy tính của Mỹ) thông báo trên trang chủ của họ, một lỗ hổng trong chip của hãng Intel có thể cho phép tin tặc giành quyền kiểm soát trên OS Windows và những OS khác.

Lỗ hổng này đã được khai thác trên các phiên bản 64 bit của Microsoft Windows 7, FreeBSD, NetBSD,... Mac OS X không bị ảnh hưởng. Kẻ tấn công có thể thực thi mã độc hại thông qua đoạt quyền kernel hoặc khởi động một cuộc tấn công leo thang đặc quyền cục bộ.

Phần mềm ảo hóa của VMware không bị ảnh hưởng (CVE-2012-0217: mô tả lỗ hổng GP trong SYSRET nhưng SYSRET lại không được sử dụng trong code của VMware Hypervisor, do vậy những sản phẩm của VMware không bị ảnh hưởng). Chỉ lưu ý là những OS khách được cài đặt làm máy ảo có thể bị ảnh hưởng nhưng sẽ được nhà cung cấp khuyến cáo cập nhật bản vá.

Trên Windows, Microsoft đã phát hành bản vá bảo mật (MS12-042) để vá lỗ hổng này.

Những sản phẩm của vendors bị ảnh hưởng

Citrix
FreeBSD Project
Intel Corporation
Joyent
Microsoft Corporation
NetBSD
Oracle Corporation
Red Hat, Inc
SUSE Linux
Xen

Không bị ảnh hưởng:

AMD
Apple, Inc
OpenBSD
VMware
Debian GNU/Linux

Tham khảo:

1. http://thehackernews.com/2012/06/intel-cpu-vulnerability-can-provide.html
2. http://www.kb.cert.org/vuls/id/649219

Tác giả bài viết: Vương Lan Kiều 
Nguồn: http://baomathethong.blogspot.com/