Sunday 19 October 2014

PHP Basics #5 : PHP Data Types

PHP : Data Types


In this tutorial I will tell you about Data Types in PHP.



PHP : Data Types



There are mainly 7 types of data in PHP but we will cover only 5 types of data now and later on we will talk about the rest 2.
So the 5 data types which we are going to talk about now are the following..

  • String
  • Integers
  • Float Numbers
  • Boolean  
  • NULL


i. String



A string in php and all other programming or web developing languages are the alpha-numeric letters and sentences. In php we always have to write strings between single or double quotes.


<?php

echo "Hello I am a String";
echo "<br />";
echo 'Hello I am also a string between single quotes';

?>

The echo "<br />"; line in the code is an html tag for next line and this also shows us that we can also echo html tags if we want but for now dont use any other html tag except <br />.


If you output the above code in a browser the result will be this..

Hello I am a String
Hello I am also a string between single quotes  

That was all about String you must know till now..



ii. Integers (Numbers)



Integers in php and every other computer language represents all numbers. Integers in php does not require quotes around it.


<?php

echo 1;
echo '<br />';
echo 10000;
echo '<br />';
echo 99;

?> 

The output of the above codes in a browser will result..



1
1000
99

iii. Float Numbers



Floats are the numbers like the decimal numbers and thats all I can say about it you will understand better in the example below..


<?php

echo 1.09;
echo '<br />';
echo 0.89;
echo '<br />';
echo 40.6;

?>

If you open the above code in a browser the result will be the following..
1.09
0.89
40.6


iv. Boolean



Boolean is simply 'true' and 'false'. Boolean is mostly used in conditional coding and you will understand it when we start conditional coding in php. For now all you need to know is that boolean is either TRUE or FALSE.


<?php


//Thats how you declare them
$a = true;
$b = false;


?> 


v. NULL 



The special NULL value represents that a variable has no value. NULL is the only possible value of data type NULL.

The NULL value identifies whether a variable is empty or not. Also useful to differentiate between the empty string and null values of databases.

Variables can be emptied by setting the value to NULL


<?php

$a = 'Hello World!';
$a = null;

echo $a;

 ?>

The output of the above code will give you a blank page because  $a was 'Hello World!', but after that you again declared $a to NULL so $a has no value 

PHP Basics #4 : Variables

PHP Variables


As with algebra, PHP variables can be used to hold values (x=5) or expressions (z=x+y).

A variable can have a short name (like x and y) or a more descriptive name (age, carname, total_volume).

Rules for PHP variables:


  • A variable starts with the $ sign, followed by the name of the variable
  • A variable name must start with a letter or the underscore character
  • A variable name cannot start with a number
  • A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ )
  • Variable names are case sensitive ($y and $Y are two different variables)

PHP Variables demonstration :

<?php

    $a = "John";
    $b = 'Terry';
    $x = 1;
    $y = 5;
    $z = $x + $y ;
    $float = 10.5;



echo $a;
echo '<br />';
echo $z;
echo '<br />';
echo $float;

?>


The output of the above will be:



John
6
10.5

Variables concept is quite easy to understand and If you have any conclusion in it please comment 

PHP Basics #3 : How to get Started with PHP coding ?

How to get started with PHP Development ?


(Continue only if you Successfully Installed Apache, PHP and MySQL)

So now you know how to run a php file in browser and its time to get started in php development !!

Today we will talk about :


  • How to write PHP codes
  • Basic Syntax
  • Echo Statement


1) How to write PHP codes ?


PHP codes can be written in any php file which means a file with .php extension and you can write it using any text editor but you must know that to write php codes you have to tell the browser that these are php codes not html and to do that all you have to do is open the php tag like all other html tags and then when php codes finishes close the php tag .. The opening php tag is <?php and the closing php tag is ?> . The browser will take all the codes between the <?php   ?> as PHP codes. And after you complete each php like you have to end with a semi-colon ; . A semi-colon tell the browser that the command ended. 


<?php

All codes here are PHP codes

?>  


