security

Escaping PHP GET and POST values [duplicate]

笑着哭i 提交于 2020-01-13 11:34:09
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: The ultimate clean/secure function I was informed in another thread that this bit of code was pretty useless: function getPost($s) { if (array_key_exists($s, $_POST)) return mysql_real_escape_string(htmlspecialchars($_POST[$s])); else return false; } function getGet($s) { if (array_key_exists($s, $_GET)) return mysql_real_escape_string(htmlspecialchars($_GET[$s])); else return false; } Can anybody help

Cannot copy file, even though FileIOPermission is granted in C#

不羁岁月 提交于 2020-01-13 11:26:53
问题 I was trying out the FileIOPermission in Windows 7 in .NET 3.5. I have been a Windows XP user and was granted this permission as I was an administrator I wrote the following code, testing to see if I could write to C:\Program Files\Outlook...... static void Main(string[] args) { Console.WriteLine("Am I an administrator? " + new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator); // Try and open a file in C:\Program Files\Microsoft Office\Office14

Check a certificate validity against a custom trust list in Java

百般思念 提交于 2020-01-13 11:12:33
问题 I have a document that is digitally signed using CAdES. I use BouncyCastle APIs to get the X509Certificate[] instances of the signers, but let's assume the list contains one and one only element. I need to verify whether this certificate is trusted or not at today's date, and I don't want to use the system's standard trust store which is normally used to trust SSL certificates. No, I want to build my own trust list with a list of .cer files in my classpath. At the moment, a single CA is

SecurityException in Sandboxed AppDomain

百般思念 提交于 2020-01-13 10:15:10
问题 I'm attempting to use C# as a scripting language using CSharpCodeProvider (using VS2010 and .NET 4.0). I want the scripts to be run in a restricted AppDomain with minimal permissions. Currently, I'm getting an exception while trying to instantiate a class in the AppDomain (The call to CreateInstanceAndUnwrap() ). Here is some simplified code that reproduces the exception: using System; using System.Collections.Generic; using Microsoft.CSharp; using System.CodeDom; using System.CodeDom

can I be hacked with this code?

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-13 09:29:25
问题 I purchased a script that has some weird code in it. I'm a PHP beginner but know a little about things like sanitizing input data. This is the code: <form action="sendpass.php" method="post" id="sendpassform"> <input type="text" name="email" /> <input type="submit" name="sendpass" value="Send" /> </form> ?> ... if($_REQUEST['email'] != ''){ $email = $_REQUEST['email']; $k = mysql_query("SELECT * FROM users WHERE email='".$email."'") or die(mysql_error()); $result= mysql_fetch_array($k); ....

Where to store large application data on android devices?

自闭症网瘾萝莉.ら 提交于 2020-01-13 09:17:27
问题 I'm currently facing a problem where I should store my object structure on the android device. The usecase: I'm starting a call to an applicationserver (with the great help of AsyncTask), get a well known response (xml-response) from the server, parse the data and transform it finally into my object structure (highly complex class diagram with many associations between the classes). So far it's working, thanks to the great XMLPullParser ;) I'm wondering where to store (and of course share)

Do assemblies placed in the GAC gain full trust?

限于喜欢 提交于 2020-01-13 09:16:21
问题 I've been hearing conflicting facts about this topic. What is correct? 回答1: You've been hearing conflicting views because it's a topic of great confusion, even among senior engineers. In short, simply placing an assembly in the GAC does implicitly give it full trust, but this can be overriden via security policy. EDIT1: Let me add that a common thought is if you don't trust an assembly fully, why are you placing it in the GAC? EDIT2: I had a link in here to a blog post from Michelle

Security impact of access modifiers (public, private, internal, protected)

旧巷老猫 提交于 2020-01-13 09:14:29
问题 Do the access modifiers of classes , properties or methods in C#, Java and other programming languages actually have an impact on the security of an application? Do they also protect against unauthorized access in some way? Or are they just a tool for clear and propper programming? 回答1: No, access modifiers don't offer security protection. They are merely there for developer convenience, e.g. they help to enforce good coding practices and help with programming patterns. It's easy to access

AWS - Configuring access to EC2 instance from Beanstalk App

青春壹個敷衍的年華 提交于 2020-01-13 08:16:24
问题 So for reasons Id rather not go into, my DB is on an EC2 instance in eu-west-1 and I have created a beanstalk app on us-east-1. Id like my app to talk to that EC2 instance on a MySQL port (3306). Can anyone assist with how Id set this up, what ingress rules I need to setup on the EC2 security group? Given that I will have multiple versions of the app in beanstalk, the IP address may change regularly (after environment rebuilds etc). 回答1: The important concept regarding Security Group Rules

General Password Security && Implementation in Actionscript 3

陌路散爱 提交于 2020-01-13 07:15:23
问题 My project for this summer is to make a multiplayer online flash game. I could use some advice as I've never implemented a secure login system before, let alone done so in Actionscript. My setup right now is a .swf sending/receiving game data to/from a Java server which communicates with a MySQL database about account info. 1) How should I proceed in general? I was thinking that maybe I should have my .swf encrypt the password, send it, (have my server encrypt it again?), then store it in the