Skip to main content

Posts

Showing posts with the label Security

Why do browsers allow onmousedown JS to change href?

I've noticed for a very long time that when you try to copy a link location or open a link on Facebook, it modifies the link and passes it through l.php . For example, I can be sent to http://www.facebook.com/l.php?u=http%3A%2F%2Fwww.google.com%2F&h=DKVUritNDJDJLDLVbldoDLFKBLOD5dlfDJY_-d3fgDUaA9b even though my browser render the link preview as http://www.google.com/ . Today, I took a closer look using Firebug and found that Facebook puts onmousedown="UntrustedLink.bootstrap($(this)[...] in the <a> tag. The second I right clicked the link, I saw the href attribute change in Firebug. This worries me. The advice many of us have given to less tech-savvy people (check where the link is taking you before you click so that you don't become a victim of phishing) now seems to have become useless. Isn't this a security risk? Can't phishing websites misuse this? Why don't browsers prevent this behavior either by disallowing onmousedown to c

Are there any differences between SQL Server and MySQL when it comes to preventing SQL injection?

I am used to developing in PHP/MySQL and have no experience developing with SQL Server. I've skimmed over the PHP MSSQL documentation and it looks similar to MySQLi in some of the methods I read about. For example, with MySQL I utilize the function mysql_real_excape_string() . Is there a similar function with PHP/SQL Server? What steps do I need to take in order to protect against SQL injection with SQL Server? What are the differences between SQL Server and MySQL pertaining to SQL injection prevention? also - is this post accurate? is the escape string character for SQL Server a single quote? Source: Tips4all

Is this sufficient to protect against a CSRF for an ajax-driven application?

I'm working on a completely ajax-driven application where all requests pass through what basically amounts to a main controller which, at its bare bones, looks something like this: if(strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') { fetch($page); } Is this generally sufficient to protect against cross-site request forgeries? It's rather inconvenient to have a rotating token when the entire page isn't refreshed with each request. I suppose I could pass and update unique token as a global javascript variable with every request -- but somehow that feels clumsy and seems inherently unsafe anyway. EDIT - Perhaps a static token, like the user's UUID, would be better than nothing? EDIT #2 - As The Rook pointed out, this might be a hair-splitting question. I've read speculation both ways and heard distant whispers about older versions of flash being exploitable for this kind of shenanigans. Since I know nothing about that

Android encryption

I am working on an android application, and I need to use encryption for one aspect of it. I am really indifferent to which algorithm I use (AES, DES, RSA, etc...). I am aware that Java has a crypto package, but I am not familiar with it at all. Can someone post an example on how to do an encrypt/decrypt function?

How can I check website security for free?

I've heard that there are some free applications that will check the vulnerability of a PHP website, but I don't know what to use. I'd like a free program (preferably with a GUI) for Windows that will analyze my site an give me a report. Anyone know of a solution?

Encrypting a folder for an Android app?

The app I am working on gets all the files from the sdcard but these files are really important and the app should maintain a security issue .So is there a way that the folder or directory that contains the file may be encrypted or locked with a key and only be used by my app? Please help I am newbie and stuck at this point.

Escaping quotes - moving from PHP4 to PHP5

I've inherited a php4 site that needs to run on my PHP5 Server, I've solved most of the issues but can't figure out what the author was trying to do here. Well, to be precise, he was tring to quote the submitted text but I'm not sure how this function is supposed to work and how I should do it in PHP5? # Function to safely add slashes when magic quotes is switched off function safe_slash($string) { if (!get_magic_quotes_gpc()) { $string = addslashes($string); } return $string; }

Is there a way to block a class from being reflected upon?

I am making a cipher class while teaching myself about java's security api. This class is going to have some sensitive stuff in it, such as the type of encryption and the like. All of this can be reflectively retrieved it some one had the motivation. I have used reflection to bypass private variables and methods before (not proud of it), so I know that can be done. Is there a way to wholly prevent reflection from working on an entire class - or even parts of it, or does that go against java's - more specifically the security api - design?

Enable Passwords On Cisco Routers Via Enable Password And Enable Secret

Security is a part of every good technical administrator’s game plan. Luckily the good folks at Cisco have made the task of securitizing a Cisco router fairly straightforward in design- with support given for up to five types of passwords. Taking advantage of these passwords is vital to a network’s internal security, and should be implemented where permitted. Enable Password – The Most Basic Of Security Features The two most basic of passwords a Cisco router can provide support for is the enable password and enable secret commands. Depending on the IOS version, administrators will likely only need to setup the enable secret command. For Cisco routers running IOS versions before version 10.3, enable password is going to be used. It is the outdated version of the two, and we’ll see why it isn’t used in average applications after we enable it. You can enable this basic password following the commands seen below. Router> enable Router# config terminal Enter configuration co