Main menu

My Blog

Google.com is the most popular search engine on the market. That’s beacuase it has the most complete and largest indexing of all internet. Here I’d like to display few interesting tricks about the google search engine.

Searching the google using the input field text box for the string “Hello” produces already a large php GET method with a lot of variables (13 different variables!)

https://www.google.com/#hl=en&output=search&sclient=psy-ab&q=hello&oq=hello&gs_l=hp.3..0l4.1930.2760.0.3170.5.5.0.0.0.0.80.388.5.5.0.les%3B..0.0…1c.1.5.psy-ab.cuLsoCtq5UE&pbx=1&bav=on.2,or.r_gc.r_pw.r_qf.&bvm=bv.43148975,d.dmg&fp=79c21eb3a028c18d&biw=1440&bih=735Let’s see what google know about me:
(& = is a separator used to separate the type variable from each other )hl=en (language: try changing the variable to “it”, “de”, “es”)output=search (query type)sclient=psy-ab q=hello (query : you can type directly your search without pressing the search buttom)oq=hello (?)gs_l=hp.3..0l4.1930.2760.0.3170.5.5.0.0.0.0.80.388.5.5.0.les%3B..0.0…1c.1.5.psy-ab.cuLsoCtq5UE (looks import but i have no idea what it is)pbx=1 (?)bav=on.2,or.r_gc.r_pw.r_qf. (?)bvm=bv.43148975,d.dmg (?)fp=79c21eb3a028c18d (?)biw=1440 (?)bih=735 (?)

As you can see google populates even the simples search (in this case “hello”) with over a dozzen of other variables which the regular user is not even aware of using. It is interesting to note that even changing 1 variable will result in a different search result list.

Ranking

When we search something for example the word “hello” , how does google order the search results. Why is a search result at place #1 and another one at place #200? They contain the same word, but why one is considered more relevant then the other one?

The algorithm used by google to rank pages is called PAGERANK. PAGERANK takes in consideration not only how many times the queried word (or string) is repeated (like traditional pre-google search engines did), but also how many pages link to it. Linking to a page is an important factor in valuing a search result because it express the importance and relevance of that page over other results. It kinda works like a reference for a page.

Advanced/Customized searches

Google offers users the ability to use advanced search features to search for something. You can add these features in your search query using the google advance search page . You Can use these features and other not described in google-advanced dirrectly in your search query with special operators and key words that google understands: here is a list (from wiki) of these features used by google that can help you specify better your query.

OR

Search for either one, such as “price high OR low” searches for “price” with “high” or “low”.

“-“

Search for either one, such as “price high OR low” searches for “price” with “high” or “low”.

“+”

(Removed on October 19, 2011). Force inclusion of a word, such as “Name +of +the Game” to require the words “of” & “the” to appear on a matching page.

“*”

Wildcard operator to match any words between other specific words.

define:

The query prefix “define:” will provide a definition[33] of the words listed after it.

stocks:

After “stocks:” the query terms are treated as stock ticker symbols for lookup.

site:

Restrict the results to those websites in the given domain, such as, site:www.acmeacme.com. The option “site:com” will search all domain URLs named with “.com” (no space after “site:”).

intext:

Prefix to search in a webpage text, such as “intext:google search” will list pages with word “google” in the text of the page, and word “search” anywhere (no space after “intext:”).

allintitle:

Only the page titles are searched(not the remaining text on each webpage).

intitle:

Prefix to search in a webpage title, such as “intitle:google search” will list pages with word “google” in title, and word “search” anywhere (no space after “intitle:”).

allinurl:

Only the page URL address lines are searched (not the text inside each webpage).

inurl:

Prefix for each word to be found in the URL; others words are matched anywhere, such as “inurl:acme search” matches “acme” in a URL, but matches “search” anywhere (no space after “inurl:”).

Interestingly dangerous search results

Try to make (simple/short) queries with “filetype=log”, or “filetype=sql” (and other log/database format terminations) and than add the string search “intext=passwor” or “intext=hash”. You will find some preddy interestings search results, mostly due to system administrator mistakes in assigning the right permission/access to their file. Also some of these file (log files) are the results of different hacking tools used by other ppl, most of them phishing site, spams etc..
Screenshoot:

Method #1 – LIVE CD/DVD

1- Boot the computer from an USB or CD ubuntu image. At the boot screen select “Try out”UBUNTU”

