美文网首页
Visual Studio 2015导入项目文件

Visual Studio 2015导入项目文件

作者: seeiy | 来源:发表于2019-09-27 10:00 被阅读0次

    问题背景

    最近用到了GitHub上面的一个xxe-lap的项目,其中的C#编写的XXE Demo在拿来用的时候出现了一系列问题。。。

    问题1:
    GitHub上面的C#使用在看到.sln文件的时候发现是用2014写的,然后我用的是2010,结果出现错误提示 “选择的文件是解决方案文件 但是用此应用程序的较新版本创建的,无法打开”

    解决方法:

    Microsoft Visual Studio Solution File, Format Version 11.00
    # Visual Studio 2010
    

    用记事本方式打开.sln文件,将上面复制的两行语句替换.sln文件里面前两行语句,保存,再用vs2010就可以打开了

    2.不推荐上面的方法,因为后面还会遇到别的问题,最简单直接的方法就是下载一个2015版的Visual Studio导入

    问题2:
    提示缺少:Nuget

    解决办法:
    一、打开Visual Studio 2010,打开Tool->Extension Manager窗体.选择Online Gallery,在搜索框中输入NuGet下载

    二、2015版本直接就自带了NuGet

    问题3:
    未能找到 CodeDom 提供程序类型“Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider。。。

    解决办法:
    2015直接找到顶部任务栏找到工具->NuGet包管理器->程序包管理控制台
    然后在控制台输入:

    Install-Package Microsoft.CodeDom.Providers.DotNetCompilerPlatform
    
    image.png
    image.png

    问题4:
    提示缺少Properties/AssemblyInfo.cs这个文件

    解决办法:
    新建一个项目,然后找到那个项目Properties这个文件夹下的这个文件AssemblyInfo.cs,然后把这个文件复制到自己的项目对应路径下

    这里给出来AssemblyInfo.cs这个文件的内容,2015版项目的内容都是一样的

    using System.Reflection;
    using System.Runtime.CompilerServices;
    using System.Runtime.InteropServices;
    
    // General Information about an assembly is controlled through the following
    // set of attributes. Change these attribute values to modify the information
    // associated with an assembly.
    [assembly: AssemblyTitle("ContosoUniversity")]
    [assembly: AssemblyDescription("")]
    [assembly: AssemblyConfiguration("")]
    [assembly: AssemblyCompany("Microsoft Corp.")]
    [assembly: AssemblyProduct("ContosoUniversity")]
    [assembly: AssemblyCopyright("Copyright © Microsoft Corp. 2014")]
    [assembly: AssemblyTrademark("")]
    [assembly: AssemblyCulture("")]
    
    // Setting ComVisible to false makes the types in this assembly not visible
    // to COM components.  If you need to access a type in this assembly from
    // COM, set the ComVisible attribute to true on that type.
    [assembly: ComVisible(false)]
    
    // The following GUID is for the ID of the typelib if this project is exposed to COM
    [assembly: Guid("0d6e9993-c2b5-420d-a732-c42696a44472")]
    
    // Version information for an assembly consists of the following four values:
    //
    //      Major Version
    //      Minor Version
    //      Build Number
    //      Revision
    //
    // You can specify all the values or you can default the Revision and Build Numbers
    // by using the '*' as shown below:
    [assembly: AssemblyVersion("1.0.0.0")]
    [assembly: AssemblyFileVersion("1.0.0.0")]
    
    

    至此,问题全部解决,成功搭建了C#的XXE环境,但是有个问题,不知道为什么PHP的payload放到C#不生效。。没有办法读取任意文件,只能使用验证型的poc

    image.png

    相关文章

      网友评论

          本文标题:Visual Studio 2015导入项目文件

          本文链接:https://www.haomeiwen.com/subject/dxigyctx.html