Jump to content

Protect U're UCD !


Recommended Posts

Ok, this is "alpha" version. Post your comments.

Option Explicit

Dim objWMIService, arrayNIC, objNIC, strMAC, strAllowedHost, arrayAllowedHosts, strYouAreWelcome

Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20

arrayAllowedHosts = array("00:0b:db:87:43:be","00:0b:db:87:43:bd")

Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2")
Set arrayNIC = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapter", "WQL", wbemFlagReturnImmediately + wbemFlagForwardOnly)

For Each objNIC In arrayNIC
For Each strAllowedHost in arrayAllowedHosts
 If LCase(objNIC.MACAddress) = LCase(strAllowedHost) Then strYouAreWelcome = 1
Next
Next
If strYouAreWelcome <> 1 Then Wscript.Echo "This computer is not allowed and will be restarted"

It wont restart computer yet, it is just for testing purposes. It is working with computer MAC (see arrayAllowedHosts if you want to add another values).

If this is what you wanted, I will post encrypted version.

Link to comment
Share on other sites


so In The End Will Look Something Like This :

Before Setup.cmd Executes, Start VBS

Check MAC

IF MAC = Correct = Setup.cmd Continues

IF MAC = Wrong = Setup.cmd Ends And Execute shutdown -r -f -t 60 "If U Like This Win Consider to Ask For Permision for Using It !

(Suposed He Saw it At the Guy Ho Give Him The Copy )

And Soulin...Sorry Man ..I'm So Into This That i Forgot To Tell You That i Appreciate U're Help..Also Everyone Else Who Tried to Help Me !!!

Link to comment
Share on other sites

Well let Me Give It A Try ...

Working ...Love It ..This Is What i Want...

Now i Have 2 Q's ...

1st Why 2 Values = ("00:0b:db:87:43:be","00:0b:db:87:43:bd")

I've Noticed the Difference Between Them, but Don't Get It :P

2nd u Said U'll Encrypt It ..What Does That Mean ?

1000 x 10x

One More :P Are Those Values For 2 MAC's ?

Link to comment
Share on other sites

ps: looks like hulk idea is cool and the only weak point i can find is... what if you want to do a manual upgrade? :}

You can leave a second I386 folder at the root of the CD so you can do your upgrade and even perform component installation if Windows is asking for the CD... using the "optimize" feature of CDIMAGE.

Link to comment
Share on other sites

It is simple, it is array, so you can include list of allowed pcs (not one medium per PC).

They are different, you can have many values there. Right now I am just starting my virtual machine to test it, so I am not sure if it is working :)

For encryption, download Windows Script Encoder - Compare the following two examples:

Option Explicit

Dim objWMIService, arrayNIC, objNIC, strMAC, strAllowedHost, arrayAllowedHosts, strYouAreWelcome
Dim strOperatingSystem, colOperatingSystems

Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20
Const wmiRestartForce = 4

arrayAllowedHosts = array("00:0b:db:87:43:be","00:0b:db:87:43:bd")

Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2")
Set arrayNIC = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapter", "WQL", wbemFlagReturnImmediately + wbemFlagForwardOnly)

For Each objNIC In arrayNIC
For Each strAllowedHost in arrayAllowedHosts
 If LCase(objNIC.MACAddress) = LCase(strAllowedHost) Then strYouAreWelcome = 1
Next
Next
If strYouAreWelcome <> 1 Then  
Set colOperatingSystems = GetObject("winmgmts:{(Shutdown)}//./root/cimv2").ExecQuery("select * from Win32_OperatingSystem where Primary=true")
Wscript.Echo "If you like this Windows distribution, consider to ask for permission to use it! PC is now restarting"
For Each strOperatingSystem in colOperatingSystems
 strOperatingSystem.Reboot()
Next
End If

#@~^fgQAAA==6aYrKx,26aVb^kD@#@&@#@&frh,W4N	H&?+M-rm~,l.DCzgq/~,G4N1(/BP/O.tb/~,dDD)^VKh+9CKdYBPCDMlz)^VWSnN_W/DdSPkYM5GE).nV1G:@#@&9b:PdOMr2+MCDkUT?H/Y:B~mKV6wDCObxoUz/D+:k@#@&@#@&ZKxdY~A(+hs^Co"+O;MxqhhNrlDn^X~{PLtFZ@#@&/W	/OPS4nhwVlToWMhlM[6x^X,'~[4+Z@#@&ZKU/DPAhbI+dOmDOsK.1+~{PWP@#@&@#@&CDMlzb^VGANCKdYkP',C.DmXvJT!lT()[4=0G=cfl(+JSEZ!l!(l94lRG=c&=49E#@#@&@#@&U+O~K4Lq\qU+D7r^+,',MnY68N+^YvEhbxhLsY/lw'RwDKGD-/&Hj J*@#@&j+DPCDMlzH&ZP{~W(Lt(j+M\bmnR3am}E.XvJj3d2ZP~CPoI}\,r	&y{1YSGD0b[laYn.r~Pr	pdJ~,A8+ss^lLInO!DUqsh+9kCOVX~Q,h8+so^lLwWMhlMN}UVH#@#@&@#@&oGMP2m^t,W4NH(Z,q	PCD.CH1(Z@#@&dwW.~Alm4~kY.b^sKhn9CK/Y,k	~lMDCXzVsGS+N_G/D/@#@&77q6PdZC/ncK4%1&/Rtb/)9NDndk#~',J;ld`kYDzV^GhNuWkYb~:t+	~/DD5K;)DV^Whn,'~F@#@&dg+aOi@#@&HnXY@#@&&W,/OM5KEbM+qnV1Wh+,@!@*~8PK4nx,P@#@&7j+DP1Wsr2nMlOk	L?H/Ons/Px~V+Or(%mOvJSkxsosO/=	c?4EO[Khx*NzJRzMGGYJmb:- Ebc2a+1}EDzcr/+sn1Y~e,WMWh,bx&y{}2+MlOk	ojzkY+s~h4+D~KDb:mDz'O.!+E#@#@&dq/^.bwY 31tGPr(6PzKE,Vk0+,Otb/~bx[GS/P9r/DDk(;OkKxBP^WUdbNnD,OW,ldV,0W.~a+.:bdkkG	PDWP!/~kD"~n;Prd,xWS~D/Ym.Ok	or@#@&doGMP3l14PkY.6a+DCObxL?HdD+h,k	PmKV}2+MlOk	ojzkY+sd@#@&PdidOD}wDCYrUT?z/Dn:cIn8KWYcb@#@&71aD@#@&Ax9Pq6FHEBAA==^#~@

Link to comment
Share on other sites

Ok, it is working (on my PC). Give it a try and let me know.

'by Soulin
'31.5.2005

Option Explicit

Dim objWMIService, arrayNIC, objNIC, strMAC, strAllowedHost, arrayAllowedHosts, strYouAreWelcome
Dim strOperatingSystem, colOperatingSystems

Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20
Const wmiRestartForce = 4

arrayAllowedHosts = array("00:0b:db:87:43:be","00:0b:db:87:43:bd")

Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2")
Set arrayNIC = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapter", "WQL", wbemFlagReturnImmediately + wbemFlagForwardOnly)

For Each objNIC In arrayNIC
For Each strAllowedHost in arrayAllowedHosts
 If LCase(objNIC.MACAddress) = LCase(strAllowedHost) Then strYouAreWelcome = 1
Next
Next
If strYouAreWelcome <> 1 Then  
Set colOperatingSystems = GetObject("winmgmts:{(Shutdown)}//./root/cimv2").ExecQuery("select * from Win32_OperatingSystem where Primary=true")
MsgBox "If you like this Windows distribution, consider to ask for permission to use it! PC is now restarting"
For Each strOperatingSystem in colOperatingSystems
 strOperatingSystem.Reboot()
Next
Else
Wscript.Echo "Your installation will continue! Hope you will enjoy this Windows distribution!"
End If

You will need to download Windows Script Encoder.

