Monday, February 1st, 2010
I've been using a php script as a gateway to fetching certain content from a server, mainly mp3 files. There are a bunch of reasons for doing this, the main ones would be to be able to easily log which files are being accessed, when, and by who - and if you plan on creating widgets for your users to stream the content they upload to your site and they happen to put it on a heavily visited part of the web you can temporarily disable or limit that user's widget's access to content giving your other user's priority and preventing your server from crashing or being overworked.
So in the Flex/AIR app I've got a URLRequest that's used to load a Sound object. Instead of specifying the index.php it had been accessing http://domain.com?var1=blah&var2=blah. Usually this will redirect to the index.php sending it the post variables and letting it do it's thing and fetch the mp3. It works on Adobe AIR for Mac, it works in a browser on Mac/Windows. But in a URLRequest from Windows it doesn't work, confirmed for XP and 7. It doesn't just redirect to the /index.php file and drop the POST/GET variables, it actually just doesn't redirect anywhere, and you get an IOError. You'd think the redirect would be handled entirely by the server and transparent to the client, but it appears that for whatever reason, Adobe AIR on Windows just returns an IO Error.
Either way it's easy to fix, you just have to specify the index file in your URLRequest like so: http://domain.com/index.php?var1=blah&var2=blah.
Tags: Adobe, AIR, Flex, gateway, mp3, not working, php, sound, streaming, urlrequest, Windows
Posted in Code, Programming | No Comments »
Monday, June 30th, 2008
While I've been Mac based for more than a year now (and how fantastic it is), I still have an old Windows box that I use as a local media server. I know from experience not to put anything valuable on it, and as an added layer of security for this still-paranoid-former-Windows-user I have a dual boot setup with the latest Kubuntu as a just-in-case. At least I'll be able to get online and troubleshoot. Despite my best practices I've just had to go through an all to familiar process with a family member's laptop. A majorly corrupt memory module caused a Windows XP re-installation to fail midway. The only option was to erase the hard drive, from something called Doctor Dos. Regardless after several hours of erasing everything, turning on the machine seemed pointless. First something called Intel Boot Agent kept declaring there was no operating system on any storage devices. After playing around with the BIOS settings changing the boot order and putting copies of Linux onto everything from thumb-drives to cds without any luck, I eventually went back into the BIOS and disabled network boot. This solved one problem and caused another.
It was no longer declaring "no operating system found" after long stints of doing nothing but was now just a blank screen and a blinking cursor. Now finally something I recognized, I had done this to my computers plenty of times, I knew there was an easy way out, but just couldn't remember what it was. Naturally I spent the next 4 hours trying everything and anything, but then Google proved it couldn't solve every problem and as I went into that dark place of accepting I'd lost and reached for a hammer, the familiarity of the rooms emotion accessed that one piece of information I needed.
All I had to do was tap shift a bunch of times while it was starting up with [any] bootable operating system disk in the cd tray and installation would start, it would all be resolved... but by the time that thought was complete the laptop was in 12 pieces on the desk in front of me, strangely all the vowel keys must have seen it coming and were way on the other side of the room, and one fluid motion to the next I snapped the biggest remaining pieces over my knee, and will likely have a serious limp for the rest of my life.
So to anyone in the future, just hit shift a bunch of times.
Tags: dos, error, install, Mac, virus, Windows
Posted in Software | No Comments »
Tuesday, May 20th, 2008
After a year and a half of using a mac I can say for certain that it's a far more secure environment than windows. I can't imagine ever doing anything important on a windows machine ever again, back when I used windows for work re-installing the entire operating system was a monthly routine, about 90% of these incidents were virus related despite heavy use of system intensive anti-virus software, firewalls, anti-spyware software, and every other effort to prevent it.
While reading a debate on a tech-blog between the commenters of a provocative post polling whether or not you use anti-virus software and why, I ran across a link to an article written almost 2 years ago at InfoWorld [http://weblog.infoworld.com]. The point argument: which is the safer operating system--Windows or OS X, and the old claim that the reason there are no mac viruses* is due to Apple's small market share (of millions and millions of customers). The following is an excerpt from the article listing some of the technical holes that exist in Windows and not in OS X that would allow a virus to get into your system, and hide. Since it's writing Apple has released a Leopard which is even more secure than previous versions, while Microsoft has done the same, most of these flaws still exist in Vista where the most tangible security improvement being disabled by most users due to it's irritating nature.
...
- All Windows background processes/daemons are spawned from a single hyper-privileged process and referred to as services.
- By default, Windows launches all services with SYSTEM-level privileges.
- SYSTEM is a pseudo-user (LocalSystem) that trumps Administrator (like UNIX's root) in privileges. SYSTEM cannot be used to log in, but it also has no password, no login script, no shell and no environment, therefore
- The activity of SYSTEM is next to impossible to control or log.
- Most of the code running on any Windows system at a given time is related to services, most or all of which run with SYSTEM privileges, therefore
- Successful infection of running Windows software carries a good chance of access to SYSTEM privileges.
- Windows buries most privileged software, service executables and configuration files in a single, unstructured massive directory (SYSTEM32) that is frequently used by third parties. Windows will notify you on an attempt to overwrite one of its own system files stored here, but does not try to protect privileged software.
- Microsoft does not sign or document the name and purpose of the files it places in SYSTEM32.
- Windows has no equivalent to OS X's bill of materials, so it cannot validate permissions, dates and checksums of system and third-party software.
- Windows requires that users log in with administrative privileges to install software, which causes many to use privileged accounts for day-to-day usage.
- Windows requires extraordinary effort to extract the path to, and the files and TCP/UDP ports opened by, running services, and to certify that they are valid.
- Microsoft made it easy for commercial applications to refuse a debugger's attempt to attach to a process or thread. Attackers use this same mechanism to cloak malware. A privileged user must never be denied access to a debugger on any system. My right to track down malware on my computers trumps vendors' interests in preventing piracy or reverse-engineering. Maintaining that right is one of the reasons that open source commercial OS kernels are so vital.
- Access to the massive, arcane, nearly unstructured, non-human-readable Windows Registry, which was to be obsolete by now, remains the only resource a Windows attacker needs to analyze and control a Windows system.
- Another trick that attackers learned from Microsoft is that Registry entries can be made read-only even to the Administrator, so you can find an exploit and be blocked from disarming it.
- Malicious code or data can be concealed in NTFS files' secondary streams. These are similar to HFS forks, but so few would think to look at these.
- One of the strongest tools that Microsoft has to protect users from malware is Access Control Lists (ACLs), but standard tools make ACLs difficult to employ, so most opt for NTFS's inadequate standard access rights.
Why this can't happen under OS X:
- OS X has no user account with privileges exceeding root.
- Maximum privilege is extended only to descendants of process ID 1 (init or Darwin's launchd), a role that is rarely used and closely scrutinized.
- Unlike services.exe, launchd executes daemons and scheduled commands in a shell that's subject to login scripts, environment variables, resource limits, auditing and all security features of Darwin/OS X.
- Apple's daemons have man pages, and third parties are duty-bound to provide the same. Admins also expect to be able to run daemons, with verbose reporting, in a shell for testing.
- OS X Man pages document daemons' file dependencies, so administrators can easily rework file permissions to match daemons' reduced privileges.
- Launchd can tripwire directories so that if they're altered unexpectedly, launchd triggers a response.
- If an attacker takes over a local or remote console, any effort to install software or alter significant system settings cannot proceed without entering the administrator's user name and password, even if the console is already logged in as a privileged user. In other words, even having privileges doesn't ensure that even an inside hacker can arrange to keep them.
- OS X has a single console and a single system log, both in plain text.
- OS X's nearest equivalent to the Registry is Netinfo, but this requires authentication for modification. In later releases of OS X, it is fairly sparse.
- Applications have their own per-user and system-wide properties files, private Registries if you like, stored in human-readable files in standard locations.
- Every installed file is traceable to a bill of materials that can verify that the file is meant to exist, and that it and all of its dependencies match their original checksums. Mac users, back up and protect your Receipts folder!
- The directories used to hold OS X's privileged system executables are sacred. Anything new that pops up there is immediately suspect.
- OS X does not require that a user be logged in as an administrator to install software. The user or someone aiding the install needs to know the name and password of a local administrative user to complete the install. On a network, most software is installed using Remote Desktop, an inexpensive Systems Management Server-like console.
- The UNIX/POSIX API, standard command-line tools and open source tools leave malware unable to hide from a competent OS X administrator. It takes a new UNIX programmer longer to choose an editor than it does to write a console app that walks the process tree listing privileged processes. Finding the owners of open TCP/UDP ports or open files is similarly trivial. The "system" is not opaque.
- Basic OS X features can be put to use to make life miserable for malware. For example, Windows' hackable restore points are done better by OS X's ability to create encrypted, read-only disk images. They're simpler than archives, and you can mount them as volumes anywhere in your file hierarchy.
- Likewise, OS X Server will image any Mac client or server's local drives and maintain safe copies that can be used not only for restoration, but which can be booted from to guarantee that there's no trace of infection.
- When erase-and-reinstall is the only way to be sure, OS X Server automates it. It can safely capture the affected Mac's active drives before having that Mac boot from the fresh install image.
So, after all this, do I have enough to judge Windows inherently more vulnerable to severe malware than OS X? I do.
...
-- by Tom Jager at [http://weblog.infoworld.com/...s_inhe.html] - click to read the whole article.
* The term 'virus' used here relates to malicious software being installed on your system without your knowledge. There is some malicious software (that I am aware of) on macs, and there's no reason why anyone couldn't just write some malicious code, however the secure unix foundation of mac os x and all of it's security features prevent malicious code from being executed without your explicit consent in 99% of cases and if a virus does get running it can't do anything significant without knowing an admin username and password and even then without tipping off the numerous checks and balances that something is awry.
Tags: Mac, OSX, platform, security, viruses, Windows, XP
Posted in Software | No Comments »