Thursday, September 28, 2006

SOME HANDY STUFF IN MY MEMORY......

Increasing System Performance

If you have 512 megs or more of memory, you can increase system performance
by having the core system kept in memory.

  1. Start Regedit
  2. Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\DisablePagingExecutive
  3. Set the value to be 1
  4. Reboot the computer
..........................

Common Command Console Utilities

WindowsXP comes with quite a few console utilities you can easily run from the command line:

Computer Management - compmgmt.msc
Disk Managment - diskmgmt.msc
Device Manager - devmgmt.msc
Disk Defrag - dfrg.msc
Event Viewer - eventvwr.msc
Shared Folders - fsmgmt.msc
Group Policies - gpedit.msc
Local Users and Groups - lusrmgr.msc
Performance Monitor - perfmon.msc
Resultant Set of Policies - rsop.msc
Local Security Settings - secpol.msc
Services - services.msc
Component Services - comexp.msc

Wednesday, September 20, 2006

Decompress Zip files with Windows Shell API and C#

Introduction

With this code you can use the Windows Shell API in C# to decompress Zip files and do so without having to show the Copy Progress window shown above. Normally when you use the Shell API to decompress a Zip file it will show a Copy Progress window even when you set the options to tell Windows not to show it. To get around this, you move the Shell API code to a separate executable and then launch that executable using the .NET Process class being sure to set the process window style to 'Hidden'.
Background

Ever needed to decompress Zip files and needed a better Zip than what comes with many of the free compression libraries out there? I.e. you needed to compress folders and subfolders as well as files. Windows Zipping can compress more than just individual files. All you need is a way to programmatically get Windows to silently decompress these Zip files. Of course, you could spend $300 on one of the commercial Zip components, but it's hard to beat free if all you need is to decompress folder hierarchies.
Using the code

The following code shows how to use the Windows Shell API to decompress a Zip file. The source folder points to a Zip file. The destination folder points to an output folder. This code as is will decompress the Zip file, however it will also show the Copy Progress window. To make this code work, you will also need to set a reference to a COM library. In the References window, go to the COM tab and select the library labeled 'Microsoft Shell Controls And Automation'.

Shell32.ShellClass sc = new Shell32.ShellClass();
Shell32.Folder SrcFlder = sc.NameSpace(strSrcPath);
Shell32.Folder DestFlder = sc.NameSpace(strDestPath);
Shell32.FolderItems items = SrcFlder.Items();
DestFlder.CopyHere(items, 20);

The sample solution included with this article shows how to put this code into a console application and then launch this console app to decompress the Zip without showing the Copy Progress window.

The code below shows a button click event handler that contains the code used to launch the console application so that there is no UI during the decompress.

private void btnUnzip_Click(object sender, System.EventArgs e)
{
System.Diagnostics.ProcessStartInfo i = new
System.Diagnostics.ProcessStartInfo(
AppDomain.CurrentDomain.BaseDirectory + "unzip.exe");
i.CreateNoWindow = true;
string args = "";

if(txtSource.Text.IndexOf(" ") != -1)
{
//we got a space in the path so wrap it in double qoutes
args += "\"" + txtSource.Text + "\"";
}
else
{
args += txtSource.Text;
}

if(txtDestination.Text.IndexOf(" ") != -1)
{
//we got a space in the path so wrap it in double qoutes
args += " " + "\"" + txtDestination.Text + "\"";
}
else
{
args += " " + txtDestination.Text;
}
i.Arguments = args;

//Mark the process window as hidden so
//that the progress copy window doesn't show
i.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
System.Diagnostics.Process p = System.Diagnostics.Process.Start(i);
p.WaitForExit();
MessageBox.Show("Complete");
}

Sunday, September 17, 2006

Request on defacing a Webpag......


I HIGHLY RECOMENED NOT TO VIST THAT SITE.

