security

How do I add first user (root) in ASP.NET MVC app?

若如初见. 提交于 2020-01-06 02:54:08
问题 I'm using ASP.NET MVC Framwork and trying to grok the ASP Membership 3.5 stuff. What is the best way to add the first administrator user without having to log in? I've been staring at the membership starter kit's source without finding it. 回答1: A simple solution (especially or rather only for dev. purposes) by doing it in a "setup" action: if (!Roles.RoleExists("Administrator")) { Roles.CreateRole("Administrator"); } if (Membership.GetUser("Admin") == null) { Membership.CreateUser("Admin",

Adding Library to JRE

ε祈祈猫儿з 提交于 2020-01-06 02:30:12
问题 I work in an enterprise setting where we use a Java applet as part of an internal application. A Java class used by the applet is included in the JDK that we use to develop, but not in the JRE that end users have on their computers. As such, every time the applet is loaded, the users seem to be requesting the class from the server. Is there a way to "add on" this class to the JRE? Either as a JAR or otherwise? 回答1: The public API of JDKs from different vendors should be identical. So either

Adding Library to JRE

梦想的初衷 提交于 2020-01-06 02:30:06
问题 I work in an enterprise setting where we use a Java applet as part of an internal application. A Java class used by the applet is included in the JDK that we use to develop, but not in the JRE that end users have on their computers. As such, every time the applet is loaded, the users seem to be requesting the class from the server. Is there a way to "add on" this class to the JRE? Either as a JAR or otherwise? 回答1: The public API of JDKs from different vendors should be identical. So either

how to write back to an existing file, ensuring the bits on the disk get overwritten in OS X

六月ゝ 毕业季﹏ 提交于 2020-01-06 02:24:09
问题 What API's Cocoa or Core Foundation, can I use to make sure that when I write back to a file that already exists on the storage device, that the bits get written over? The idea is to clear out the bits for security reasons. 回答1: In modern filesystems, there's no way to guarantee that you are overwriting the same physical location on disk -- the lack of that guarantee allows the filesystem to offer you better performance. You might be interested in reading this paper (PDF), appropriately

The Defined function “mysql_entities_fix_string” in PHP isn't getting called

你离开我真会死。 提交于 2020-01-06 01:46:33
问题 <?php require_once 'login.php'; require_once 'welcome.php'; $db_server = mysql_connect($db_hostname,$db_username,$db_password); if(!$db_server) die("Unable to connect with MySql : " . mysql_error()); mysql_select_db($db_database) or die("Unable to connect with db"); echo <<<_END <form action = 'ps.php' method = 'post'><pre> Enter your Username <input type = 'text' name = 'username'> Enter your Password <input type = 'text' name = 'password'> <input type = 'submit' value = 'Cl1ck M3'> </pre><

The Defined function “mysql_entities_fix_string” in PHP isn't getting called

感情迁移 提交于 2020-01-06 01:46:08
问题 <?php require_once 'login.php'; require_once 'welcome.php'; $db_server = mysql_connect($db_hostname,$db_username,$db_password); if(!$db_server) die("Unable to connect with MySql : " . mysql_error()); mysql_select_db($db_database) or die("Unable to connect with db"); echo <<<_END <form action = 'ps.php' method = 'post'><pre> Enter your Username <input type = 'text' name = 'username'> Enter your Password <input type = 'text' name = 'password'> <input type = 'submit' value = 'Cl1ck M3'> </pre><

Can https fallback to http and security level of https

泪湿孤枕 提交于 2020-01-06 01:03:51
问题 I am considering installing SSL/TLS for my domain. There are two questions that have been bothering me: Is there any scenario where a https connection can fallback to http? So, for e.g. if my ajax looks something like this $.post("https://foo.com", function(){ }); Is there any chance this could change to $.post("http://foo.com", function(){ }); and even if it does would my domain be still accesible at http://foo.com ? Next I have read extensively about using SSL/TLS and from what I have read

Can https fallback to http and security level of https

南笙酒味 提交于 2020-01-06 01:03:49
问题 I am considering installing SSL/TLS for my domain. There are two questions that have been bothering me: Is there any scenario where a https connection can fallback to http? So, for e.g. if my ajax looks something like this $.post("https://foo.com", function(){ }); Is there any chance this could change to $.post("http://foo.com", function(){ }); and even if it does would my domain be still accesible at http://foo.com ? Next I have read extensively about using SSL/TLS and from what I have read

VBscript to get the properties of event from event ID

你说的曾经没有我的故事 提交于 2020-01-05 20:00:54
问题 I want to know if it is possible to get the IP of machine, logged on user, hostname from event id 4624 using vbscript? I want a vbscript which takes out this information: 回答1: It's possible. You need to query events with the ID 4624 from the eventlog and then parse name, IP address and port out of the message string, e.g. with a regular expression: Set wmi = GetObject("winmgmts://./root/cimv2") Set re = New RegExp re.Pattern = "Network Information:\s+" & _ "Workstation Name:\s*(.*?)\s+" & _

Convert .der to .pem using OpenSSL-Net

戏子无情 提交于 2020-01-05 17:40:53
问题 I have a .der certificate that is binary encoded which needs to be converted to a .pem file programatically in .net This line gives the correct output using OpenSSL on OSX: openssl x509 -inform der -in cert.crt -out cert.pem But we need to do the same in .net We have tried many solutions but are completely stuck. Would something like this work: var oc = OpenSSL.X509.X509Certificate.FromDER(bio); Any advice very welcome :) 回答1: In the end we were able to use this to import the DER into a