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

9:00 AM
not sure if I also use stringify
@Wietbot evalnode console.log(5);
console.log({test: "hello"});
 
Result: undefined
Output:
5
[object Object]
 
ye, need to add the same stringify logic
then the output would be
Result: undefined
Output:
{}
{"test":"hello"}
:D
 
<.<
@Wietlol So something like that runs in your lambda, right
 
ye, sort of
@Wietbot evalnode console.log
 
9:02 AM
<empty result>
 
@Wietbot evalnode console.log.toString()
 
not sure how to display that...
 
(obj) => {
items.push(obj)
}
 
or that
ooh, can you use the bot to read the handler.js file?
do it :D
 
Probably?
What's the path?
 
9:03 AM
iDunno
 
but the file is handler.js
 
lmao, this is going to be great if it works, hang on
 
@Wietbot evalnode var fs = require('fs');
var contents = fs.readFileSync('handler.js', 'utf8');
console.log(contents);
 
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);
 
9:04 AM
well... there you go
 
LOL
That was way too easy
 
oh wait, I kind of messed that up
if (typeof result === "string" && /\S/.test(result))
	return {result};
else
	return {result: "<empty result>"};
the result part is sooo wrong
 
wow
good job
And you are the one calling me dumb all the time
yikes
:D
@Wietbot evalNode const fs = require("fs");
const files = fs.readdirSync("/sbin");
console.log(files.join("\n"))
 
Result: undefined
Output:
bin
boot
dev
etc
home
lib
lib64
media
mnt
opt
proc
root
run
sbin
srv
sys
tmp
usr
var
 
9:08 AM
Result: undefined
Output:
alternatives
build-locale-archive
capsh
chkconfig
chroot
getcap
getpcaps
glibc_post_upgrade.x86_64
iconvconfig
iconvconfig.x86_64
install-info
ldconfig
sefcontext_compile
setcap
sln
update-alternatives
zdump
zic
 
Surely you don't mind me having a look at those files? @Wietlol
@Wietbot evalNode const fs = require("fs");
const files = fs.readdirSync(__dirname);
console.log(files.join("\n"))
 
Result: undefined
Output:
alternatives
build-locale-archive
capsh
chkconfig
chroot
getcap
getpcaps
glibc_post_upgrade.x86_64
iconvconfig
iconvconfig.x86_64
install-info
ldconfig
sefcontext_compile
setcap
sln
update-alternatives
zdump
zic
Result: undefined
Output:
.idea
handler.js
package.json
 
Why would you add your .idea folder there @Wietlol? It doesn't belong there, really!
This is a lot more fun than nashorn... You can do so much more with so much less :D
 
the idea folder is there because of sls deploy not filtering it
@Wietbot evalNode const fs = require("fs");
const files = fs.readdirSync(__dirname + "/.idea");
console.log(files.join("\n"))
 
Result: undefined
Output:
jsLibraryMappings.xml
misc.xml
modules.xml
node.iml
vcs.xml
workspace.xml
 
9:14 AM
vcs you say :)
 
no, deploy from local machine :D
 
@Wietbot evalNode const fs = require("fs");
const files = fs.readFileSync(__dirname + "/.idea/vcs.xml", {encoding: 'utf-8'});
console.log(files.join("\n"))
 
Result: undefined
Output:
60
63
120
109
108
32
118
101
114
115
105
111
110
61
34
49
46
48
34
32
101
110
99
111
100
105
110
103
61
34
85
84
70
45
56
34
63
62
13
10
60
112
114
111
106
101
99
116
32
118
101
114
115
105
111
110
61
34
52
34
62
13
10
32
32
60
99
111
109
112
111
110
101
110
116
32
110
97
109
101
61
34
86
99
115
68
105
114
101
99
116
111
114
121
77
97
112
112
105
110
103
115
34
62
13
10
32
32
32
32
60
109
97
112
112
105
110
103
32
100
105
114
101
99
116
111
114
121
61
34
36
80
82
79
74
 
I wont set up a build pipeline for one js project
 
9:15 AM
what?
 
{}
 
@Wietlol Output is in buffer format
 
oh
 
but it's empty with encoding utf-8?!
 
