Skip to content

Instantly share code, notes, and snippets.

View v2-dev's full-sized avatar

Giulia v2-dev

View GitHub Profile
@v2-dev
v2-dev / scan-l2.py
Created September 24, 2017 09:24
find every device connected to the subnet with the pair MAC Address <---> Subnet IP using scapylibrary
#! /usr/bin/env python
# scan-layer2 : arpings a subnet to find every device connected to the subnet
import sys
if len(sys.argv) != 2:
print ("Usage: scan-layer2 \n eg: scan-layer2.py 192.168.1.0/24")
sys.exit(1)
from scapy.all import srp,Ether,ARP,conf
ans,unans=srp(Ether(dst="ff:ff:ff:ff:ff:ff")/ARP(pdst=sys.argv[1]),timeout=10)
@v2-dev
v2-dev / gist:4e57262908548671adcd908ecb0ae2e8
Created September 26, 2016 10:03
How to download a specific filename of a webpage using wget and regex
wget -r -nd -A c --accept-regex="/.*\.ext" 'url'
@v2-dev
v2-dev / parseline.c
Created September 12, 2016 15:31
read from stdin and print only alphabetical characters
#include <stdio.h>
#include <stdlib.h>
#define BUFSIZE 1024
char *word;
void errExit(const char *errmsg)
{
fprintf(stderr, "%s\n", errmsg);