SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


TSQL Virus or Bomb?


TSQL Virus or Bomb?

Author
Message
jgama
jgama
SSC-Enthusiastic
SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)

Group: General Forum Members
Points: 143 Visits: 1
Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/jgama/tsqlvirusorbomb.asp



Razvan Socol
Razvan Socol
SSCommitted
SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)

Group: General Forum Members
Points: 1963 Visits: 129
There is a slight chance that the script which searches for EXEC-s will not function correctly: if the procedure is larger than 4000 characters and the word "EXEC" starts in a @current_text and ends in another one.

Razvan



John Scarborough
John Scarborough
Mr or Mrs. 500
Mr or Mrs. 500 (528 reputation)Mr or Mrs. 500 (528 reputation)Mr or Mrs. 500 (528 reputation)Mr or Mrs. 500 (528 reputation)Mr or Mrs. 500 (528 reputation)Mr or Mrs. 500 (528 reputation)Mr or Mrs. 500 (528 reputation)Mr or Mrs. 500 (528 reputation)

Group: General Forum Members
Points: 528 Visits: 52
There's no such word as "virii". It's "viruses".

John Scarborough
MCDBA, MCSA
ewilson10
ewilson10
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1259 Visits: 22
Hello.

I'm looking forward to playing with the 'Validate SP's and UDF's with checksum' over the next couple of weeks and I was wondering if there's a way to use this logic against Jobs and DTS packages?

Everett


Everett



Everett Wilson
ewilson10@yahoo.com
K. Brian Kelley
K. Brian Kelley
Keeper of the Duck
Keeper of the Duck (39K reputation)

Group: Moderators
Points: 39464 Visits: 1917
quote:
There's no such word as "virii". It's "viruses".


In scientific and medical arenas, virii tend to be used. With that said, some computer folks use virii instead of viruses. If you do a Google search you'll see it's quite accepted.


K. Brian Kelley, GSEC
http://www.truthsolutions.com/
Author: Start to Finish Guide to SQL Server Performance Monitoring
http://www.netimpress.com/

K. Brian Kelley
@‌kbriankelley
K. Brian Kelley
K. Brian Kelley
Keeper of the Duck
Keeper of the Duck (39K reputation)

Group: Moderators
Points: 39464 Visits: 1917
quote:
I'm looking forward to playing with the 'Validate SP's and UDF's with checksum' over the next couple of weeks and I was wondering if there's a way to use this logic against Jobs and DTS packages?


Yes. Generating a checksum or a hash is a standard way of checking change on most anything, to include files. For instance, you can configure products like BindView to generate a hash on critical files (such as those in C:\WINNT\) and at a later time compare the hash results to see if changes have happened. So pretty much you can do this on anything... generate the checksum or hash and then compare at a later time. For jobs you may a look at the sysjobsteps table. For DTS packages, look at sysdtspackages if stored in SQL Server.


K. Brian Kelley, GSEC
http://www.truthsolutions.com/
Author: Start to Finish Guide to SQL Server Performance Monitoring
http://www.netimpress.com/

K. Brian Kelley
@‌kbriankelley
ewilson10
ewilson10
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1259 Visits: 22
Thanks for the information. This is shapping up to be a nice tool.


Everett



Everett Wilson
ewilson10@yahoo.com
jgama
jgama
SSC-Enthusiastic
SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)

Group: General Forum Members
Points: 143 Visits: 1

Hi Razvan,

Thank you for letting me know about that problem. You are right and there are two solutions in TSQL: one is to store the entire code in a text record in a temp table and search from there. This is slow and with lots of code envolved. The second idea is to search for EXEC in each 8kb block, then search for E at the end of one block and XEC at the beginning of the next one, and son on.
Unfortunatelly, I don't have the time to work on it now but I will do it.

Peace,
Joseph Gama





jgama
jgama
SSC-Enthusiastic
SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)SSC-Enthusiastic (143 reputation)

Group: General Forum Members
Points: 143 Visits: 1

Hi Razvan,

I finally got the code and I will post it soon, the problem was solved.

Peace

Joseph Gama





Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search