-9

I made a simple batch script for tech support scam baiting but i want it too run it when a scammer runs dir /s or tree /s how would i do this?

Logo4
  • 1
  • 3
    How do you expect to distinguish scammers from non-scammers? – Scott Hunter Mar 03 '17 at 18:13
  • 1
    I used a adfly rip off to find a fake popup – Logo4 Mar 03 '17 at 18:16
  • No idea what you are trying to accomplish. You will need to write a better description of your task and provide code that you are already using. Otherwise this question will be closed. – Squashman Mar 03 '17 at 18:49
  • Inbuilt commands can't be overridden (AFAIK), instead you would need get them to use a *fake* console, you could base it from `CMD++` - http://mirum.weebly.com/cmd – Sam Denty Mar 03 '17 at 19:24
  • @SamDenty - You don't need to overwrite the commands, just monitor the command history for `dir` or `tree`. Still not possible in batch, though. – SomethingDark Mar 03 '17 at 19:26
  • @SomethingDark What about using the below batch file, and executing it on the startup of CMD using http://stackoverflow.com/a/17405182/5269570 – Sam Denty Mar 03 '17 at 19:29

1 Answers1

1

Based upon CMD++, this batch-file will act like a normal command prompt until tree or dir is typed as a command. To get this to run on the startup of CMD by using a solution like this

Script:

@echo off
call :Variables
:CMD
:::::::::::::::::::::::::::::::::::::::::
:: CMD++ - http://mirum.weebly.com/cmd ::
:::::::::::::::::::::::::::::::::::::::::
:NormalMode
    color 07
    title C:\WINDOWS\system32\cmd.exe
    echo Microsoft Windows [Version 10.0.14986]
    echo (c) 2016 Microsoft Corporation. All rights reserved.
    goto :cmdCommand
:cmdCommand
    echo.
:cmdCommand2
    set "cmdCommand="
    %echo% C:\Users\%username%&set /p "cmdCommand=>"
    if not defined CmdCommand (goto :CmdCommand2)
    set "CMDCmd=%cmdCommand:"=%"
    call :commands
goto :cmdCommand
:commands
    if /i "%CMDCmd:~0,3%"=="dir" goto :execute
    if /i "%CMDCmd:~0,4%"=="tree" goto :execute
    %cmdCommand%
    goto :cmdCommand
:Variables
    set "cmd++=goto cmdCommand"
    set "echo=<nul set /p ="
goto :EOF

:execute
    echo They entered 'dir' or 'tree'
    pause
goto :EOF

Example output:

Microsoft Windows [Version 10.0.14986]
(c) 2016 Microsoft Corporation. All rights reserved.

C:\Users\samde>echo hello world
hello world

C:\Users\samde>pause
Press any key to continue . . .

C:\Users\samde>tree
They entered 'dir' or 'tree'
Press any key to continue . . .

Community
  • 1
  • 1
Sam Denty
  • 3,693
  • 3
  • 30
  • 43