2- After the desktop session has loaded start the terminal or just press CTRL+ALT+t

3- At the terminal type:

sudo su
mkdir /mnt/new
fdisk -l#now here is the hard part; you have to figure out what is the partition you need to use in the next command, where is your "/" root-linux-system located?
mount /dev/PARTITION /mnt/new #mount the partition where you "/"(root-system) folder is located
grub-install --root-directory=/mnt/new /dev/DISKNAME #install the bootloader in the right disk

4- Now close the terminal, exit the live session, take out the cd and reboot your system.
5- Press “SHIFT” to load the new grub menu, and select “Recovery Mode”

Let me guess… you lost your password? ehh , don’t worry the net is full of different solutions to the matter of this possible problem. First let me start by saying that this tutorial is not intended to retrive your original password (see my Cryptography section for that). Also if you have an encrypted home directory (like with TrueCrypt) this method won’t work.

There are several ways to reset your password. I will describe here 2 methods:
Method # 1 – No live cd
Method # 2 – With live cd

1- Boot the computer from an USB or CD ubuntu image. At the boot screen select “Try out”UBUNTU”

2- After the desktop session has loaded start the terminal or just press CTRL+ALT+t

3- At the terminal type:

sudo su
mkdir /mnt/new
fdisk -l
(now here is the hard part; you have to figure out what is the partition you need to use in the next comand, usually it's the one that hase the "*" on the line, check my screen shoot for help)
mount /dev/PARTITION /mnt/new
chroot /mnt/new
mount -o rw,remount /
passwd USERNAME
PASSWORD
PASSWORD

Let’s say you you don’t want to use the previous methods, anothe way to reset you password is to access and edit directly the shadow file of your filesystem located in /etc/shadow. I will not explain here how to mount the partition, what kind of priviledges you should have etc.. because there are multiple ways to access the linux partition, from a MacOSX, Windows, another linux distribution and so on.. but instead I will focus on how to edit the hash file properly in order to give you access to your user’s login.
here we go:
1- navigate into the /etc folder . There are sever files here, using a text editor open the one named “shadow”.
2- find the line containing your username. It should be something like this:

4- save and reboot the linux system. Login with your username and at the request to enter a password simply press enter (leave it empty).

Note this methode may not work on all distributions. I noticed that Ubuntu work only with the empty method (::) where instead other ditros may accept also (:!:) and (:NP:) inputs. They all say the same thing, which is that the user does not have a password.

How many times have you encountered booting problems? The cause of your problem may be depend on several factors: Grub conf file wrong or missing, file-system corrupted, your windows partition does not show in grub, or does not boot, MBR corrupted, etc… Don’t worry the net is full of program and script that can debug and find the cause or yoyur errors. I choose to include the one written by Ulrich Meierfrankenfeld and Gert Hulselmans. It’s a clean code and very easy to use. Also you can edit it to meet your needs too.

When running the script, without specifying an output file, all the output
is written to the file "RESULTS.txt" in the same folder as the script.

But when run from /bin, /sbin, /usr/bin, or another system folder, the file
"RESULTS.txt" is written to the home directory of the user.

When the file "RESULTS.txt" already exists, the results will be written to
"RESULTS1.txt". If "RESULTS1.txt" exists, the results will be written to
"RESULTS2.txt", ...

To get version number, release date, last git commit and git retrieval date
of this script, use (no root rights needed):

${0} -v
${0} -V
${0} --version

To get this help text, use (no root rights needed):

${0} -h
${0} -help
${0} --help

To automatically gzip a copy of the output file, use (root rights needed):

${0} -g
${0} --gzip

To write the output to stdout instead of a file, use (root rights needed):

${0} --stdout

The last development version of Boot Info Script can be downloaded, with:
(no root rights needed)

${0} --update

If no filename is specified, the file will be saved in the home dir as
"bootinfoscript_YYYY-MM-DD_hh:mm:ss".

If multiple versions of Boot Info Script are detected in the same directory,
Boot Info Script will list all versions found.
In that case you need to force Boot Info Script to run a certain version,
by adding "--this" as first argument (root rights needed):

${0} --this

HELP

exit 0;
}

## Download the last development version of BIS from git: ##
#
# ./bootinfoscript --update
#
# If no filename is specified, the file will be saved in the home dir as
# "bootinfoscript_YYYY-MM-DD_hh:mm:ss".