2) Basic Syntax of PHP


PHP has very easy syntax rules as compared to other programming or scripting languages, the most important rule is to end your every statement with a semi-colon. We will demonstrate it soon and you will get hang of it.
One more important thing in php to remember is that white spaces had no effect in php coding there is no indentation rules in php, which for me is quite good.

3) echo 


If you have any experience with any programming languages then I guess you know what this statement does and for those who dont know this statement simply prints out anything you want on the screen. So if you have gone through the Last Tutorial of this series you must have created a folder in you localhost path named test and now time to use this folder for demonstration of all the exercises.
The syntax of echo statement is   
To print text in browser -> echo "Quotes if Text";
To print numbers in browser -> echo 1;
So create a new file named echo.php and inside the folder test and type the following inside the echo.php file..



<?php

echo "Hello World!!";


?>


If you open the file in browser the result will be..
Hello World!!


You can also do other things such as maths calculations..


<?php

echo 2+2;

?>

Result :
4

This was some basics of php codes and in next tutorials we will learn about PHP Variables and all..Till then do some experiments with your codes and try some more examples .. If you get stuck anywhere please comment

Tuesday 14 October 2014

PHP Basics #1 : Introduction to PHP

Introduction To PHP


What is PHP ?
PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML

What can PHP do ?

PHP is most commonly used as a Server-Side Scripting Language but it is not only bounded to it. PHP can also be used to write small desktop programs it is not that popular to creating desktop apps but still you can create small application which can help you in small tasks.

Why use PHP ?


1.) Works Great with HTML - If you already have a website and are familiar with HTML, making the step to PHP is easy. If fact, PHP and HTML are interchangeable within the page! While PHP might add some new features to your site, its basic appearance is still all created with HTML


2.) Interactive Features - PHP allows you to interact with your visitors in ways HTML alone can't. This can mean simple things like e-mail forms, or more elaborate things like shopping carts that save your past orders and recommend similar products. It can also mean social things like interactive forums and private messaging systems


3.) Easy to Learn - PHP is a lot easier to get started with than you might think. By learning just a few simple functions, you are able to do a lot of things with your website. And once you know the basics, there are a wealth of scripts available on the internet that you only need to tweak a little to fit your needs.


On the next post we will discuss about the Basic Syntax and how to write PHP codes on a html file..





PHP Basics #2 : How to Install Apache, PHP and MySQL

How to get started with PHP...?


Hello everyone in this tutorial I will show you how to make a development environment for PHP. This is one of the topics where most of the beginners have problems when to get to PHP development. You must get one thing clear that we cannot just open a editor and create a new html file and write php codes on it...this technique is not going to work with PHP as you need a localhost or a server PC to run php files and the file you are going to write PHP codes should be a .php file and don't worry this will not effect any of your html codes..

The above paragraph gives you alot of information but now lets get all topics clear.

To Start Developing in PHP :-
  • PHP will not work if we write php codes in an HTML file and open in the browser.
  • The file in which we will write php codes must be a PHP file ex. index.php and you dont need to worry about the HTML file getting corrupt or anything you HTML is gonna run fine in a php file.
  • We need a server to run php files. 
So the above three point is all we need to know for now and and we will solve each of them next..


Installation Guide For Ubuntu:


About LAMP

LAMP stack is a group of open source software used to get web servers up and running. The acronym stands for Linux, Apache, MySQL, and PHP. Since the virtual private server is already running Ubuntu, the linux part is taken care of. Here is how to install the rest.


Step One—Install Apache



Apache is a free open source software which runs over 50% of the world’s web servers.
To install apache, open terminal and type in these commands:

sudo apt-get install apache2

