This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Backend | |
class DHCP < Sinatra::Base | |
get '/options' do | |
content_type "application/json" | |
ordinateur = Ordinateur.where(:mac => params["mac"].try(:gsub, ":", "-")).limit(1).first | |
return '{}' if ordinateur.nil? || ordinateur.desactive? | |
ordinateur.vu! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# language: fr | |
Fonctionnalité: DHCP | |
Afin de distribuer des IPs | |
En tant qu'API appelée par le serveur DHCP | |
Je souhaite pouvoir répondre à celui-ci | |
Scénario: Répondre correctement | |
Soit un adhérent ayant la chambre 1005 | |
Et une date de départ dans 1 an | |
Et un ordinateur avec pour mac 00-11-22-33-44-55 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <linux/module.h> //these are for every module | |
#include <linux/kernel.h> | |
#include <linux/types.h> //u_int && co | |
#include <linux/skbuff.h> //struct sk_buff | |
#include <linux/in.h> //basic internet shiat | |
#include <linux/ip.h> //protocol headers | |
#include <linux/tcp.h> | |
#include <linux/netfilter.h> //need this for register_ | |
#include <linux/netfilter_ipv4.h> //.. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <netinet/in.h> | |
#include <linux/types.h> | |
#include <linux/netfilter.h> /* for NF_ACCEPT */ | |
#include <linux/ip.h> | |
#include <linux/tcp.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TP 3: Working with netfilter and libnetfilter-queue | |
The objective of this TP is to work with netfilter kernel module creation and user-space processing of queued packets using libnetfilter-queue. | |
Important: The result of this TP should be sent to: [email protected] or [email protected] with TP3-yourname as a subject. | |
If you don't finish on time, consider it as a homework and send it before Friday April 15 at 8:00PM. | |
Context: | |
-------- | |
Whenever the host receives an incomming ssh connection (on port 22), the module drops the packet. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require "mechanize" | |
agent = Mechanize.new | |
page = agent.get "https://cas.it-sudparis.eu/cas/login?service=http://si-etudiants.it-sudparis.eu/opdotnet/noyau/SSO/cas.aspx" | |
session = page.body.match(/jsessionid\=(.*?)\?service/)[1] | |
lt = page.body.match(/name\=\"lt\" value=\"(.*?)\"/)[1] |
NewerOlder