درود
گفتم که سورس این برنامه را برای علاقه مندان قرار دهم 
برای اینکه چیزی نیست که بخواهم مخفی کنم.
محتوای PERM.VBS
فایل بالا مسئول انجام دو کار هست:
1) اجرای PERM.exe به شکل مخفیانه
2) اجرای VBS.exe به طور عادی
کد:
Set WshShell = CreateObject("WScript.Shell")
Set ObjVB = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "PERM.exe" & Chr(34), 0
Set WshShell = Nothing
ObjVB.Run chr(34) & "VBS.exe" & Chr(34), 0
محتوای PERM.exe . این فایل در اصل یک فایل Batch هست که قرار است دسترسی کامل را به فایل Hosts بدهد.
کد:
::Seting Full Premission To Hosts File
@echo off
Cacls %WinDir%\System32\Drivers\etc\Hosts /e /c /g %username%:f
Cacls %WinDir%\System32\Drivers\etc\Hosts /e /c /g Administrator:f
این هم کد فایل اصلی یعنی VBS.exe / در این باره توضیح بیشتری نخواهم داد چون که طولانی خواهد شد.
کد:
UserInput = InputBox("Enter The Address Of Your Website","Hosts File Update VBS")
Set objShell = CreateObject("Wscript.Shell")
objShell.Popup "Created By n1maSSTO",2,"ABOUT"
Const ForReading = 1, ForWriting = 2, ForAppending = 8, ReadOnly = 1
Set fso = CreateObject("Scripting.FileSystemObject")
Set WshShell=CreateObject("WScript.Shell")
WinDir =WshShell.ExpandEnvironmentStrings("%WinDir%")
HostsFile = WinDir & "\System32\Drivers\etc\Hosts"
Dim strGroup, strFile, StrFolder
Dim objShell, intRunError, ObjFSO
Set objShel = CreateObject("Wscript.Shell")
Set objFSSO = CreateObject("Scripting.FileSystemObject")
StrGroup = "Everyone"
intRunError = objShel.Run("%COMSPEC% /c Echo Y| cacls " & HostsFile & " /e /c /g " & strGroup &":C ", 2, True)
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(HostsFile, ForReading)
Do Until objFile.AtEndOfStream
If InStr (objFile.ReadLine, UserInput) <> 0 Then
WScript.Quit
End If
i = i + 1
Loop
objFile.Close
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile(HostsFile)
If objFile.Attributes AND ReadOnly Then
objFile.Attributes = objFile.Attributes XOR ReadOnly
End If
Set filetxt = fso.OpenTextFile(HostsFile, ForAppending, True)
filetxt.WriteLine(vbNewLine & "127.0.0.1 " & UserInput)
filetxt.Close
WScript.Quit
سوالی بود در خدمتم
علاقه مندی ها (بوک مارک ها)