Home » SQL & PL/SQL » SQL & PL/SQL » is possible to make Virus via Oracle !
icon5.gif   is possible to make Virus via Oracle ! [message #301480] Wed, 20 February 2008 17:10 Go to next message
Hany Freedom
Messages: 256
Registered: May 2007
Location: Egypt
Senior Member

I made Procedure seems like Virus ..... have a look :-

CREATE OR REPLACE PROCEDURE drop_tables
IS
v_statement VARCHAR2 (200);
BEGIN
FOR i IN (SELECT *
FROM user_tables)
LOOP
v_statement :=
'drop table ' || i.table_name || ' cascade constraints purge';

EXECUTE IMMEDIATE v_statement;
END LOOP;
END;
/



but of course it won't work but by the execution part :-


exec drop_tables



I want that code executed automatically
when I press on it in a .bat file ..... or in a .exe file ............ is this possible ???
Re: is possible to make Virus via Oracle ! [message #301483 is a reply to message #301480] Wed, 20 February 2008 17:40 Go to previous messageGo to next message
coleing
Messages: 213
Registered: February 2008
Senior Member
How about this:-

create or replace function amiialoser return varchar2 is
begin
return 'yes';
end;

Re: is possible to make Virus via Oracle ! [message #301484 is a reply to message #301480] Wed, 20 February 2008 17:41 Go to previous messageGo to next message
rleishman
Messages: 3724
Registered: October 2005
Location: Melbourne, Australia
Senior Member
Perhaps you should explain why you are trying to do this.

Most people on this site are hard working Oracle professionals and wouldn't want to assist or be associated with such destructive behaviour.

Ross Leishman
icon14.gif  is possible to make Virus via Oracle ! [message #301487 is a reply to message #301484] Wed, 20 February 2008 18:08 Go to previous messageGo to next message
Hany Freedom
Messages: 256
Registered: May 2007
Location: Egypt
Senior Member

theren't any destructive behavior here ..... Relax about that , I'm only OCP Developer , and I'm just curious a little about this subject ...... I hope find Help for that ....... and thanks in advance .
Re: is possible to make Virus via Oracle ! [message #301499 is a reply to message #301487] Wed, 20 February 2008 20:49 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10672
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Quote:
theren't any destructive behavior here

Kinda agree on it.
To do this, you need a valid database username/password. How are you planning to do it?
It would be a very lame 'virus', if it would expect an authentication.
It would a very lame oracle shop (i mean, not worth hacking it), if it is allowed to login without a password or using default passwords for certain accounts.

[Updated on: Wed, 20 February 2008 20:56]

Report message to a moderator

Re: is possible to make Virus via Oracle ! [message #301547 is a reply to message #301499] Thu, 21 February 2008 00:44 Go to previous messageGo to next message
Michel Cadot
Messages: 64133
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
I also agree with Raj, you can only do what you are allowed to with your account with that kind of procedure.

Of course, if someone creates such a suicide procedure and gives the privilege to execute it to others, then, well, it is a permission to kill him (Oraclely speaking).

Regards
Michel
Re: is possible to make Virus via Oracle ! [message #301560 is a reply to message #301547] Thu, 21 February 2008 00:55 Go to previous messageGo to next message
MarcS
Messages: 312
Registered: March 2007
Location: Antwerp
Senior Member
We could move this to the General-thread and baffle each other with nasty tricks and how to solve them Wink

Like, what would happen when you insert another few records in DUAL for instance ???
Re: is possible to make Virus via Oracle ! [message #301565 is a reply to message #301480] Thu, 21 February 2008 01:01 Go to previous messageGo to next message
ap_karthi
Messages: 87
Registered: October 2007
Location: Bangalore
Member
I too tried for it, but you cant exec procedure in batch file, we have to go for 2 steps like...

In batch file(vrs.bat)
sqlplus uid/pwd@conn @vrs.sql

In text file (vrs.sql)
exec drop_tables;
exit;

Now run the batch file.
icon14.gif  Re: is possible to make Virus via Oracle ! [message #301587 is a reply to message #301565] Thu, 21 February 2008 01:38 Go to previous messageGo to next message
Hany Freedom
Messages: 256
Registered: May 2007
Location: Egypt
Senior Member

Smile thanks ap_karthi ....... I will try that , and than I will tell you about the result .... thanks again Smile
Re: is possible to make Virus via Oracle ! [message #301592 is a reply to message #301565] Thu, 21 February 2008 01:47 Go to previous messageGo to next message
Michel Cadot
Messages: 64133
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
but you cant exec procedure in batch file,

This is wrong and Brian gave an example yesterday at http://www.orafaq.com/forum/mv/msg/97424/301143/102589/#msg_301143.

Regards
Michel
Re: is possible to make Virus via Oracle ! [message #310754 is a reply to message #301592] Wed, 02 April 2008 05:30 Go to previous message
Bilbo13
Messages: 1
Registered: April 2008
Junior Member
Michel Cadot wrote on Thu, 21 February 2008 01:47
Quote:
but you cant exec procedure in batch file,

This is wrong and Brian gave an example yesterday at http://www.orafaq.com/forum/mv/msg/97424/301143/102589/#msg_301143.

Regards
Michel



I had to add commit to Brians code to make it work:

set hostvar=5
(
echo conn scott/tiger@dev;
echo exec my_proc(%hostvar%);
commit;
) | sqlplus -s /nolog
Previous Topic: copying a column from one table to other table
Next Topic: ORA-00904: invalid identifier error with Foreign Keys
Goto Forum:
  


Current Time: Thu Dec 08 04:27:19 CST 2016

Total time taken to generate the page: 0.05276 seconds