« first day (3331 days earlier)      last day (1619 days later) » 

10:00 AM
@Wietbot evalCsharp ((System.Func<string>)(()=>{return
System.IO.File.Exists("/tmp/b.tmp")
.ToString();})).Invoke()
 
False
 
@Wietbot evalcsharp System.IO.Directory.GetFiles("/").ForEach(it => Console.WriteLine(it));
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,35): error CS7036: There is no argument given that corresponds to the required formal parameter 'action' of 'Array.ForEach<T>(T[], Action<T>)')
 
@Wietbot evalCsharp ((System.Func<string>)(()=>{
System.IO.File.WriteAllText("/tmp/b.tmp","123456");
return System.IO.File.Exists("/tmp/b.tmp")
.ToString();})).Invoke()
 
True
 
10:02 AM
are you sure its safe?
 
I hope so
@Wietbot evalcsharp foreach (string file in System.IO.Directory.GetFiles("/"))
{
Console.WriteLine(file);
}
 
null
 
@Wietbot evalCsharp ((System.Func<string>)(()=>{
System.IO.File.WriteAllText("/tmp/b.tmp","123456");
return 5
.ToString();})).Invoke()
 
5
 
null
 
10:04 AM
@Wietbot evalCsharp ((System.Func<string>)(()=>{
System.IO.Directory.GetFiles("/tmp/").ToList().ForEach(X=>System.IO.File.Delete(X))
return 5
.ToString();})).Invoke()
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,114): error CS1002: ; expected)
 
@Wietbot evalcsharp System.IO.File.ReadAllText("/tmp/b.tmp")
 
@Wietbot evalCsharp ((System.Func<string>)(()=>{
System.IO.Directory.GetFiles("/tmp/").ToList().ForEach(X=>System.IO.File.Delete(X));
return 5
.ToString();})).Invoke()
 
123456
 
hmm... csharp io is not readonly
node io is
 
10:05 AM
its dent respond
@Wietbot evalCsharp ((System.Func<string>)(()=>{
System.IO.Directory.GetFiles("/tmp/").ToList().ForEach(X=>System.IO.File.Delete(X));
return 5
.ToString();})).Invoke()
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,68): error CS1061: 'string[]' does not contain a definition for 'ToList' and no accessible extension method 'ToList' accepting a first argument of type 'string[]' could be found (are you missing a using directive or an assembly reference?))
 
@Wietbot evalcsharp string.Join(", ", System.IO.Directory.GetFiles("/tmp"))
 
<empty result>
 
@Wietbot evalCsharp ((System.Func<string>)(()=>{
foreach (var X in System.IO.Directory.GetFiles("").ToList()) System.IO.File.Delete(X);
return 5
.ToString();})).Invoke()
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,81): error CS1061: 'string[]' does not contain a definition for 'ToList' and no accessible extension method 'ToList' accepting a first argument of type 'string[]' could be found (are you missing a using directive or an assembly reference?))
 
10:07 AM
@Wietbot evalCsharp ((System.Func<string>)(()=>{
foreach (var X in System.IO.Directory.GetFiles("/tmp/")) System.IO.File.Delete(X);
return 5
.ToString();})).Invoke()
 
/tmp/clr-debug-pipe-2-276344-in, /tmp/clr-debug-pipe-2-276344-out, /tmp/b.tmp
5
 
two output?
 
@Wietbot evalcsharp string.Join(", ", System.IO.Directory.GetDirectories("/"))
 
/sbin, /media, /bin, /var, /selinux, /usr, /opt, /srv, /sys, /etc, /lib, /root, /tmp, /lib64, /mnt, /proc, /home, /dev, /boot
 
ah
@nyconing other was mine
 
10:07 AM
@Wietbot evalcsharp System.IO.File.ReadAllText("/tmp/b.tmp")
 
System.IO.FileNotFoundException(Could not find file '/tmp/b.tmp'.)
 
delete was successful
 
@Wietbot evalcsharp System.IO.File.ReadAllText("/tmp/clr-debug-pipe-2-276344-in")
 
System.IO.FileNotFoundException(Could not find file '/tmp/clr-debug-pipe-2-276344-in'.)
 
