Linux vmi284606.contaboserver.net 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
Apache/2.4.57 (Ubuntu)
: 167.86.127.34 | : 216.73.217.31
Cant Read [ /etc/named.conf ]
7.2.24-0ubuntu0.18.04.17
root
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
local /
go /
doc /
articles /
wiki /
[ HOME SHELL ]
Name
Size
Permission
Action
edit.html
216
B
-rw-r--r--
final-noclosure.go
2.26
KB
-rw-r--r--
final-noerror.go
1.14
KB
-rw-r--r--
final-parsetemplate.go
2.16
KB
-rw-r--r--
final-template.go
1.49
KB
-rw-r--r--
final.go
2.13
KB
-rw-r--r--
final_test.go
413
B
-rw-r--r--
go.mod
34
B
-rw-r--r--
http-sample.go
277
B
-rw-r--r--
index.html
22.39
KB
-rw-r--r--
notemplate.go
1.29
KB
-rw-r--r--
part1-noerror.go
688
B
-rw-r--r--
part1.go
745
B
-rw-r--r--
part2.go
891
B
-rw-r--r--
part3-errorhandling.go
1.67
KB
-rw-r--r--
part3.go
1.26
KB
-rw-r--r--
test_Test.txt.good
12
B
-rw-r--r--
test_edit.good
183
B
-rw-r--r--
test_view.good
79
B
-rw-r--r--
view.html
100
B
-rw-r--r--
wiki_test.go
4.45
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : part3-errorhandling.go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build ignore package main import ( "html/template" "io/ioutil" "log" "net/http" ) type Page struct { Title string Body []byte } func (p *Page) save() error { filename := p.Title + ".txt" return ioutil.WriteFile(filename, p.Body, 0600) } func loadPage(title string) (*Page, error) { filename := title + ".txt" body, err := ioutil.ReadFile(filename) if err != nil { return nil, err } return &Page{Title: title, Body: body}, nil } func renderTemplate(w http.ResponseWriter, tmpl string, p *Page) { t, _ := template.ParseFiles(tmpl + ".html") t.Execute(w, p) } func viewHandler(w http.ResponseWriter, r *http.Request) { title := r.URL.Path[len("/view/"):] p, err := loadPage(title) if err != nil { http.Redirect(w, r, "/edit/"+title, http.StatusFound) return } renderTemplate(w, "view", p) } func editHandler(w http.ResponseWriter, r *http.Request) { title := r.URL.Path[len("/edit/"):] p, err := loadPage(title) if err != nil { p = &Page{Title: title} } renderTemplate(w, "edit", p) } func saveHandler(w http.ResponseWriter, r *http.Request) { title := r.URL.Path[len("/save/"):] body := r.FormValue("body") p := &Page{Title: title, Body: []byte(body)} err := p.save() if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return } http.Redirect(w, r, "/view/"+title, http.StatusFound) } func main() { http.HandleFunc("/view/", viewHandler) http.HandleFunc("/edit/", editHandler) http.HandleFunc("/save/", saveHandler) log.Fatal(http.ListenAndServe(":8080", nil)) }
Close