Advertisement
labyrinth-servers1

Wire Tap

Mar 27th, 2019
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 2.15 KB | None | 0 0
  1. /*
  2. Wire Tap Copyright (C) 2018 Grathium Sofwares <grathiumsoftwears@gmail.com>
  3.     This program comes with ABSOLUTELY NO WARRANTY
  4.     This is a free software, and you are welcome to redistribute it under certain
  5.     conditions.
  6. */
  7.  
  8. package main
  9.  
  10. import (
  11.     "fmt"
  12.     "io/ioutil"
  13.     "net/http"
  14.     "encoding/hex"
  15.     "strings"
  16. )
  17.  
  18. var replacer = strings.NewReplacer("/", "#", "?", "#")
  19. func main() {
  20.     var website string
  21.  
  22.     for ok := true; ok; ok = true {
  23.         fmt.Println("Wire Tap Copyright (C) 2018 Grathium Sofwares <grathiumsoftwears@gmail.com>", // legal shit
  24.         "\nThis program comes with ABSOLUTELY NO WARRANTY",
  25.         "This is a free software, and you are welcome to redistribute it under certain\n",
  26.         "conditions.",
  27.         )
  28.  
  29.         fmt.Println("\nWebsite to Access (without http):")
  30.         fmt.Scanln(&website)
  31.    
  32.         websiteedit := "http://" + website
  33.         websiteedit = "https://api.ready.mobi/api/v1/prism/proxy?prismid=1&testid=1qo0&i=0&device=0&url=" + websiteedit // add proxy URI
  34.         output := getHTML(websiteedit) // use the getHTML function to get the source of the user input website
  35.    
  36.         // write the output to a file to use later
  37.         fmt.Println(output); fmt.Printf("\033c")
  38.         websiteHTML := string(output[:])
  39.    
  40.         // correct file name for use
  41.         str := website
  42.         str = replacer.Replace(str)
  43.  
  44.         // create the website file
  45.         err := ioutil.WriteFile(str + ".html", []byte(websiteHTML), 0755)
  46.         if err != nil {
  47.             fmt.Printf("Unable to write file: %v", err)
  48.         }
  49.    
  50.         fmt.Println("" +
  51.             "Done!")
  52.         // pause the program
  53.         var pause string
  54.         fmt.Scanln(&pause)
  55.         fmt.Printf("\033c") // clear the screen ready for a new session
  56.     }
  57. }
  58.  
  59.  
  60.  
  61. func getHTML(w string) []byte {
  62.     url := w
  63.     fmt.Println("Seaching Packets...")
  64.     resp, err := http.Get(url)
  65.     // handle the error if there is one
  66.     if err != nil {
  67.         panic(err)
  68.     }
  69.     // do this now so it won't be forgotten
  70.     defer resp.Body.Close()
  71.     // reads html as a slice of bytes
  72.     html, err := ioutil.ReadAll(resp.Body)
  73.     if err != nil {
  74.         panic(err)
  75.     }
  76.     // show the HTML code as a string %s
  77.     return html
  78. }
  79.  
  80. // random hex string generator
  81. func randomHex(n int) string {
  82.     bytes := make([]byte, n)
  83.     return hex.EncodeToString(bytes)
  84.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement