小编Joe*_*Joe的帖子

错误的System.Web.Mvc更新

我在GAC中添加了System.Web.Mvc v4.0.0.0,因此我通过nuget手动安装了Mvc,其中包含"Install-Package Microsoft.AspNet.Mvc -Version 5.2.3".

我现在安装了System.Web.Mvc v5.2.3.0, NuGet经理

和GAC中的System.Web.Mvc v4.0.0.0 GAC

我在Web.config中有这个:

 <dependentAssembly>
    <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
  </dependentAssembly>
Run Code Online (Sandbox Code Playgroud)

我构建并运行该项目,我得到了下一个错误:

无法加载文件或程序集'System.Web.Mvc,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35'或其依赖项之一.该系统找不到指定的文件.

但是我已经配置并添加了MVC v5.2.3.0包.为什么会出现此错误?

已解决的 Dereference System.Web.Mvc参考 - >右键单击 - > Mange NuGet包... - >卸载MVC - >现在"安装".

asp.net nuget

5
推荐指数
1
解决办法
2818
查看次数

找不到类型或命名空间名称“ClaimsIdentity”

我已经添加了这些用途并安装了 nuget 包。为什么我不能使用 Claim?Visual Studio 表示无法找到 ClaimsIDentity、Claim 和 ClaimTypes。

~/Controllers/AccController.cs

using Microsoft.AspNet.Identity;
using Microsoft.Owin.Security;
using System.Threading.Tasks;
using System.Web;
using System.Web.Mvc;

namespace MyProject.Controllers
{
    public class AccController : Controller
    {
        [AllowAnonymous]
        [HttpPost]
        public ActionResult Login(LoginModel model)
        {
            if (!ModelState.IsValid)
            {
                return View();
            }

            // Don't do this in production!
            if (model.Email == "admin@admin.com" && model.Password == "password")
            {
                var identity = new ClaimsIdentity(new[] {
                new Claim(ClaimTypes.Name, "Ben"),
                new Claim(ClaimTypes.Email, "a@b.com"),
                new Claim(ClaimTypes.Country, "England")
            },
                    "ApplicationCookie");

                var ctx = Request.GetOwinContext();
                var authManager …
Run Code Online (Sandbox Code Playgroud)

c# asp.net

1
推荐指数
1
解决办法
2903
查看次数

执行shellcode分段错误

我编译了一个基本的漏洞利用(基本上,C中的源代码没有任何用处,只需执行执行Bash的操作码).问题是当我执行二进制文件时:"分段错误".

在这里我做了什么:

executeBash.asm(NASM)

section .text
global _start
_start:
xor EAX, EAX           ; EAX = 0
push EAX               ; "\0\0\0\0"
push DWORD 0x68732F2F  ; "//sh"
push DWORD 0x6E69622F  ; "/bin"
mov EBX, ESP           ; arg1 = "/bin//sh\0"
push EAX     ; NULL -> args[1]
push EBX     ; "/bin//sh\0" -> args[0]
mov ECX, ESP ; arg2 = args[]
mov AL, 0X0B ; syscall 11
int 0x80     ; excve("/bin//sh", args["/bin//sh", NULL], NULL)
Run Code Online (Sandbox Code Playgroud)

在终端:

prompt$ nasm -f elf32 executeBash.asm
prompt$ ld -m elf_i386 executeBash.o -o …
Run Code Online (Sandbox Code Playgroud)

c linux x86 assembly gcc

0
推荐指数
1
解决办法
1670
查看次数

标签 统计

asp.net ×2

assembly ×1

c ×1

c# ×1

gcc ×1

linux ×1

nuget ×1

x86 ×1