-
Mar 22nd, 2014, 01:21 PM
#1
Thread Starter
Junior Member
Mac Address Changer *not working, need help*
I am trying to make a program that changes my mac address and it hasn't been working right can you guys check it out?
here is the full code
Code:
Imports System.Management
Public Class Form1
Private Sub FillNetworkAdapters()
Dim mc As System.Management.ManagementClass
Dim mo As ManagementObject
mc = New ManagementClass("Win32_NetworkAdapterConfiguration")
Dim moc As ManagementObjectCollection = mc.GetInstances()
For Each mo In moc
If mo.Item("IPEnabled") = True Then
Dim strAdapter As String
strAdapter = mo.Item("Caption").ToString().Substring(11)
combo_network.Items.Add(strAdapter)
End If
Next
End Sub
Private Sub MainForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
FillNetworkAdapters()
End Sub
Private Function GetMACAddress(ByVal Adapter As String) As String
Dim mc As System.Management.ManagementClass
Dim mo As ManagementObject
mc = New ManagementClass("Win32_NetworkAdapterConfiguration")
Dim moc As ManagementObjectCollection = mc.GetInstances()
For Each mo In moc
If mo.Item("IPEnabled") = True Then
Dim strAdapter As String
strAdapter = mo.Item("Caption").ToString().Substring(11)
If strAdapter = Adapter Then
Return mo.Item("MacAddress").ToString()
End If
End If
Next
End Function
Private Sub combo_network_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles combo_network.SelectedIndexChanged
label_mactext.Text = GetMACAddress(combo_network.SelectedItem.ToString)
End Sub
Private Function DoPadding(ByVal x As String) As String
Dim Ret As String
Dim z As Integer
Ret = x
If Len(x) < 4 Then
For z = 1 To 4 - Len(x)
Ret = "0" & Ret
Next
End If
Return Ret
End Function
Private Sub ShowRestart()
Dim res As MsgBoxResult = MsgBox("Your MAC Address has been changed. In order to make the changes take effect, either restart your computer or enable and disable the changed Network Adapter.", MsgBoxStyle.Information)
End Sub
Private Sub bt_update_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_update.Click
If IsOkay() = False Then
Exit Sub
End If
Dim regKey As Microsoft.Win32.RegistryKey
Dim Addr As String = GetRoot(combo_network.SelectedItem.ToString())
regKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(Addr, True)
regKey.SetValue("NetworkAddress", mac_text.Text.Replace(":", ""))
ShowRestart()
End Sub
Private Function GetRoot(ByVal Adapter As String) As String
Dim regKey As Microsoft.Win32.RegistryKey
Dim i As Integer = 0
Do
Dim Root As String = "SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\"
Dim Last As String = DoPadding(i)
regKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(Root & Last, True)
Try
Dim cAdapter As String = regKey.GetValue("DriverDesc").ToString()
If cAdapter = Adapter Then
(GetRoot & Last)
End If
Catch
Exit Do
End Try
i += 1
Loop
End Function
Private Function IsOkay() As Boolean
If mac_text.Text = "" Then
MsgBox("You didn't enter a MAC Address", MsgBoxStyle.Critical)
Return False
End If
Dim ed As String = mac_text.Text.Replace(":", "")
If ed.Length <> 12 Then
MsgBox("A MAC Address must have a length of 12", MsgBoxStyle.Critical)
Return False
End If
Try
If combo_network.SelectedItem.ToString = "" Then
MsgBox("No Network Adapter selected", MsgBoxStyle.Critical)
Return False
End If
Catch
MsgBox("No Network Adapter selected", MsgBoxStyle.Critical)
Return False
End Try
Dim noerror As Boolean = True
Dim i As Integer
For i = 0 To ed.Length - 1
If IsHex(ed.Substring(i, 1)) = False Then
MsgBox("MAC Address in wrong format", MsgBoxStyle.Critical)
Return False
End If
Next
Return True
End Function
Private Function IsHex(ByVal l As String) As Boolean
Dim table As String = "0123456789ABCDEF"
Dim i As Integer
For i = 0 To table.Length - 1
If l = table.Substring(i, 1) Then
Return True
End If
Next
Return False
End Function
Private Sub bt_defaultmac_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_defaultmac.Click
If IsOkay() = False Then
Exit Sub
End If
Dim regKey As Microsoft.Win32.RegistryKey
Dim Addr As String = GetRoot(combo_network.SelectedItem.ToString())
regKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(Addr, True)
Try
regKey.DeleteValue("NetworkAddress")
Catch
'Do NOTHING
End Try
ShowRestart()
End Sub
End Class
It has
4 labels
2 buttons
text box
and combobox or combonetwork something like that
can u guys test it and see why it isn't changing my mac address?
-
Mar 22nd, 2014, 01:45 PM
#2
Re: Mac Address Changer *not working, need help*
Why would you want to change your MAC address? This is the kind of thing that is used by hackers.
-
Mar 22nd, 2014, 03:00 PM
#3
Thread Starter
Junior Member
Re: Mac Address Changer *not working, need help*
I am just doing random programs to learn and no I am not a hacker lol I wish :O seems to complicated to be a hacker but I am doing this to learn so can you help or not?
-
Mar 22nd, 2014, 04:18 PM
#4
Fanatic Member
Re: Mac Address Changer *not working, need help*
I'm not to sure what your local laws are but in Australia changing a MAC address is against the law and punishable by up to 5 years in prison. I recommend if you are learning to learn something from a tutorial or pick a project that doesn't break any laws.
My CodeBank Submissions
- Listbox with transparency and picture support - Click Here
- Check for a true internet connection - Click Here
- Open Cash drawer connected to receipt printer - Click Here
- Custom color and size border around form - Click Here
- Upload file to website without user logins, includes PHP - Click Here
- List All Removable USB Storage Devices - Click Here
- Custom On/Off Slide Control - Click Here
- Insert multiple rows of data into one database table using parameters - Click Here
- Trigger USB/Serial Cash Drawer - Click Here
-
Mar 22nd, 2014, 04:21 PM
#5
Fanatic Member
Re: Mac Address Changer *not working, need help*
Oh I should also add that there is no real legitimate reason to be changing the MAC address. its only use is to bypass something and thus you are violating something: http://en.wikipedia.org/wiki/MAC_spoofing
My CodeBank Submissions
- Listbox with transparency and picture support - Click Here
- Check for a true internet connection - Click Here
- Open Cash drawer connected to receipt printer - Click Here
- Custom color and size border around form - Click Here
- Upload file to website without user logins, includes PHP - Click Here
- List All Removable USB Storage Devices - Click Here
- Custom On/Off Slide Control - Click Here
- Insert multiple rows of data into one database table using parameters - Click Here
- Trigger USB/Serial Cash Drawer - Click Here
-
Mar 22nd, 2014, 07:47 PM
#6
Thread Starter
Junior Member
Re: Mac Address Changer *not working, need help*
Ummm changing mac isn't against the law, our service providers offer us in our default router access to change mac, i wanted to make a program for my self to change it and plus i download many many programs and i do not want to risk of being a zombie i think that is what its called
-
Mar 23rd, 2014, 02:51 PM
#7
Re: Mac Address Changer *not working, need help*
While it may not be against the law where you are, the primary reason to do it is for malicious activity, and this site is too civilised to condone that kind of thing.
As you claim your only intention to change your MAC address is "to learn", it shouldn't be a problem for you to switch to learning things that are more useful (such as learning to work with databases, or graphics, or creating a web site, etc).
-
Mar 23rd, 2014, 09:51 PM
#8
Re: Mac Address Changer *not working, need help*
Wait a second....you can change a network card's MAC address ? Its assigned by the manufacturer. Isn't that read only ?
-
Mar 23rd, 2014, 10:14 PM
#9
Fanatic Member
Re: Mac Address Changer *not working, need help*
Niya yes it is burned into the ROM of a device (in this case the NIC of a router or computer), but you can tell the system to believe its a different value, the device is still what it was set just windows thinks its different.
My CodeBank Submissions
- Listbox with transparency and picture support - Click Here
- Check for a true internet connection - Click Here
- Open Cash drawer connected to receipt printer - Click Here
- Custom color and size border around form - Click Here
- Upload file to website without user logins, includes PHP - Click Here
- List All Removable USB Storage Devices - Click Here
- Custom On/Off Slide Control - Click Here
- Insert multiple rows of data into one database table using parameters - Click Here
- Trigger USB/Serial Cash Drawer - Click Here
-
Mar 23rd, 2014, 10:55 PM
#10
Thread Starter
Junior Member
Re: Mac Address Changer *not working, need help*
Originally Posted by si_the_geek
While it may not be against the law where you are, the primary reason to do it is for malicious activity, and this site is too civilised to condone that kind of thing.
As you claim your only intention to change your MAC address is "to learn", it shouldn't be a problem for you to switch to learning things that are more useful (such as learning to work with databases, or graphics, or creating a web site, etc).
i know how to make sites and some graphics. i move on to other random projects and what is so wrong about changing a damn mac. you guys acting like im going to shut down google or youtube or something lol if changing mac here is against rules then sorry for asking if not i want some help
-
Mar 23rd, 2014, 10:56 PM
#11
Thread Starter
Junior Member
Re: Mac Address Changer *not working, need help*
no, goto your defaults router website and find something that allows change your mac address and change its values easy as that, legal and easy to do. and it is "burned" into your network you can change it when ever unless you are some other internet provider, they don't allow changing IPs
-
Mar 23rd, 2014, 10:57 PM
#12
Thread Starter
Junior Member
Re: Mac Address Changer *not working, need help*
EDIT: like I said i wanna change my IP because I download many programs and i have been hacked before and my ISP said to change my mac address so i did and i was actually fine... and i just wanna make a program so i dont got to type my router etc..
-
Mar 24th, 2014, 02:58 AM
#13
Re: Mac Address Changer *not working, need help*
Originally Posted by bensonsearch
I'm not to sure what your local laws are but in Australia changing a MAC address is against the law and punishable by up to 5 years in prison.
I missed this post.....Just how in God's name can anyone think its justifiable to imprison someone for changing their MAC address ? This is unbelievable.
-
Mar 24th, 2014, 05:55 AM
#14
Re: Mac Address Changer *not working, need help*
Originally Posted by Scifen
EDIT: like I said i wanna change my IP because I download many programs and i have been hacked before and my ISP said to change my mac address so i did and i was actually fine... and i just wanna make a program so i dont got to type my router etc..
Changing the mac address of a router interface would have to be done on the router or through an API provided by the router mfg.
-
Mar 24th, 2014, 06:03 AM
#15
Fanatic Member
Re: Mac Address Changer *not working, need help*
Hey Niya. I don't think they actually would it's more to deter people from doing it I think. Once upon a time we had large fines for washing your car with a hose. Had to use buckets. Water restrictions and all
Scifen the physical MAC address is burned into the ROM. This is unchangeable as well it's burned into it. As I said it's more the system is fooled into reading a different number as the MAC address.
It's not up to this forum to lay down law nor is it possible for us to judge people's real intentions behind things. This forum is 100% viewable by anyone which means anything that can possibly be malicious in nature won't be proactively answered. Regardless of your intentions can you guarantee everyone in the worlds intentions?
My CodeBank Submissions
- Listbox with transparency and picture support - Click Here
- Check for a true internet connection - Click Here
- Open Cash drawer connected to receipt printer - Click Here
- Custom color and size border around form - Click Here
- Upload file to website without user logins, includes PHP - Click Here
- List All Removable USB Storage Devices - Click Here
- Custom On/Off Slide Control - Click Here
- Insert multiple rows of data into one database table using parameters - Click Here
- Trigger USB/Serial Cash Drawer - Click Here
-
Mar 24th, 2014, 08:17 AM
#16
Re: Mac Address Changer *not working, need help*
Originally Posted by bensonsearch
It's not up to this forum to lay down law nor is it possible for us to judge people's real intentions behind things. This forum is 100% viewable by anyone which means anything that can possibly be malicious in nature won't be proactively answered. Regardless of your intentions can you guarantee everyone in the worlds intentions?
Right, so by that logic, we can't discuss anything to do with network requests (those can be used for malicious purposes). Or, in fact, making applications (a hacker could learn how to make a program that automates some attack). Or in fact, anything to do with programming at all.
Originally Posted by si_the_geek
While it may not be against the law where you are, the primary reason to do it is for malicious activity
No, the primary reason to do it is for anonymity and privacy. What exactly is malicious about changing a name?
I'd suggest a quick skim through this for an alternative view on the maliciousness of changing your MAC address:
http://blog.erratasec.com/2013/01/i-...way-aaron.html
-
Mar 24th, 2014, 08:26 AM
#17
Re: Mac Address Changer *not working, need help*
No, the primary reason to do it is for anonymity and privacy. What exactly is malicious about changing a name?
I thought you'd typically run your connections through a VPN / proxy to mask who you really were, not fake your network card's MAC address? You certainly would use a lower level language than .NET (C or C++) so you can get to the driver level.
-
Mar 24th, 2014, 08:32 AM
#18
Re: Mac Address Changer *not working, need help*
Originally Posted by bensonsearch
Once upon a time we had large fines for washing your car with a hose. Had to use buckets. Water restrictions and all
Wow, I'm never coming to Australia. You all have some rather ridiculous laws mate.
-
Mar 24th, 2014, 04:43 PM
#19
Thread Starter
Junior Member
Re: Mac Address Changer *not working, need help*
So can I get help or not? I don't just want you guys arguing... -.-
-
Mar 24th, 2014, 04:46 PM
#20
Re: Mac Address Changer *not working, need help*
Originally Posted by Scifen
So can I get help or not?
Probably not; besides, you should probably be using C or C++ so you can get at the driver level. That's what most proxy programs will do.
-
Mar 24th, 2014, 05:17 PM
#21
Fanatic Member
Re: Mac Address Changer *not working, need help*
Originally Posted by Evil_Giraffe
Right, so by that logic, we can't discuss anything to do with network requests (those can be used for malicious purposes). Or, in fact, making applications (a hacker could learn how to make a program that automates some attack). Or in fact, anything to do with programming at all.
No, the primary reason to do it is for anonymity and privacy. What exactly is malicious about changing a name?
I'd suggest a quick skim through this for an alternative view on the maliciousness of changing your MAC address:
http://blog.erratasec.com/2013/01/i-...way-aaron.html
OK, first and foremost you are over simplifying my post something severe. The topic in this post is one that is more associated with malicious intent (OP or otherwise as again this is a public forum) than most other posts. It is against forum rules to discuss topics that is illegal in nature. while this topic is up for debate on that it has almost no real world honest applications or reasons behind it.
The site you linked to even states that someone was in trouble for doing this very thing. The problem with changing a name as you put it is the MAC address of a NIC is how authorities can trace bad people like hackers and the like(as all hardware MAC address's are registered and filed), it is also a way of enforcing security on a network and many other things.
To use this kind of method as identity protection is kinda weak anyways, if its in home use your ISP still knows its you as the physical line is still yours (as well as perhaps a username and login), to use it in a public area like a cafe's hotspot is kinda redundant as what is changing the MAC address going to stop? it would only really stop them from noticing you connect all the time. A better method would be to use VPN's and/or Proxy servers and well lets face it not put personally identifiable information on your computer if you are that worried.
either which way people stand on this topic, the fact it borders along a very very very grey line is reason enough it shouldn't be here, especially when the OP just wants to learn new things. starting out with a grey area probably isn't the best place.
This is my 2 cents, your more than welcome to disagree
My CodeBank Submissions
- Listbox with transparency and picture support - Click Here
- Check for a true internet connection - Click Here
- Open Cash drawer connected to receipt printer - Click Here
- Custom color and size border around form - Click Here
- Upload file to website without user logins, includes PHP - Click Here
- List All Removable USB Storage Devices - Click Here
- Custom On/Off Slide Control - Click Here
- Insert multiple rows of data into one database table using parameters - Click Here
- Trigger USB/Serial Cash Drawer - Click Here
-
Mar 24th, 2014, 05:49 PM
#22
Re: Mac Address Changer *not working, need help*
Why don't people who "just want to learn" things ever say that about something that is unquestionably benign? There are difficult subjects such as genetic algorithms, bleeding-edge graphics, AI, and so forth, but nobody ever seems to do those "just to learn". The rationale is ONLY used for those areas that are considered dodgy.
I have never studied a piece of technology with no purpose in mind. I always set about it with the purpose of doing something novel (whether I got there or not is a different matter). At this point, as soon as somebody states that they are doing something "just to learn", that's a flag. Theoretically, the database behind VBF could be used to determine the veracity of that assumption, but it would be a rather beastly search. I would guess that the phrase is far more common in closed threads than in average threads. I would also guess that the phrase will be found far more often in association with people with low post counts, though that will have serious statistical biases.
Big data: Lots of questions.
By the way, now that TOR doesn't stand for anything, though it used to, somebody needs to come up with The Hyper Onion Router. It could be used for controlling power grids and the like, but would mostly just be a boon for those who are inclined to share their o-punion.
EDIT: Curse you EG!!!! I went to that link, then tried to scroll the scrollbars in the screen shot in the link.
Last edited by Shaggy Hiker; Mar 24th, 2014 at 05:53 PM.
My usual boring signature: Nothing
-
Mar 24th, 2014, 07:27 PM
#23
Thread Starter
Junior Member
Re: Mac Address Changer *not working, need help*
Well I did not see anything about mac changing is a rule here. It isn't illigeal where I live. I just want a little program instead of VPNs since they are slow and laggy. I like to have fake IP when im in the net since if people get my real IP i can get ddos or even traced so that is why. if someone is going to help please inbox me or comment
-
Mar 24th, 2014, 07:29 PM
#24
Fanatic Member
Re: Mac Address Changer *not working, need help*
Changing your MAC address has nothing to do with faking an IP. That's VPN and or proxy
My CodeBank Submissions
- Listbox with transparency and picture support - Click Here
- Check for a true internet connection - Click Here
- Open Cash drawer connected to receipt printer - Click Here
- Custom color and size border around form - Click Here
- Upload file to website without user logins, includes PHP - Click Here
- List All Removable USB Storage Devices - Click Here
- Custom On/Off Slide Control - Click Here
- Insert multiple rows of data into one database table using parameters - Click Here
- Trigger USB/Serial Cash Drawer - Click Here
-
Mar 24th, 2014, 10:35 PM
#25
Thread Starter
Junior Member
Re: Mac Address Changer *not working, need help*
Pretty much is you just have to manually change it each time this is why I want to create a program. NOW CAN SOMEONE ACTUALLY GIVE ME HELP INSTEAD OF ARGUING.
-
Mar 25th, 2014, 12:43 AM
#26
New Member
Re: Mac Address Changer *not working, need help*
Originally Posted by Scifen
Pretty much is you just have to manually change it each time this is why I want to create a program. NOW CAN SOMEONE ACTUALLY GIVE ME HELP INSTEAD OF ARGUING.
your program is working fine..
you just need to change this part
If cAdapter = Adapter Then
GetRoot = Root & Last
End If
btw, i am on windows 7
-
Mar 25th, 2014, 10:14 AM
#27
Re: Mac Address Changer *not working, need help*
Originally Posted by Scifen
Well I did not see anything about mac changing is a rule here. It isn't illigeal where I live. I just want a little program instead of VPNs since they are slow and laggy. I like to have fake IP when im in the net since if people get my real IP i can get ddos or even traced so that is why. if someone is going to help please inbox me or comment
You want us to quit arguing? That seems unlikely. After all, you have already confirmed that you lied about your reason for writing this, since your motivation is clearly not "doing random programs to learn". Why would that motivate anybody to help you with anything when you open with a lie? If you feel the need to deceive people about your intentions, what are you saying about us when you are effectively telling us not to worry about the real purpose and help you anyways?
Still, the link EG posted is probably all you really needed. If you read through it, it contains code (mostly for Apple, but also for Windows) and an interesting discussion as to whether MAC address spoofing is good or bad.
My usual boring signature: Nothing
-
Mar 25th, 2014, 10:34 AM
#28
Re: Mac Address Changer *not working, need help*
Originally Posted by Shaggy Hiker
You want us to quit arguing? That seems unlikely. After all, you have already confirmed that you lied about your reason for writing this, since your motivation is clearly not "doing random programs to learn". Why would that motivate anybody to help you with anything when you open with a lie? If you feel the need to deceive people about your intentions, what are you saying about us when you are effectively telling us not to worry about the real purpose and help you anyways?
Still, the link EG posted is probably all you really needed. If you read through it, it contains code (mostly for Apple, but also for Windows) and an interesting discussion as to whether MAC address spoofing is good or bad.
Couldn't agree more! Can't wait to hear why the OP lied from the beginning.
-
Mar 25th, 2014, 11:39 AM
#29
Addicted Member
Re: Mac Address Changer *not working, need help*
Originally Posted by Scifen
Well I did not see anything about mac changing is a rule here. It isn't illigeal where I live. I just want a little program instead of VPNs since they are slow and laggy. I like to have fake IP when im in the net since if people get my real IP i can get ddos or even traced so that is why. if someone is going to help please inbox me or comment
the vpn I use isn't that slow, 6MB downstream and around 5MB up. It's $30 something a year, works like a charm and is not slow.
-
Mar 25th, 2014, 10:34 PM
#30
Re: Mac Address Changer *not working, need help*
Originally Posted by Scifen
NOW CAN SOMEONE ACTUALLY GIVE ME HELP INSTEAD OF ARGUING.
I help you out by stopping the arguing: Thread Closed! MAC spoofing is mainly used for malicious purposes and we do have rules about that.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|