@Wietbot evalcsharp string.Join(", ", System.IO.Directory.GetFiles("/tmp"))
 
10:09 AM
hehe can I try it one another folder that looks like system file?
 
<empty result>
 
wut?
oh, wait
i see
@nyconing sure, go ahead
its only a container anyway
 
@Wietbot evalCsharp ((System.Func<string>)(()=>{
foreach (var logicalDrive in System.Environment.GetLogicalDrives()) {
foreach (var X in System.IO.Directory.GetFiles(logicalDrive).ToList()) System.IO.File.Delete(X);
}
return 5
.ToString();})).Invoke()
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,161): error CS1061: 'string[]' does not contain a definition for 'ToList' and no accessible extension method 'ToList' accepting a first argument of type 'string[]' could be found (are you missing a using directive or an assembly reference?))
 
@Wietbot evalCsharp ((System.Func<string>)(()=>{
foreach (var logicalDrive in System.Environment.GetLogicalDrives()) {
foreach (var X in System.IO.Directory.GetFiles(logicalDrive)) System.IO.File.Delete(X);
}
return 5
.ToString();})).Invoke()
 
10:10 AM
System.UnauthorizedAccessException(Access to the path '/dev/urandom' is denied.)
 
ok
@Wietbot evalCsharp ((System.Func<string>)(()=>{
foreach (var logicalDrive in System.Environment.GetLogicalDrives()) {
foreach (var X in System.IO.Directory.GetFiles(logicalDrive)) try{System.IO.File.Delete(X);}catch{//skip it}
}
return 5
.ToString();})).Invoke()
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,244): error CS1513: } expected)
 
@Wietbot evalCsharp ((System.Func<string>)(()=>{
foreach (var logicalDrive in System.Environment.GetLogicalDrives()) {
foreach (var X in System.IO.Directory.GetFiles(logicalDrive)) {try{System.IO.File.Delete(X);}catch{//skip it}}
}
return 5
.ToString();})).Invoke()
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,246): error CS1513: } expected)
 
@Wietbot evalCsharp ((System.Func<string>)(()=>{
foreach (var logicalDrive in Environment.GetLogicalDrives()) {
foreach (var X in System.IO.Directory.GetFiles(logicalDrive)) {
try { System.IO.File.Delete(X); } catch { }
}
}
return 5
.ToString();})).Invoke()
 
10:12 AM
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,59): error CS0103: The name 'Environment' does not exist in the current context)
 
@Wietbot evalCsharp ((System.Func<string>)(()=>{
foreach (var logicalDrive in System.Environment.GetLogicalDrives()) {
foreach (var X in System.IO.Directory.GetFiles(logicalDrive)) {
try { System.IO.File.Delete(X); } catch { }
}
}
return 5
.ToString();})).Invoke()
 
System.IO.IOException(Not a directory)
 
I think aws will protects their system file
 
@Wietbot evalscharp string.Join(", ", System.IO.Directory.GetDirectories("/"))
 
/sbin, /media, /bin, /var, /selinux, /usr, /opt, /srv, /sys, /etc, /lib, /root, /tmp, /lib64, /mnt, /proc, /home, /dev, /boot
 
10:13 AM
else it will become a news "aws security vulnerability exposed"
 
@Wietbot evalcsharp foreach (string directory in System.IO.Directory.GetDirectories("/"))
{
    try
    {
        System.IO.Directory.Delete(directory);
    }
    catch (System.Exception ex)
    {
        Console.WriteLine(ex);
    }
}
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((7,12): error CS0246: The type or namespace name 'Exception' could not be found (are you missing a using directive or an assembly reference?))
 
oh great
 
Result: null
Output:
System.IO.IOException: Access to the path '/sbin' is denied.
at System.IO.FileSystem.RemoveDirectoryInternal(DirectoryInfo directory, Boolean recursive, Boolean throwOnTopLevelDirectoryNotFound)
at System.IO.FileSystem.RemoveDirectory(String fullPath, Boolean recursive)
at System.IO.Directory.Delete(String path)
at Submission#0.<<Initialize>>d__0.MoveNext()
System.IO.IOException: Access to the path '/media' is denied.
at System.IO.FileSystem.RemoveDirectoryInternal(DirectoryInfo directory, Boolean recursive, Boolean throwOnTopLevelDirectoryNotFound)
 
