Skip to main content

Posts

DNS Lookup in Java

A simple DNS lookup in Java import java.net.InetAddress; import java.net.UnknownHostException; public class DNSLookup { public static void main(String... args) { InetAddress inet = null; try { final String host = "eradicus.blogspot.com"; inet = InetAddress.getByName(host); System.out.println("DNS Lookup: " + host); System.out.println("IP Adress: " + inet.getHostAddress()); } catch (UnknownHostException e) { e.printStackTrace(); } } } By using the InetAddress API you will be able to obtain the IP address of the target.

Reversing a linked list in C++

Linked list is one of the most popular data structures in Computer Science . Read more about linked lists [here] . In this entry we will write a function to reverse a linked list in C++ efficiently. Link* reverse_list(Link* p) { if (p == NULL) { return NULL; } Link* h = p; p = p->next; h->next = NULL; while(p != NULL) { Link* t = p->next; p->next = h; h = p; p = t; } return h; } Enjoy.

Fiddler Web Debugging Proxy

Here's a useful tool for debugging web apps specifically running in IE versions 8 and below. This is not just limited to applications running on the browser though, it can listen to any application utilizing HTTP / HTTPS. You do not need to configure your proxy settings to redirect traffic, it just works on the fly. IE 9 has Developer Tools in it, more info [here] just like FireBug for Firefox and Chrome Developer Tools. It does not mean that we can not use it though. I would still recommend it for debugging HTTP / HTTPS communication to avoid looking at 3 different tools.

Number of Simultaneous Connections in IIS

So I have reached the testing phase of the anti CSRF / CSS / SQL Injection fixes for a classic ASP web application at work. Luckily it didn’t take me long enough to learn the language. My machine will be used for quality assurance purposes. I have encountered an error regarding the number of simultaneous connections made to my local IIS webserver while running OWASP CSRFTester Project . The fix is simple; just increase the number of simultaneous connections for IIS using the command below: Assuming your PWD is inetpub\adminscripts cscript adsutil.vbs set w3svc/MaxConnections 40 iisreset

Repair Windows 7 System Files

8 out of 10 average PC users have their box’s system files altered by malwares, viruses, etc. We usually reinstall the OS if the antivirus and anti malware software did not perform their job well. Here’s one way to fix the corrupted system files without the need of restarting your Windows 7 box. 1. Run the Command Prompt as Administrator 2. Type the following command C:\Windows\system32\> sfc /scannow 3. After the verification phase, you will receive a message about your system files’ integrity Windows Resource Protection did not find any integrity violations.

Android Intent

What is an Android Intent? - functions like a verb - something like “open contacts manager”, “search contacts”, “call contact”, and etc. - I see it something like a description of a method / action to be performed - used for starting other Activities You can read more about this here: Android Intent