That’s it. To check if Apache is installed, direct your browser to your server’s IP address (eg. http://12.34.56.789). The page should display the words “It works!" like this.
How to Find your Server’s IP address
You can run the following command to reveal your server’s IP address.
ifconfig eth0 | grep inet | awk '{ print $2 }'


Step Two—Install MySQL


MySQL is a powerful database management system used for organizing and retrieving data
To install MySQL, open terminal and type in these commands:

sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql

During the installation, MySQL will ask you to set a root password. If you miss the chance to set the password while the program is installing, it is very easy to set the password later from within the MySQL shell.
Once you have installed MySQL, we should activate it with this command:


sudo mysql_install_db

Finish up by running the MySQL set up script:
sudo /usr/bin/mysql_secure_installation

The prompt will ask you for your current root password.
Type it in.Enter current password for root (enter for none):
OK, successfully used password, moving on...
Then the prompt will ask you if you want to change the root password. Go ahead and give it a password for mysql
Once you're done with that you can finish up by installing PHP.


Step Three—Install PHP



PHP is an open source web scripting language that is widely use to build dynamic webpages.
To install PHP, open terminal and type in this command.


sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt

After you answer yes to the prompt twice, PHP will install itself.
Congratulations! You now have LAMP stack on your computer!!



Test Your New Personal Server:

Now when you can open your browser and type on the url localhost/ and press enter. If the link opens an webpage saying Apache2 Ubuntu Default Page it means you have successfully Installed Apache Server on your machine ...!

Important Note: The localhost folder is located it /var/www/html/  now can can create a new folder test inside /var/www/html/ and then create a new file inside the test folder and name it index.php open that file with any text editor or your html editor and type the following :

<?php

echo "Hello World!!";

?>

Now goto browser and open localhost/test/index.php and see the result..!
(Dont worry I will explain the codes in next tutorial. If you encounter any problem please COMMENT.)

Saturday 4 October 2014

What is sitemap and how to use it ?

What is a sitemap ?

sitemap is a file where you can list the webpages of your site to tell Google and other search engines about the organization of your site content. Search engine web crawlers like Googlebot read this file to more intelligently crawl your site.



Types Of Sitemap ?

There are two popular versions of a site map. An XML Sitemap is a structured format that a user doesn't need to see, but it tells the search engine about the pages in a site, their relative importance to each other, and how often they are updated. HTML sitemaps are designed for the user to help them find content on the page, and don't need to include each and every subpage. This helps visitors and search engine bots find pages on the site.

Sitemaps are written in XML (Extensible Markup Language) it is due to that the search engine crawlers can crawl easily an XML file. You should know that every directory can contain its own XML fine but its a good Web Developer's habit is to put the main sitemap.xml file on the root directory of the website. 


Here's an example of a sitemap.xml file :



sitemap.xml example



Below we will revise the lines of the sitemap file one by one:



  • Every Sitemap XML file must begin with an opening tag <urlset> and must end with </urlset>.
  • Every "parent" entry should begin with <url> tag and end with </url>.
  • In a similar way, every "child" entry should be placed between <loc> and </loc> tags. After a <loc> tag, an URL is expected which should start with "http://". The length of the URL can be 2048 characters at most.


  • The <lastmod> tag expects a date in the following format YYYY-MM-DD. Be advised that you do not have to modify this tag each time you modify the document. The search engines will get the dates of the documents once they crawl them.


  • The <changefreq> tag is used as a hint for the crawlers to indicate how ofter the page is modified and how often it should be indexed. Note that this value may or may not affect the crawl bot behavior which depends solely on the search engine.


  • The <changefreq> tag expects one of the following values: always, hourly, daily, weekly, monthly, yearly, never. Be advised that "always" is used for pages which are dynamically generated or changed/modified upon every access. As for the "never" value – be advised that even if you mark your page with a never value most probably it will be indexed once in a week for example.


  • The <priority> value can vary from 0.0 to 1.0. Be advised that this indicates only your personal preferences for the way you would like to have your website indexed. The default value of a page that is not prioritized is 0.5. Any page with higher value will be crawled before the page with priority 0.5, and all pages with lower priority will be indexed after the page with 0.5 value. Since the priority is relative it is used only for your website and even if you set a high priority to all of your pages this does not mean that they will be indexed more often, because this value is not used to make comparison between different websites.




Whats Next ?

I hope now you know what a sitemap of a website is and its tags also. But for those who dont want to write these all by themselves dont worry I have got a good website for you which will do these all automatically and then you can download the sitemap.xml file of your website and upload it on you root folder of your website.

Sitemap Generator



And Then...?

Well after you got the sitemap.xml file you can upload it on the root of your website you can goto Google WebMaster and submit your website's sitemap so that google bots can crawl it easily !!


How to submit..?

If you have uploaded the sitemap.xml file on your root folder of your website you can simply goto Crawl tab on the Google Webmaster and then sitemap and then click on Test/Add Sitemap and type your website url.

example: www.yourwebsite.com/sitemap.xml



I hope this was informative for you..Please Share 

Friday 5 September 2014

Few Android Shortcuts !!

Android key combinations for quick hacks !

1) Force reboot:

Many times android users face a problem of freezing of mobile phone, In case your android phone is frozen, you can reboot it using an android trick.

Just press Power Button+ Home Key + Volume up button simultaneously.

2) Quick Google Access:

Android phones built primarily for internet, many of android users don’t know that android phones provide a way by which we can access Google search in just a single click. To use this android trick,

Press menu key and hold it for couple of seconds, it will launch the Google search.

3) Reboot Android in safe mode:

As like computers, we can also reboot android phones in safe mode. The latest android jelly bean version provides an option to reboot in safe mode, if something goes wrong.
To reboot your android in safe mode, follow the below given instructions.

*Long press the power button
*Long press on the power off option.

Android phone will show a confirmation message about rebooting it in safe mode, if we reboot android phone in safe mode then all the 3rd party application will be disabled. These applications can again be enabled when we reboot our phone normally. This is a great android utility in case when, one of your 3rd party application is causing trouble for you and you want to hunt it.

4) Unlock android phones by face detection:

This is a cool android trick by which you can unlock your phone by using face detection, In the jelly bean version, android provides a way by which android phone can be unlock using face detection, to make this feature more secure, jelly bean version added another layer of protection in which android phone can be unlocked only when the face is matched as well as we have to blink eyes in order to unlock phone. Blinking eyes tells the android security system that person is live and it’s not an illegal attempt of unlocking using a still image.
To activate this,

Go to Settings > Security > Screen lock > Face unlock.

5) Get detailed information about phone status:

We can get the detailed statistics like phone information, battery information, usage statistics and WiFi information by just dialing *#*#4636#*#*

This is a handy USSD to get the details about battery usage, DNS check, Ping, Application time usage time and so on.

6) Move android apps to SD card:

Its good idea to install android apps in SD card, but what if you installed apps on your phone memory. Don’t worry android phones provide a way by which we can move our apps to SD card. To move apps to SD card, follow these steps:

Go to settings > Application settings > Manage application > Select the application, You will see the option “Move to SD card”.

7) Hard Reset and Factory reset your android phone:

This android trick comes handy at the time of selling an android phone. Android phone can be formatted in two ways

Factory reset
Hard reset

a) Factory reset: In factory reset, your phone is being formatted to factory level. Means all the settings will go by default and all the internal data will be deleted. To factory reset a phone dial *#*#7780#*#*.

b) Hard reset: To hard reset a phone dial *2767*3855#, this will delete all the data (including internal and External SD data) as well as settings of android phone. Don’t try this code for testing purpose, until you are not sure. It will not ask for a confirmation.

8) Context menu in android:

long press on the screen, will show you additional options for customizing android phones. This context menu is somewhat similar to the right click menu of most operating systems.

9) Taking screen shots on android phone:

Android phones offer a great feature by which we can take the screen shot without using any 3rd party application. However the screen shot android tricks vary from one android version to another version.

Press the Home button + power button (This trick work on most android phones.)
For Galaxy Nexus: Power button + volume down button.
For Galaxy Note 2 and S3: Swipe your palm on the screen to take screen shot.

10) Android Version Animation:

This is another cool android trick to play with your android phone.
To use this android trick, Go to settings > about phone > Tab repeatedly on ‘Android version’.

After sometime, the android version will be animated

