473,405 Members | 2,176 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Mac modifier

Recently where I live they have made tried to make the act of
wardriving illegal.
This in a state that has several "state run" wifi hotspots, that all
run wide open (go figure).
Anyways this got me thinking about the potential for plausible
deniability should the need ever arise. I realized that you actually
need to change 2 things, MAC address and hostname, since both are
typicall tracked by DHCP servers.
Below is the complete source for a new tool I made which does exactly
that.
It will randomly change both your hostname and MAC address until you
reboot your computer, at which time (hopefully), they revert to their
default settings again.
Save this, compile it, and run it using sudo and giving a single
argument which is the device name to modify

sudo ./modify eth0

This program is completely free, totally public domain, and
considering the draconian laws getting passed lately I don't even want
credit for it. As such it is also 100% unsupported, if it hoses your
computer, thats your problem. This is for education use only, please
don't use this for illegal purposes, void where prohibited etc, blah
and insert other legal jargon here.

Enjoy!

#include <iostream>
#include <cstdlib>
#include <ctime>

std::string Pickchar(std::string chars){
int pos = rand()%chars.length();
return(chars.substr(pos,1));
}

std::string HostName(){
int x = rand()%32+3;
std::string name;
for(int count = 0; count < x; count++){
name +=Pickchar("abcdefeghijklmnopqrstuvwxyz.
1234567890");
}
return(name);
}

std::string MakeMac(){
std::string mac;
for(int x = 1; x < 18; x++){
if(x%3 0){
mac += Pickchar("0123456789ABCDEF");
}else{
mac +=":";
}
}
return(mac);
}

int main(int argc, char* argv[]){
srand((unsigned)time(0));
std::string device = argv[1];
std::string change;
change += "hostname ";
change += HostName();
change +="\n";
change += "ifconfig ";
change += device;
change += " down hw ether ";
change += MakeMac();
change += "\n";
change += "ifconfig ";
change += device;
change += " up\n";
change += "ifdown ";
change += device;
change += "\n";
change += "ifup ";
change += device;
change +="\n";
std::cout << change;
system(change.c_str());
}

May 2 '07 #1
1 1262
"DevNull" <sm*****@gmail.comwrote in message
news:11********************@y80g2000hsf.googlegrou ps.com...
Recently where I live they have made tried to make the act of
wardriving illegal.
This in a state that has several "state run" wifi hotspots, that all
run wide open (go figure).
Anyways this got me thinking about the potential for plausible
deniability should the need ever arise. I realized that you actually
need to change 2 things, MAC address and hostname, since both are
typicall tracked by DHCP servers.
Below is the complete source for a new tool I made which does exactly
that.
It will randomly change both your hostname and MAC address until you
reboot your computer, at which time (hopefully), they revert to their
default settings again.
Save this, compile it, and run it using sudo and giving a single
argument which is the device name to modify

sudo ./modify eth0

This program is completely free, totally public domain, and
considering the draconian laws getting passed lately I don't even want
credit for it. As such it is also 100% unsupported, if it hoses your
computer, thats your problem. This is for education use only, please
don't use this for illegal purposes, void where prohibited etc, blah
and insert other legal jargon here.

Enjoy!

#include <iostream>
#include <cstdlib>
#include <ctime>

std::string Pickchar(std::string chars){
int pos = rand()%chars.length();
return(chars.substr(pos,1));
}

std::string HostName(){
int x = rand()%32+3;
std::string name;
for(int count = 0; count < x; count++){
name +=Pickchar("abcdefeghijklmnopqrstuvwxyz.
1234567890");
}
return(name);
}

std::string MakeMac(){
std::string mac;
for(int x = 1; x < 18; x++){
if(x%3 0){
mac += Pickchar("0123456789ABCDEF");
}else{
mac +=":";
}
}
return(mac);
}

int main(int argc, char* argv[]){
srand((unsigned)time(0));
std::string device = argv[1];
std::string change;
change += "hostname ";
change += HostName();
change +="\n";
change += "ifconfig ";
change += device;
change += " down hw ether ";
change += MakeMac();
change += "\n";
change += "ifconfig ";
change += device;
change += " up\n";
change += "ifdown ";
change += device;
change += "\n";
change += "ifup ";
change += device;
change +="\n";
std::cout << change;
system(change.c_str());
}
This is probably more appropriate to alt.2600.hackers.programming
May 2 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: steve | last post by:
Can someone give me an example of using the ’e’ pattern modifier in php regex: http://www.php.net/manual/en/reference.pcre.pattern.modifiers.php Thanks in advance. Wish the manual had some...
2
by: Dan Disney | last post by:
I have read conflicting information on the access scope of VB.Net class declarations when no access modifier is specified. MSDN library documentation states "Classes that do not specify an access...
3
by: N Khan via .NET 247 | last post by:
Hi, I know the usage of access modifier ?public? in DLL assembliesbut I am a bit puzzled that if let say I have a public class inan exe assembly then what purpose access modifier ?public?...
2
by: Rolf Kemper | last post by:
Dear All, may be some one can comment why belows code snipet does not work.(only one 'i' item is returned) I tried to use the g modifier in order to get an array of values back. (My expection is...
3
by: Roderick A. Anderson | last post by:
I'm dealing with a project that requires me to query a MS SQL Server. Not a PostgreSQL issue I know but I want to ask if the LIMIT modifier is SQL standard? MS SQL Server uses a TOP modifier. ...
3
by: fh1996 | last post by:
Documents say that "new" class modifier is only used with nested classes. "new" indicates that the class hides an inherited member of the same name." public class MyDerivedC : MyBaseC { new...
3
by: Aaron | last post by:
Hi, I am attempting to alter the behaviour of a base class using the new modifier. I have hit a snag and am unable to hide the base class member. The skeleton code is below, I have included an...
1
by: Mark Kamoski | last post by:
Hi-- Please help. What is the default access modifier value for a Sub or a Function when one has not explicitly been set. In MSDN, in "Access Types", it states... "If no access modifier...
10
by: =?iso-8859-2?B?SmFuIFJpbmdvuQ==?= | last post by:
Hello everybody, this is my first post to a newsgroup at all. I would like to get some feedback on one proposal I am thinking about: --- begin of proposal --- Proposal to add...
1
by: muler | last post by:
"If an instance method declaration includes the sealed modifier, it must also include the override modifier." The C# Programming Language, § 10.5.5 Sealed Methods Why is this? Thanks,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.