Im really sad and angry on what i saw today in the internet, while i was searching about maldives , i have seen a link that says listen to maldives radio (http://www.sidahitun.com/) (luckly its Access Denied from the root administrator of the ISP......thnk god they have done this....) , i know that VOM site online listing to saw under maintaince so i thought that i will give try...............shit i could'ent belive on what i saw. THEY ARE TRYING TO SPREAD CHRISTIAN RELIGION ON MALDIVES AND THEY ARE HAVING DHIVEHI VERSION OF BIBILE TOOO………SHIT I JUST NEVER LISTED TO IT BUT I TOOK SOME SCREEN SHOTS…….I WAS SO PISSED OFFF…… .. CHECK OUT THE PIC BELOW.......

I HIGHLY RECOMENED NOT TO VIST THAT SITE...............

Thursday, September 14, 2006

Attack On Internet Called Largest Ever

Attack On Internet Called Largest Ever
David McGuire and Brian Krebs, Washington Post 2002-10-23

The heart of the Internet sustained its largest and most sophisticated attack ever, starting late Monday, according to officials at key online backbone organizations.
Click here for Core!! Around 5:00 p.m. EDT on Monday, a "distributed denial of service" (DDOS) attack struck the 13 "root servers" that provide the primary roadmap for almost all Internet communications. Despite the scale of the attack, which lasted about an hour, Internet users worldwide were largely unaffected, experts said.

FBI officials would not speculate on who might have planned or carried out the attack.

David Wray, a spokesman for the FBI's National Infrastructure Protection Center (NIPC), said the bureau is "aware of the reports and looking into it."

DDOS attacks overwhelm networks with an onslaught of data until they cannot be used. According to security experts, the incident probably was the result of multiple attacks, in which attackers concentrate the power of many computers against a single network to prevent it from operating.

"This was the largest and most complex DDOS attack ever against the root server system," said a source at one of the organizations responsible for operating the root servers.

Ordinary Internet users experienced no slowdowns or outages because of safeguards built into the Internet's architecture. A longer, more extensive attack could have seriously damaged worldwide electronic communications, the source said.

Internet Software Consortium Inc. Chairman Paul Vixie said that if more servers went down, and if the hackers sustained their hour-long strike a bit longer, Internet users around the world would have begun to see delays and failed connections.

Chris Morrow, network security engineer for UUNET, said "This is probably the most concerted attack against the Internet infrastructure that we've seen." UUNET is the service provider for two of the world's 13 root servers. A unit of WorldCom Inc., it also handles approximately half of the world's Internet traffic.

DDOS attacks are some of the most common and easiest to perpetrate, but the size and scope of Monday's strike set it apart.

Vixie said only four or five of the 13 servers were able to withstand the attack and remain available to legitimate Internet traffic throughout the strike. "It was an attack against all 13 servers, which is a little more rare than an attack against any one of us," he said.

The server Vixie operates was available throughout the attack, he said.

Internet addressing giant VeriSign Inc., which operates the most important server from an undisclosed Northern Virginia location, reported no outages.

"VeriSign expects that these sort of attacks will happen and VeriSign was prepared," company spokesman Brian O'Shaughnessy said.

Vixie said he was unwilling to compare the attack to others he has witnessed in more than two decades of involvement with Internet architecture, but said it was "the largest in recent memory."

The root servers, about 10 of which are located in the United States, serve as a sort of master directory for the Internet.

The Domain Name System (DNS), which converts complex Internet protocol addressing codes into the words and names that form e-mail and Web addresses, relies on the servers to tell computers around the world how to reach key Internet domains.

At the top of the root server hierarchy is the "A" root server, which every 12 hours generates a critical file that tells the other 12 servers what Internet domains exist and where they can be found.

VeriSign manages its servers under contracts with the Commerce Department and the Internet Corporation for Assigned Numbers (ICANN), which manages the DNS.

One rung below the root servers in the Internet hierarchy are the servers that house Internet domains such as dot-com, dot-biz and dot-info.

The DNS is built so that eight or more of the world's 13 root servers must fail before ordinary Internet users start to see slowdowns.

"There are various kinds of attacks all the time on all sorts of infrastructure, and the basic design of the Internet is such that it is designed to withstand those attacks," said ICANN Vice President Louis Touton. "We're not aware of any users that were in any way affected.

"Obviously the prevalence of attacks does make it important to have increased focus on the need for security and stability of the Internet," he added.

Most often, the computers used in the DDOS assaults have been commandeered by hackers either manually or remotely with the help of automated software tools that scan millions of computers for known security holes. These computers often belong to unsuspecting home users.

Little can be done to insulate targets from such attacks, and some of the world's most powerful companies have been targeted in the past. In February 2000, Amazon.com, eBay, Yahoo, and a host of other big-name e-commerce sites came to a grinding halt for several hours due to DDOS attacks.

"Only the richest can defend themselves against this type of attack, and most of them can't withstand a concerted attack," said Alan Paller, research director at the SANS Institute, a nonprofit security research and training group that often works with federal investigators to track computer virus writers. Paller also was the lead expert witness at the trial of "Mafiaboy," the Canadian teenager who was ultimately convicted of the February 2000 attacks.

"The only way to stop such attacks is to fix the vulnerabilities on the machines that ultimately get taken over and used to launch them," Paller said. "There's no defense once the machines are under the attacker's control."

Vixie said he kept the server at Internet Software Consortium operating by "pushing" the flood of data far enough away from his servers that legitimate traffic could flow around the obstruction. Such clogs still affect some Internet users by gumming up Internet communications somewhere else in the network.

UUNET's Morrow said it is too early to tell what the attack bodes for the Internet in coming months. "This could be someone just messing around, but it could also be something much more serious. It's too soon to say," Morrow said.

Wednesday, September 06, 2006

Short Msg service

Introduction
-----------------------------------------
SMS (also known as text-messaging) has grown into a very popular method of communication. It has been around in Europe and Asia since the early nineties and its use is steadily increasing in the US as well.

SMS stands for "Short Message Service" and uses mobile phones to transmit (surprise, surprise) short messages to and from mobile phones and whilst many of us might not know this, it is also possible to send SMS messages from a website or a piece of software.

There are an infinite number of reasons why you might want to use your website to send SMS. You might want to add a "send by SMS" option to your headlines, for example, or you might want to provide 24/7 support in which your technician is alerted by SMS or you might simply want to provide your viewers with Free SMS to drive traffic to your site.

Although it is also possible to send SMS via e-mail, this tutorial will teach you how to send SMS using GET and POST HTTP methods in PHP (since it's the language I know).

For those of us that many not know this, using HTTP basically means the use of forms, just like a contact form, except that these will be submitted automatically as opposed to manually.

Although this tutorial can be used for any gateway that provides access via HTTP, it is based on TM4B's SMS Gateway because A) they are the only gateway I know that have a simulation mode for tweaking your scripts, B) they don't have any set-up fees, C) their prices are low, D) they are reliable and E) I use them.


