Git Product home page Git Product logo

xlog's Introduction

xlog

基于flex & bison的web日志扫描工具


与二进制扫描工具yara语法相似
一、语法规则
//例1: 检测url
//含义:请求url种含有$str,不含有$str1 且 请求为post 或者get方法,且返回请求为404的
//关键字url:用于修饰str变量为匹配请求的url
//关键字GET、POST:表示请求为GET\POST
//关键字status:表示http status
//关键字not:表示不满足

rule yara_attackAdmin {
  meta:
    description = "attack admin"
  strings:
    $str="admin.php" url
    $str1="feed" url

  condition:
    $str and (GET or POST) and status=404 and not $str1
}

//例2:检测agent
//含义:请求agent含有DNSPod-Monitor的
//关键字agent:用于修饰str变量为匹配请求的agent参数
rule yara_agent {
  meta:
    description = "Detect agent"
  strings:
    $str="DNSPod-Monitor" agent
  condition:
    $str and (GET or POST)
}


//例3:检测refer
//含义:请求refer为某个链接
//关键字refer:用于修饰str变量为匹配请求的refer参数
rule yara_refer {
  meta:
description = "Detect refer"
  strings:
$str="http://blog.xxxx.me/wp-admin/post.php?post=2445&action=edit&message=10" refer
  condition:
$str
}


//例4:正则检测url
//含义:请求url为满足正则表达式shell[1-9].php
//关键字双斜杠:双斜杠里面的内容为正则表达式
//关键字url:用于修饰str变量为匹配请求的url
rule yara_reg {
  meta:
    description = "Detect refer"
  strings:
    $str=/shell[1-9].php/ url
  condition:
    $str
}
二、使用
1、下载源码后,可直接make可生产scanner程序
2、执行:./scanner 规则文件路径 web访问日志
3、输出命中的结果:
    可根据命令行定制化输出
    -a 输出全部结果(默认)
    -ip 输出ip
    -refer 输出ip
    -request 输出url
    ....
    -st 参数time 输出访问时间大于time的结果
    -et 参数time 输出访问时间小雨time的结果

问题反馈邮箱:[email protected]

xlog's People

Contributors

breagitt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.