Linux

How to Root Galaxy S4!

This is a video by our buddy Zedomax on rooting the Galaxy S4. This method is only for root access, its not a video on installing custom recovery, so please enjoy and remember to subscribe to his YouTube Channel.

.

This method works on all Qualcomm Galaxy S4 running Android 4.2.2 including:
AT&T SGH-i337, T-Mobile SGH-M919, Sprint SPH-L720, Verizon, US Cellular, Telus, .
Rogers, etc…

For GT-i9500 octa-core S4, see other root method here:
http://www.youtube.com/watch?v=1VZd71…

Download and Step-by-Step tutorial here:
http://galaxys4root.com/galaxy-s4-roo…

For rooting Galaxy S4 on Linux/Ubuntu, please see this video instead:
http://www.youtube.com/watch?v=JIAbdV…
For rooting Galaxy S4 on Mac OSX, please see this video instead:
http://www.youtube.com/watch?v=q5Sluq…

For more awesome info on rooting the Galaxy S4 stop over at http://GalaxyS4Root.com

Using netcat to print header info from web browsers

You can identify what information is sent from the browser to the remote web server using a Linux tool called netcat (nc). Netcat is often referred to as a “Swiss-army knife for TCP/IP”. Its list of features includes port scanning, transferring files, and port listening, and it can be used as a backdoor.

Simply run netcat in listing mode on your desired port. Example: nc -l 8080. You can then point to address of this system http://ip_address:port and netcat will display the values received.

The following are some example of the output:

Google Chrome – Version 27.0.1453.116m:

GET / HTTP/1.1
Host: 10.255.255.10:8080
Connection: keep-alive
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116 Safari/537.36
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8

 

Internet Explorer 10 – Version 10.0.9200.16599

