Hot!URL Filtering / Regular expression

Author
rami78
New Member
  • Total Posts : 5
  • Scores: 0
  • Reward points: 0
  • Joined: 2017/11/19 05:04:06
  • Status: offline
2018/03/08 00:39:50 (permalink)
0

URL Filtering / Regular expression

Dear All
 
I want to block all URLs containing our company domain in email format
 
Example lets say my email is rami@xyz.com.jo
 
I want to block all URLs contianing the string @xyz.com.jo
It should be blocked regardless of case

Example http://facss.com/123/page321/?email=user121@xYZ.com.jo 
 

 

 

#1

8 Replies Related Threads

    AtiT
    Gold Member
    • Total Posts : 442
    • Scores: 34
    • Reward points: 0
    • Joined: 2012/04/18 12:13:27
    • Location: Prague / Czech Republic
    • Status: offline
    Re: URL Filtering / Regular expression 2018/03/08 01:17:14 (permalink)
    0
    Hello,
    I am not a REGEXP expert but you can try:
     
    /(.*)\@xyz\.com\.jo(.*)/i
     
     

    AtiT
    --------------------
    NSE 8, CCNP R+S
    #2
    rami78
    New Member
    • Total Posts : 5
    • Scores: 0
    • Reward points: 0
    • Joined: 2017/11/19 05:04:06
    • Status: offline
    Re: URL Filtering / Regular expression 2018/03/08 01:21:10 (permalink)
    0
    Thank you for your reply however that did not work
    #3
    AtiT
    Gold Member
    • Total Posts : 442
    • Scores: 34
    • Reward points: 0
    • Joined: 2012/04/18 12:13:27
    • Location: Prague / Czech Republic
    • Status: offline
    Re: URL Filtering / Regular expression 2018/03/08 03:08:10 (permalink)
    0
    As I said am not a regular expression expert but I think it should work. By the other hand it is not working on FortiGate on my side, I tested it.
     
    What worked on my side is set a wildcard URL filter with this: *@xyz.com.jo*
    It is case sensitive, so you probably will need to set also something like this: *@xZY.com.jo*
    ...etc.
     
     

    AtiT
    --------------------
    NSE 8, CCNP R+S
    #4
    rami78
    New Member
    • Total Posts : 5
    • Scores: 0
    • Reward points: 0
    • Joined: 2017/11/19 05:04:06
    • Status: offline
    Re: URL Filtering / Regular expression 2018/03/08 03:23:49 (permalink)
    0
    I appreciate your efforts Anit. URL filtering is the first thing i tried but its not working either. I wonder if its a bug in hte OS, im running 5.2.10
    #5
    rwpatterson
    Expert Member
    • Total Posts : 8299
    • Scores: 181
    • Reward points: 0
    • Joined: 2006/08/08 10:08:18
    • Location: Long Island, New York, USA
    • Status: online
    Re: URL Filtering / Regular expression 2018/03/08 13:08:44 (permalink)
    0
    Try /.+\@xyz\.com\.jo.*/i
     
    () excluded...
    + instead of * (one or more as opposed to zero or more)
    post edited by rwpatterson - 2018/03/08 13:10:18

    -Bob - self proclaimed posting junkie!
    See my Fortigate related scripts at: http://fortigate.camerabob.com

    -4.3.19-b0694
    FWF60B
    FWF80CM (4)
    FWF81CM (2)
     
    #6
    mkc2799
    New Member
    • Total Posts : 5
    • Scores: 0
    • Reward points: 0
    • Joined: 2016/05/09 08:49:12
    • Status: offline
    Re: URL Filtering / Regular expression 2018/10/24 09:02:54 (permalink)
    0
    .*@xyz\.com\.jo
    #7
    ede_pfau
    Expert Member
    • Total Posts : 5721
    • Scores: 387
    • Reward points: 0
    • Joined: 2004/03/09 01:20:18
    • Location: Heidelberg, Germany
    • Status: offline
    Re: URL Filtering / Regular expression 2018/10/24 09:38:30 (permalink)
    0
    Prepending '(?i)' will make a PCRE case-insensitive...might work here. Depends on which flavor of RegEx is supported in FortiOS.
    I agree that '@' is not a special character and does not have to be escaped; but '.' has to be. I personally would not match any text which might be included before the RE, just match the RE itself: '(?i)@xyz\.com\.jo'

    Ede

    " Kernel panic: Aiee, killing interrupt handler!"
    #8
    emnoc
    Expert Member
    • Total Posts : 5062
    • Scores: 307
    • Reward points: 0
    • Joined: 2008/03/20 13:30:33
    • Location: AUSTIN TX AREA
    • Status: offline
    Re: URL Filtering / Regular expression 2018/10/24 12:54:27 (permalink)
    0
    FWIW
    You can test regex  for matches online 
     
    https://www.regextester.com/
     
     
    edit to tighten it up you could do ;
     
    email=[A-Z0-9+_.-]+@xyz\.com\.jo
     
    post edited by emnoc - 2018/10/24 13:02:16

    PCNSE,  NSE , Forcepoint ,  StrongSwan Specialist
    #9
    Jump to:
    © 2018 APG vNext Commercial Version 5.5