• 15 апреля стартует «Курс «SQL-injection Master» ©» от команды The Codeby

    За 3 месяца вы пройдете путь от начальных навыков работы с SQL-запросами к базам данных до продвинутых техник. Научитесь находить уязвимости связанные с базами данных, и внедрять произвольный SQL-код в уязвимые приложения.

    На последнюю неделю приходится экзамен, где нужно будет показать свои навыки, взломав ряд уязвимых учебных сайтов, и добыть флаги. Успешно сдавшие экзамен получат сертификат.

    Запись на курс до 25 апреля. Получить промодоступ ...

Совместимость Ие6 И Ие7 ( А Может Вбс Версий) На Скрипте! Нужна По

  • Автор темы k2chogori
  • Дата начала
K

k2chogori

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>PrintBarCode</title>
<meta content="True" name="vs_snapToGrid">
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
</HEAD>
</form>
<script language="VbScript">
On Error Resume Next

Dim objShell
Dim sPath
Dim sPrinter
Dim sPort
Dim sDriver
Dim ar_PrnInfo
Dim strMessage
Dim strAppl
Dim sPrinterPath
Dim ok
Dim sSourceUrl
Dim sLocalFile
Dim hfile
dim objimg

Set objFS = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("WScript.Shell")
Set objNetwork = CreateObject("WScript.Network")
ComputerName = objNetwork.computername
sPath = "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows\Device"
ar_PrnInfo = Split(objShell.RegRead(sPath), ",")
If IsArray(ar_PrnInfo) Then
sPrinterPath = ar_PrnInfo(0)
sPort = ar_PrnInfo(2)
sDriver = ar_PrnInfo(1)
Else
sPrinterPath = ar_PrnInfo
sPort = ar_PrnInfo
sDriver = ar_PrnInfo
End If
dim s
s= "71;73;70;56;57;97;174;0;49;0;247;0;0;0;0;0;128;0;0;0;128;0;128;128;0;0;0;12
8;128;0;128;0;128;128;128;128;128;192;192;192;255;0;0;0;255;0;255;255;0;0;0;255;
2
55;0;255;0;255;255;255;255;255;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0
;
0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;
0
;0;0;0;0;0;0;0;0;0;0;0;51;0;0;102;0;0;153;0;0;204;0;0;255;0;51;0;0;51;51;0;51;10
2
;0;51;153;0;51;204;0;51;255;0;102;0;0;102;51;0;102;102;0;102;153;0;102;204;0;102
;
255;0;153;0;0;153;51;0;153;102;0;153;153;0;153;204;0;153;255;0;204;0;0;204;51;0;
2
04;102;0;204;153;0;204;204;0;204;255;0;255;0;0;255;51;0;255;102;0;255;153;0;255;
2
04;0;255;255;51;0;0;51;0;51;51;0;102;51;0;153;51;0;204;51;0;255;51;51;0;51;51;51
;
51;51;102;51;51;153;51;51;204;51;51;255;51;102;0;51;102;51;51;102;102;51;102;153
;
51;102;204;51;102;255;51;153;0;51;153;51;51;153;102;51;153;153;51;153;204;51;153
;
255;51;204;0;51;204;51;51;204;102;51;204;153;51;204;204;51;204;255;51;255;0;51;2
5
5;51;51;255;102;51;255;153;51;255;204;51;255;255;102;0;0;102;0;51;102;0;102;102;
0
;153;102;0;204;102;0;255;102;51;0;102;51;51;102;51;102;102;51;153;102;51;204;102
;
51;255;102;102;0;102;102;51;102;102;102;102;102;153;102;102;204;102;102;255;102;
1
53;0;102;153;51;102;153;102;102;153;153;102;153;204;102;153;255;102;204;0;102;20
4
;51;102;204;102;102;204;153;102;204;204;102;204;255;102;255;0;102;255;51;102;255
;
102;102;255;153;102;255;204;102;255;255;153;0;0;153;0;51;153;0;102;153;0;153;153
;
0;204;153;0;255;153;51;0;153;51;51;153;51;102;153;51;153;153;51;204;153;51;255;1
5
3;102;0;153;102;51;153;102;102;153;102;153;153;102;204;153;102;255;153;153;0;153
;
153;51;153;153;102;153;153;153;153;153;204;153;153;255;153;204;0;153;204;51;153;
2
04;102;153;204;153;153;204;204;153;204;255;153;255;0;153;255;51;153;255;102;153;
2
55;153;153;255;204;153;255;255;204;0;0;204;0;51;204;0;102;204;0;153;204;0;204;20
4
;0;255;204;51;0;204;51;51;204;51;102;204;51;153;204;51;204;204;51;255;204;102;0;
2
04;102;51;204;102;102;204;102;153;204;102;204;204;102;255;204;153;0;204;153;51;2
0
4;153;102;204;153;153;204;153;204;204;153;255;204;204;0;204;204;51;204;204;102;2
0
4;204;153;204;204;204;204;204;255;204;255;0;204;255;51;204;255;102;204;255;153;2
0
4;255;204;204;255;255;255;0;0;255;0;51;255;0;102;255;0;153;255;0;204;255;0;255;2
5
5;51;0;255;51;51;255;51;102;255;51;153;255;51;204;255;51;255;255;102;0;255;102;5
1
;255;102;102;255;102;153;255;102;204;255;102;255;255;153;0;255;153;51;255;153;10
2
;255;153;153;255;153;204;255;153;255;255;204;0;255;204;51;255;204;102;255;204;15
3
;255;204;204;255;204;255;255;255;0;255;255;51;255;255;102;255;255;153;255;255;20
4
;255;255;255;33;249;4;1;0;0;16;0;44;0;0;0;0;174;0;49;0;0;8;255;0;255;9;28;72;176
;
160;193;131;8;19;42;92;200;176;161;195;135;16;35;74;156;72;177;162;197;139;24;51
;
106;220;200;177;163;199;143;32;67;138;28;73;178;164;201;147;40;83;170;92;201;178
;
165;203;151;48;87;162;152;73;179;166;77;20;2;103;230;196;249;79;103;193;155;53;1
1
9;10;29;8;148;230;80;159;62;17;38;77;120;243;40;207;166;11;139;66;93;234;148;32;
8
2;169;83;159;106;53;136;181;42;81;169;94;169;254;228;169;48;171;211;160;81;177;2
6
;237;73;246;235;208;179;106;175;122;181;170;118;238;87;180;104;119;138;45;250;15
0
;173;89;182;92;219;6;142;219;215;238;213;184;114;1;43;166;219;85;241;94;155;122;
2
19;230;189;11;121;177;223;202;137;233;150;69;92;216;177;100;173;136;183;122;30;4
4
;250;48;208;205;74;5;187;189;140;23;179;104;198;96;89;199;126;220;215;52;225;209
;
150;35;135;141;157;186;247;65;219;107;255;62;110;28;186;115;102;207;197;113;15;1
5
;254;57;178;88;216;198;215;194;94;218;218;57;115;190;148;137;171;62;14;92;187;93
;
235;181;65;75;255;255;205;156;52;105;234;229;101;119;31;159;156;182;229;245;216;
1
9;47;151;95;217;124;246;250;247;117;35;119;13;126;108;235;219;238;161;103;157;11
9
;184;77;87;26;126;208;221;55;89;127;213;169;119;224;130;178;13;120;90;110;5;238;
7
;224;129;231;241;23;33;121;250;209;135;93;106;13;18;152;97;124;219;189;102;97;93
;
202;149;72;98;127;129;117;248;224;132;32;166;39;162;127;40;6;216;156;131;43;86;1
0
4;24;130;27;26;184;35;132;154;189;231;26;144;10;78;104;99;144;161;209;23;93;120;
1
6;66;229;99;133;78;114;40;228;127;227;141;104;100;137;225;73;152;227;113;90;154;
1
04;90;140;112;9;152;86;152;48;230;135;163;134;72;222;152;36;134;20;206;248;37;12
1
;30;178;167;90;139;39;70;201;32;103;109;122;41;222;133;223;65;121;93;153;79;194;
1
03;98;154;9;90;41;104;131;132;174;182;230;110;116;162;39;104;140;113;254;213;232
;
103;207;157;217;37;162;138;170;153;36;163;52;70;71;229;100;160;166;231;91;162;13
3
;82;6;233;108;88;10;121;169;134;92;94;230;233;159;161;58;255;58;232;88;147;218;8
7
;170;129;57;146;90;39;170;125;74;218;163;169;153;26;170;226;158;162;254;154;21;1
5
9;180;170;122;166;112;179;250;106;167;171;193;210;248;236;167;197;70;121;108;141
;
169;138;185;104;138;246;185;215;37;174;122;250;234;98;183;216;34;171;235;161;172
;
54;91;44;147;101;230;234;224;171;240;46;75;172;187;59;174;26;162;186;173;166;89;
4
1;166;46;18;153;47;180;182;202;219;42;119;243;242;170;35;180;149;194;5;102;158;1
9
2;249;182;111;149;192;218;171;110;150;2;203;136;239;149;116;38;152;240;148;104;9
0
;154;103;169;237;101;171;105;200;189;26;28;164;198;115;174;38;33;187;226;114;12;
1
10;203;4;75;172;36;195;29;131;219;167;194;30;223;156;236;135;21;47;169;236;182;5
1
;219;76;225;202;7;227;220;152;206;250;226;71;242;206;35;227;25;116;196;251;177;4
0
;165;181;60;206;167;105;134;194;242;235;167;204;108;46;151;180;212;147;198;10;17
7
;213;186;130;221;243;199;63;111;202;45;211;194;234;247;242;176;62;15;12;168;202;
1
03;31;153;233;210;114;191;122;109;219;157;162;156;45;247;179;44;155;28;109;103;4
9
;21;110;184;75;130;225;148;151;156;73;49;78;150;116;144;55;46;185;100;122;89;197
;
218;225;32;61;158;211;79;68;109;222;121;79;158;131;190;185;230;164;119;94;186;23
1
;58;105;254;30;230;153;127;158;56;87;150;139;46;250;233;160;211;174;248;231;166;
2
15;158;59;229;172;123;164;58;227;184;207;238;122;80;182;203;126;123;232;212;25;1
4
3;123;202;189;99;116;188;236;176;67;255;148;235;185;143;94;189;238;161;35;175;18
8
;246;205;251;190;253;242;217;79;255;253;243;228;43;95;188;245;220;51;223;253;69;
1
88;51;86;168;227;119;197;95;249;252;126;197;206;94;246;189;7;4;0;59;test"
Dim strContects
dim ar
dim i
ar = Split(s, ";")
for i = 0 to UBound(ar)-1
strContects = strContects + chr(ar(i))
next