## Check if there are other bootinfoscript files in the same directory. ##
#
# This can be useful when BIS was downloaded multiple times with Firefox, Chromium, ...
# Those browsers will add a suffix to the filename, when there was already
# a file with the same name:
#
# bootinfoscript()
#
# To force BIS to run a certain version, add "--this" as first argument:
#
# ./bootinfoscript --this
#

if [ ${stdout_output} -eq 1 ] ; then
# The LogFile name is not used when --stdout is specified.
LogFile="";
elif ( [ ! -z "${LogFile_cmd}" ]) ; then
# The RESULTS filename is specified on the commandline.
LogFile=$(basename "${LogFile_cmd}");

# Directory where the RESULTS file will be stored.
Dir=$(dirname "${LogFile_cmd}");

# Check if directory exists.
if [ ! -d "${Dir}" ] ; then
echo "The directory \"${Dir}\" does not exist.";
echo 'Create the directory or specify another path for the output file.';
exit 1;
fi

# Set ${Dir} to the home folder of the current user if the script is
# in one of the system folders.
# This allows placement of the script in /bin, /sbin, /usr/bin, ...
# while still having a normal location to write the output file to.

cd ${Folder}
Log=${Folder}/Log # File to record the summary.
Log1=${Folder}/Log1 # Most of the information which is not part of
# the summary is recorded in this file.
Error_Log=${Folder}/Error_Log # File to catch all unusal Standar Errors.
Trash=${Folder}/Trash # File to catch all usual Standard Errors these
# messagges will not be included in the RESULTS.
Mount_Error=${Folder}/Mount_Error # File to catch Mounting Errors.
Unknown_MBR=${Folder}/Unknown_MBR # File to record all unknown MBR and Boot sectors.
Tmp_Log=${Folder}/Tmp_Log # File to temporarily hold some information.
core_img_file=${Folder}/core_img # File to temporarily store an embedded core.img of grub2.
core_img_file_unlzma=${Folder}/core_img_unlzma # File to temporarily store the uncompressed part of core.img of grub2.
PartitionTable=${Folder}/PT # File to store the Partition Table.
FakeHardDrives=${Folder}/FakeHD # File to list devices which seem to have no corresponding drive.
BLKID=${Folder}/BLKID # File to store the output of blkid.

## Get total number of blocks on a device. ##
#
# Sometimes "fdisk -s" seems to malfunction or isn't supported (busybox fdisk),
# so use "sfdisk -s" if available.
# If sfdisk isn't available, calculate the number of blocks from the number of
# sectors (divide by 2).

if [ "${pa}" = "T" ] ; then
# no stage 2 file found.
Stage2_Msg="${Stage2_Msg}, but no stage2 files can be found at this location.";
else
pa=$((${pa}+1));
Stage2_Msg="${Stage2_Msg}. A stage2 file is at this location on ${stage2_hdd}. Stage2 looks on";

Grub2_Msg="looks at sector ${sector_nr} of the same hard drive for core.img";

for HI in ${!HDName[@]} ; do
# If the drive name passed to grub2_info matches the drive name of the current
# value of HDName, see if the sector offset to core.img is smaller than the
# total number of sectors of that drive.

if [ ${core_img_found} -eq 0 ] ; then
# core.img not found.
Grub2_Msg="${Grub2_Msg}, but core.img can not be found at this location";
else
# core.img found.

if [ "${drive_nr_hex}" != '0xff' ] ; then
Grub2_Msg="${Grub2_Msg}. Grub2 is configured to load core.img from BIOS drive ${drive_nr} (${drive_nr_hex}) instead of using the boot drive passed by the BIOS";
fi

# There are at least 2 versions of filefrag.
# For both versions, we can get the blocksize and the location of the block
# of the file that is the farest away from the beginning of the disk.
# For the newer version, we can also get the number of file fragments.

if [ "${tmp}" = 'LILO' ] ; then
BSI="${BSI} and the \"map\" file was found at this location.";
else
BSI="${BSI} but the \"map\" file was not found at this location.";
fi
else
BSI="${BSI} but the \"map\" file was not found at this location.";
fi;;

0000) # If the first two bytes are zero, the boot sector does not contain any boot loader.
BST='-';;

if [[ "${MFT_Mirr_FILE}" != 'FILE' ]] ; then
BSI="${BSI} The info in the boot sector on the starting sector of the MFT Mirror is wrong.";
fi

