Posts

Showing posts from June, 2013

Information Gathering for a successful Hack

Image
The very first step of a successful hack is Enumeration. Enumeration, alias Reconnaissance is an information gathering process. Its also know as foot printing. As the saying goes ' Information is Power', the more information we can gather, the more there is a chance of a successful attack. Information can be anything about the system and related entities. Methods can be various, that can help us get information about the system or the person or the organisation. There are several methods of information gathering some of them are discussed as follows.   DNS Enumeration is done to find out information about target system/website. This helps us finding out the emails, usernames, ip address, computer names about the system. For this we can use tools like nslookup , whois lookup , dig , traceroute . These will help us find information about the ip address about the system and which will disclose even more information about the system like open ports, operating system, runni

Installing composer in Linux

Image
Composer is a very useful tool for php developers. Its used for dependency management for PHP projects. To use composer you need to install it and it can be done by the two commands in Linux : curl -sS https://getcomposer.org/installer | php sudo mv composer.phar /usr/local/bin/composer Now verify that composer has been installed by typing the command composer in terminal, you should see the composer usage as follows: $ composer    ______   / ____/___  ____ ___  ____  ____  ________  _____  / /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/ / /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ / \____/\____/_/ /_/ /_/ .___/\____/____/\___/_/                     /_/ Composer version 20dda687c5f7b59414e8ff134b71428ac97ddfc1 Usage:   [options] command [arguments] Options:   --help           -h Display this help message.   --quiet          -q Do not output any message.   --verbose        -v|vv|vvv Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debu

How to draw Stacked Column Bar Graph using HighCharts

Image
Well the above picture if a stacked column bar graph generated using HighCharts . HighCharts can be used for generating various graphs. And this one is an example among those. I am came to know about highcharts when I was working in a project where I had to show the sales made and the cost incurred. And my solution was highcharts. So I thought sharing it with you. To generate the chart the following code can be used: <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script type="text/javascript" src="http://code.highcharts.com/highcharts.js"></script> <script type="text/javascript" src="http://code.highcharts.com/modules/exporting.js"></script> <div id="summary_graph" style="min-width: 400px; height: 400px; margin: 0 auto"></div>                     <script>                     $(function ()

Removing index.php from URL in CodeIgniter

Image
Everybody wants to make their URL user friendly,pretty URLs. Why won't any one like pretty URLs? Pretty URLs make the website search engine friendly too besides making the URL easy to understand. While starting with CodeIgniter , we see index.php in the URLs if not removed and this goes against our will.  So to get rid of this in CodeIgniter , all we need to do is change the config.php file in application/config/ and add .htaccess to the root  directory of CodeIgniter . Changes to be made in config.php: 1. Change the base url: $config['base_url'] = 'http://localhost/example/'; 2. make the index_page blank $config['index_page'] = ''; Now the next file to edit is .htacess file, if its not there create on in the root directory. So your directory structure should be like this ->application ->system ->index.php ->license.txt ->README ->.htaccess The content in .htaccess file should be as follows: Options -Indexes Options +FollowSymLinks

How to integrate irc client in website

Image
Internet Relay Chat [ IRC ] is a protocol for live interactive Internet text messaging of synchronous conferencing  Its massively used for group communication. It also allows private messaging and file transfers.  And its extensively used till date. There are many IRC servers and millions of users are online. Freenode, IRCnet , Quakenet , EFnet , rizon are some examples of IRC servers. To connect to these servers IRC clients are used. There are irc clients for every operating system. Most common ones are Xchat , mIRC , irssi , empathy and more. However, the are web based clients too. For the case you cant to integrate Freenode in your website for your channel then you can do that too. For freenode servers you can use the iframe tag to integrate. An example code is as follows which has been configured for default nickname to be NOSKian[0-9] and channel to be #nosk in freenode server. <iframe src="http://webchat.freenode.net?nick=NOSKian.&channels=nosk&prom

Pulling videos From Youtube Playlist

Image
This time, I am going to read the youtube videos from a youtube playlist. The code is pretty simple and straight forward. The following code will pull all the videos with the playlist id 5Hc74bvAC8V6XQnPFDEYOHFhMlEPg8q1. You need to change the playlist id to the desired ones. The example not only pulls the videos but embeds them using iframe. So youtube playlist can be embeded in your website this way. <?php $playlist_id = "5Hc74bvAC8V6XQnPFDEYOHFhMlEPg8q1"; $url = "https://gdata.youtube.com/feeds/api/playlists/".$playlist_id."?v=2&alt=json"; $data = json_decode(file_get_contents($url),true); $info = $data["feed"];                 $video = $info["entry"]; $nVideo = count($video); //number of videos                     foreach($video as $v){                   $title =  $v['title']['$t'];         $link = $v['link'][0]['href'];         $description =$v['media$group']['media$description'

Writing Nested ajax requests

Image
I had not come to this need before. But yes I came to a situation where it felt like there was a need of using the values returned by an AJAX request and do another AJAX request and return the values. Actually this thing came my way while I was writing a modules of YellowPages. There I had this issue. When I select a country in a dropdown, then zones will be populated in another dropdown and the selected dropdown in zones will make another dropdown to pull the districts of the default selected zone. For this I had to use nested AJAX requests. May be this might not be the best way to do this. But yet, it works for me and you might give a try if you are thinking of something similary $(document).ready(function(e) { $('#country_id').change(function(){ var id = $(this).val(); $.ajax({ type:"POST", url: getLocation(), data: 'action=getZones&id='+id, success: function(msg){ var zones=JSON.parse(msg); var zone_content="" for(var i=0;i<zo

Getting Started with Firefox OS 'Hello World' App

Image
Firefox OS, also know as Boot to Gecko [B2G] is a mobile operating system developed by Mozilla. Its a Linux operating system developed using HTML, JS, CSS along with Linux Kernel. This is still in development phase. However, you can start hacking Firefox OS right away. First of all, lets get setup with all the tools of trade for Firefox OS Apps hacking. I hope you have Firefox Browser, if not then you can either install using yum, apt-get or even download from  http://www.mozilla.org/en-US/ . Once you have installed Mozilla Firefox, you need to install the Firefox OS Simulator on Firefox. To install the addon: Click on Tools->Addons. Then you can use the search box to find Firefox OS Simulator. But for now, better use this shortcut link  https://addons.mozilla.org/en-US/firefox/addon/firefox-os-simulator/?src=search . That's all we need. Now open your favorite editor and create an index.html file as follows: <!doctype html> <html lang="en">    

Resetting Android Touchmate Proto-Tab

Image
Sometimes, simply you get locked out of your tablet because of too many incorrect combination of keys or patterns. The same condition happened to my friend, while she handed her tablet to a kid to play Angry Bird. She tried too many combinations and got locked out. The 'reset' button doesn't work: 'i.e. every time we use this method we are asked for the google accout of the touchmate'. And we need to do factory reset. So how are we going to do this. This post is for Touchmate Proto Tab with IceCream Sandwich, lets go through the steps: 1. Power off the tablet. 2. Hold the power button, volume up and volume down button all at once 3. You'll see something like this: 4. Now Press the power button and you'll see menu system 5. Use volume up button to navigate to factory reset 6. Use power button to select 7. The device will be factory reset. 8. Now navigate to reboot 9. Use power button to select 10. The proto tab should boot up normally without