well...
@Wietbot evalcsharp string.Join(", ", System.IO.Directory.GetDirectories("/"))
 
10:15 AM
/sbin, /media, /bin, /var, /selinux, /usr, /opt, /srv, /sys, /etc, /lib, /root, /tmp, /lib64, /mnt, /proc, /home, /dev, /boot
 
nothing got deleted
not even tmp
@Wietbot evalcsharp string.Join(", ", System.IO.Directory.GetDirectories("/").Select(it => it + " " + System.IO.Directory.GetFiles("/" + it).Length))
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,59): error CS1061: 'string[]' does not contain a definition for 'Select' and no accessible extension method 'Select' accepting a first argument of type 'string[]' could be found (are you missing a using directive or an assembly reference?))
 
great
@Wietbot evalcsharp foreach (string directory in System.IO.Directory.GetDirectories("/"))
{
    Console.WriteLine(directory + " : " + System.IO.Directory.GetFiles("/" + directory).Length);
}
 
Result: System.UnauthorizedAccessException(Access to the path '/root' is denied.)
Output:
/sbin : 49
/media : 0
/bin : 59
/var : 0
/selinux : 0
/usr : 0
/opt : 0
/srv : 0
/sys : 0
/etc : 50
/lib : 0
 
System.IO.File.Delete delete file, not dir
 
10:20 AM
@Wietbot evalcsharp foreach (string directory in System.IO.Directory.GetDirectories("/"))
{
try
{
Console.WriteLine(directory + " : " + System.IO.Directory.GetFiles("/" + directory).Length);
}
catch
{
Console.WriteLine(directory);
}
}
 
Result: null
Output:
/sbin : 49
/media : 0
/bin : 59
/var : 0
/selinux : 0
/usr : 0
/opt : 0
/srv : 0
/sys : 0
/etc : 50
/lib : 0
/root
/tmp : 0
/lib64 : 127
/mnt : 0
/proc : 42
/home : 0
/dev : 7
/boot : 0
 
@Wietbot evalCsharp ((System.Func<string>)(()=>{
System.IO.Directory.Delete("/tmp/", true);
return 5
.ToString();})).Invoke()
 
System.IO.IOException(Access to the path '/tmp/' is denied.)
 
@Wietbot evalcsharp void Foo() => Console.WriteLine("test");
Foo();
 
Result: null
Output:
test
 
10:22 AM
@Wietbot evalCsharp ((System.Func<string>)(()=>{
System.Diagnostics.Process.Start("");
return 5
.ToString();})).Invoke()
 
System.InvalidOperationException(Cannot start process because a file name has not been provided.)
 
@Wietbot evalCsharp ((System.Func<string>)(()=>{
System.IO.File.WriteAllText("/tmp/a.txt","sudo power off");
System.Diagnostics.Process.Start("/tmp/a.txt");
return 5
.ToString();})).Invoke()
 
System.ComponentModel.Win32Exception(Permission denied)
 