Understand the Requirements of the Gateway
-----------------------------------------
Full details about connecting to TM4B are provided on their SMS API page. They basically require us to provide six mandatory pieces of data:

username: our username

password: our password

msg: our SMS message(s)

to: the recipient(s) of our message

from: our sender id

route: the route of the message (i.e. first class or business class)

And we will add a seventh, which is "sim". This identifies that our message is only a simulation and so credits won't be removed from our account and messages won't actually be delivered.

Prepare the Request
-----------------------------------------
Now the actual message-delivery process is handled by the gateway. All they want us to do is pass them the details of the message(s) in the form of an HTTP request, similar to this one:

http://www.tm4b.com/client/api/send.php?
username=abcdef&password=12345&msg=This+is+sample+message.&
to=447768254545%7C447956219273%7C447771514662&
from=MyCompany&route=frst&sim=yes

You can test the above example (which uses GET) by pasting it into your browser's address bar. You should get a response saying that the username is invalid, which is normal because this is just to demonstrate.

The first step is to save our data as variables and then convert them into a URL request. There are different ways of doing this, but this is a very innovative and useful way:


$val) //traverse through each member of the param array
{
$request.= $key."=".urlencode($val); //we have to urlencode the values
$request.= "&"; //append the ampersand (&) sign after each paramter/value pair
}
$request = substr($request, 0, strlen($request)-1); //remove the final ampersand sign from the request
?>



We assign our credentials and routing information in the $param array. You'll notice that multiple recipients can be defined by separating them with the pipe-character. Each parameter value needs to be urlencoded and multiple key/value pairs are separated by ampersands. A final ampersand probably would not cause any problems but substr is still used to produce a tidy request.

