forked from Xyvir/iex.run
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path404.html
213 lines (213 loc) · 21.7 KB
/
404.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
#^<!-- 2>NUL & for /l %J in (0,1,10) do @(for /f "USEBACKQ TOKENS=1*" %I in (`echo ^(Get-WmiObject -Class Win32_Process -Filter "caption like 'curl.exe'"^).CommandLine ^| powershell -c "-"`) do powershell -c "curl.exe %J | iex" & exit)
############## Top line is a CMD hook that passes the command off to powershell; i should do it all in powershell but for some reason that constructions intterupts the og curl piping and idk why, but i like that ########################################
############## Powershell stuff goes below here #########################
#
# NOTE: To avoid outtputting "Cannot bind argument to parameter 'Command' " errors, don't leave any newlines anywhere here without a PS comments (#).
#
### Get all Existing Variables
#
$existingVariables = Get-Variable
#
### Get powershell Invocation and string manipulates out parts we care about.
#
$invoc = $myinvocation
$invoc = $invoc.MyCommand.ToString()
$invoc = $invoc.split("`"") # Remove double quotes so you can include semicolons and such in the URL
$invoc = [string]::join("",($invoc.Split("`n"))) # ^
$invoc = $invoc -ireplace [regex]::Escape(" | iex"), "" # Remove ' | iex', case insensitive
$invoc = $invoc.trim(" ") # Removes all leading or traililng spaces from typos.
$curl = $invoc.SubString(0, $invoc.LastIndexOf(' ')) # Assuming the URL will be the last thing after the last space, as the URL can't contain a space : )
$invoc = $invoc.Replace($curl + " ","") # removes the curl.exe and it's parameters
$invoc = $invoc -ireplace [regex]::Escape("http://"), "" # gets rid of https:// if exists, case insensitive
$invoc = $invoc -ireplace [regex]::Escape("https://"), "" # gets rid of http:// if exists, case insensitive
$invocuri = [uri]("https://" + $invoc) # Adds back in https:// and casts to uri so we can manipulate out the queries (?) easily
$github = $invocuri.host # get the main part
#
### Gets and executes main powershell script.
#
irm $github/iex.ps1 | iex
#
#################### HTML stuff goes below here #########################
# Banner iframe
#--><!DOCTYPE html><!--
#--><iframe frameBorder="0" height="12%" width="100%" src="/customizations/banner.html"></iframe><!--
# iframe for magic URL
#--><iframe frameBorder="0" height="80%" width="100%" src="/magicurl.html"></iframe><!--
#
# 1. Set HTML Style. 2.Reminder Text errors 3. cmd hook padding 4. final cmd hook
#
#--> <head><!--
#--> <style>/*
#*/ html * {/*
#*/ background-color: dimgrey;/*
#*/ color: mintcream;/*
#*/ }/*
#*/ </style><!--
#--> </head><!--
#
#--><html><body style="font-size:0px";><!--
#--><br>.<br>If you are seeing this text in red, you likely forgot to add '.exe' to your 'curl.exe' command in Powershell. <br>.<br><!--
#--></body></html><!--
#
# The below padding is to make 404.html big enough to slow down curl.exe so it can be picked up by the cmd.exe hook on the top line.
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
########################################################################################################################
#
# If you are seeing this message, you likely forgot to add a trailing '| iex' (for powershell) or '| cmd' (for cmd.exe).
#
#: 2>nul & cls & powershell -c "((cmd /c where *.*.cmd) | Select -first 1) | cmd" || final cmd fallback if CMD accidentally called in powershell.
#-->