@Wietbot evalcsharp void Break(string path)
{
    try
    {
        foreach (string childDir in System.IO.Directory.GetDirectories(path))
        {
            Break($"{path}/{childDir}");
        }
        foreach (string childFile in System.IO.Directory.GetFiles(path))
        {
            try
            {
                System.IO.File.Delete(childFile);
            }
            catch (Exception ex)
            {
                Console.WriteLine($"cant delete {path}");
            }
        }
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((19,9): error CS1524: Expected catch or finally)
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((19,9): error CS1524: Expected catch or finally)
 
10:25 AM
@Wietbot evalCsharp ((System.Func<string>)(()=>{
System.IO.File.WriteAllText("/tmp/a.sh","sudo power off");
System.Diagnostics.Process.Start("/tmp/a.sh");
return 5
.ToString();})).Invoke()
 
System.ComponentModel.Win32Exception(Permission denied)
 
wut?
@Wietbot evalcsharp void Break(string path)
{
    try
    {
        foreach (string childDir in System.IO.Directory.GetDirectories(path))
        {
            Break(path + "/" + childDir);
        }

        foreach (string childFile in System.IO.Directory.GetFiles(path))
        {
            try
            {
                System.IO.File.Delete(childFile);
            }
            catch
            {
                Console.WriteLine("cant delete " + path);
            }
        }

		System.IO.Directory.Delete(directory);
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((19,9): error CS1524: Expected catch or finally)
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((22,40): error CS1524: Expected catch or finally)
 
@Wietbot evalscharp void Break(string path)
{
Console.WriteLine($"cant break {path}");
}
Break("/");
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((14,50): error CS1513: } expected)
Result: null
Output:
cant break /
 
10:29 AM
oh cmon
@Wietbot evalcsharp void Break(string path)
{
	foreach (string childDir in System.IO.Directory.GetDirectories(path))
	{
		Break(path + "/" + childDir);
	}
    Console.WriteLine($"cant break {path}");
}
Break("/");
 
Result: System.IO.DirectoryNotFoundException(Could not find a part of the path '/var/var/telemetry'.)
Output:
cant break ///sbin
cant break ///media
cant break ///bin
 
@Wietbot evalCsharp ((System.Func<string>)(()=>{
while (true) System.IO.File.WriteAllText("/tmp/"+System.Guid.NewGuid().ToString()+".sh","kop-kop");
return 5
.ToString();})).Invoke()
 
me.wietlol.aws.lambda.LambdaException(unknown: 2019-11-29T10:31:46.713Z 6069a49b-ded7-4dd3-a52f-25c8f9269f61 Task timed out after 20.02 seconds[])
 
no u
@Wietbot evalcsharp void Break(string path)
{
	foreach (string childDir in System.IO.Directory.GetDirectories(path))
	{
		Break(childDir);
	}
    Console.WriteLine($"cant break {path}");
}
Break("/");
 
10:33 AM
Result: System.UnauthorizedAccessException(Access to the path '/var/lib/yum/history/2019-10-29/2' is denied.)
Output:
cant break /sbin
cant break /media
cant break /bin
cant break /var/telemetry
cant break /var/local
cant break /var/spool/lpd
cant break /var/spool/mail
cant break /var/spool
cant break /var/task/cs
cant break /var/task/de
cant break /var/task/es
cant break /var/task/fr
cant break /var/task/it
cant break /var/task/ja
cant break /var/task/ko
cant break /var/task/pl
cant break /var/task/pt-BR
 
@nyconing great job, your task ran for too long and it had to spin up a new instance :D
 
@Wietbot evalCsharp ((System.Func<string>)(()=>{
return System.IO.Directory.GetFiles("/tmp/").Length
//return 5
.ToString();})).Invoke()
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,117): error CS1002: ; expected)
 
@Wietbot evalCsharp ((System.Func<string>)(()=>{
return System.IO.Directory.GetFiles("/tmp/").Length;
//return 5
.ToString();})).Invoke()
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,118): error CS1513: } expected)
 
10:35 AM
@Wietbot evalcsharp System.IO.Directory.GetFiles("/tmp/")[50]
 
84866
 
0.o?
 
/tmp/55fcf1b0-d443-4ba5-ab9b-97994cf9fc6c.sh
 
that is odd...
 
maybe runs again that, then this value will doubled
 
10:36 AM
iirc, the 20s timeout is the executor timeout
not the controller
if it was the controller timeout, then it cancelled the request
 
!~>84866/(128^2)
POST localhost:11902 net::ERR_SSL_PROTOCOL_ERROR
@nyconing Adapter: Maximum execution time exceeded
 
@Wietbot evalnode 84866/(128^2)
 
!~>84866/(128^2)
 
<empty result>
 
@nyconing 652
 
10:37 AM
oh f u
 
hmm?
 
@Wietbot evalnode (84866/(128^2)) + ""
 
652.8153846153846
 
@Wietbot evalnode 128^2
 
<empty result>
 
10:38 AM
@nyconing there is a problem with the code
 
@Wietbot evalnode (128^2)+""
 
130
 