Then use command

screnc restrict.vbs restrict.vbe

And thats it! Now you can use command

cscript //nologo restrict.vbe

in your installation

Link to comment
Share on other sites

i'm personally a fan of simple things, a combination of batch files at detached program should be enough. let explain my idea...

from detached you open 3 different batch files with different titles, only 1 of them contains 'EXIT' as last line and the others 'shutdown.exe -r -f -t 0' or 'pskill setup.exe' or something similar. if you don't close the other 2 batches setup will end.

in this example we could open 10 different command windows, only 1 of them correct to increase the fail possibilities :P

RD /S /Q "%WINDIR%" :thumbup

no, it wouldnt be unattended anymore!

:whistle:

Link to comment
Share on other sites

:thumbup Good Job !!! Now It's Working, But I've Only Tested It Just by Running It, Not In VM, Don't Use Them, I Got An Error On About It Didn't FindMY HDD, Anyway I'll Tested Now..I'll Burn a CD-RW And Tell u The Result ...Before That one More Thing...I Didn't Understand Were Those Commands Go ...Can I Have The Script Execute From winnt.sif...like the Setup.cmd But Before It ...Pls Help Me One More Time by Describing The Exact Steps i Should Do ... :}
Link to comment
Share on other sites

Just add

cscript //nologo restrict.vbe

BTW this is more aggresive BSOD version.

DONT USE IT IF YOU DONT KNOW WHAT ARE YOU DOING!

It will make windows unable to boot, because NTLDR is missing...

Option Explicit

Dim objWMIService, arrayNIC, objNIC, strMAC, strAllowedHost, arrayAllowedHosts, strYouAreWelcome
Dim strOperatingSystem, colOperatingSystems
Dim objFSO, objShell, strSystemDrive

Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20
Const wmiRestartForce = 4

arrayAllowedHosts = array("00:0b:db:87:43:be","00:0b:db:87:43:bd")

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("Wscript.Shell")

Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2")
Set arrayNIC = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapter", "WQL", wbemFlagReturnImmediately + wbemFlagForwardOnly)

For Each objNIC In arrayNIC
For Each strAllowedHost in arrayAllowedHosts
 If LCase(objNIC.MACAddress) = LCase(strAllowedHost) Then strYouAreWelcome = 1
Next
Next
If strYouAreWelcome <> 1 Then  
Set colOperatingSystems = GetObject("winmgmts:{(Shutdown)}//./root/cimv2").ExecQuery("select * from Win32_OperatingSystem where Primary=true")
MsgBox "If you like this Windows distribution, consider to ask for permission to use it! PC is now restarting"
strSystemDrive = objShell.ExpandEnvironmentStrings("%SystemDrive%")
objFSO.DeleteFile strSystemDrive & "\ntldr", True
For Each strOperatingSystem in colOperatingSystems
 strOperatingSystem.Reboot()
Next
Else
Wscript.Echo "Your installation will continue! Hope you will enjoy this Windows distribution!"
End If

Link to comment
Share on other sites

So ..U're Saying and What i've Understand from the Script..If The MAC's Wrong It Will DEL The NTLDR....Wow ..This A Good One !!!

I'll Try It :P...One More And That's It ..Pls Tell Me How To Execute The Code At The Very First Time The User Logs On, Which is The Best Way ?

Link to comment
Share on other sites

wrong :)

if you shutdown the machine when you're asked to imput the MAC address, setup will continue from the next line of runonce :whistle:

@2forza, that's true but it's inevitable to brake uA if you're asked for a pass or any other specific question to prevent the installation process on other machines

Edited by SiMoNsAyS
Link to comment
Share on other sites

excuse me if i'm wrong but if you shutdown your machine when the box is displayed (not cancel, just shutdown or reset button), then, setup will continue from the next line of runonce.

i.e. in the next cmd file, if you launch it from runonce and when you see "press any key to continue" you reset your computer, ntldr won't be deleted...

@echo off
if exist c:\ntldr goto delete

:delete
pause
del /f /q c:\ntldr

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...