still empty result tho?
@Wietbot evalNode const fs = require("fs");
const files = fs.readFileSync(__dirname + "/.idea/vcs.xml", {encoding: 'utf-8'});
console.log(files.toString())
 
9:16 AM
{}
Result: undefined
Output:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>
 
there
 
awwww, I hoped for credentials :P
(I know they aren't in there)
 
no, no credentials :D
 
Gib credentials <.<
 
no
 
9:17 AM
Are there any interesting executables on that thing?
 
iDunno
 
I don't know linux enough to know what interesting stuff there might be :/
@Wietbot evalNode const fs = require("fs");
const files = fs.readdirSync("/home");
console.log(files.join("\n").toString())
 
{"errno":-21,"syscall":"read","code":"EISDIR"}
 
we need madara
 
<empty result>
 
9:18 AM
wat?
Yeah the response to the edit was probably eaten by SO again.
 
@Wietbot evalNode const fs = require("fs");
const files = fs.readdirSync("/");
console.log(files.join("\n"))
 
Result: undefined
Output:
bin
boot
dev
etc
home
lib
lib64
media
mnt
opt
proc
root
run
sbin
srv
sys
tmp
usr
var
 
@Wietbot evalNode const fs = require("fs");
const files = fs.readdirSync("/home");
console.log(files.toString())
 
<empty result>
 
9:19 AM
nope
it is empty
 
@Wietbot evalNode const fs = require("fs");
const files = fs.readdirSync("/home");
console.log(files.length.toString())
 
Result: undefined
Output:
0
 
B O O O O O O O R I N G !
 
hey, I have no control over the file system there
AWS sets that up
I cant fill the home dir
 
9:21 AM
can you passwd and change the password of that user?
That would be funny :D
 
@Wietbot evalNode const fs = require("fs");
const files = fs.readdirSync("/");
files.forEach(e => {
    console.log(e)
});
 
Result: undefined
Output:
bin
boot
dev
etc
home
lib
lib64
media
mnt
opt
proc
root
run
sbin
srv
sys
tmp
usr
var
 
Wouldn't do much I guess but the idea is funny to me at least
 
@Wietbot evalNode const fs = require("fs");
const files = fs.readdirSync("/");
files
    .filter(e => e !== "root")
    .forEach(e => {
        const inner = fs.readdirSync("/" + e);
        console.log(e + " " + inner.length)
    });
 
Result: {"errno":-13,"syscall":"scandir","code":"EACCES","path":"/root"}
Output:
bin 156
boot 0
dev 8
etc 77
home 0
lib 8
lib64 144
media 0
mnt 0
opt 0
proc 55
 
9:22 AM
oh, you cant access root, it seems
 
Result: undefined
Output:
bin 156
boot 0
dev 8
etc 77
home 0
lib 8
lib64 144
media 0
mnt 0
opt 0
proc 55
run 0
sbin 18
srv 0
sys 0
tmp 0
usr 12
var 25
 
and quite a few of them are empty
 
9:35 AM
@Wietbot evalCs ()=>{var a = "";while (true){a += a+long.MaxValue.ToString();} return a;}
no timeout?
 
evalCsharp is the command I think
 
javax.script.ScriptException(<eval>:1:1 Expected an operand but found )
()=>{var a = "";while (true){a += a+long.MaxValue.ToString();} return a;}
^ in <eval> at line number 1 at column number 1)
 
@Wietbot evalCsharp ()=>{var a = "";while (true){a += a+long.MaxValue.ToString();} return a;}
.........
too slow
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,1): error CS1660: Cannot convert lambda expression to type 'object' because it is not a delegate type)
 
@Wietbot evalCsharp ((Action)(()=>{var a = "";while (true){a += a+long.MaxValue.ToString();} return a;})).Invoke()
 
9:37 AM
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,3): error CS0246: The type or namespace name 'Action' could not be found (are you missing a using directive or an assembly reference?))
 
@Wietbot evalCsharp ((System.Action)(()=>{var a = "";while (true){a += a+long.MaxValue.ToString();} return a;})).Invoke()
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,81): error CS8030: Anonymous function converted to a void returning delegate cannot return a value)
 