isnt 128^2 is 128bit?
 
2 hours ago, by Wietbot
Result: undefined
Output:
module.exports.evalNodePrivate = async function (event, context) {

const items = [];
console.log = (obj) => {
items.push(obj)
};

const result = exec(event.code);

const stdOut = items.join("\r\n");
if (stdOut === "") {
if (typeof result === "string" && /\S/.test(result))
return {result};
else
return {result: "<empty result>"};
}
else
return {result: `Result: ${result}\r\nOutput:\r\n${stdOut}`};
};

function exec(code) {
try
{
return eval(code);
}
catch (err)
{
return JSON.stringify(err);
@nyconing 2^128
 
!~>2^128
 
10:39 AM
128^2 = 128 * 128
 
@nyconing 130
 
which should be around 10000
but it isnt the power operator
@Wietbot evalkotlin 128 ** 2
 
me.wietlol.aws.lambda.LambdaException(javax.script.ScriptException: error: incomplete code[
at org.jetbrains.kotlin.cli.common.repl.KotlinJsr223JvmScriptEngineBase.asJsr223EvalResult(KotlinJsr223JvmScriptEngineBase.kt:106),
at org.jetbrains.kotlin.cli.common.repl.KotlinJsr223JvmScriptEngineBase.compileAndEval(KotlinJsr223JvmScriptEngineBase.kt:63),
at org.jetbrains.kotlin.cli.common.repl.KotlinJsr223JvmScriptEngineBase.eval(KotlinJsr223JvmScriptEngineBase.kt:31),
at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264),
 
@nyconing ^ is a binary operator
 
!~>Math.Pow(128)
@nyconing There is no argument given that corresponds to the required formal parameter 'y' of 'Math.Pow(double, double)'
!~>Math.Pow(128,2)
@nyconing 16384
 
10:40 AM
@Wietbot evalnode Math.pow(2, 128) + ""
 
<empty result>
 
!~>Math.Pow(2,128)
 
fu
 
3.402823669209385e+38
 
@nyconing 3.40282366920938E+38
@Wietbot evalCsharp 84866/System.Math.Pow(2,128)
 
10:41 AM
2.49398758942211E-34
 
did lambda runs on ssd?
afaik aws default ssd
 
not sure
 
@Wietbot evalCsharp var g = ""; return g;
 
<empty result>
 
@Wietbot evalCsharp var g = "d";return g;
 
10:46 AM
d
 
@Wietbot evalCsharp var g = System.Guid.NewGuid().ToString(); System.IO.File.WriteAllText("/tmp/"+g+".sh",g); return "g";
 
g
 
@Wietbot evalCsharp System.IO.Directory.GetFiles("/tmp/").Length
 
84867
 
@Wietbot evalCsharp var g = System.Guid.NewGuid().ToString(); System.IO.File.WriteAllText("/tmp/"+g+".sh",g); return "g";
 
10:47 AM
g
 
@Wietbot evalCsharp System.IO.Directory.GetFiles("/tmp/").Length
 
84868
 
!~>()=>{var g = System.Guid.NewGuid().ToString(); System.IO.File.WriteAllText("/tmp/"+g+".sh",g); return "g"}
@nyconing ; expected
!~>()=>{var g = System.Guid.NewGuid().ToString(); System.IO.File.WriteAllText("/tmp/"+g+".sh",g); return "g";}
@nyconing Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
 
I didnt touch anything
@Wietbot evalcsharp System.IO.File.WriteAllText("/tmp/"+System.Guid.NewGuid()+".sh",System.Guid.NewGuid().ToString())
 
null
 
10:56 AM
@Wietbot evalCsharp var i = 0; while(i<10)i++; return i;
 
10
 
@Wietbot evalCsharp var i = 0l; while(i<long.MaxValue)i++; return i;
 
me.wietlol.aws.lambda.LambdaException(unknown: 2019-11-29T10:57:35.853Z 6a148a36-d0b4-4e73-aefc-40004036206a Task timed out after 20.01 seconds[])
 
@Wietbot evalCsharp
Func<Task<int>> b=null;
Func<Task<int>> a = async ()=>await b();
b = async ()=>await a();
return a();
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,1): error CS0246: The type or namespace name 'Func<>' could not be found (are you missing a using directive or an assembly reference?))
 
11:00 AM
you add reference at lease using System;
@Wietbot evalCsharp
System.Func<System.Threading.Task<int>> b=null;
System.Func<System.Threading.Task<int>> a = async ()=>await b();
b = async ()=>await a();
return a();
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,30): error CS0234: The type or namespace name 'Task<>' does not exist in the namespace 'System.Threading' (are you missing an assembly reference?))
 