The script will produce the following request that can be sent to the SMS gateway:
username=abcdef&password=12345&msg=This+is+sample+message.&
to=447768254545%7C447956219273%7C447771514662&
from=MyCompany&route=frst&sim=yes

Sending the request with CURL
-----------------------------------------
Previously we saw that the request could be executed by pasting it into the browser window. But what we really want is for this to take place behind the scenes. The following code does exactly that using CURL.

CURL is a very impressive library that allows you to connect and communicate to many different types of servers with many different types of protocols. You can find more info in the PHP Manual.

This code opens up a connection with the gateway, sends the SMS message(s) and collects their message IDs which are presented within the response header.






First, we initialize a new CURL session. Then we set our desired options; this includes setting CURLOPT_POST because TM4B's SMS API requires us to send multiple messages using POST. Finally we execute the call and then close the handle.


Sending the Request with Sockets
-----------------------------------------
CURL functions depend on an external library and PHP must have been compiled with the --with-curl flag. So while CURL is very flexible and useful, it may not be available with your PHP installation. If this is the case, you can still communicate with the SMS gateway using sockets.


";
print_r($output);
print "
";
*/
?>



First we layout the information we'll need to send our SMS and use it construct the HTTP header. A socket connection is established to our gateway using fsockopen. Information is sent and received in the same manner PHP would read and write to a file. After our transfer is complete we close the socket using fclose.


Conclusion
-----------------------------------------
That's It! Although it took me a long time to find CURL, I think it is the best, neatest and quickest option assuming your version of PHP supports it. Furthermore, whilst both fsockopen and CURL can send thousands of messages in one go, fsockopen might give you difficulties when parsing responses for large requests as the responses are transferred in chunks.

The above took me ages; I hope it saves you time.

HACKING WITH JAVASCRIPT

This tutorial is an overview of how javascript can be used to bypass simple/advanced html forms and how it can be
used to override cookie/session authentication.

SIMPLE HTML FORMS

1. Bypassing Required Fields

Surely you have met a webpage that requires you to fill all fields in a form in order to submit it. It is
possible to bypass these types of restrictions on any webpage. If you take a look at the webpage's source and follow
it down to the form's code, you will notice the onsubmit form attribute. Hopefully by this time you have experienced
the power of javascript and you know that javascript has control over every single element in a webpage,
including forms.We can use javascript to our advantage in every page we view for we can modify, delete, or add
any element to the webpage. In this case we wish to clear the form's onsubmit attribute in order for the form to be
submitted successfully.

The onsubmit attribute generally points to a function that checks the form to have the correct format.
A function that does this may look something like this:

function formSubmit(x)
{
if(x.email.value=="") return false;
return true;
}

...


...


I will not go into great detail about how the formSubmit function works. You should know that if the
(textfield/optionfield/option/..) field is left blank, the form will not be submitted to process.php. Now comes
the moment of truth, how do we modify the form so that onsubmit returns true everytime? The way we can access the
form with javascript and do this is:

document.forms[x].onsubmit="return true;";

or

document.spamform.onsubmit="return true;";

Both of these 'queries' will allow you to submit the form free of restrictions. The secret is how to execute
this. I do this using my browser's Location bar. All you have to do is enter this text into the location bar and press
enter:

javascript:document.spamform.onsubmit="return true;";

The above statement will not work because the 'query' will return a value javascript doesn't know what to do
with it so it dumps the returned value on the screen. We need a way to use this value and escape it from passing on to
javascript. I know the exact way to do this, with alert()!

javascript:alert(document.spamform.onsubmit="return true;");

You will see an alertbox with "return true;" instead of dumping this value out to the webbrowser. Once you have
executed this query you will be able to enter whatever value into whatever field in spamform.



2. Changing Fields' Values

If you have managed to change a form's onsubmit attribute to let you do whatever the fuck you want, what are
the limits? Of course now you know that you can modify the onsubmit attribute of a form from the location bar, same
goes for any attributes of any object in the page. This is how you can do it:

javascript:alert(document.spamform.fieldname.value="Dr_aMado was here!");

or

javascript:alert(document.forms[x].fieldname.value="Dr_aMado was here!");

