Foro de elhacker.net

Programación => Scripting => Mensaje iniciado por: FurioMoltisanti en 3 Noviembre 2017, 16:45 pm



Título: [VBS] Ver fuente pagina .onion
Publicado por: FurioMoltisanti en 3 Noviembre 2017, 16:45 pm
Hace unos días me motive con esto del VBS. Tiene mucho que mejorar, lo se, agradecería solo criticas constructivas, tampoco le voy a dedicar mas tiempo. Dejo parte de las URL porque no se como esta la normativa. El wget lo descarga porque tenia intención de hacer mas cosas pero aquí quedo la cosa.

Código
  1. Dim wDir
  2. Dim url7z
  3. Dim urlTor
  4. Dim urlWget
  5. Dim urlPolipo
  6.  
  7. wDir = pGetEnv("%USERPROFILE%") & "\YoYo\"
  8. url7z = "http://www.7-zip.org/*/7z1604.exe"
  9. urlTor = "https://www.torpro*/*/tor-win32-0.3.1.7.zip"
  10. urlWget = "https://eternally*/*/wget.exe"
  11. urlPolipo = "https://www.ir*/*/polipo-20140107-win32.zip"
  12.  
  13.  
  14. pMkDir wDir
  15. If Not pFileExist(wDir & "7z\7z.exe") Then
  16. If pDownload(url7z, wDir) then
  17. pMkDir wDir & "7z"
  18. pExecute wDir & "7z1604.exe /S /D=" & wDir & "7z\", True
  19. pDeleteFile wDir & "7z1604.exe"
  20. End if
  21. End If
  22.  
  23. If Not pFileExist(wDir & "tor\tor.exe") Then
  24. If pDownload(urlTor, wDir) then
  25. pUnZip wDir & "tor-win32-0.3.1.7.zip", wDir & "tor"
  26. pDeleteFile wDir & "tor-win32-0.3.1.7.zip"
  27. End if
  28. End If
  29.  
  30. If Not pFileExist(wDir & "wget\wget.exe") Then
  31. pMkDir wDir & "wget"
  32. pDownload urlWget, wDir & "wget\"
  33. End If
  34.  
  35.  
  36. pExecute wDir & "tor\tor.exe", False
  37.  
  38. If Not pFileExist(wDir & "polipo\polipo.exe") Then
  39. If pDownload(urlPolipo, wDir) then
  40. pUnZip wDir & "polipo-20140107-win32.zip", wDir & "polipo"
  41. pDeleteFile wDir & "polipo-20140107-win32.zip"
  42. End if
  43. End If
  44.  
  45. pExecute wDir & "polipo\polipo.exe socksParentProxy=localhost:9050 socksProxyType=socks5", False
  46. WScript.Sleep 2000
  47. MsgBox pTorGetPage("http://uj3wazyk5u4hnvtk.onion/")
  48. pExecute "TSKILL POLIPO", False
  49. pExecute "TSKILL TOR", False
  50.  
  51.  
  52. Function pFileExist(pathFile)
  53. Dim objFSO
  54. Set objFSO = CreateObject("Scripting.FileSystemObject")
  55. pFileExist = objFSO.FileExists(pathFile)
  56. End Function
  57.  
  58. Function pDownload(strLink, pStrSaveTo)
  59. strSaveName = Mid(strLink, InStrRev(strLink,"/") + 1, Len(strLink))
  60. strSaveTo = pStrSaveTo + strSaveName
  61. Set objHTTP = CreateObject("WinHttp.WinHttpRequest.5.1")
  62.  
  63. objHTTP.Open "GET", strLink, False
  64. ' objHTTP.SetCredentials "User", "Password", HTTPREQUEST_SETCREDENTIALS_FOR_SERVER
  65. objHTTP.Send
  66.  
  67. Set objFSO = CreateObject("Scripting.FileSystemObject")
  68. If objFSO.FileExists(strSaveTo) Then
  69. objFSO.DeleteFile(strSaveTo)
  70. End If
  71.  
  72. If objHTTP.Status = 200 Then
  73. Dim objStream
  74. Set objStream = CreateObject("ADODB.Stream")
  75. With objStream
  76. .Type = 1 'adTypeBinary
  77. .Open
  78. .Write objHTTP.ResponseBody
  79. .SaveToFile strSaveTo
  80. .Close
  81. End With
  82. Set objStream = Nothing
  83. End If
  84. Set objHTTP = Nothing
  85. pDownload = False
  86. If objFSO.FileExists(strSaveTo) Then
  87. pDownload = True
  88. End If
  89. Set objFSO = Nothing
  90. End Function
  91.  
  92. Sub pMkDir(pDirectory)
  93. Dim oFSO
  94. Dim directory
  95. Dim sDirectory
  96. directory = pDirectory
  97. Set oFSO = CreateObject("Scripting.FileSystemObject")
  98. If Mid(directory, Len(directory), 1) = "\" Then
  99. directory = Left(directory, Len(directory)-1)
  100. End If
  101. If Mid(directory, Len(directory), 1) <> ":" And Mid(directory, Len(directory), 1) <> "%" Then
  102. sDirectory = Left(directory, InStrRev(directory, "\") - 1)
  103. If Not oFSO.FolderExists(sDirectory) Then
  104. pMkDir sDirectory
  105. End If
  106. If Not oFSO.FolderExists(directory) Then
  107. oFSO.CreateFolder directory
  108. End If
  109. End If
  110. Set oFSO = Nothing
  111. End Sub
  112.  
  113. Sub pExecute(pathExe, wait)
  114. Dim objShell
  115. Dim objFSO
  116. Set objShell = WScript.CreateObject("WScript.Shell")
  117. objShell.Run "cmd.exe /c " & Chr(34) & pathExe & Chr(34), 0, wait
  118. Set objShell = Nothing
  119. End Sub
  120.  
  121. Sub pDeleteFile(pahtFile)
  122. Dim oFSO
  123. Set oFSO = CreateObject("Scripting.FileSystemObject")
  124. If oFSO.FileExists(pahtFile) Then
  125. oFSO.DeleteFile pahtFile
  126. End If
  127. Set oFSO = Nothing
  128. End Sub
  129.  
  130. Sub pUnZip(pathZip, dest)
  131. Dim unZip
  132. unZip = wDir + "7z\7z.exe"
  133. If pFileExist(pathZip) And pFileExist(unZip) Then
  134. pExecute unZip & " e " & pathZip & " -o" & dest, True
  135. End If
  136. End Sub
  137.  
  138. Function pTorGetPage(strUrl)
  139. Set WinHttpReq = CreateObject("WinHttp.WinHttpRequest.5.1")
  140. WinHttpReq.SetProxy 2, "127.0.0.1:8123"
  141. WinHttpReq.Open "GET", strUrl, False
  142. WinHttpReq.Send
  143. pTorGetPage = WinHttpReq.ResponseText
  144. End Function
  145.  
  146. Function pGetEnv(strEnv)
  147. Dim oShell
  148. Set oShell = CreateObject("WScript.Shell")
  149. pGetEnv = oShell.ExpandEnvironmentStrings(strEnv)
  150. End Function