Giter Site home page Giter Site logo

nuaa-is-sniffer's Introduction

KSniffer

一个在Linux上运行的嗅探器程序,分为cmd版本和gui版本,如果无法运行gui版本你可以尝试运行cmd版本。

cmd版本

在编译运行之前,你需要安装编译套件,以Ubuntu为例:

sudo apt-get install build-essential

当安装完成之后,进入项目文件夹,然后进入cmd版本文件夹:

cd ./cmd

接着你可以使用我编写的编译脚本来进行编译:

./build.sh

如果编译失败,你可以尝试自己使用gcc编译:

gcc ./sniffer.c -o ./sniffer

编译成功之后则会输出一个可执行文件,先赋予它可执行权限:

chmod 777 ./sniffer

之后按照这样的格式执行(注意要使用sudo,因为需要打开网卡混杂模式):

sudo ./sniffer interfaceName

其中interfaceName为网卡名,如果你不知道自己的网卡名,可以使用:

ifconfig

来查看你的网卡

gui版本

我使用qt编写了一个带有用户界面的版本,/gui文件夹中存放的是qt的项目文件,如果你需要编译运行,则使用qt打开pro文件,然后自行配置项目,配置完成之后点击编译即可完成编译。

但是编译完成的可执行文件,不能直接通过qt来运行,因为其中设置了网卡的混杂模式,必须使用管理员身份来执行。

你需要找到qt的编译输出文件夹,然后使用:

sudo ./KSnifferGUI

来执行可执行文件,这样程序才能正常工作

Tips

  • 这段代码并不能在Mac上运行,因为Mac上的gcc并不是真正的gcc,Mac的真正编译前端是clang而不是gcc,其中的头文件也大都有改动,很多网络相关的头文件都经过了修改,所以Mac上并不能运行该代码。
  • 如果不能运行,一定先检查自己的环境是否正常配置

关于

作者: NUAA 161520311

nuaa-is-sniffer's People

Contributors

flyandnotdown avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.