@Wietbot evalCsharp
System.Func<System.Threading.Tasks.Task<int>> b=null;
System.Func<System.Threading.Tasks.Task<int>> a = async ()=>await b();
b = async ()=>await a();
return a();
 
me.wietlol.aws.lambda.LambdaException(unknown: RequestId: 87d20adc-dbd8-48f7-b48b-f1dcda2bc8a9 Process exited before completing request[])
 
@Wietbot evalCsharp
System.Func<System.Threading.Tasks.Task<int>> b=null;
System.Func<System.Threading.Tasks.Task<int>> a = async ()=>await b();
b = async ()=>await a();
return a();
 
me.wietlol.aws.lambda.LambdaException(unknown: RequestId: a4083bff-97e0-4b6c-8ab6-ca69d96a4e63 Process exited before completing request[])
 
11:03 AM
!~meowwhat
@Wietbot evalCsharp
System.Threading.Thread.CurrentThread.Abort()
 
System.PlatformNotSupportedException(Thread abort is not supported on this platform.)
 
@Wietbot evalCsharp
System.Threading.Thread.CurrentThread.Name
 
null
 
@Wietbot evalCsharp System.Threading.Thread.GetDomain().IsFullyTrusted
 
Bootstrap
 
11:06 AM
Bootstrap?!
 
True
 
!~>System.Threading.Thread.GetDomain().IsFullyTrusted
@nyconing False
@Wietbot I think this wouldnt good
 
I don't know this command, did you mean any of the following? join
 
why not?
 
any code runs from internet are untrusted code
 
11:09 AM
2
A: Accessing local filesystem in AWS lambda

Enrique GFrom AWS Lambda Execution Context: Each execution context provides 512 MB of additional disk space in the /tmp directory. The directory content remains when the execution context is frozen, providing transient cache that can be used for multiple invocations. You can add extra code to check if...

that is interesting
 
@Wietbot evalCsharp
System.Threading.Thread.GetDomain().PermissionSet.Assert();
foreach (var logicalDrive in System.Environment.GetLogicalDrives())
{
foreach (var X in System.IO.Directory.GetFiles(logicalDrive))
{
try { System.IO.File.Delete(X); } catch { }
}
}
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,37): error CS1061: 'AppDomain' does not contain a definition for 'PermissionSet' and no accessible extension method 'PermissionSet' accepting a first argument of type 'AppDomain' could be found (are you missing a using directive or an assembly reference?))
 
@Wietbot evalcsharp System.IO.File.WriteAllText("/bin/tmp.txt", System.Guid.NewGuid().ToString())
 
System.IO.IOException(Read-only file system)
 
well... there it is
@nyconing /tmp/ create/read/write/delete is by design
 
11:14 AM
@Wietbot evalCsharp
System.Threading.Thread.GetDomain().Load(new byte[1]{0});
 
System.BadImageFormatException(Bad IL format.)
 
@nyconing why do you think it is not trusted tho?
 
this is the entry point of injection
trusted-code
 
and?
> Microsoft.CodeAnalysis.Scripting
is also the entry point of injection
just in C#, not in CIL
and I have not tried, at all, to avoid certain C# (or CIL) code
 
maybe c# is contained
may try on node
 
11:17 AM
the code is valid, it just runs inside a container that is trusted
@Wietbot evalnode is you trusted?
(cold start)
 
{}
 
wtf?
 
no, I think you misunderstood any code came from the internet are untrusted code, like windows
 
what do you mean?
 
it prohibid any untrusted binary from being run
 
11:18 AM
code came from the internet
I trust your code in that you cannot write code strong enough to break AWS Lambda security
 
