Jump to content

(Under 100 lines Challenge) Security Script

Go to solution Solved by KuJoe,

Not a bad script, but you're looking at security all wrong. If you want to add security then passwords are not the solution. 2FA is the best and easiest method. Your solution is type a password and then typing another password, my solution is typing a password and then clicking a button on another device, significantly more secure since only the person with that device (me) can click that button whereas your solution lets anybody type both passwords.

Hi!

 

I have created a script for windows to add a little more security to your computer!

This script force closes explorer.exe and then pops up a cmd window asking for a username and password. Now your thinking. Can I just task manager start a cmd window and type start explorer.exe? No in the background the script constantly closes the task manager process. Now how does this add security? Well simply open your run box after downloading the script (Windows key + r) and type shell:startup simply place a COPY of lock.bat and then leave the original files somewhere on your pc. Now when ever your pc starts up it will automatically runs the script making it harder for people to get access by guessing the password. You can also put a copy of lock.bat on your desktop and then use it instead of the standard windows lock just easier to log in and out!

 

Here is the source code!

 

Code for lock.bat

 

   

taskkill /f /im explorer.exe
@echo off
title LOCKDOWN INITIATED
cls
:1
echo ===LOGIN===
echo.
echo Please enter the username!
echo.
echo ===========
set /p selection=Username:
if %selection%==USERNAME HERE goto a
if not %selection%==USERNAME HERE goto 1
:a
echo ===LOGIN===
echo.
echo Please enter the password!
echo.
echo ===========
set /p selection=Password:
if %selection%==PASSWORD HERE goto b
if not %selection%==PASSWORD HERE goto 1
:b
title Login Succesfull
cls
echo Loging in to pc!
echo.
timeout 3 > nul
echo Welcome %username%
start unlock.bat 

 

Code for prevent.bat:

 

 :a
taskkill /f /im taskmgr.exe
goto a 

 

code for unlock.bat

 @echo off
start explorer.exe 

 

This script all together is 35 lines of code in the bat format!

Link to comment
https://linustechtips.com/topic/818119-under-100-lines-challenge-security-script/
Share on other sites

Link to post
Share on other sites

i feel like this is very dangerous ...

killing explorer.exe isn't a nice experience, ive done it on my i7 3517u laptop running w8 a long time ago to get better FPS in minecraft lol 

Ryzen 5 3600 stock | 2x16GB C13 3200MHz (AFR) | GTX 760 (Sold the VII)| ASUS Prime X570-P | 6TB WD Gold (128MB Cache, 2017)

Samsung 850 EVO 240 GB 

138 is a good number.

 

Link to post
Share on other sites

Just now, themctipers said:

i feel like this is very dangerous ...

killing explorer.exe isn't a nice experience, ive done it on my i7 3517u laptop running w8 a long time ago to get better FPS in minecraft lol 

I have had 0 problems with it and have been using it for weeks + it was just for the under 100 lines challenge so I could use a different language and make it better.

Link to post
Share on other sites

Just now, SlushyG said:

I have had 0 problems with it and have been using it for weeks + it was just for the under 100 lines challenge so I could use a different language and make it better.

i just feel like it is bad :( 

Ryzen 5 3600 stock | 2x16GB C13 3200MHz (AFR) | GTX 760 (Sold the VII)| ASUS Prime X570-P | 6TB WD Gold (128MB Cache, 2017)

Samsung 850 EVO 240 GB 

138 is a good number.

 

Link to post
Share on other sites

Just now, SlushyG said:

I mean I understand why but I mean your can read the source code nothing is going to mess with your computer i'm learning how to program not make virus. 

the only bad feeling i get is that its killing explorer.exe

thats it 

 

lol 

Ryzen 5 3600 stock | 2x16GB C13 3200MHz (AFR) | GTX 760 (Sold the VII)| ASUS Prime X570-P | 6TB WD Gold (128MB Cache, 2017)

Samsung 850 EVO 240 GB 

138 is a good number.

 

Link to post
Share on other sites

Not a bad script, but you're looking at security all wrong. If you want to add security then passwords are not the solution. 2FA is the best and easiest method. Your solution is type a password and then typing another password, my solution is typing a password and then clicking a button on another device, significantly more secure since only the person with that device (me) can click that button whereas your solution lets anybody type both passwords.

-KuJoe

Link to post
Share on other sites

Just now, KuJoe said:

Not a bad script, but you're looking at security all wrong. If you want to add security then passwords are not the solution. 2FA is the best and easiest method. Your solution is type a password and then typing another password, my solution is typing a password and then clicking a button on another device, significantly more secure since only the person with that device (me) can click that button whereas your solution lets anybody type both passwords.

I see what you mean but i'm still learning how to script and code but thanks for the feedback :)

Link to post
Share on other sites

Oh man, I love adding easy to circumvent security!

 

Safe mode, nuke it from orbit.

 

A cool project would to do what KuJoe suggested, but to make it integrated with winlogin through the API, and to receive 2FA codes using Google Authenticator. That shit would be cool.  

idk

Link to post
Share on other sites

4 minutes ago, SlushyG said:

I see what you mean but i'm still learning how to script and code but thanks for the feedback :)

No problem, if you want to write a script that offers a better security feature might I suggest a script that generates an e-mail when somebody logs into your Windows PC? It doesn't really add any more security but it's a nice tracking method (and I'm sure there are plenty of scripts out there that do it already but it might be a nice script challenge that's also useful).

-KuJoe

Link to post
Share on other sites

Just now, KuJoe said:

No problem, if you want to write a script that offers a better security feature might I suggest a script that generates and e-mail when somebody logs into your Windows PC? It doesn't really add any more security but it's a nice tracking method (and I'm sure there are plenty of scripts out there that do it already but it might be a nice script challenge that's also useful).

Ill look into it thanks!

Link to post
Share on other sites

1 minute ago, KuJoe said:

No problem, if you want to write a script that offers a better security feature might I suggest a script that generates an e-mail when somebody logs into your Windows PC? It doesn't really add any more security but it's a nice tracking method (and I'm sure there are plenty of scripts out there that do it already but it might be a nice script challenge that's also useful).

unplug internet cord or turn off wifi card disable script

Link to post
Share on other sites

Just now, Alaradia said:

toss bronze mesh over it or aluminum foil........ or un secure the antenna connection on the wifi card physical access is total access 

Nope, it's not possible to login to my PC without an internet connection. :D

-KuJoe

Link to post
Share on other sites

2 minutes ago, Alaradia said:

remove drive plug it into a usb adapter look at it from another computer or live cd

OK, we'll assume you took out all of the hard drives and had a spare RAID controller laying around... it would take much longer to break the hardware encryption than it would for the data center security to find you.

-KuJoe

Link to post
Share on other sites

1 minute ago, SlushyG said:

Perma ddos so you can never use it again? xD JKJKJK

That's a possibility, luckily I keep backups in other data centers and have thousands of IPs to work with (not to mention I can rent a server for dirt cheap to move my VM over to).

-KuJoe

Link to post
Share on other sites

Just now, KuJoe said:

That's a possibility, luckily I keep backups in other data centers and have thousands of IPs to work with (not to mention I can rent a server for dirt cheap to move my VM over to).

Oh I know I own 3 of them xD one just a pc back up server 

Link to post
Share on other sites

Just now, KuJoe said:

OK, we'll assume you took out all of the hard drives and had a spare RAID controller laying around... it would take much longer to break the hardware encryption that it would for the data center security to find you.

your computers in a data center? but i'm obviously not going to crack in while in the data center ill take them leave then decrypt when i'm in a safe place

Link to post
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

×