What is a Intrusion Detection System (IDS) ?

Hey everybody, now that we discussed online security its time to identify how your network could be threatened. In order to do so i'm going to start with the Intrusion Detection System or IDS. After this article you should be able to understand what an IDS is, how it works and which types are available.

What is a Intrusion Detection System (IDS)::

A system that tries to identify attempts to hack or break into a computer system or to misuse it. IDSs may monitor packets passing over the network, monitor system files, monitor log files, or set up deception systems that attempt to trap hackers.

Computer systems have become more vulnerable to intrusions than ever. Intrusion Detection is a security technology that allows not only the detection of attacks, but also attempts to provide notification of new attacks unforeseen by other components. Intrusion detection is an important component of a security system, and it complements other security technologies.

How does an IDS work::

While there are several types of IDSs, the most common types work the same. They analyze network traffic and log files for certain patterns. While a firewall will continually block a hacker from connecting to a network, most firewalls never alert an admin.

The admin may notice if s/he checks the access log of the firewall, but that could be weeks or even months after the attack. This is where an IDS comes into play. The attempts to pass through the firewall are logged, and IDS will analyze its log. At some point in the log there will be a large number of request-reject entries. An IDS will flag the events and alert an administrator. The admin can then see what is happening right after or even while the attacks are still taking place. This gives an admin the advantage of being able to analyze the techniques being used, source of attacks, and methods used by the attacker.

Types of intrusion detection systems::

* Host-Based Intrusion Detection System (HIDS): Host-based intrusion detection systems or HIDS are installed as agents on a host. These intrusion detection systems can look into system and application log files to detect any intruder activity.

* Network-Based Intrusion Detection System (NIDS): These IDSs detect attacks by capturing and analyzing network packets. Listening on a network segment or switch, one network-based IDS can monitor the network traffic affecting multiple hosts that are connected to the network segment, thereby protecting those hosts. Network-based IDSs often consist of a set of single-purpose sensors or hosts placed at various points in a network. These units monitor network traffic, performing local analysis of that traffic and reporting attacks to a central management console.

Things to consider (important!!)

* Signatures: Signature is the pattern that you look for inside a data packet. A signature is used to detect one or multiple types of attacks. For example, the presence of “scripts/iisadmin” in a packet going to your web server may indicate an intruder activity. Signatures may be present in different parts of a data packet depending upon the nature of the attack.

* Alerts: Alerts are any sort of user notification of an intruder activity. When an IDS detects an intruder, it has to inform security administrator about this using alerts. Alerts may be in the form of pop-up windows, logging to a console, sending e-mail and so on. Alerts are also stored in log files or databases where they can be viewed later on by security experts.

* Logs: The log messages are usually saved in file.Log messages can be saved either in text or binary format.

* False Alarms: False alarms are alerts generated due to an indication that is not an intruder activity. E.g. misconfigured internal hosts may sometimes broadcast messages that trigger a rule resulting in generation of a false alert.
Some routers, like Linksys home routers, generate lots of UPnP related alerts. To avoid false alarms, you have to modify and tune different default rules. In some cases you may need to disable some of the rules to avoid false alarms.

* Sensor: The machine on which an intrusion detection system is running is also called the sensor in the literature because it is used to “sense” the network.

What are CAPTCHAs ?

What are CAPTCHAs

Whenever we create an account on any website or comment on any blog we see scrambled words which we have to type and continue these are CAPTCHAs .

What are CAPTCHAs and what they do?

It stands for Completely Automated Public Turing-test to tell Computers and Humans Apart.These tries to test that you are a person and not a auto filling software.

Why CAPTCHAs are necessary?

These are used to prevent hackers from avoiding misuse of online services.

There are some examples of activities which are undertaken by hackers are given below :-

-Opening someone's account by attempting different password again and again.

-Creating hundreds of free accounts

-Swaying an online poll by robotically submitting hundreds of false responses.

-Spamimng blogs by posting dozens of bogus comments.

These CAPTCHAs test prevent about 90% of hackers attacks.

