Trong khi thử chơi vài cái war game ở
hacktests.com tôi phát hiện ra một sự nhầm lẫn nho nhỏ của Ian Qvist. Và Ian Qvist đã fix ngay lỗi này:
http://hacktests.com/ViewNews.aspx?NewsId=25Có lẽ vì ông bạn Ian Qvist, thay vì viết hết tất cả các lời giải (solution) tôi chỉ viết các chỉ dẫn (hint) để bạn có thể tự mình hoàn thành các challanges ở đây. Các password tôi sẽ ẩn đi để các bạn tự tìm.
JavaScript challangesJavaScript 1:
Bạn cần View-source trang
http://752913a7-9050-4a92-aa02-acd15c6fd39f.hacktests.com/Login.aspxvà bạn sẽ thấy đoạn code sau :
<script language="JavaScript" type="text/javascript">
<!--
var username= "Marin"
var password= "MySecretPassword";
password=prompt("Please enter the login password","");
if (password=="MySecretPassword")
{
window.location.href="http://www.disneylandparis.com";
}
else if (password=="xxxxxxxxxxxxx")
{
window.location.href="xxxxxxxxxxxxx";
}
else
{
window.location.href="http://www.disneylandparis.com";
}
//-->
</script>
Như vậy bạn sẽ nhận được mật khẩu cần tìm.
Congratulations! You completed this level.
To register the site as completed, you need a Password ID.
Password ID: 173c1aa5-xxxx-xxxx-xxxx-xxxxxxxxxxxx

JavaScript 2:
tương tự cái trên bạn cũng view-source và nhận dc đoạn code:
<script language="JavaScript" type="text/javascript">
<!--
var multiply = 1;
var divide = 3;
var plus = 84;
var nr = 2;
var i = 0;
number=prompt("Please enter the correct number","");
multiply = multiply + multiply * multiply;
divide = divide * 4 * divide;
plus = plus * plus - plus + 3;
i = number + multiply + plus * divide + nr;
if (i == 162758)
{
window.location.href="xxxxxxxxxxxxx.aspx";
}
else
{
window.location.href="http://www.disneylandparis.com";
}
//-->
</script>
Bạn để ý dòng
if (i == 162758) , như vậy bạn cần biết JavaScript inline debug để thay đổi giá trị của i, để được cái cần tìm.
Cũng có thể bạn không cần tìm ra i mà vẫn có point bằng cách chạy link :
Run http://352913a7-9050-4a92-aa02-acd15c6fd39f.hacktests.com/
xxxxxxxxxxxxx.aspx get point

