Tuesday, May 27, 2008

Fun with Binary and ASCII

Wanna have fun with Binary and ASCII stuff...

 

open command prompt. Press ALT key and while key is kept pressed, type the Binary code for 'A', which is 1000001. Now, when you will release the ALT key, you will get 'A' printed on prompt. But if you try typing Binary of 'B' (1000010), you will get 'J'.

WHY???

The answer is simple...

Console does not understand Binaries. Instead, it works with ASCII codes. If you press ALT key and type some ASCII code, it will print the character equivalent of that ASCII. In case the number is larger than 256, it will be divided by 256 and remainder will be treated as the new number to be evaluated. As a matter of fact, when we mod binary code or 'A', we get ASCII code for 'A' itself. But in binaries of 'A' and 'B', there is a difference of 10 decimal numbers. So J is printed.

 

So, just hv fun with other binary stuff.     

Friday, May 23, 2008

Detect SQL Server Instances in Network

If you want to detect all accessible instances of SQL Server, simply create a .NET project and add a COM reference to Microsoft SQLDMO

 

Now Open your code file and paste this code in a function...

 

Dim sqlServers As SQLDMO.NameList

Dim sqlServer As String

' Get a list of servers

sqlServers = New SQLDMO.Application().ListAvailableSQLServers

For Each sqlServer In sqlServers

Response.Write(sqlServer,"<br>")

Next

 

 

When you will call this function, list of all accessible SQL Server instances will be printed on screen.

:)

Thursday, May 15, 2008

URL/IP Obfuscating

Hi guys,

I am back with a new trick. This time we will obfuscate URL and IP Address. But before that, a warning...

 

This hack will not work on browsers behind Proxy/Firewall. Also, only IP Addresses can be obfuscated by this technique. So any complete URL, rendering to an IP Address can be used. No Sub-domains

 

So Here we go.

This technique will convert URL looking like http://www.google.com to something like http://0xD1559968

 

How to do...

 

Step 1: Get IP Address for URL you want to obfuscate. Easiest way to do so is go to command shell by typing "cmd" at run (Win Key + R)

Step 2: Now perform calculation on this IP Address using the following example...

firstoctet * 256 + secondoctet = * 256 + thirdoctet = * 256 + fourthoctet = your new address!

 

Let's do this with an example...

URL: http://www.google.com

IP Address: 209.85.153.104

Calculation:

     209 * 256 + 85 = 53589

     53589 * 256 + 153 = 13718937

     13718937 * 256 + 104 = 3512047976

Now you can check site http://3512047976

To make things even smarter, convert this number to HEX. You can use the normal calculator (Start » All Programs » Accessories » Calculator) for this. It has a scientific mode in which it will convert any number from DEC to HEX. From there you will get http://0xD1559968

 

So here you go....

 

Obfuscate IPs and URLs, and have fun.

Just remember to get away from any PROXY or Firewall.

And no sub-domains.

Thursday, May 01, 2008

URL Encryption

 

Are you looking forward to encrypt URL through JavaScript and retrieve it. Well this is particularly helpful for people using AJAX's Refresh functionality as I mentioned in my post at  http://vikramjits.blogspot.com/2008/05/ajax-refresh-problem.html

 

All you have to do is download this JavaScript file and call function encrypt/decrypt when calling a page.

 

e.g.

 

Step 1 (as mentioned in other Post) will now become...

var Crawl = window.location.hash;
    if (Crawl.length > 1)
     {
        Crawl = unescape(Crawl.replace('#',''));
        Crawl = 'AjaxPages/' + decrypt(Crawl) // + window.location.search;       
         getPage(Crawl);
     }
    else
     {
        getPage('AjaxPages/default.asp');
     }

 

Similarly, when adding to has, write

window.location.hash = escape(encrypt(Hash));

 

Download JavaScript File