This article is only used for technical discussion and research. Do not use it for other purposes.
PS: to celebrate getting rid of the claw of exam-oriented education for the moment, and to those schools that secretly engage in exam-oriented education with quality education!
Preface
Google hacking is actually nothing new. I saw some related introductions on some foreign sites in the early years. However, since google hacking did not pay attention to this technology at the time, I think that at most it is only used to find unrenamed mdb or webshells left by others, and there is not much practical use. but some time ago, after carefully reading some information, I suddenly realized that google hacking is not so simple...
Simple implementation of google hacking
I remember I saw an article written in the past. I simply used www.google.com to search for dvbbs6.mdb or conn. inc. in fact, some google syntaxes can be used to provide us with more information (of course, they also provide more information to those who are used to attacks .), the following describes some common syntaxes.
Intext:
This is to use a character in the body of the webpage as a search condition. for example, enter "intext: Net" in google. returns all the web pages that contain "" in the webpage body. allintext: similar to intext.
Intitle:
Similar to the intext above, search for whether the webpage title contains the characters we are looking. for example, search: intitle: Security angel. all Web pages whose titles contain "Security Angel" will be returned. similarly, allintitle: is similar to intitle.
Cache:
Search for the cache of some content in google, and sometimes you may find some good stuff.
Define:
Search for the definition of a word. Search: define: hacker. The definition of hacker is returned.
Filetype:
I would like to recommend that you use this tool to collect information about specific targets, whether it is a web attack or what we will talk about later. search for files of the specified type. for example, input: filetype: doc. all file URLs ending with doc will be returned. of course, if you are looking. bak ,. mdb or. inc is also available, and more information may be obtained :)
Info:
Query the basic information of a specified site.
Inurl:
Search whether the specified character exists in the URL. For example, if you enter inurl: admin, N Connections similar to the following are returned: success.
Link:
For example, search: inurl: www.4ngel.net can return all URLs connected to www.4ngel.net.
Site:
This is also useful. For example, site: www.4ngel.net. will return all URLs related to this site of 4ngel.net.
Some operators are also useful:
+ Display columns that may be ignored by google as the query range
-Ignore a word
~ Word of consent
. Single wildcard
* Wildcard, which can represent multiple letters
"" Precise Query
Next, let's talk about the actual application (I personally prefer to use google.com and search for the following content on google). For an attacker who is eager to test, maybe he is most interested in the password file. google often discloses some sensitive information to them because of its powerful search capabilities. search for the following content by google:
Intitle: "index of" etc
Intitle: "Index of". sh_history
Intitle: "Index of". bash_history
Intitle: "index of" passwd
Intitle: "index of" people. lst
Intitle: "index of" pwd. db
Intitle: "index of" etc/shadow
Intitle: "index of" spwd
Intitle: "index of" master. passwd
Intitle: "index of" htpasswd
"#-FrontPage-" inurl: service. pwd
Sometimes important password files are exposed to the network without protection for various reasons. If they are obtained by someone with ulterior motives, the harm is very great. below is a passwd file of the FreeBSD system I found (I have processed it ):
Figure 1
Google can also be used to search for programs with vulnerabilities. For example, ZeroBoard found a file code leakage vulnerability some time ago. We can use google to find websites that use this program online:
Intext: ZeroBoard filetype: php
Or use:
Inurl: outlogin. php? _ Zb_path = site:. jp
To find the page we need. phpmyadmin is a set of powerful database operation software. Due to misconfiguration of some sites, we can directly operate phpmyadmin without using a password. we can use google to search for the program URLs with such vulnerabilities:
Intitle: phpmyadmin intext: Create new database
Figure 2
Remember http://www.xxx.com/_vti_bin/..%5C..%5C..%5C..%5C..%5C../winnt/system32/cmd.exe? Dir? You may also find many antique-grade machines by using google. We can also use this to find pages with other cgi vulnerabilities.
Allinurl: winnt system32
Figure 3
As we have mentioned earlier, google can be used to search for database files. Some syntaxes can be used to precisely search for more information (access database, mssql, mysql Connection Files, etc ). for example:
Allinurl: bbs data
Filetype: mdb inurl: database
Filetype: inc conn
Inurl: data filetype: mdb
Intitle: "index of" data // This often occurs on apache + win32 servers with incorrect configuration.
Like the above principle, we can also use google to find the backend. The method is just a few words. After all, the purpose of this article is to let everyone know about google hacking, instead of letting you use google to destroy it. security is a double-edged sword. The key lies in how you use it.
The upper part of this article can be found in 4ngel.net.
Google can be used to collect and penetrate information on a site. Next we will use google to perform a test on a specific site. Www.xxxx.com is one of the famous universities in China. I decided to perform a test on the website by chance (all the information about the school involved in this article has been processed. Do not check the number :).
First, use google to check some basic information about the site (some details are omitted ):
Site: xxxx.com
Find the domain names of several school departments from the returned information:
Http://a1.xxxx.com
Http://a2.xxxx.com
Http://a3.xxxx.com
Http://a4.xxxx.com
Ping by the way, it should be on different servers. (think about the poor web server in our school. The University is rich and sweaty ). Schools generally have a lot of good information. Let's see if there are any good things:
Site: xxxx.com filetype: doc
Get N good doc files. First look for the website management background address:
Site: xxxx.com intext: Management
Site: xxxx.com inurl: login
Site: xxxx.com intitle: Management
More than 2 Admin backend addresses:
Http://a2.xxxx.com/sys/admin_login.asp
Http://a3.xxxx.com: 88/_ admin/login_in.asp
Pretty good. Let's see what programs are running on the server:
Site: a2.xxxx.com filetype: asp
Site: a2.xxxx.com filetype: php
Site: a2.xxxx.com filetype: aspx
Site: a3.xxxx.com filetype: asp
Site :.......
......
On the a2 server, IIS is used, asp is used, and a php Forum is also used.
The a3 server is also IIS, aspx + asp. Web programs should all be developed by themselves. If you have a forum, you can see if you can meet any public FTP account or something:
Site: a2.xxxx.com intext: ftp ://*:*
No value found. Let's see if there are any upload vulnerabilities:
Site: a2.xxxx.com inurl: file
Site: a3.xxxx.com inurl: load
A file upload page is found on a2:
Http://a2.xxxx.com/sys/PreviousFile.asp
I checked it with IE and did not have the access permission. Try injection,
Site: a2.xxxx.com filetype: asp
Get the address of N asp pages, and let the software do the physical work. This program obviously does not prevent injection, and the dbowner permission is not high, but it is sufficient, back a shell I don't like very much, and it seems that the database is not small, and the web administrator's password is exposed directly. Then, MD5 encryption is passed. Generally, the passwords of school sites are relatively regular, and they are usually domain name + phone deformation. Use google to fix it.
Site: xxxx.com // obtain N second-level domain names
Site: xxxx.com intext: * @ xxxx.com // get N email addresses and the name of the email owner.
Site: xxxx.com intext: Phone Number // N
Create a dictionary of the information and then run it slowly. After a while, I ran out of four accounts, two of which were from the student union, one administrator, and one possibly from the teacher's account. Login:
Name: website administrator
Pass: a2xxxx7619 // Let's talk about it, that is, the domain name + 4 digits
How to escalate the permission is not discussed in this article.
Prevention of google hacking:
Refer to the previous article: http://www.4ngel.net/article/26.htm.
However, I personally do not recommend this method. It is a bit of Silver-free three hundred. In a simple way, google deletes some information on its website and accesses this URL:
Http://www.google.com/remove.html
A few days ago I saw someone discussing how to use a program to cheat the robot. I think I can try it:
The Code is as follows:
<? Php
If (strstr ($ _ SERVER [HTTP_USER_AGENT], "Googlebot "))
{
Header ("HTTP/1.1 301 ");
Header ("Location: http://www.google.com ");
}
?>
Asp:
<%
If instr (R