JavaScript 3:
View-source:
http://bb3cbf3c-bab4-498a-9baf-12721a6bc0b5.hacktests.com/Login.aspxBạn sẽ nhìn thấy 1 đoạn javascript nhưng xem ra sẽ không nhìn thấy mật khẩu ngay, bạn cần phân tích một chút.
Bạn save file đó về máy và thêm vào như sau nhé :
<script language="JavaScript" type="text/javascript">
<!--
var oxo0x00xox0xoo0xox00xo0x00xox0xoo0xox0 = "83345";
var oxo0x00xox0x0o0x0x0xo0x00xox0xoo0xox0 = "extrastrongpassword";
password=prompt("Please enter the login password","");
newPassword = oxo0x00xox0xoo0xox00xo0x00xox0xoo0xox0.substr(1,1) + oxo0x00xox0xoo0xox00xo0x00xox0xoo0xox0.substr(3,1) + oxo0x00xox0xoo0xox00xo0x00xox0xoo0xox0.substring(0,1) + password.substring(1);
alert(newPassword);
if (newPassword=="348873")
{
window.location.href=password.substring(2,1) + password.substring(1,1) + password.substring(3,1) + "." + oxo0x00xox0x0o0x0x0xo0x00xox0xoo0xox0.substring(4,5) + oxo0x00xox0x0o0x0x0xo0x00xox0xoo0xox0.substring(5,6) + oxo0x00xox0x0o0x0x0xo0x00xox0xoo0xox0.substring(11,12) + oxo0x00xox0x0o0x0x0xo0x00xox0xoo0xox0.substring(1,2);
}
else
{
alert("Go search for the solution");
window.location.href="http://www.google.com";
}
//-->
</script>
Từ đó bạn sẽ suy luận ra kết quả
Hint : kết quả có 3 số , http://bb3cbf3c-bab4-498a-9baf-12721a6bc0b5.hacktests.com/xxx.aspx
JavaScript 4:
View-source:
http://9cf786f3-ddbf-44b4-99cf-7949fadcdc18.hacktests.com/Login.aspxĐây là 1 ví dụ về User Agent Switcher
Bạn cần dùng Firefox và cài đặt (Install) : User Agent Switcher
https://addons.mozilla.org/firefox/59/You need to be viewing this page in the GuardDog 3 browser on the CandyLand operating system, to see the correct image!
Sau đó đổi Agent như thông tin trên và Refresh lại bạn sẽ nhìn thấy 1 hình ảnh ghi mật khẩu.
JavaScript 5:
View-source:
http://254b96e1-d992-4b47-996e-80bbb7f13132.hacktests.com/Login.aspx<script type="text/javascript" src="md5.js"></script>
<script type="text/javascript" src="script.js"></script>
script.js
e=prompt("Please enter username","");f=prompt("Please enter password","");
d=hex_md5(f);
if(e=='jack'&&d=='7b6835b9cd3667f365d2c25bf5261012')
{window.location.href=e+f.substr(0,1)+".aspx";}
else{alert("Wrong password or username");}
==> jack+<1 char>.aspx --> Scan it !
C# application challanges Vì đây là ứng dụng C# nên tôi sẽ trình bày cách đặc thù để vượt qua các ứng dụng kiểu này. Tuy nhiên có rât nhiều cách khác nữa, tôi sẽ trình bày ở các ví dụ khác.
Công cụ : .NET Reflector
http://www.aisto.com/roeder/dotnet/Đây là công cụ tuyệt hảo để decode đối với các project viết trên .NET.
C# application challanges 1:
Dùng công cụ trên decode bạn sẽ nhận được đoạn code :
private static void Main()
{
Console.WriteLine("Please enter your username");
string text = Console.ReadLine();
Console.WriteLine("Please enter your password");
string text2 = Console.ReadLine();
if ((text == "bauer") && (text2 == "xxxxxxxxxxx"))
{
Uri requestUri = new Uri("http://ac61fd17-d9e3-427d-a3df-6ad2b882282d.hacktests.com/xxxxxxx.aspx");
StreamReader reader = new StreamReader(WebRequest.CreateDefault(requestUri).GetResponse().GetResponseStream());
Console.WriteLine("The level password is: " + new Guid(reader.ReadLine()));
Console.ReadLine();
}
else
{
Console.WriteLine("Wrong username or password");
Console.ReadLine();
}
}
Từ đó bạn sẽ nhận được GUID qua nhập user/pass ở trong đoạn code hoặc chạy link ở trên.
Ví dụ này cũng làm tương tự và bận nhận được đoạn code :
private static void Main()
{
Console.WriteLine("Enter username: ");
string text = Console.ReadLine();
Console.WriteLine("Enter password: ");
string text2 = Console.ReadLine();
string text3 = new StreamReader("users.txt").ReadLine();
string text4 = text3.Split(new char[] { ':' })[0];
string text5 = Encryption.Decrypt(text3.Split(new char[] { ':' })[1]);
if ((text4 == text) && (text2 == text5))
{
Console.WriteLine("Your user is in the user database. please wait while you are being authenticated");
string text6 = "?username=" + text4 + "&password=" + text5;
Uri requestUri = new Uri("http://1260108b-6d0f-4c21-8ccc-1b6cda73065c.hacktests.com/Members/Answer.aspx" + text6);
try
{
Console.WriteLine(new StreamReader(WebRequest.CreateDefault(requestUri).GetResponse().GetResponseStream()).ReadToEnd());
Console.ReadLine();
}
catch (Exception exception)
{
Console.WriteLine("An error occurred: " + exception.Message);
Console.ReadLine();
}
}
else
{
Console.WriteLine("Your username and password did not match the one in the database");
Console.ReadLine();
}
}
Cái này thì không đơn giản như cái trên, bạn cần chạy được hàm
Encryption.Decrypt để có thể lấy được mật khẩu.
Vì mật khẩu được mã hóa trong file users.txt
Hanson:AZ1LmvbIFOlxspz9+8EsrG8T5ENoa8XY1LVJ92nimvk=
Đây là kết quả :

Chúc các bạn vui vẻ !