浏览代码

Add Malifious filter

The filter reads a file in the home and send the content outside
Gildas Chabot 8 年之前
父节点
当前提交
be8a531fde
共有 4 个文件被更改,包括 74 次插入0 次删除
  1. 4 0
      README.md
  2. 20 0
      base64Encode/base64Encode.go
  3. 二进制
      base64Encode/unicorn.png
  4. 50 0
      pluginSrc/unicorn/plugin.go

+ 4 - 0
README.md

@@ -13,6 +13,10 @@ To activate the plugins, move the `.so` files from the
13 13
 
14 14
 - Malicious plugin -> read a folder and write to image
15 15
   - Check source code?
16
+- Panic in plugin?
17
+- In presentation
18
+  - Add background about the solutions before the plugins: see the
19
+    presentation from the dotGo.
16 20
 
17 21
 ## Presentation
18 22
 

+ 20 - 0
base64Encode/base64Encode.go

@@ -0,0 +1,20 @@
1
+package main
2
+
3
+import (
4
+	"encoding/base64"
5
+	"fmt"
6
+	"io/ioutil"
7
+	"os"
8
+)
9
+
10
+func main() {
11
+	f, err := os.Open("unicorn.png")
12
+	if err != nil {
13
+		panic(err)
14
+	}
15
+	bytes, err := ioutil.ReadAll(f)
16
+	if err != nil {
17
+		panic(err)
18
+	}
19
+	fmt.Println(base64.StdEncoding.EncodeToString(bytes))
20
+}

二进制
base64Encode/unicorn.png


文件差异内容过多而无法显示
+ 50 - 0
pluginSrc/unicorn/plugin.go