strContects = strContects + chr(26)
Set fso = CreateObject("Scripting.FileSystemObject")

strPath = "c:\TEMP\barcode.gif"

' open the file
Set file = fso.opentextfile(strPath, 2, True)

' write the info to the file
file.write(strContects)
' close and clean up
file.Close
set file = nothing
set fso = nothing

Sub WriteFile(sFilePathAndName,sFileContents)
Const ForWriting =2
Set oFS = Server.CreateObject("Scripting.FileSystemObject")
Set oFSFile = oFS.OpenTextFile(sFilePathAndName,ForWriting,True)
oFSFile.Write(sFileContents)
oFSFile.Close
Set oFSFile = Nothing
Set oFS = Nothing
End Sub

Sub PrintFile()
Dim objShell1
Set objShell1 = CreateObject("WScript.Shell")
' window.print()
objShell1.Exec "mspaint /p c:\TEMP\barcode.gif"
Set objShell1 = Nothing
End Sub

Set objNetwork = Nothing
Set objShell = Nothing

If Err.Number<>0 Then
Msgbox "Printing Error ...."&"\n"&" Error Number is " & Err.Number & " Error Desc is " & Err.Description

Else
Msgbox "BarCode successfully printed"

End If

Msgbox sPrinterPath & sPort & sDriver
</SCRIPT>
</body>
</HTML>


Вопросы:
1. При работе с этим скриптом в ИЕ 6 вылазит ошибка (файл создается но его размер 0кбайт ) : Printing Error ....\n Error Number is 5 Error Desc is invalid Procedure call or argument ! Если выполнить скрипт на ИЕ7 все нормально и создается гиф файл в С:/TEMP/barcode.gif .
Может ли это возникнуть из-за каких-то несовместимостей версии ИЕ? или ВБС ?
Если закоментить 's то ошибок не возникает.
2. Что делает процедура Sub WriteFile(sFilePathAndName,sFileContents) что за параметры sFilePathAndName,sFileContents ?
3. window.print() нужна ли тут?
 
Мы в соцсетях:

Обучение наступательной кибербезопасности в игровой форме. Начать игру!