@Wietbot evalCsharp ((System.Action)(()=>{var a = "";while (true){a += a+long.MaxValue.ToString();} return a;}))
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,81): error CS8030: Anonymous function converted to a void returning delegate cannot return a value)
 
@nyconing cold start
also, evalcs is more like evaljs than evalcsharp
so, it recognized it as evaljs
 
9:38 AM
@Wietbot evalCsharp ()=>{var a = "";while (true){a += a+long.MaxValue.ToString();} return a;}
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,1): error CS1660: Cannot convert lambda expression to type 'object' because it is not a delegate type)
 
fuzzy matching :D
 
@Wietbot evalCsharp {var a = "";while (true){a += a+long.MaxValue.ToString();} return a;}
 
System.OutOfMemoryException(Exception of type 'System.OutOfMemoryException' was thrown.)
 
9:39 AM
cold starts happen when a certain command isnt used for too long or when invoking more times concurrently than the amount of available instances
 
@Wietbot evalCsharp var a = "";while (true){a += a+long.MaxValue.ToString(); GC.Collect();} return a;
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,58): error CS0103: The name 'GC' does not exist in the current context)
 
@Wietbot evalCsharp var a = "";while (true){a += a+long.MaxValue.ToString(); System.GC.Collect();} return a;
 
System.OutOfMemoryException(Exception of type 'System.OutOfMemoryException' was thrown.)
 
wut?
oh wait
I see
 
9:40 AM
@Wietbot evalCsharp return 5/0
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,11): error CS1002: ; expected)
 
@Wietbot evalCsharp return 5/0;
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,8): error CS0020: Division by constant zero)
 
@Wietbot evalcsharp 5/0
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,1): error CS0020: Division by constant zero)
 
9:41 AM
either dont use return, or also use semi
:D
 
@Wietbot evalCsharp return System.Environment.ProcessorCount;
 
2
 
@Wietbot evalCsharp return System.Environment.MachineName;
 
169
 
XD
 
@Wietbot evalCsharp return System.Environment.MachineName;;
 
169
 
@Wietbot evalCsharp return System.Environment.MachineName;;;;
 
@Wietbot evalNode const exec = require('child_process').execSync; const result = exec("env", {encoding: "utf-8"}); console.log(result);
 
Result: undefined
Output:
AWS_LAMBDA_FUNCTION_VERSION=$LATEST
AWS_SESSION_TOKEN=IQoJb3JpZ2luX2VjEIL//////////wEaCWV1LXdlc3QtMSJIMEYCIQDCX9x3oKszb5rv3kNv+E05PL27yVZ/cmaAZCFRSFFt5AIhAP2m3KQbpSdkkVVMarDGdxX0zcD5QIiCGMDVNHfl9F/1KvgBCLv//////////wEQABoMMDU5NTk4NTA0OTUyIgz/LW8JQhF9Xy43hm4qzAGoxh4cVqpWYrRKsjU64ygueBKazLLMjlZsTRPpDYCEk3wPwhseKHb86VIEL48rIyU8jEGUbqnu5x/0Y2LiPFFqWHj6c/5dmAKc7ClbGtnc9M7CzDRwJqtaxtd3FhAhUixRZZi1+kliXkzG2mErP9HeBLHWqtt1QEZFtsu4kFb6At1r2mtHEN1yUTRI6V2lls0FRF7AOv/ACp9pqbABMjSyw3JCgOTg19tnk2kWkhH788s02hQ+bEtQeIi7/hxYne02TdXKe3ufB+dVxt0w9M+D7wU63wEk4bfDHSSL4C+4VQyC0gPahhITC
 
9:42 AM
ummmmmmmmmm
 
@Wietbot evalCsharp class A{};
 
null
 
should we be allowed to see the session_token?
 
why not?
 
dunno
usually session tokens should be kept confidential, no?
 
9:43 AM
@Wietbot evalCsharp System.Environment.CurrentDirectory;
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,1): error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement)
 
if it was secret, it would have been called AWS_SECRET_TOKEN
 
afaik aws lanbda is untrusted code safe
so it that configured properly , it can
 
@Wietlol AWS_SECRET_ACCESS_KEY
Is literally in there
 