GET / HTTP/1.1
Accept: text/html, application/xhtml+xml, */*
Accept-Language: en-US
User-Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)
Accept-Encoding: gzip, deflate
Host: 10.255.255.10:8080
DNT: 1
Connection: keep-alive

 

Firefox – Version 21.0

GET / HTTP/1.1
Host: 10.255.255.10:8080
User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:21.0) Gecko/20100101 Firefox/21.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive

 

Google Chrome (Android) – Version 27.0.1453.90

GET / HTTP/1.1
Host: 10.255.255.10:8080
Connection: keep-alive
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
User-Agent: Mozilla/5.0 (Linux; Android 4.2.2; SAMSUNG-SGH-I337 Build/JDQ39) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.90 Mobile Safari/537.36
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8

 

Using SSH as VPN Solution in Linux

Looking for a quick simple way to have VPN access to your network or simply to secure your connection when you are on a remote network you don’t complete truest such as a public hot-spot.

And while there are many solutions I have one which is simple to use.

It’s called ‘sshuttle’ and all you need a remote server that you have remote SSH access to and a bit of software on your Linux computer.

To install ‘sshuttle’ on Debian releases you simple apt-get install sshuttle

To use sshuttle you just use the following command:

sshuttle -r user@remote_host 0.0.0.0/0 –dns

This will initiate a SSH VPN connection and send all your traffic security from the network your on out of the remote network your trust.

Simple and easy to setup and use.

 

Note: You do require to have access to a remote SSH server. Setting up an openSSH server is simple to do in Linux and even on a Windows host. — Search Google, you’ll find plenty of info, and perhaps it may even take you back to here if I get around to writing up something.  Best of luck to ya.

sudo and “unable to resolve host hostname” error message

Working on a clean install of Ubuntu Desktop 13.04. I changed the hostname of the system /etc/hostname and later noticed I got the following error message “unable to resolve host hostname” when ever I did an sudo command (example: sudo -i).

To resolved this I changed the following:

I used nano to edit /etc/hosts and changed host entry to 127.0.0.1 to my new host name. Closed the file and no more error message.

 

Using DD for disk cloning

Using one of the built in commands in Linux I decided to clone a drive. Unlike in Windows this does not require the use or purchase of a tool or software.

The command dd is used to make a block-level copy of the hard drive. The command can be used to clone one drive to another or to make a full disk image of a drive for later use. Using the following command: ‘dd if=/dev/sdf of=/tmp/disk.img’

This will clone the disk sdf to a disk image file named disk.img
You can also use the following: ‘dd if=/dev/sdf of=/tmp/disk.img bs=16384 conv=notrunc,noerror’

Syntax Reference:

if= the Input file, read the source drive
of= the output file or file to write to
bs= blocksize to set. In the above I set this to 16384 because the larger blocksize transfer faster than the default
conv= conversion converts the file according to the arguments applied, where notrunc means do not truncate the file, and noerror means do not stop on any read errors

I hope this simple breakdown helps you.

 

like us on facebook – http://www.facebook.com/jermsmitcom

Finding the Failed Hard Drive – Linux Software RAID

After discovering my software raid system had suffered from a failed disk drive it was time to locate it and replace. But the question was “Which physical disk drive failed”. I don’t have a fancy blinking light or one that changes to amber or red when something is wrong.

So to locate the drive I need to gather information such as the serial number of the drive itself so that I can match it up with the physical disk. I was able to do this using the ‘lshw’ command:

Running the command # lshw -class disk gave me the following for example:

*-disk:0
description: ATA Disk
product: WDC WD10EVDS-63U
vendor: Western Digital
physical id: 0
bus info: scsi@2:0.0.0
logical name: /dev/sdb
version: 01.0
serial: WD-WCAV58689449
size: 931GiB (1TB)
capabilities: partitioned partitioned:dos
configuration: ansiversion=5 signature=1eb72643

From these results I gather the information I am looking for: logical name, serial number, and vendor (if you have different vendor type disks in your software raid) I matched the logical name with that of the failed device.

 

Tip: Linux maps its hard drives using UDEV, and doesn’t guarantee a drive that is mounted at sdb today, will be mounted as sdb tomorrow. So be aware of this before pulling drives.

How to Find Hardware Devices in Linux with lshw

I needed to know the exact serial number of a failed disk drive in a software RAID set. I used the lshw tool to list out the drives on my system so that I could identify the disk that had failed.

This tool will list the the hardware you are running and a good way to inventory what’s under the hood without opening the box.

lshw is available on most package management systems.

If you use APT (Debian-based Linux: Ubuntu for example), run the following command in terminal: sudo apt-get install lshw

If you use Yum (Red Hat, Fedora, CentOS, Yellow Dog Linux, etc), run the following command in terminal: sudo yum install lshw

 

Some Basic Use of Nmap

Nmap (“Network Mapper”) is a free and open source utility for network discovery and security auditing. I along with many other systems and network administrators also find it to be a useful tool for the right job. Nmap can be installed and used in Windows, and mostly common in Linux distributions such as Debian and the well known Ubuntu.

You can get the Windows install form http://nmap.org/ along with the Linux versions.  In Linux (Debian) I simple sudo apt-get install nmap -y and the rest is done in a few seconds.

Now that you have Nmap, what can you do? Here are some examples I use every so often:

~# nmap google.com – gives me info about google.com (Hostname google.com resolves to 11 IPs..)

~# nmap 192.168.1.0/24 – scans my network and return info on machines and service ports listening

~# nmap -sP 192.168.1.100 – attempts to detect if a host is up or down

~# nmap -PN 192.168.1.100 – attempts to detect if a host is up or down (no pings sent)

~# nmap -sT 192.168.1.100 – port scan using TCP

~# nmap -sU 192.168.1.100 – port scan using UDP

~# nmap -O 192.168.1.100 – attempts to identify the remote OS, returns TCP/IP fingerprint

And I could go on, but lets just end these example here and I’m sure you’ll find others.

Run … run, you clever boy … and remember. – Clara Oswald

logstalgia – website access log visualization tool

Logstalgia is a website traffic visualization that replays or streams web-server access logs as a pong-like battle between the web server and an never ending torrent of requests.

On a regular basis I tail the access.log of my website watching request to jermsmit.com
jermsmit.com

Last night I ran across a awesome log visualizer tool called logstalgia. Logstalgia displays request as small balls of color which travel over the screen to the request which was made. Successful request are bounced back to the host requesting them. Those 404’s are just travel off screen as being missed by the web server which is represented as a paddle moving up and down the screen.

Logstalgia supports several standardized access.log formats used by web servers such as Apache, Lighttpd and Nginx and pretty much any web server log meeting the supported standard formats

NCSA Common Log Format (CLF)
“%h %l %u %t “%r” %>s %b”

NCSA Common Log Format with Virtual Host
“%v %h %l %u %t “%r” %>s %b”

NCSA extended/combined log format
“%h %l %u %t “%r” %>s %b “%{Referer}i” “%{User-agent}i””

NCSA extended/combined log format with Virtual Host
“%v %h %l %u %t “%r” %>s %b “%{Referer}i” “%{User-agent}i””

This tool is available under Windows and Linux, so stop by the project site and have some fun with this. I almost can’t wait to get back to work after the weekend to put this up on a display to watch traffic in real time. Now how cool is that.

Link to the Logstalgia Project Home Site

Check out the YouTube video to see it in action – http://youtu.be/HeWfkPeDQbY

If anyone ask, tell them jermsmit.com sent ya.

Keep Calm and Install Wheezy

Debian 7.0 Wheezy released!

Want to give it a try?
Check out the live images!

Want to install it?
Choose your favorite installation media among Blu-ray Discs, DVDs, CDs and USB sticks.

Already on Debian and want to upgrade?
You are just an apt-get dist-upgrade away from Wheezy! Find how, reading the installation guide and the release notes.