Thursday, January 8, 2015

Recovering Tinder messages from users who've deleted their accounts

Okay, I've used Tinder.

However, we'll put that aside and get more technical here.

I ran into the situation where a person had given me some info to add her on Facebook, so that we could continue the conversation, but then deleted/disabled her Tinder account!

For those who don't know, Tinder will remove such a person from your matches and you cannot look at the conversation history anymore. Well, that sucks!

So here's a really, really, technical solution.

For security reasons, Android will not let you look in /data/com.tinder. Inside /data/com.tinder/db/tinder.db is a copy of all of the messages you've sent and received in the app. So we need this file, but without a rooted phone, the only way to access this data is to access it through Tinder, which would require us to modify and recompile Tinder ;-). If you try to use a file manager to browse /data, nothing will show up.

At this point you can root your phone, which requires unlocking the bootloader, which has been claimed to void your warranty, and naturally, when you unlock the bootloader the phone is wiped for security reasons.

So rooting is really not an option for such a silly little thing. You might as well give up on this potential person, even if they are your soul mate? :-(

The workaround is to enable ADB USB debugging in Android, and take a backup using the adb tool on your computer, while it's connected to the handset. Do not set a password!

adb backup -f my_backup.ab -apk -shared -all

And confirm from the phone that you want to allow this backup.

At this point you'll have a huge file called my_backup.ab. You'll need to extract this using the Android Backup Extractor which will require Java7 to be installed. Then you can run:

java -jar abe.jar unpack my_backup.ab my_backup.tar

Which will create a standard .tar file called my_backup.tar.

We can then extract this using tar

tar -xf my_backup.tar

Then navigate to the folder that's created, apps/ then com.tinder/db

From here, open the database (a SQLite DB) using sqlite3 command:

sqlite3 tinder.db

Let's view some messages!

select * from main.messages LIMIT 10;

Anything look familiar here? It should!

Okay so this is all out of order. What we are looking for are the most recent conversations. The field we are interested in is called 'created', so let's order messages by that!

SELECT * from main.messages ORDER BY created ASC;

54ef7ac30147af1b7d000192|53ef05f9f6061a2f32055da4||2014-02-08T19:28:06.922Z||Lol I am, do you want to add me on Facebook? Suzy Queens|

The names and unique IDs have been changed to protect everyone involved. But hey! There's the message I've been looking for! A match made in heaven. The person will owe you a drink for all of the hard work you've done ;-)

So my advice would be, if you get a phone number or last name from someone you are interested in...take a screenshot right then and there...Tinder will hide the conversation if that person then leaves Tinder or unmatches you. Otherwise, use this method if you are nerdy, or just can't take a hint. ;-)

Sunday, April 13, 2014

Heartbleed: Why your replacement SSL certificate should be free

We've all heard of Heartbleed, the devastating encryption vulnerability in the OpenSSL implementation of SSL/TLS used by an estimated 2/3 of internet websites.

Heartbleed was a simple programming mistake not caught by the small team of developers who manage OpenSSL and contribute to and manage the software.

As a result of the vulnerability, which has existed for 2 years, all websites using OpenSSL need to have users change their passwords and they also must order replacement SSL certificates from a Certificate Authority.

Read more on how SSL works and what a root CA is...

Unfortunately, SSL certificates cost money. They are usually in the $10-$150 range.

Considering that there are only 3 developers working on OpenSSL, and yet, most of the CA's customers will be using OpenSSL, in my mind, says that they should have developers contributing to, and auditing that codebase.

Their entire business relies on this chain of trust, so they should be auditing it. It's their job.

That's why a re-issue due to Heartbleed should be free of charge.

Saturday, April 5, 2014

Linux don't care...

Say for example, Windows won't let you delete or back up an open file. Even if you wanted to easily create a snapshot of a volume and back up an open file in a consistent manner, it's not that easy.

Linux don't care...

In fact, a recent question I was asked in an interview pre-screening, was whether you can delete an in-use logfile and if that space is automatically marked free by the OS?

The answer to that is, no. On Linux, a file can be deleted when it's in-use. The file will disappear from the FS, but the handle to the file will remain open, and in fact, the application will continue to write to the file even when its hard link count is now exactly zero! That log file will actually appear in the /proc filesystem under that process' PID, in its list of open files. In order to actually delete the file you need to close the file handle. This is done in various ways depending on the application, but it can usually be triggered quite easily, and as a sysadmin, you should why and how you should do this.

UNIX expects you to be a competent and knowledgeable sysadmin, and this has the advantage of creating a very predictable environment with few exceptions to basic tenets laid out as a contract of sorts

I like that.

I like being treated like an adult.

Mac OS X filesystems, frustratingly lacking

I guess I'm a bit spoiled. Linux never leaves me hanging when I need to access a filesystem. Anything I throw at it--NTFS, FAT32, HFS+, ext2, ext3, XFS, ZFS.

The other day I was trying to help my sister install dual boot Ubuntu with Mac OS. Apple's disk utility couldn't seem to resize the main HFS+ partition, claiming that there wasn't enough free space (even though 12GB was available). I figured it was a system file in use, so it was off to burn a bootable OS X install DVD--because she's like everyone else and lost her original one. As an aside: Who ever saves these things? I'm still dreaming of the day a client answers, "Yes!" to the question, "Do you have the original install CDs?"

I had an ext3 formatted disk with the OS X .ISO file on it, and needed to use a Windows system that had a DVD-DL drive (the Mac OS X disk is 7.5GB). Even with some 3rd party ext3 utilities for OS X, I still could not read the ext3 partition. I gave up.

Just because it's based on Open Source, doesn't mean it's for geeks.

Storage Debate: NAS build or buy?

You're a storage guru. You eat storage for breakfast, lunch, and dinner. Storage fears you. I/O buses cower in your presence.

Okay, perhaps you aren't this intense. You don't have a VNX storage array in your bedroom. You aren't any lesser of a man or woman because of that.

But you still need to store and backup your stuff! So you've decided that you want to do it in-house. What are some considerations? Read on to find out.

Well, what about the cloud?

The cloud is in the full throes of popularity, but with the recent NSA and privacy violations from a multitude of companies, it's no wonder that many people, like myself, prefer to keep their data in their own hands.

In the arena of self-hosted data, it's a balance between cost, functionality, and complexity.

Here, I'll look at the difference between Network Attached Storage devices--which are network attached appliances that simply let you store files--and a home-built PC file server.

Cutting Costs

The geeks among you may be saying, "why not just buy a computer with lots of storage bays and create an array and share it? I mean, a NAS is a computer!"

Of course, this is all true. It's also true that a PC is cheaper to build, will be faster than the mostly ARM-based NASes on the market today, and can also do double duty with other roles and services. A PC contains commodity hardware that is both affordable, and readily available.

When it comes to cost, a PC is almost always cheaper.

However, this does not factor in how valuable your time is or whether your intent is to learn the ins-and-outs of storage configuration, which can be a tiresome road to travel.

In my case, I do not have the luxury of spending days tweaking a storage server, or logging in every week to kill runaway processes. I do not have the interest currently in researching all of the best-practice configuration file flags for critical file sharing services.

Future-proof & easy maintenance

NAS RAIDs are standard software RAIDs running on Linux's MD infrastructure. The MD subsystem is tried and true, but lacks some neat features offered at a bit of a higher level--that a NAS will not support. One such feature is the Logical Volume Manager of Linux, which allows very flexible allocation and de-allocation of storage into logical or virtual storage volumes. I use LVM quite frequently to grow shared storage by replacing drive, with almost zero downtime.

Do you really want your NAS to be a full-blown computer? Subject to routine upgrade and maintenance needs, viruses. Do you want to manage a server? Are you a sysadmin?

I've compared Synlogy, QNAP, and Thecus, the 3 underdogs of storage. (and NETGEAR, but I would relegate their NAS offerings to do duty as very well-built doorstops). My current favorite is QNAP.

The boxes are well-built, performant, and QNAP participates in the community. The hardware has gotten so slick, with such cool features as HDMI output, that in the hardware, they've actually pre-installed the XBMC Media Center! I applaud QNAP for going with a best-of-breed existing solution rather than trying to home-bake their own multimedia management solution.  That would have simply ended up being terrible and cause them lots of negative press. XBMC is almost universally recognized as one of the best unified entertainment centers among both the commercial and open-source offerings. It really is that good, and the documentation is even better, the XBMC wiki is second to none.

As I hear, Synology is offering similar features, but if you are one to consider who was there first (me), then you choose that vendor to encourage them to be ahead of the curve.

Joining a domain

If you are building your own storage server and want to integrate it into a domain, you are on your own in trying to get Kerberos and Samba talking Active Directory to your Domain Controllers. It's a secret sauce that Microsoft has kept the recipe under wraps for quite awhile.

Don't get me wrong, it's certainly possible, and many smart people can get this running very quickly on a Linux box, but I am not one of those people.

Finesse and Purposeful Duty

Any PC can be cheap, but a power-mising, living-room-quiet, compact mini PC starts to get into NAS cost territory anyway. A small ITX motherboard, compact case, and other PC components are expensive.

In that respect, a NAS is really great value!

But, even if you thought the PC was the cheaper solution, you've still gotta configure the RAID, keep track of what drives in which bays are on which SATA ports and hope you don't destroy your array if you remove the wrong drive when you go to do maintenance.

Add to this that most NASes are hot-plug ready, meaning zero downtime if you are just swapping out a drive on a RAID5 volume for example.

Plug and Play Apps

Most NAS devices these days come with cool addons, one of which is XBMC as mentioned earlier. I use my QNAP to stream webcams and create time lapses. I use it as a remote music player, since it has a nice streaming interface. I rsync my backups to it, I use it to tunnel SSH ports into my home network as a pseudo-VPN. I use it for VPN (OpenVPN). I use it to Torrent things and time them so I am not torrenting during peak evening hours when the Internet is slow.

You can plug in a USB audio stick and stream tunes straight from the NAS into your stereo system. It talks to your USB UPS and will shut down gracefully.

There are so many neat things you can use a low power, embedded Linux system for, it's quite amazing.

What to do with your hard-earned money?

Give it to QNAP or Synology, browse their respective forums, and enjoy easier and safer access to your files, along with a slew of great add-on apps.

Monday, November 11, 2013

Why I would not buy a NETGEAR ReadyNAS

Recently I had the fortune to test a NETGEAR ReadyNAS. Now this review is rather harsh toward the ReadyNAS, so I say "fortunate" because I most likely would have not been exposed to this hardware in any other context, and within minutes of beginning work on managing these devices it was clear to me that I would not use my own money to buy one. I'll detail why in just a moment.

For those not familiar with Network Attached Storage (NAS), a quick explanation would be that a NAS is like a hard disk that connects to a network. In addition to simple storage, a network-attached disk like this usually offers some other software features like all-inclusive backup, remote access through VPN, and media sharing. In summary, a NAS is a storage appliance; a place to store data that is plug and play.

This disappointing design and functionality of the ReadyNAS made me chuckle a bit, because I've been regularly called by NETGEAR marketers about selling ReadyNAS as part of my solution portfolio. I've explained to them that I am a QNAP and Synology guy, but they persist, attempting to answer my questions and assure me that their product does everything the QNAP does, and they act interested in my suggestions to improve the NETGEAR line. I don't know, from my perspective, the ReadyNAS is a solution beyond hope, and I feel that NETGEAR should just drop the product line. They are not a storage company.

http://www.theinquirer.net/inquirer/review/1014485/netgear-storage-central-killed-pcs

Introduction

My exposure comes from a job site where I was responsible for integrating a Philips Ultrasound system called Xcelera. As part of this solution, Philips uses 2 stock ReadyNAS Pro 4 to store and archive patient studies, which is basically all of the Ultrasound and analysis data that is generated.

As a sysadmin I am tasked with checking that studies are appearing on the NAS and subsequently copied to a second NAS.

User Interface

Firstly, the firmware for the ReadyNAS is called RAIDar. It has a web interface which I found to be quite poor functionally when compared to current firmwares from QNAP and Synology. The design and interactivity of I would estimate to be somewhere in the 2003 era, even though the firmware is dated 2012. While I may not be a fan of the "Desktop in your browser" mentality of the Synology and QNAP firmwares, at least they are featureful, perform well, are easy to use, and interactive in their feedback.

No Link to Admin Mode

Also, the first thing you do when you get to the RAIDar login page is realize that even if you log in as admin, there is nothing to configure! It's not readily apparent that you must use a separate URL for admin, otherwise from the base URL you are directed to a simple file manager page. There should be a link from the file management interface to the admin area.

https://netgear/shares/ = generic file manager
https://netgear/admin/ = admin area

File Manager

Since the file manager was one of the first things I saw in RAIDar, here's what it looks like:
Very rudimentary indeed. Here's the QNAP equivalent, which includes a nicer multi-pane view including previews, and search.


Share Creation

Creating shares is done through this form on the ReadyNAS.
There is nothing dynamic about this page unfortunately. But I can say that the bulk-operations aspect is somewhat appealing, on the QNAP you must go through 7 steps of a wizard to create a single share, but at least on the QNAP you can assign permissions on a share during creation. On the ReadyNAS, you must first create a share, then switch to manage permissions.

Audit Features

In the process of integrating the ReadyNAS Pro 4 into my auditing and logging framework, I quickly realized that remote logging is not supported. This leads me to conclude that the ReadyNAS and RAIDar are not auditable and should not be used in secure environments. This seems to be ignored in practice, as in this case the device is being used in a medical context. I suspect anyone using ReadyNAS at a PCI-DSS or HIPAA compliant site is ignoring this major shortcoming and possibly not being forthcoming with their suppliers, managers, and customers.

The interesting thing is that NETGEAR has shipped syslogd, which can send logs to a central logging host, however, you must log into the NAS via SSH (and possibly get denied future support) to get it to work!

The ReadyNAS forum has a particular thread started in 2008 where a user requests syslog functionality. It's 2013 as of this writing and it still has not been implemented.

In contrast, the QNAP can both log to remote hosts and itself act as a syslog server, and even send email alerts on syslog events, all without touching a config file! Very slick.


Add Ons & Community

The market for add-ons on the ReadyNAS is relatively poor. In addition, I could not get the market listing to load on my ReadyNAS, I needed to download packages manually from NETGEAR's website.

In contrast, what QNAP has done is taken great Open Source projects and ported them to work on the Turbo NAS series. In fact the newest Turbo NASes include HDMI output and QNAP went to lengths to port XBMC, a best-of-breed media center package, to the QNAP NAS, rather than doing something silly like writing their own solution. The included apps on QNAP are also quite nice, like OpenVPN, MySQL, ClamAV, and Photo, Video, and Music apps that let you access content through a web browser without the complexities of VPN.

The QNAP forums and QNAP wiki are also much more active and complete, respectively, than the NETGEAR ones.

Apps Market

This section of the post is relevant mostly to consumers and prosumers, as remote access to a NAS in a corporate environment is not a feature most companies are looking for.

However, I think that an active set of mobile apps shows a company's commitment to current technologies and the competency of their development team.

Let's compare!

Here is the NETGEAR app list for Android. Very poor reviews! The icons don't even match. It seems either the apps don't work, or people are having trouble using them. 2-star averages.
And here is a list for Synology. At least all of their icons are consistent looking. There are a lot of apps! Generally 4-star reviews.
And here is QNAP. The reviews are generally favorable, and most icons are consistent.
And Thecus. Not many apps, but maybe features are consolidated in each app.










In summary

In short, my experiences with NETGEAR have shown them to be a lackluster company when it comes to quality control and feature requests. They do seem to fix their bugs.

My experience with NETGEAR support on a VPN firewall I have from them also convinced me that NETGEAR is interested in selling hardware, but not interested in supporting it.

I would not recommend NETGEAR ReadyNAS, or their other products to any of my clients, save for network switches or any of their other products that do not have complex firmware or functionality. As far as I'm concerned, NETGEAR is a simple network gear company that excels only at creating "dumb" devices. They should  stick to their niche.

The positives:
  • Nice little handle at the back of the machines to make them easy to carry
  • Build quality is professional
  • NETGEAR donates to netatalk, the FLOSS project that develops the AFP functionality in all NASes
  • Some cool addons @ http://www.readynas.com/?cat=75
  • Batch adding of shares

The negatives:
  • Clunky user interface
  • Lacking advanced features
  • Threatening disclaimers when trying to get root shell access
  • Poor community involvement and community documentation
  • Poorly rated mobile apps
  • No syslog auditing for compliance, a critical enterprise feature

If you are looking for an extensible, feature-rich, easy-to-use NAS, with a great support community, and enterprisey features, look elsewhere.

Friday, October 4, 2013

What do I name my server? (server naming guidelines)

Best practices

For more ideas on server naming, I really like this article, and the handy abbreviations he has come up with.
<location><role><sequence>

Example for some database servers in Ontario (ON = Ontario, SQL = SQL Server):
ONSQL01
ONSQL02

Drawbacks of the "smart" naming approach

The one drawback of this approach is that server roles are often changing, and installing a new service would could render the function of a server to something completely different. Many services will refuse to work properly if the server is renamed, and this is often hard to predict, so the approach should always be "don't rename servers" in my book. There may be certain roles that never change, i.e. things like Active Directory, where its fairly certain that an AD server will always be an AD server.

The second drawback of such a naming scheme is that the names can get so unwieldy that you may as well have gone with servers named after Looney Tunes characters and simply looked them up in a name -> role table.

Commentor "Bish" in the above reference blog post at retrohack.com writes:
My company is the embodiment of your plan. USWAFTP104, UKLODC62, etc. It is the hell anyone would instantly recognize after 12 seconds of consideration.
Which machine was that? Do you mean USMIESX4H2 or was that USMIESX2H4 that you just shut down? Oh no! The amount of times that someone remotes (ssh, rdp, etc) into a box and – even if they double-check the number 6 times – shuts down, patches or reboots the wrong host is astounding.
A lot of my clients are using UNC paths (\\) to launch applications and services, and trying to explain to a user to open a Run window and type USMIESX4H2 as the server name is just very unfriendly.


Because of this, it may be wise to implement completely "agnostic" names such as those listed at namingschemes.com. Of course, naming all of your servers after ships that appear in Star Trek may is probably a logical approach (thanks, Spock), but your resident boss may think they are too childish. In my opinion this plays a factor only if your organization is client facing, ie, "Hi Mr. Schneider, yes, log into your client portal on daffy.procompany.com".

My picks today are (appropriately nerdy):
  1. Car parts (pedal, clutch, wheel)
  2. Chess pieces (rook, queen, pawn)
  3. Periodic table elements (copper, chromium, hydrogen)
  4. Planets (mars, jupiter, saturn)
  5. Greek alphabet (alpha, beta, though there are some unfriendly names like 'mu'), this is closely related to the UN/NATO Alphabet.
Take Greek Gods for example, you can name Athena, and expand this either numerically, like 'athena1', 'athena2', or geographically like 'athena-west' 'athena-east' and still have some semblance of user friendliness. However, it should be noted that some common practices include making regional servers part of their own DNS subdomains such as athena.west.example.com and athena.east.example.com, but conversely many DNS naming documents suggest NOT having the same hostnames for any servers even if they are in different DNS domains!

What Microsoft Says

And of course, what  post on this blog would be complete without poking a bit of fun at Microsoft for going the exact opposite direction in recommending non-industry standard naming conventions. I like this gem:
"Identify the owner of the computer in the computer name."
from KB909264 at Microsoft's site.


No! No! No! This is some terrible advice! I run into this all of the time, where a client lets an employee go and wants to change the name, or confusion rising out of "Fred" using a PC called "TomPC1". Absolutely couter-intuitive.

Not to mention that some well-known RFCs discourage this naming convention, such as RFC1178.


Not only that, but I've had clients insist that the name of their computer be changed, even though for most intents and purposes, the hostname is never seen and is irrelevant to their job function, but it just feels wrong, because "Tom" stole from the company and "I might get some bad juju from being associated with him in any way." Then I need to explain that changing the name may break some services in an unpredictable way somewhere down the line, and in the process see the user get the glazed-over look.

For client PCs

I settled at first on desktop-XX for desktops then notebook-XX for notebooks as my company's naming conventions for clients (under 100 employees), and later I dropped the hyphen because it's unnecessary.

So there you have it.