the lambdas have one possible security issue
 
9:44 AM
@Wietbot evalCsharp System.Windows.Forms.MessageBox.Show("");
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,1): error CS0234: The type or namespace name 'Windows' does not exist in the namespace 'System' (are you missing an assembly reference?))
 
huh?
 
So now I have an AWC Access key ID and an AWS secret access key. Noice :D
 
AWS_ACCESS_KEY_ID=ASIAQ3YCZAP4GSD72MN5
AWS_SECRET_ACCESS_KEY=nxCVNWnr28fwPYpyi2ioCqUfq8Tpn/wyd4kAwm7D
 
I think that would allow me to do all sorts of stuff
 
9:45 AM
but this is not an AKIA key
this is an ASIA key
 
probably. probably not, I don't know enough about aws for that.
 
@Wietbot evalCsharp GC.GetTotalMemory(true);
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,1): error CS0103: The name 'GC' does not exist in the current context)
 
@Wietbot evalCsharp System.GC.GetTotalMemory(true);
 
null
 
9:46 AM
that's not much
 
@geisterfurz007Stopthischaos not sure that the ASIA key is usable at all
 
@Wietbot evalCsharp System.GC.GetTotalMemory(true).ToString();
 
null
 
only from within aws services
 
awww, lame!
What do you need that key for?
 
9:47 AM
@Wietbot evalCsharp System.GC.GetTotalMemory(true).ToString()??"null?";
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,1): error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement)
 
and the only rights it appears to have is writing logs to cloudwatch with the appropriate log group (WS_LAMBDA_LOG_GROUP_NAME=/aws/lambda/wietbot-commands-eval-node-2-dev-evalNodePrivate)
 
To register Lambdas to your account?
 
which you can do too by simply writing to the actual console
 
@Wietbot evalCsharp ((string)null)??"null?";
 
9:47 AM
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,1): error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement)
 
which is not console.log or Console.WriteLine, those are redirected
 
old c#
config it to 8.0
 
@Wietbot evalCsharp ((string)null)??"null?"
 
null?
 
You just had a semicolon too much
 
9:48 AM
@nyconing stop using semis
:D
 
@Wietbot evalCsharp ((string)null)??"null?"
 
null?
 
@Wietbot evalcsharp "hello";
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,1): error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement)
 
@Wietbot evalCsharp System.GC.GetTotalMemory(true).ToString()
 
9:48 AM
9452936
 
@Wietbot evalCsharp ()=>System.GC.GetTotalMemory(true).ToString();
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,1): error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement)
 
@Wietbot evalCsharp ()=>System.GC.GetTotalMemory(true).ToString()
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,1): error CS1660: Cannot convert lambda expression to type 'object' because it is not a delegate type)
 
@Wietbot evalCsharp (()=>System.GC.GetTotalMemory(true).ToString())
 
9:49 AM
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,2): error CS1660: Cannot convert lambda expression to type 'object' because it is not a delegate type)
 
@Wietbot evalCsharp (()=>System.GC.GetTotalMemory(true).ToString()).Invoke()
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,1): error CS0023: Operator '.' cannot be applied to operand of type 'lambda expression')
 
@Wietbot evalCsharp (()=>System.GC.GetTotalMemory(true).ToString())()
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,1): error CS0149: Method name expected)
 
9:50 AM
@Wietbot evalCsharp ((Action)(()=>System.GC.GetTotalMemory(true).ToString())).Invoke()
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,3): error CS0246: The type or namespace name 'Action' could not be found (are you missing a using directive or an assembly reference?))
 
@Wietbot evalCsharp ((System.Action)(()=>System.GC.GetTotalMemory(true).ToString())).Invoke()
 
null
 
@Wietbot evalcsharp ((Func<String>)(()=>System.GC.GetTotalMemory(true).ToString()))()
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,3): error CS0246: The type or namespace name 'Func<>' could not be found (are you missing a using directive or an assembly reference?))
 
9:50 AM
LMAO
All that effort for "null"
 
@Wietbot evalCsharp ((System.Func<string>)(()=>System.GC.GetTotalMemory(true).ToString())).Invoke()
 
9651672
 
