This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "encoding/hex" | |
| "fmt" | |
| "syscall" | |
| "unsafe" | |
| ) | |
| var procVirtualProtect = syscall.NewLazyDLL("kernel32.dll").NewProc("VirtualProtect") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "encoding/hex" | |
| "fmt" | |
| ) | |
| func main() { | |
| sc, err := hex.DecodeString("fc4883e4f0e8c000000041...") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Runtime.InteropServices; | |
| using System.Threading; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| namespace hollow | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "bytes" | |
| "fmt" | |
| "log" | |
| "github.com/google/gopacket" | |
| "github.com/google/gopacket/pcap" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| affix@target:~$ id | |
| uid=1001(affix) gid=1001(affix) groups=1001(affix),999(docker) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package function | |
| import ( | |
| "encoding/json" | |
| "encoding/xml" | |
| "fmt" | |
| "io/ioutil" | |
| "log" | |
| "net/http" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func Handle(req []byte) string { | |
| json, _ := json.Marshal(data.Channel.Posts) // Encode our Struct as JSON | |
| return fmt.Sprintf("%s", string(json)) // Return a String to the OpenFaaS Gateway | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func Handle(req []byte) string { | |
| // ... | |
| data := &PostData{} // Create and initialise a data variable as a PostData struct | |
| err = xml.Unmarshal(body, data) // Parse the XML into the structure | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type PostData struct { | |
| Channel struct { | |
| Posts []struct { | |
| Title string `xml:"title"` | |
| Link string `xml:"link"` | |
| Category []string `xml:"category"` | |
| Creator string `xml:"creator"` | |
| PubDate string `xml:"pubDate"` | |
| Updated string `xml:"updated"` | |
| License string `xml:"license"` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func Handle(req []byte) string { | |
| resp, err := http.Get("https://medium.com/feed/@" + string(req)) // Use the 'req' variable to build our feed URL | |
| // Standard Error Handler | |
| if err != nil { | |
| log.Fatal(err) | |
| } | |
| defer resp.Body.Close() // Defer closing until the Handle function returns | |
| body, _ := ioutil.ReadAll(resp.Body) // Read the response body and ignore errors |