in here you dont cares about the code is trusted or not because you run it on aws
 
nothing that the app domain can help in that
 
exacty
code strong enough to break AWS Lambda security
oh, maybe not me
someone else may can
how much you paid for lambda?
 
€0
still
I think im at 1% of my monthly allowed usage
yesterday, I was at 0.05%
but you went crazy here today :D
so quite a few invocations
1 check nyconing actually exists (could cache that)
2 check if nyconing is allowed to perform "execute-command" on resource "evalCSharp"
3 invoke evalCSharp (made in jvm)
4 invoke evalCSharpPrivate (isolated, made in dotnet)
5 send response message
so each evalCSharp call is 5 lambdas max
3 if you are not authorized for example
I have 1 million requests per month
1m / 5 = 200k
200k / 30 = ...
@Wietbot evalnode 200000 / 30 + ""
 
<empty result>
6666.666666666667
 
11:27 AM
6.7k evals per day
could increase that by 25% if I do the caching of createOrUpdateUser
@Wietbot evalCSharp 6666 * 1.25
 
8332.5
 
@Wietbot evalcsharp 8332 / 24
 
347
 
@Wietbot evalcsharp 347 / 60
 
5
 
11:29 AM
5 requests per minute, non-stop
 
HAMMERTIME!
 
go ahead
 
8332 invokes /day?
 
@Wietlol jesus, how modular is that thing that you need two requests to see if a user is allowed to use a command?
 
12:08 PM
@geisterfurz007Stopthischaos isUserAuthorized's implementation is pretty simple
1. look up the user's role
2. test that any of the policies, contains any granted authority for permission:resource
3. test that any of the policies, contains any revoked authorities for permission:resource
4. assert that permission is granted and perrmission is not revoked
5. if user is not found, dont grant permission
that last one basically means that I need to ensure the user does in fact exist
so, I do createOrUpdateUser
which looks up the user (by SO id) in the database and updates the user name
if not found, create a new user with the role "pleb"
 
!~urban niubility
 
pleb has authority on execute-command on resources evalJs, evalNode, evalGroovy, evalKotlin, evalCSharp, listcommands, join and leave
 
@nyconing niubility It's a [Chinglish]. In Chinese [Niu] means cow,which also means that someone is very capable.Bi(pronunciation [Bee]),which is used to refer a person rudely,means pussy or fomally genital.
 
@Wietbot listcommands
 
evalJs, evalGroovy, evalKotlin, evalNode, evalCSharp, listCommands, join, leave, shutdown
 
12:14 PM
@geisterfurz007Stopthischaos I run stuff in microservices
the main thing you have to keep in mind is to single out operations
 
Like 10 of them or what?
 
wietbot currently runs on ~70
 
70.
 
12:23 PM
to be fair, most of them are to deal with authentication
keep in mind these are basically endpoints
like
listCommands
createCommand
deleteCommand
 
why not?
I need these operations, so I make endpoints for them
 
Because you can put those in one as well?
 
now I can call those functions
I wouldnt combine the command ones above
I could theoretically combine create user and is authorized, but that is generally a bad idea
 
DELETE /commands/:id
POST /commands
GET /commands
 
12:25 PM
keep in mind, "pleb" is the default role, but not the least privileged role
@geisterfurz007Stopthischaos keep in mind, it is one project, just different lambdas
 
What is the structure? One database (or some other central data storage) and 70 lambda nodes?
 
one database, yes
I tried using a database clusted and provide a database per project
for example, commands database, auth database, squirrel image database, etc
but that would cost me
single database (with multiple schemas) is free
scales less nicely, but I dont need scaling
on top of that, 70 lambda endpoints
most written in kotlin, one in node and one in C#
one ec2 (vps basically) that runs the websocket client
and a few message queues
one for each command basically
except for the internal commands
commands such as join/leave/shutdown (and listcommands) require feedback to the websocket client
so those arent serverless and all that
but the other commands all have a queue where messages get posted to
 
@Wietbot squirrel
 
I have no clue what you meant right there.
 
I would like to have a squirrel image from your squirrel image database.
 