@Wietbot evalCsharp (()=>System.GC.GetTotalMemory(true).ToString()).Invoke()
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,1): error CS0023: Operator '.' cannot be applied to operand of type 'lambda expression')
 
@Wietbot evalCsharp ()=>System.GC.GetTotalMemory(true).ToString().Invoke()
 
9:51 AM
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,1): error CS1660: Cannot convert lambda expression to type 'object' because it is not a delegate type)
 
nyconing is on a roll here
 
Bruv, that is harder to read than the Objective-C code to connect to a flutter method channel O-O
 
@Wietbot evalCsharp ((System.Func<string>)(()=>{return System.GC.GetTotalMemory(true).ToString();})).Invoke()
 
9714888
 
@geisterfurz007Stopthischaos and it doesnt even compile :D
oh, that one did
 
9:52 AM
Why is it more now?
 
@geisterfurz007Stopthischaos it is the used memory
not the total memory
 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
using Newtonsoft.Json;
 
nor the available memory
 
@Wietlol
 
9:52 AM
that's why the method is called "totalMemory" and not "usedMemory"
Oh wait...
 
oh wait...
ye, its the used memory
GC.GetTotalMemory()
not
Machine.GetTotalMemory() << pseudocode
 
@Wietbot evalCsharp ((System.Func<string>)(()=>{return
System.Environment.CurrentDirectory.ToString();
})).Invoke()
 
/var/task
 
!~convert 9714888B MB
 
@Wietlol 9.7149 MB
 
9:54 AM
I dont believe that
 
@Wietbot evalCsharp ((System.Func<string>)(()=>{return
System.Environment.CurrentDirectory
.ToString();})).Invoke()
 
/var/task
 
oh wait, perhaps it is
 
@Wietbot evalCsharp ((System.Func<string>)(()=>{
System.Environment.Exit(0); return 5
.ToString();})).Invoke()
 
me.wietlol.aws.lambda.LambdaException(unknown: RequestId: 9501aeb9-9d7b-4beb-a64b-a7283cf91826 Process exited before completing request[])
 
9:55 AM
> A number that is the best available approximation of the number of bytes currently allocated in managed memory.
 
@Wietbot evalCsharp ((System.Func<string>)(()=>{
System.Environment.Exit(0);; return 5
.ToString();})).Invoke()
 
still no clue what the number is
 
Oki, 11 AM, it's weekend \(-_\)
Byeeee
 
me.wietlol.aws.lambda.LambdaException(unknown: RequestId: 906c2e00-293c-4c6c-b0b2-ca0a3801f691 Process exited before completing request[])
 
@Wietbot evalCsharp ((System.Func<string>)(()=>{return
System.Environment.CurrentDirectory
.ToString();})).Invoke()
 
9:56 AM
/var/task
 
@Wietbot evalCsharp ((System.Func<string>)(()=>{return
System.Environment.CurrentDirectory
.ToString();})).Invoke()
 
@nyconing you can also just use multiple statements without the lambda stuff
or just use
@Wietbot evalcsharp System.Environment.CurrentDirectory.ToString()
 
/var/task
 
perhaps even
@Wietbot evalcsharp System.Environment.CurrentDirectory
 
/var/task
 
9:57 AM
not sure what you use the lambda for
 
@Wietbot evalCsharp ((System.Func<string>)(()=>{return
new string(System.Environment.GetLogicalDrives())
.ToString();})).Invoke()
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,47): error CS1503: Argument 1: cannot convert from 'string[]' to 'char[]')
 
@Wietbot evalCsharp ((System.Func<string>)(()=>{return
string.Join(System.Environment.GetLogicalDrives())
.ToString();})).Invoke()
 
Microsoft.CodeAnalysis.Scripting.CompilationErrorException((1,48): error CS1503: Argument 1: cannot convert from 'string[]' to 'char')
 
@Wietbot evalCsharp ((System.Func<string>)(()=>{return
string.Join(",",System.Environment.GetLogicalDrives())
.ToString();})).Invoke()
 
9:58 AM
/,/dev,/tmp,/proc,/proc/sys/kernel/random/boot_id,/etc/passwd,/var/runtime,/var/lang,/etc/resolv.conf,/var/task
 

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