if [[ "${Comp_Size}" -ne 0 ]] ; then
BSI="${BSI} According to the info in the boot sector, ${name} has ${BPB_Part_Size} sectors, but according to the info from fdisk, it has ${size} sectors.";
fi
fi
fi

# Check whether Partitons starting sector and the Partition Size of BPB and fdisk agree.
if [[ "${offset}" -eq "${start}" && "${Comp_Size}" -eq "0" ]] ; then
BSI="${BSI} No errors found in the Boot Parameter Block."; # If they agree.
else # If they don't agree.
if [[ "${offset}" -ne "${start}" ]] ; then # If partition starting sector disagrees.
# Display the starting sector according to the BPB.
BSI="${BSI} According to the info in the boot sector, ${name} starts at sector ${offset}.";

# Check whether partition is a logcial partition and if its starting sector value is a 63 or 2048.
if [[ "${offset}" -ne "63" && "${offset}" -ne "2048" || "${kind}" != "L" ]] ; then
# If not, display starting sector according to fdisk.
BSI="${BSI} But according to the info from fdisk, ${name} starts at sector ${start}.";
else
# This is quite common occurence, and only matters if one tries to boot Windows from a logical partition.
BSI="${BSI} But according to the info from fdisk, ${name} starts at sector ${start}. \"63\" and \"2048\" are quite common values for the starting sector of a logical partition and they only need to be fixed when you want to boot Windows from a logical partition.";
fi
fi

# If partition sizes from BPB and FDISK differ by more than 255 sector, display both sizes.
if [[ "${Comp_Size}" -ne "0" ]] ; then
BSI="${BSI} According to the info in the boot sector, ${name} has ${BPB_Part_Size} sectors.";

if [[ "$BPB_Part_Size" -ne 0 ]] ; then
BSI="${BSI}. But according to the info from the partition table, it has ${size} sectors.";
fi # Don't display a warning message in the common case BPB_Part_Size=0.
fi
fi # End of BPB Error if-then-else.
fi # End of Investigation of the BPB of vfat partitions.

# Loop through all directories which might contain boot_code files.
for file in ${Boot_Codes_Dir} ; do

# If such directory exist ...
if [ -d "${mountname}${file}" ] && FileNotMounted "${mountname}${file}" "${mountname}" ; then
# Look at the content of that directory.
for loader in $( ls "${mountname}${file}" ) ; do
# If it is a file ...
if [ -f "${mountname}${file}${loader}" ] && [ -s "${mountname}${file}${loader}" ] ; then

if [ "${sig}" = 'GRUB' ]; then
grub2_info "${mountname}${file}${loader}" ${drive} 1.97;
BFI="${BFI} Grub2 (v1.97-1.98) in the file ${file}${loader} ${Grub2_Msg}.";
fi
fi
done # End of loop through the files in a particular Boot_Code_Directory.
fi
done # End of the loop through the Boot_Code_Directories.

## Show the location (offset on disk) of all files in: ##
# - the GrubError18_Files list
# - the SyslinuxError_Files list

# Search for hard drives which don't exist, have a corrupted partition table
# or don't have a parition table (whole drive is a filesystem).
# Information on all hard drives which a valid partition table are stored in
# the hard drives arrays: HD?????

if [ "${dr}" -eq 128 ] ; then
Message="${Message} and looks on the same drive in partition #${pa} for ${stage}";
else
Message="${Message} and looks on boot drive #${dr} in partition #${pa} for ${stage}";
fi
fi;;

printf '\nFinished. The results are in the file "%s"\nlocated in "%s".\n\n' "$(basename "${LogFile}")" "${Dir}/";
fi

exit 0;

How to:
1-Copy the text to a file named: bootinfoscript.sh in your home folder
2. run the command : sudo ./bootinfoscript
3. the script will output the results in the file RESULTS.txt
3. to view simply use a text editor or run : less RESULTS.txt

if ARGV.empty? or not ARGV[0].include? LA7TV_URL
$stderr.puts <<-EOD
This script downloads videos from http://www.la7.it, for your personal use only.
The idea is that you can watch what you see online for free, but offline too.
Please be sensible and don't use this method for breaking the law.

This is a script to get a diagnosis of network’s trubleshoting ( Wi-Fi/Lan) in your linux machine. If you are using USB- network adapters is highly suggest that you run a lsusb command next to the scripts. Since i did not include any usb scan for network devices I suggest to use a different script or to change this one to meet your needs.