Tuesday, 29 May 2012

iPhone - iOS 5.1.1 untethered jailbreak with Absinthe 2.0.2


Summary
After copious amounts of work and many sleepless nights Absinthe 2.0 is finally here to jailbreak your device. This release has been a large collaborative effort between Chronic-Dev Team and iPhone Dev Teams (Jailbreak Dream Team)

This jailbreak supports firmware 5.1.1 ONLY and is again one of the most easiest jailbreaks to use (so easy your grandma could do it ;D)


Press Release
http://conference.hitb.org/hitbsecconf2012ams/ios-jailbreak-dream-team-releases-absinthe-2-0-ios-5-1-1-jailbreak/


Absinthe 2.0 supports the following devices
iPad1,1 – 2,1 – 2,2 – 2,3 – 3,1 – 3,2 – 3,3

iPhone2,1 – 3,1 – 3,3 – 4,1

iPod3,1 – 4,1

(Support for iPad2,4 will be added at a later date)



How To Use Absinthe 2.0 (if you're unjailbroken)
1. Make a backup of your device in iTunes by right clicking on your device name under the ‘Devices’ menu and click ‘Back Up’.

2. Once your backup is complete return to your device and go to Settings – General – Reset – Erase all Content and Settings. This will make the jailbreak process much faster.

3. Open Absinthe and be sure you are still connected via USB cable to your computer.

4. Click ‘Jailbreak’ and wait…. just be patient and do not disconnect your device.

5. Once jailbroken return to iTunes and restore your backup from earlier. Right click on your device name under the ‘Devices’ menu in the left panel of iTunes and click ‘Restore from Back Up…’ then select the latest backup you created before. (restoring this backup will return all the content previously on your device ie, apps, photos, etc.)

6. Thanks for using Absinthe, enjoy your jailbroken iDevice!


How To Untether 5.1.1 (if you're already jailbroken)
Just search for and install "Rocky Racoon 5.1.1 Untether" from Cydia.


Download Links
Absinthe v2.0.2 MacOSX (10.5, 10.6, 10.7)
Absinthe v2.0.2 Windows (XP/Vista/Win7)
Absinthe v2.0.2 Linux (x86/x86_64)


Source: http://greenpois0n.com

iPhone - What are SHSH Blobs and how to downgrade your iOS firmware


Summary
An SHSH Blob is a signature file which is verified against Apple Server to verify the the iPhone is running the latest version of iOS. If for some reason, when you are try to restore to a previous version, Apple will not allow you to restore it becuase, you are trying load a older version of iOS. To make this possible, we need to send a request to a different server (Local or designated) which sends a SHSH blob (which was saved by you) back to iTunes faking that its the current version.


This applies to all apple based devices
iPhone, iPad, iPod Touch etc...


An SHSH Blob CANNOT be shared across multiple devices
I.e. you can't use a friends! This is because the ECID (Exclusive Chip ID - Unique ID for the device) is saved alongside it and must match.


Why and when to save these SHSH Blobs?
You should save these SHSH Blobs everytime your device is updated to a new firmware version. This will allow you to downgrade the firmware for the device regardless of Apple unsigning the firmware or not. So keep a collection, and you can downgrade to whichever you wish.


Why should I downgrade?
- Your generally unhappy with the new firmware
- The new jailbreak has problems, and you would like to revert to a previous firmware where your previous jailbreak was running smoothly.
- The new firmware only has a Tethered jailbreak available.

Teathered vs. Unteathered?
This simply means, weather you need a computer to start your phone. If a release of redsn0w offers a Teathered solution, then !everytime! your phone turns off (out of battery, new app install etc.) you will need to plug it into your computer and use redsn0w to boot the phone! The batteries are pretty decent, so you probably don't even care or it's no big deal.


I don't have my SHSH Blobs for a previous firmware version, but I still want to downgrade...
A utility called "An SHSH Blobs Extractor" is being worked on by iH8sn0w... This allows you to extract blobs for a previous firmware version from the device. Stay tuned though, it's not out yet!


How do I save an SHSH Blob for my device
NOTE: Do you not need a jail broken device to save your SHSH Blob.

You have a number of options here, but the way that works for jailbroken and non-jailbroken devices is by using TinyUmbrella (For Windows and MAC).

TinyUmbrella Download
TinyUmbrella-5.11.01.pkg (MAC)
TinyUmbrella-5.11.01.exe (Win)
View the TinyUmbrella blog to get the latest version here

1. Open TinyUmbrella
2. Click "Start TSS Server"
3. Save SHSH
4. The SHSH files for your device will now be stored on your local system.

NOTE:
If your device is jailbroken, you can store these on the Cydia server. This will allow you to revert back to a previous firmware without worrying about keeping them safe. Also, if you buy an Apple device from ebay, the seller may have already done this, so its good to check Cydia if this is the case!


Downgrading your device with SHSH Blobs
Once you have the SHSH Blobs for the firmware you would like to downgrade to, then you can use iFaith to achieve this! More information here

Monday, 28 May 2012

Shell Script: NSLookup DNS entry to see which server is LIVE

Here is a simple script which allows you to perform an NSLookup on a DNS entry to find out if the current host is Live or not.

This is useful if you have a mirrored backup server that shouldnt process any data unless its currently live. If a failover occurs, the backup server will then realise it's live and process the information which the other server was currently processing.


Code Snippet
  1. #!/bin/sh
  2. ################################################################################
  3. # Does an NSLookup on a server DNS entry to determine which server is currently LIVE.
  4. ################################################################################
  5. #
  6. # Get LIVE server and query current server
  7. liveServer=`eval nslookup mgs | grep "Name:"`
  8. currentServer=`eval hostname`
  9.  
  10.  
  11. # Nslookup to see if this server is LIVE
  12. echo "$liveServer" | grep $currentServer >/dev/null 2>&1
  13.  
  14. if [ "$?" -eq "0" ]; then
  15.     echo "This IS the Live server"
  16. else
  17.     echo "This IS NOT the Live server"
  18. fi
  19.  
  20.  
  21.  
  22. exit 0
End of Code Snippet

Thursday, 3 May 2012

iTunes - Play .ogg vorbis files in iTunes


By default, you cannot play .ogg files in iTunes, as they currently are not supported. iTunes uses Quicktime libraries in the backend to handle playback of audio and video content. We can, however, use a utility to allow Quicktime to handle files of different types.

Xiph
Xiph QuickTime Components (XiphQT) is, in short, the solution for Mac and Windows users who want to use Xiph formats in any QuickTime-based application, e.g. playing Ogg Vorbis in iTunes or producing Ogg Theora with iMovie.

Download
http://www.xiph.org/quicktime/download.html

Bonus
Also: How to add FLAC files into iTunes

Wednesday, 2 May 2012

Linux/Mac - Find files by filetype and move them into a target directory

Find (find) all text files ('*.txt') in the current directory (.) by case-insensitive filename (-iname) and display the output in the console (-print).
Code Snippet
  1. find . -iname '*.txt' -print
End of Code Snippet


Find (find) all text files ('*.txt') in the current directory (.) by case-insensitive filename (-iname) and (-exec) move each one of them (mv {}) to the temp directory (/tmp).
Code Snippet
  1. find . -iname '*.txt' -exec mv {} /tmp \;
End of Code Snippet

daemonize - Running commands as a Unix daemon


Daemonize
daemonize runs a command as a Unix daemon. As defined in W. Richard Stevens’ 1990 book, UNIX Network Programming (Addison-Wesley, 1990), a daemon is “a process that executes ‘in the background’ (i.e., without an associated terminal or login shell) either waiting for some event to occur, or waiting to perform some specified task on a periodic basis.” Upon startup, a typical daemon program will:

  • Close all open file descriptors (especially standard input, standard output and standard error)
    Change its working directory to the root filesystem, to ensure that it doesn’t tie up another filesystem and prevent it from being unmounted
  • Reset its umask value
  • Run in the background (i.e., fork)
  • Disassociate from its process group (usually a shell), to insulate itself from signals (such as HUP) sent to the process group
  • Ignore all terminal I/O signals
  • Disassociate from the control terminal (and take steps not to reacquire one)
  • Handle any SIGCLD signals

Download: daemonize

Example Usage
Code Snippet
  1. daemonize ./samplescript.sh
End of Code Snippet

By checking running processes on our system, we can see our script running as a daemon...
Code Snippet
  1. ps -ef | grep samplescript
End of Code Snippet

root 898 1 0 10:51 ? 00:00:00 /bin/sh /usr/local/bin/samplescript.sh

Tuesday, 1 May 2012

Solaris/SunOS - xymond_client: fatal: libpcre.so.0: open failed: No such file or directory Killed

libpcre.so.0: open failed: No such file or directory Killed
This is an error which appeared in the logs during runtime of a client installation of some system monitoring software called Xymon.
The problem is that during runtime, the pcre shared object files cannot be located. This can be because we haven't installed the libraries, or we didn't link them properly when building from source.
The same solution may apply to any other software that relies on the pcre libraries.


Here are the steps to resolve the problem...

1. Ensure you have CSWpcre installed... You can do this using pkgutil
Code Snippet
  1. pkgutil -i pcre
End of Code Snippet

Check that the pcre shared objects and includes can be found in the csw directory..

/opt/csw/lib
/opt/csw/include


2. Navigate to the Xymon build directory and open the Solaris/SunOS Makefile...
Code Snippet
  1. vi Makefile.SunOS
End of Code Snippet


3. Add a reference to pcre to the linker..

REPLACE
NETLIBS = -lresolv -lsocket -lnsl
WITH
NETLIBS = -lresolv -lsocket -lnsl -lpcre


4. Use GNU make to make a new Xymon binary...

Code Snippet
  1. make -s
End of Code Snippet


Troubleshooting Xymon Client Connectivity
Logs are your friend! These are located in the Xymon log's directory.. (/xymon/client/logs)


Sending a test query to the Xymon server
Code Snippet
  1. /xymon/client/bin/xymon --debug XYMONSERVERIPADDRESS "query XYMONSERVERIPADDRESS conn"
End of Code Snippet

Troubleshooting client connection using the web server interface
You can view all client machine activity with Xymon server (even if the machine is not configured in hosts.cfg) by viewing Ghost Clients (http://XYMONSERVER/xymon-cgi/ghostlist.sh)... This may help you identify why some servers aren't showing up.