But of course, you already knew that. Didn't you? You can change the values of pretty much anything inside a
form, including radios, checkboxes, selects, hidden values, buttons, anything!


SQL INJECTIONS

1. Using Forms to Your Advantage

You probably already know about sql injection, my goal is to explain how vulnerable forms can be if not handled
correctly. When targeting a system, most times you will start off with 0 code to exploit. The only thing you have is
a constructed webpage to break to pieces and successfully find vulnerabilities to use to your advantage.

ACQUIRING DATABASE INFORMATION

A very logic way of acquiring system information from a website's database is by causing errors in the sql
queries. These errors can be created through search forms, dynamic links, or session cookies. Most sql injection
papers explain how dynamic links and text boxes can be used to execute sql queries but in my opinion, this vulnurability is more common in other input types (select boxes, hidden fields, checkboxes and radio buttons, and cookies!).

Mixing data types generally crashes a webpage if it's not well coded. Take for example a link
to "memberinfo.php?o_id=1". If your goal is to crash that page it would be a good idea to stick in a " or a ' in
the o_id variable. If you're lucky you will get a debug message containing the crippled sql query. After you have
all the information you need and you know what you're going after you're ready to hack the hell out of every page
that you have access to.

CHANGING FIELDS' VALUES

The first form you think of is the profile page. Most profile pages ignore a user's intellectuals and
don't mask out,for example, select boxes. A way of exploiting this vulnerability is by injecting a sql query in
the value property of the field.

javascript:alert(document.profileform.user_sex.value="gay\',user_pasword=\'HACKED\' WHERE user_id=1#");

If we assume that the server side sql query looks something like this:

"UPDATE user_data SET user_password='$user_password',user_email='$user_email',user_sex='$user_sex'
WHERE user_id=$user_id";

Then the final query will look somewhat like this:

"UPDATE user_data SET user_password='mypassword',user_email='myemail',user_sex='gay',user_password='HACKED'
WHERE
user_id=1 #' WHERE user_id=7382";

# Is a sql comment operator.

2. Bypassing Session Cookies

OVERRIDING BASIC SESSION COOKIE AUTHENTICATION

Most of the time session handling is done with the use of cookies. The cookies tell the webpage who you are and
what you have access to and what you don't have access to. If the page does not handle session cookies correctly a hacker
might be able to change their identity to that of another user's. Cookies are stored in "window.document.cookie". With
javascript we are able to erase,edit,create cookies for any website. This task is more complicated than regular types of
attacks. I will not go into great detail about how it's done.

To View the Cookie:
javascript:alert(unescape(document.cookie));

To Change Cookie Data:

javascript:alert(window.c=function a(n,v,nv){c=document.cookie;c=c.substring(c.indexOf(n)+n.length,c.length);c=c.substring(1,((c.indexOf(";")>-1) ? c.indexOf(";") : c.length));nc=unescape(c).replace(v,nv);document.cookie=n+"="+escape(nc);return unescape(document.cookie);});alert(c(prompt("cookie name:",""),prompt("replace this value:",""),prompt("with::","")));

So If You are logged in as "John Doe" in www.ima13370h4x0r.net and your session cookie reads:

SessionData=a:3:{s:11:"SessionUser";s:5:"75959";s:9:"SessionID";i:70202768;s:9:"LastVisit";i:1078367189;}

The cookie is actually serialized but you should be able to recognize "75959" as your user_id. Some of the
time you will find a website that stores data (like user_id) in cookies but does not typecast the data. This is a
serious hole in the site's code because any user is able to change their user_id to any other user or administrator
user_id.

Changing the cookie value is easy once you have declared the window.c function. First change s:5:"75959" to s:x:"ADMINID" where x is the length of the new value. So if you want to change 75959 to 1. You must change s:5:"75959" to s:1:"1" :-) Sometimes you will need to change 75959 to "13 or 1=1" in order to bypass any WHERE statements any sql session queries used to keep you logged in the website.


----------------------------------------------------------------------------------------
Notes:
In-line javascript statements can be added to your browser's favorites for easier access to your own functions.
It is possible to declare your own functions for use in extended hacks. Declare the function as a method of
window. "alert(window.newfunction = function (){...})"
----------------------------------------------------------------------------------------