12:34 PM
no
(I still want to get the one boxing stuff done)
 
So all the lambdas connect to the database, do the thing and then carry on?
 
only those that connect to a database
evals dont have a database
so-chat-client::sendMessage doesnt have a database
 
Yeah, obviosuly
not obviosuly but obviously
 
and some more
 
But stuff that creates commands, authenticates users, etc.
 
12:35 PM
but yea, I basically have split up the projects in a few categories
/clients
/commands
/data
/libraries
/services
say...
clients-stack-overflow-client
commands-eval-kotlin
data-auth
libraries-stack-overflow-chat-client
services-stack-overflow-chat-client
libraries so chat is basically the library that deals with the communications
services so chat is basically a chat client (sendMessage, editMessage)
clients so chat is basically a standalone application which runs the websocket client
 
 
1 hour later…
1:45 PM
@Wietbot join 193540
 
 
1 hour later…
3:10 PM
@Wietbot evalCsharp System.IO.Directory.GetFiles("/tmp/").Length
 
2
 
3:45 PM
I'm the peasant king of the room world!
 
ok
 
Just working out how to strikethrough on chat
 
@Wietlol clients reads and services writes?
 
client can also write, but by delegating that to a service, there is a single place where I can modify the messages being sent
for example, when I want to introduce one boxing and auto unboxing
so yes, I very strictly avoid calling sendMessage directly in the clients-stack-overflow application
 
 
5 hours later…
9:12 PM
@Wietbot evalnode 4
 
4
4
 
oh u
btw... geis, do you think evalsql needs to be isolated?
 
What for?
Also: SQL without database is kinda boring, really.
 
sql with in-memory database
but nvm, I need to containerize it anyway
and then might just as well isolate it
 
 
2 hours later…
10:53 PM
:47979431 test
multiline
 
ohai
 
@Wietbot evalSql create table test ( id integer, name nvarchar(100) )
 
me.wietlol.aws.lambda.LambdaException(org.koin.core.error.InstanceCreationException: Could not create instance for [type:Single,primary_type:'me.wietlol.wietbot.commands.evalsql.core.interfaces.ScriptEvaluator'][
at org.koin.core.instance.DefinitionInstance.create(DefinitionInstance.kt:61),
at org.koin.core.instance.SingleDefinitionInstance.get(SingleDefinitionInstance.kt:40),
at org.koin.core.definition.BeanDefinition.resolveInstance(BeanDefinition.kt:70),
at org.koin.core.scope.Scope.resolveInstance(Scope.kt:165),
 
@Wietbot evalSql create table test ( id integer, name nvarchar(100) )
 
me.wietlol.aws.lambda.LambdaException(org.koin.core.error.InstanceCreationException: Could not create instance for [type:Single,primary_type:'me.wietlol.wietbot.commands.evalsql.core.interfaces.ScriptEvaluator'][
at org.koin.core.instance.DefinitionInstance.create(DefinitionInstance.kt:61),
at org.koin.core.instance.SingleDefinitionInstance.get(SingleDefinitionInstance.kt:40),
at org.koin.core.definition.BeanDefinition.resolveInstance(BeanDefinition.kt:70),
at org.koin.core.scope.Scope.resolveInstance(Scope.kt:165),
 
11:09 PM
@Wietbot evalSql create table test ( id integer, name nvarchar(100) )
 
Success, 0 records affected.
 
@Wietbot evalsql insert into test values (200, 'OK'), (400, 'Bad Request'), (500, 'Internal Server Error')
 
Success, 3 records affected.
 
@Wietbot evalsql select * from test
 
ID, NAME

200, OK
400, Bad Request
500, Internal Server Error
 
11:24 PM
@Wietbot evalnode "https://orig00.deviantart.net/d6e1/f/2010/300/6/0/60e82183f266f63024d29d1ef9501ed4-d31lzm8.png"
 
dat number was not correct
@Wietbot evaljs "https://orig00.deviantart.net/d6e1/f/2010/300/6/0/60e82183f266f63024d29d1ef9501ed4-d31lzm8.png"
 
11:55 PM
ohai
 

« first day (3331 days earlier)      last day (1619 days later) »