program controll;

{$m 16384,0,0}

uses dos;

var
  i:integer;
  a,c,b: string;
  ax,clear:boolean;

  function pass:boolean;
  var 
    d:string;
  begin
    clear := false;
    writeln('');
    writeln('Only high level security allowed to use this command.');
    write('Enter clearance password: ');
    readln(d);
    if d=c then clear := true;
    pass := clear;
  end;

begin
  a := '';
  b := '';
  c := 'r7';
  clear := false;
  while a <> 'RET7' do
  begin
    ax := true;
    getdir(0,b);
    write(b,'>');
    readln(a);
    for i:= 1 to length(a) do a[i] := upcase(a[i]);
    if clear = false then begin
      if pos('ATTRIB',a)>0 then ax := pass;
      if (pos('/A',a)>0) and (pos('DIR',a)>0) then ax := pass;
      if pos('DOS',a)>0 then ax := pass;
      if pos('REMCOM',a)>0 then ax := pass;
      if pos('DEL',a)>0 then ax := pass;
      if pos('REN',a)>0 then ax := pass;
      if pos('COMMAND',a)>0 then ax := pass;
    end;
    if ax=true then exec('c:/command.com','/c'+a);
    if ax=false then writeln('Access denied!');
    writeln('');
  end;
  writeln('ddos shell terminated');
end.