What is a logic behind this CAPTCHAs?

Commonly, these CAPTCHA phrases are .gif pictures of scrambled words, but can also be .mp3 voice recordings. These pictures and recordings are very hard for conventional software programs to understand, and hence, robots are usually unable to type the phrase in response to the picture or recording.

Wednesday 27 August 2014

What is Web Development ? (Complete Beginner's Guide)

Hello everyone today we will talk about web development the first thing we will talk about is What is Web Development and then we will talk about where and how to start...


What is Web Development ?

As we are completely surrounded with internet we are also surrounded with website thorough which we access information from the internet, the main reason behind the creation of the Internet was to share information throughout the world in an easy way, so to access those information website is created where the information is kept or stored and we visit those websites to gain access to those information..But how and from where does websites come and here come the Web Development, the process of creating or developing websites is called Web Development.

Thursday 21 August 2014

Download Elite Android Hacking Tools !!

Best Android Hacking Tools

#1. ANDROID HACKING TOOLS WHICH FILE SIZE IS 25.37MB WHICH ONLY CONTAINS ANDROID HACKING TOOLS!

Download Android Hacking Tools Package 1

RAR Password = sabeer

#2. COMPLETE ANDROID PACKAGE WHICH FILE SIZE IS 1.56GB WHICH CONTAINS ANDROID HACKING TOOLS, ANDROID FOUR [4] FILE MANAGERS, ANDROID ELEVEN [11] KEYBOARDS, ANDROID GAMES OF THE DAY, ANDROID APPLICATIONS, ANDROID THEMES, ANDROID LAUNCHER!


Download Android Hacking Tools Complete Package

RAR Password = sabeer


THESE ARE THE TOP RATING AND HEAVY BEST APPS I AM PROVIDING YOU IN A .RAR COMPLETE ANDROID PACKAGE!


►ANDROID HACKING TOOLS:
01.Hackode
02.AndroidRAT
03.APK Inspector.
04.Droid Box
05.Burp Suite
06.zANTI
07.Droid Sheep
08.dSploit
09.AppUse (Android Pentest Platform Unified Standalone Environment)
10.Shark for Root

►ANDROID FOUR [4] FILE MANAGERS:
11.Android File Manager
12.Arc File Manager
13.OI File Manager
14.File Manager
15.Aroma File Manager 1.91

►ANDROID ELEVEN [1228.] KEYBOARDS:
16.Dodol Keyboard
17.Emoji Keyboard.apk
18.Ice Cream Sandwich Keyboard.apk
19.Jelly Bean Keyboard.apk
20.Keyboard ManMan.apk
21.Kii Keyboard.apk
22.Magic Keyboard Free.apk
23.Perfect Keyboard Free.apk
24.Red Keyboard Free.apk
25.TouchPal Keyboard.apk
26.TouchPal X Keyboard.apk
27.Dynamic Keyboard - Pro v1.9.1

►ANDROID GAMES OF THE DAY:
28.AVP Evolution v1.5.1
29.Kingdom Rush Frontiers v1.0
30.Pacific Rim v1.6.0
31.Shadowrun Returns v1.0.5
32.Sine Mora v1.24

►ANDROID APPLICATIONS:
33.Advanced Task Manager Pro v3.1.9
34.AppMgr Pro III (App 2 SD) v3.19
35.BackCountry Navigator PRO GPS v5.1.
36.edjing PE - Turntables DJ Mix v1.3.0
37.Sliding Messaging Pro v7.60 
38.TuneIn Radio Pro v9.1 
39.wRotatr v1.408 
40.Whatsapp
41.Viber
42.Tango
43.Google Chrome
44.Twitter
45.Faceook

►ANDROID THEMES:
46.GLASS APEXNOVAGOSMART THEME v7.0
47.Flow Theme for CM10.2 v2.9.7

►ANDROID LAUNCHER:
48.TSF Shell v1.9.9.7.6 


Special Thanks to Sabeer for this Post Admin of Facebook Page Cyber Elite
https://www.facebook.com/TestedHackingTrickz