-
Notifications
You must be signed in to change notification settings - Fork 480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error loadFromRemoteSources #99
Comments
In order to solve it do: -open powershell and read the version of .net. -Now with the version of .net, if you are on 32 bits machine go to -Then edit the file machine.config in order to get something with
Then it should works. Sources: -https://stackoverflow.com/questions/2325473/where-is-machine-config/2325492#2325492 As you can see it was a mitigation and you need that the target system disable this mitigation. No idea if it is bypassable. |
@chmod750 after a long long reading I think it is a bug that lead to block on c# sandbox. Some generator bypass it some do not. Sounds to be a bug. Not your mistake. |
I was just reading this to see how I can resolve it. I ran it and it worked for me without a bypass. I am running this on a Windows 11, I wonder what the test environment is when this error appears. This gadget relies on a patched issue and I think we are including a vulnerable DLL with the project for it so the tests would work. This means that even if there is an issue here, it would only affect the |
Just realised ASP.NET Core Runtime 2.1.23 was used to run it. I have never used anything other than .NET Framework and Mono to run ysoserial.net so it will be interesting to me to see if it even runs... |
It worked for me on mono teh last year!! @irsdl could you provide more infos on your system please? I hope there is no regression!!! |
I only use a windows box with .net framework to generate the payloads which might not be ideal for automation. I will try to see if I can make it in a linux container with mono. If you have already done it, please share the details so it can speed things up. |
Hello,
I have an error executing a PSObject payload (ASP.NET Core Runtime 2.1.23). Does it means I have to bypass loadFromRemoteSources restrictions on the target too?
ysoserial.exe -f BinaryFormatter -g PSObject -o base64 -c "ping 10.0.0.1" -t
Unhandled Exception: System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.
at System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence)
at System.Reflection.Assembly.LoadFile(String path)
at ysoserial.Generators.PSObjectGenerator.Generate(String formatter, InputArgs inputArgs) in D:\a\ysoserial.net\ysoserial.net\ysoserial\Generators\PSObjectGenerator.cs:line 67
at ysoserial.Generators.GenericGenerator.GenerateWithInit(String formatter, InputArgs inputArgs) in D:\a\ysoserial.net\ysoserial.net\ysoserial\Generators\GenericGenerator.cs:line 68
at ysoserial.Program.Main(String[] args) in D:\a\ysoserial.net\ysoserial.net\ysoserial\Program.cs:line 197
The text was updated successfully, but these errors were encountered: