cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Former Member
Not applicable
Report Inappropriate Content
Message 1 of 9

How to block pages by its content

I want to block pages that contains words like:

World Of Warcraft, Lineage, (list of this words is more than 10 words)

Body.PositionOfPattern() is not satisfied me.

Another question - how to block contents in different codepage than utf-8 (for example windows-1251) - convert to hex ?

PS. MWG7 (7.1.6.1)

8 Replies
Former Member
Not applicable
Report Inappropriate Content
Message 2 of 9

Re: How to block pages by its content

i found rule only like that

OnlineGame.PNG

Former Member
Not applicable
Report Inappropriate Content
Message 3 of 9

Re: How to block pages by its content

apellepa wrote:

i found rule only like that

OnlineGame.PNG

I need to comment on this rule because it is not a good example for the usage of the property Body.PositionOfPattern.

This rule has two problems:

1) If you are looking for a byte pattern given in hex digits, the pattern must be enclosed with double quotes. Otherwise the property will look for the hex notation of the pattern.

2) The property must start searching at position/offset 0 if it should start at the first byte of the body.

Look at the correct example:

bodypositionofpattern1.png

As Alex already said, Body.PositionOfPattern is not a good choice here anyway, because it is meant for searching a byte pattern, not text.

Ciao

Felix

Message was edited by: fschulte on 4/17/12 9:20:22 AM CDT
Former Member
Not applicable
Report Inappropriate Content
Message 4 of 9

Re: How to block pages by its content

Thanks alexott!

You are right, page has not detected by medif type, after change ruleset filter all works as expected:

games.PNG

But this page () cathed only by rule:

     Body.PositionOfPattern ("edebe0e9ed20e8e3f0", 1, 2000) greater then 0

Message was edited by: apellepa on 4/17/12 10:20:26 PM EEST
Former Member
Not applicable
Report Inappropriate Content
Message 5 of 9

Re: How to block pages by its content

Hi

You need to create a string list containing the words and then a rule which matches in list on Body.ToString (Number, Number)

Former Member
Not applicable
Report Inappropriate Content
Message 6 of 9

Re: How to block pages by its content

Hi.

it's better not to use Body.ToString as it has no information about encoding, etc.

Former Member
Not applicable
Report Inappropriate Content
Message 7 of 9

Re: How to block pages by its content

You need to check strings against Body.Text property, as it extracts only text, skipping not necessary markup. Another plus for it is that it takes encoding into account.

So your rule should look something like:

IF (MediaType.EnsuredTypes contains 'text/html') AND (Body.Text matches in list "your list of words") THEN Block

your list of words it's better save as Wildcard list (but you can put only words that you're interested in).

Former Member
Not applicable
Report Inappropriate Content
Message 8 of 9

Re: How to block pages by its content

I try this, but its not work as expected:

site http://www.playtime.co.ua/ should be blocked by keyword "*онлайн игры*" but this site is not blocked.

My rule:

BlockByKeyword.PNG

my lists

GamesLists.PNG

Former Member
Not applicable
Report Inappropriate Content
Message 9 of 9

Re: How to block pages by its content

Hello

It looks like we have some issues media type detection - page contains not allowed characters at start of page, so it not detected as text/html...

You Deserve an Award
Don't forget, when your helpful posts earn a kudos or get accepted as a solution you can unlock perks and badges. Those aren't the only badges, either. How many can you collect? Click here to learn more.

Community Help Hub

    New to the forums or need help finding your way around the forums? There's a whole hub of community resources to help you.

  • Find Forum FAQs
  • Learn How to Earn Badges
  • Ask for Help
Go to Community Help

Join the Community

    Thousands of customers use the McAfee Community for peer-to-peer and expert product support. Enjoy these benefits with a free membership:

  • Get helpful solutions from McAfee experts.
  • Stay connected to product conversations that matter to you.
  • Participate in product groups led by McAfee employees.
Join the Community
Join the Community