Results 1 to 6 of 6

Thread: Script Problem

  1. #1
    Member
    Join Date
    Mar 2010
    Location
    SO CAL
    Posts
    59

    Question Script Problem

    Hello every one now everytime I run this in etterfilter I get an error..


    Code:
    if(ip.proto==TCP && tcp.dst==80){
        if(search(DATA.data,"Accept-Encoding")){ 
          replace("Accept-Encoding", "Accept-Rubbish!");
    
           msg("zapped Accept-Encoding!\n");
           }
         }
    
    
    if(ip.proto==TCP && tcp.src==80){
        replace("img src","img src=\"http://www.hellokittypink.com/wp-content/uploads/2008/01/hello-kitty-contacts.jpg\"");
    
        replace("IMG SRC","img src=\"http://www.hellokittypink.com/wp-content/uploads/2008/01/hello-kitty-contacts.jpg\"");
    
    
        msg("Filter Ran.\n");
    }
    THIS IS THE ERROR

    Code:
    root@bt:~/enc0de# etterfilter ron.filter -o ron.ef
    
    etterfilter NG-0.7.3 copyright 2001-2004 ALoR & NaGA
    
    
     12 protocol tables loaded:
            DECODED DATA udp tcp gre icmp ip arp wifi fddi tr eth
    
     11 constants loaded:
            VRRP OSPF GRE UDP TCP ICMP6 ICMP PPTP PPPoE IP ARP
    
     Parsing source file 'ron.filter'
    [ron.filter:2]: Function "if" not recognized
    Can someone point me in the right direction here.

    Thanks for you time and input.

  2. #2
    Junior Member
    Join Date
    Jan 2010
    Posts
    79

    Default Re: Script Problem

    Put a space after the if's. Functions don't have spaces. The if's do.

    Quote Originally Posted by enc0de View Post
    Hello every one now everytime I run this in etterfilter I get an error..


    Code:
    if(ip.proto==TCP && tcp.dst==80){
        if(search(DATA.data,"Accept-Encoding")){ 
    
    if(ip.proto==TCP && tcp.src==80){

    Thanks for you time and input.

  3. #3
    Member
    Join Date
    Feb 2010
    Posts
    75

    Default Re: Script Problem

    It should be:

    Code:
    if (ip.proto == TCP && tcp.dst == 80) {
       if (search(DATA.data, "Accept-Encoding")) {
          replace("Accept-Encoding", "Accept-Rubbish!");
              # note: replacement string is same length as original string
          msg("zapped Accept-Encoding!\n");
       }
    }
    if (ip.proto == TCP && tcp.src == 80) {
       replace("img src=", "img src=\"http://www.hellokittypink.com/wp-content/uploads/2008/01/hello-kitty-contacts.jpg\" ");
       replace("IMG SRC=", "img src=\"http://www.hellokittypink.com/wp-content/uploads/2008/01/hello-kitty-contacts.jpg\" ");
       msg("Filter Ran.\n");
    try compile as you have been,also
    Code:
    etterfilter ron.filter -o ron.ef
    chmod 755 ron.ef
    Make sure you execute ettercap from the same directory as ron.ef
    Last edited by pieface; 03-24-2010 at 12:43 AM.

  4. #4
    My life is this forum thorin's Avatar
    Join Date
    Jan 2010
    Posts
    2,629

    Default Re: Script Problem

    I'm not sure why your if is failing but your replacement is going to fail.

    Assume pages contain "img src=blef.gif" after your replacement I believe it will contain "img src=\"http://www.hellokittypink.com/wp-content/uploads/2008/01/hello-kitty-contacts.jpg\blef.gif". Your if statement might be failing because you have an odd number of " (quote symbols) in your replace statement (looks like you have 5 when you only need 4).
    I'm a compulsive post editor, you might wanna wait until my post has been online for 5-10 mins before quoting it as it will likely change.

    I know I seem harsh in some of my replies. SORRY! But if you're doing something illegal or posting something that seems to be obvious BS I'm going to call you on it.

  5. #5
    Very good friend of the forum hhmatt's Avatar
    Join Date
    Jan 2010
    Posts
    660

    Default Re: Script Problem

    Quote Originally Posted by thorin View Post
    I'm not sure why your if is failing but your replacement is going to fail.

    Assume pages contain "img src=blef.gif" after your replacement I believe it will contain "img src=\"http://www.hellokittypink.com/wp-content/uploads/2008/01/hello-kitty-contacts.jpg\blef.gif". Your if statement might be failing because you have an odd number of " (quote symbols) in your replace statement (looks like you have 5 when you only need 4).
    Code:
    replace("img src","img src=\"http://www.hellokittypink.com/wp-content/uploads/2008/01/hello-kitty-contacts.jpg\"");
    I count 6.

    @OP
    It is indeed the space between your if statement. Check this out it may be of help to you.

    http://www.irongeek.com/i.php?page=s...ettercapfilter
    Last edited by hhmatt; 03-24-2010 at 07:55 PM.

  6. #6
    Member
    Join Date
    Mar 2010
    Location
    SO CAL
    Posts
    59

    Wink Re: Script Problem

    Thanks for all the help and support.
    Stand up and be counted as a linux user.

Similar Threads

  1. Startup script running
    By PostalService in forum Beginners Forum
    Replies: 1
    Last Post: 10-23-2010, 12:21 PM
  2. bt4-customise script?
    By Mr-Protocol in forum Beginners Forum
    Replies: 3
    Last Post: 06-15-2010, 12:28 PM
  3. automated WEP cracking script - wepcrack.sh
    By phillips321 in forum Experts Forum
    Replies: 10
    Last Post: 05-05-2010, 11:32 PM
  4. is there a startup script location?
    By redss in forum Beginners Forum
    Replies: 5
    Last Post: 03-09-2010, 06:49 AM
  5. Shell script
    By bbakker in forum Beginners Forum
    Replies: 1
    Last Post: 01-24-2010, 01:02 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •