Script para determinar usuarios con el password igual al username
PARA IMPLEMENTAR EN POWER
create or replace procedure dba_valida_usuario_password as
-- Buscar Usuarios que tienen el Password Igual que el username
hexpw varchar2(30);
modpw varchar2(30);
un varchar2(30);
cursor c1 is select username,password from dba_users
where length(trim(password)) = 16;
begin
execute immediate 'truncate table dbo.aud_val_usuario_password';
for i in c1 loop
hexpw := i.password;
un := i.username;
execute immediate 'alter user 'un' identified by 'un;
select password into modpw from dba_users where username = un;
if modpw = hexpw then
dbms_output.put_line(un);
insert into dbo.aud_val_usuario_password values (un);
else
execute immediate 'alter user 'un' identified by values '''hexpw'''';
end if;
commit;
end loop;
end;
/
SQL> CREATE TABLE AUD_VAL_USUARIO_PASSWORD (USERNAME VARCHAR2(20));/
SQL> set serveroutput on
SQL> exec dba_valida_usuario_password;
OUTLN
DBSNMP
CTXSYS
MDSYS
TEST
PL/SQL procedure successfully completed.
Suscribirse a:
Enviar comentarios (Atom)
No hay comentarios:
Publicar un comentario