Windows MAC spoofer 3.0 (GUI) 07-10-2013, 09:13 PM
#1
Windows MAC spoofer 3.0 (X fork)
This is the GUI version of my HC official Batch MAC spoofer. This is the X fork coded in Lua. As this is pretty shoddy in my opinion, I'll probably take on the CLI version instead for the next versions.
I'm not releasing this as HC official as it's too much of a skiddie version of the last version, but releasing it here as it is surely more noob-friendly.
Screenshot
I have limited bandwidth this month, so I uploaded one image only. The window on top is the script run with lua.exe, in the two beneath it is run with wlua.exe. Showing the ping, spoof and unspoof windows.
This is the GUI version of my HC official Batch MAC spoofer. This is the X fork coded in Lua. As this is pretty shoddy in my opinion, I'll probably take on the CLI version instead for the next versions.
I'm not releasing this as HC official as it's too much of a skiddie version of the last version, but releasing it here as it is surely more noob-friendly.
Code:
----------------------------------------------------------------
-- MAC spoofer v3.0 --
-- Windows MAC spoofer X (GUI) fork --
-- Coded by noize --
----------------------------------------------------------------
require("iuplua")
check = 0
if not iupx then iupx = {} end
function iupx.menu(templ)
local items = {}
for i = 1,#templ,2 do
local label = templ[i]
local data = templ[i+1]
if type(data) == 'function' then
item = iup.item{title = label}
item.action = data
elseif type(data) == 'nil' then
item = iup.separator{}
else
item = iup.submenu {iupx.menu(data); title = label}
end
table.insert(items,item)
end
return iup.menu(items)
end
function iupx.show_dialog (tbl)
local dlg = iup.dialog(tbl)
dlg:show()
iup.MainLoop()
end
function iupx.GetString (title,prompt,default)
return iup.GetParam(title, nil,prompt.." %s\n",default or "")
end
function iupx.pplot (tbl)
require("iupxpplot")
return iupxpplot.pplot(tbl)
end
require("iupluacontrols")
function quit()
os.exit()
end
function readf(file)
local f = io.open(file, "r")
if not f then return nil end
return f:read("*a")
end
function writef(file, text)
local f = io.open(file, "w")
f:write(text)
f:close()
end
function toVar(cmd)
local handle = io.popen(cmd)
var = handle:read("*a")
handle:close()
end
toVar("ipconfig -all")
mac = var
toVar("arp -a")
arp = var
function null()
end
nicLabel = iup.label {
expand="NO",
title=" NIC: ",
size="82x10",
}
nic = iup.text {
expand="HORIZONTAL",
tip="NIC to spoof",
}
conLabel = iup.label {
expand="NO",
title=" Connection name: ",
size="82x10",
}
con = iup.text {
expand="HORIZONTAL",
tip="Connection name",
}
nic2Label = iup.label {
expand="NO",
title=" NIC: ",
size="82x10",
}
nic2 = iup.text {
expand="HORIZONTAL",
tip="NIC to restore",
}
con2Label = iup.label {
expand="NO",
title=" Connection name: ",
size="82x10",
}
con2 = iup.text {
expand="HORIZONTAL",
tip="Connection name",
}
macLabel = iup.label {
expand="NO",
title=" MAC address: ",
size="82x10",
}
newmac = iup.text {
expand="HORIZONTAL",
tip="MAC address to assume",
value="00:11:22:33:44:55",
}
solveLabel = iup.label {
expand="NO",
title=" IP address to get respective MAC of: ",
}
solve = iup.text {
expand="HORIZONTAL",
value="192.168.0.1",
}
resolve = iup.button {
title="Resolve",
expand="HORIZONTAL",
}
pingLabel = iup.label {
expand="NO",
title=" Host name or IP address: ",
}
pingBox = iup.text {
expand="HORIZONTAL",
value="",
}
ping = iup.button {
title="Ping",
expand="HORIZONTAL",
}
spoof = iup.button {
title="Spoof",
expand="HORIZONTAL",
}
unspoof = iup.button {
title="Unspoof",
expand="HORIZONTAL",
}
bar = "----------------------------------------------------------------------------------------------"
about1 = "MAC spoofer v3.0"
about2 = "Coded by Noize"
about3 = "Language: Lua 5.1\n"
about4 = "You are allowed to edit, re-use and give away the source code as long as you give credits."
tab1 = iup.multiline {
expand="YES",
value=mac,
tabtitle="Current host",
readonly="YES",
}
tab2 = iup.multiline {
expand="YES",
value=arp,
tabtitle="LAN",
readonly="YES",
}
tab3 = iup.vbox {
iup.hbox {
solveLabel,
solve
},
iup.hbox {resolve},
tabtitle="Resolve",
}
tab4 = iup.vbox {
iup.hbox {
pingLabel,
pingBox
},
iup.hbox {ping},
tabtitle="Ping",
}
tab5 = iup.vbox {
iup.hbox {
nicLabel,
nic
},
iup.hbox {
conLabel,
con
},
iup.hbox {
macLabel,
newmac
},
iup.hbox {spoof},
tabtitle="Spoof",
}
tab6 = iup.vbox {
iup.hbox {
nic2Label,
nic2
},
iup.hbox {
con2Label,
con2
},
iup.hbox {unspoof},
tabtitle="Unspoof",
}
tab7 = iup.vbox {
iup.fill{},
iup.hbox {
iup.fill{},
iup.label {
expand="NO",
title=bar,
},
iup.fill{},
},
iup.hbox {
iup.fill{},
iup.label {
expand="NO",
title=about1,
},
iup.fill{},
},
iup.hbox {
iup.fill{},
iup.label {
expand="NO",
title=about2,
},
iup.fill{},
},
iup.hbox {
iup.fill{},
iup.label {
expand="NO",
title=about3,
},
iup.fill{},
},
iup.hbox {
iup.fill{},
iup.label {
expand="NO",
title=about4,
},
iup.fill{},
},
iup.hbox {
iup.fill{},
iup.label {
expand="NO",
title=bar .. "\n\n",
},
iup.fill{},
},
iup.fill{},
tabtitle = "About",
}
tabs = iup.tabs {tab1,tab2,tab3,tab4,tab5,tab6,tab7,expand="YES",}
function resolve:action()
toVar("arp -a " .. solve.value)
iup.Message("Scanning: " .. solve.value, var)
end
function ping:action()
if pingBox.value ~= "" then
toVar("ping -n 1 " .. pingBox.value .. " | find /i \"ms\"")
if var ~= nil and var ~= "" then
pingMsg = "Ping successful.\nHost is reachable."
else
pingMsg = "Ping failed.\nHost is unreachable."
end
iup.Message("Target: " .. pingBox.value,pingMsg)
else
iup.Message("MAC spoofer","No target specified.")
end
end
function doTheTwist()
f:write("if not defined con < nul set /p var=3 > tempReturnStatusFile.data & exit\n")
f:write("ver | find \"XP\" > nul\n")
f:write("if %ERRORLEVEL%==0 goto skipnetsh1\n")
f:write("netsh interface set interface \"%con%\" admin=DISABLED\n")
f:write("netsh interface set interface \"%con%\" admin=ENABLED\n")
f:write("< nul set /p var=0 > tempReturnStatusFile.data & exit\n")
f:write(":skipnetsh1\n")
f:write("echo Const ssfCONTROLS = 3 > macspooferbynoize.vbs\n")
f:write("echo sConnectionName = \"%con%\" >> macspooferbynoize.vbs\n")
f:write("echo sEnableVerb = \"En^&able\" >> macspooferbynoize.vbs\n")
f:write("echo sDisableVerb = \"Disa^&ble\" >> macspooferbynoize.vbs\n")
f:write("echo set shellApp = createobject(\"shell.application\") >> macspooferbynoize.vbs\n")
f:write("echo set oControlPanel = shellApp.Namespace(ssfCONTROLS) >> macspooferbynoize.vbs\n")
f:write("echo set oNetConnections = nothing >> macspooferbynoize.vbs\n")
f:write("echo for each folderitem in oControlPanel.items >> macspooferbynoize.vbs\n")
f:write("echo if folderitem.name = \"Network Connections\" then >> macspooferbynoize.vbs\n")
f:write("echo set oNetConnections = folderitem.getfolder: exit for >> macspooferbynoize.vbs\n")
f:write("echo end if >> macspooferbynoize.vbs\n")
f:write("echo next >> macspooferbynoize.vbs\n")
f:write("echo if oNetConnections is nothing then >> macspooferbynoize.vbs\n")
f:write("echo msgbox \"Failed to find 'Network Connections'.\" >> macspooferbynoize.vbs\n")
f:write("echo wscript.quit >> macspooferbynoize.vbs\n")
f:write("echo end if >> macspooferbynoize.vbs\n")
f:write("echo set oLanConnection = nothing >> macspooferbynoize.vbs\n")
f:write("echo for each folderitem in oNetConnections.items >> macspooferbynoize.vbs\n")
f:write("echo if lcase(folderitem.name) = lcase(sConnectionName) then >> macspooferbynoize.vbs\n")
f:write("echo set oLanConnection = folderitem: exit for >> macspooferbynoize.vbs\n")
f:write("echo end if >> macspooferbynoize.vbs\n")
f:write("echo next >> macspooferbynoize.vbs\n")
f:write("echo if oLanConnection is nothing then >> macspooferbynoize.vbs\n")
f:write("echo msgbox \"Failed to find '\" ^& sConnectionName ^& \"'.\" >> macspooferbynoize.vbs\n")
f:write("echo wscript.quit >> macspooferbynoize.vbs\n")
f:write("echo end if >> macspooferbynoize.vbs \n")
f:write("echo bEnabled = true >> macspooferbynoize.vbs\n")
f:write("echo set oEnableVerb = nothing >> macspooferbynoize.vbs\n")
f:write("echo set oDisableVerb = nothing >> macspooferbynoize.vbs\n")
f:write("echo for each verb in oLanConnection.verbs >> macspooferbynoize.vbs\n")
f:write("echo if verb.name = sEnableVerb then >> macspooferbynoize.vbs\n")
f:write("echo set oEnableVerb = verb >> macspooferbynoize.vbs\n")
f:write("echo bEnabled = false >> macspooferbynoize.vbs\n")
f:write("echo end if >> macspooferbynoize.vbs\n")
f:write("echo if verb.name = sDisableVerb then >> macspooferbynoize.vbs\n")
f:write("echo set oDisableVerb = verb >> macspooferbynoize.vbs\n")
f:write("echo end if >> macspooferbynoize.vbs\n")
f:write("echo next >> macspooferbynoize.vbs\n")
f:write("echo if bEnabled then >> macspooferbynoize.vbs\n")
f:write("echo oDisableVerb.DoIt() >> macspooferbynoize.vbs\n")
f:write("echo else >> macspooferbynoize.vbs\n")
f:write("echo oEnableVerb.DoIt >> macspooferbynoize.vbs\n")
f:write("echo end if >> macspooferbynoize.vbs\n")
f:write("echo wscript.sleep 500 >> macspooferbynoize.vbs\n")
f:write("call macspooferbynoize.vbs\n")
f:write("if exist macspooferbynoize.vbs del macspooferbynoize.vbs /f /q > nul\n")
f:write("< nul set /p var=0 > tempReturnStatusFile.data & exit\n")
f:close()
os.execute("tempScriptFile.bat")
while true do
if readf("tempReturnStatusFile.data") then break end
end
returnCode = tonumber(readf("tempReturnStatusFile.data"))
os.remove("tempScriptFile.bat")
os.remove("tempReturnStatusFile.data")
end
function spoof:action()
os.remove("tempReturnStatusFile.data")
writef("tempScriptFile.bat","@echo off\n")
f = io.open("tempScriptFile.bat", "a")
f:write("set keyword=" .. nic.value .. "\n")
f:write("if not defined keyword < nul set /p var=4 > tempReturnStatusFile.data & exit\n")
f:write("reg query HKLM\\SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002bE10318}\\ /v DriverDesc /s | find /i \"%keyword%\"\n")
f:write("if not \"%errorlevel%\"==\"0\" < nul set /p var=1 > tempReturnStatusFile.data & exit\n")
f:write("set i=0\n")
f:write(":keyloop\n")
f:write("set /a i=i+1\n")
f:write("if %i% LSS 10 set n=000%i%\n")
f:write("if %i% GTR 9 set n=00%i%\n")
f:write("if %i% GTR 99 set n=0%i%\n")
f:write("if %i% GTR 999 set n=%i%\n")
f:write("reg query HKLM\\SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002bE10318}\\%n% /v DriverDesc /s | find /i \"%keyword%\" 2>nul > nul\n")
f:write("if \"%errorlevel%\"==\"0\" goto quitloop\n")
f:write("goto keyloop\n")
f:write(":quitloop\n")
f:write("reg add \"HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002bE10318}\\%n%\" /v \"NetworkAddress\" /d \"" .. newmac.value .."\" /f 2>nul > nul\n")
f:write("if not \"%errorlevel%\"==\"0\" < nul set /p var=2 > tempReturnStatusFile.data & exit\n")
f:write("set con=" .. con.value .. "\n")
doTheTwist()
if returnCode == 0 then
returnMsg = "MAC address successfully changed"
elseif returnCode == 1 then
returnMsg = "No NIC found searching for the given keyword"
elseif returnCode == 2 then
returnMsg = "Failed to add the registry key\nTry running the program again with admin privileges"
elseif returnCode == 3 then
returnMsg = "MAC address successfully changed\nConnection has not been restarted yet\nYou'll need to manually restart your NIC before you can see any change"
elseif returnCode == 4 then
returnMsg = "You cannot leave the NIC textbox blank"
else
returnMsg = "Unknown error"
end
iup.Message("MAC spoofer",returnMsg)
end
function unspoof:action()
os.remove("tempReturnStatusFile.data")
writef("tempScriptFile.bat","@echo off\n")
f = io.open("tempScriptFile.bat", "a")
f:write("set keyword=" .. nic2.value .. "\n")
f:write("if not defined keyword < nul set /p var=4 > tempReturnStatusFile.data & exit\n")
f:write("reg query HKLM\\SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002bE10318}\\ /v DriverDesc /s | find /i \"%keyword%\"\n")
f:write("if not \"%errorlevel%\"==\"0\" < nul set /p var=1 > tempReturnStatusFile.data & exit\n")
f:write("set i=0\n")
f:write(":keyloop\n")
f:write("set /a i=i+1\n")
f:write("if %i% LSS 10 set n=000%i%\n")
f:write("if %i% GTR 9 set n=00%i%\n")
f:write("if %i% GTR 99 set n=0%i%\n")
f:write("if %i% GTR 999 set n=%i%\n")
f:write("reg query HKLM\\SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002bE10318}\\%n% /v DriverDesc /s | find /i \"%keyword%\" 2>nul > nul\n")
f:write("if \"%errorlevel%\"==\"0\" goto quitloop\n")
f:write("goto keyloop\n")
f:write(":quitloop\n")
f:write("reg delete \"HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002bE10318}\\%n%\" /v \"NetworkAddress\" /f 2>nul > nul\n")
f:write("if not \"%errorlevel%\"==\"0\" < nul set /p var=2 > tempReturnStatusFile.data & exit\n")
f:write("set con=" .. con2.value .. "\n")
doTheTwist()
if returnCode == 0 then
returnMsg = "MAC address successfully restored"
elseif returnCode == 1 then
returnMsg = "No NIC found searching for the given keyword"
elseif returnCode == 2 then
returnMsg = "Failed to delete the registry key\nEither you don't have enough privileges or you haven't spoofed this NIC yet"
elseif returnCode == 3 then
returnMsg = "MAC address successfully restored\nConnection has not been restarted yet\nYou'll need to manually restart your NIC before you can see any change"
elseif returnCode == 4 then
returnMsg = "You cannot leave the NIC textbox blank"
else
returnMsg = "Unknown error"
end
iup.Message("MAC spoofer",returnMsg)
end
dlg = iup.dialog {tabs; title="MAC spoofer v3.0", size="HALFxHALF",}
dlg:show()
iup.MainLoop()Screenshot
I have limited bandwidth this month, so I uploaded one image only. The window on top is the script run with lua.exe, in the two beneath it is run with wlua.exe. Showing the ping, spoof and unspoof windows.
My Bitcoin address: 1AtxVsSSG2Z8JfjNy9KNFDUN6haeKr7LiP
Give me money by visiting www.google.com here: http://coin-ads.com/6Ol83U
If you want a Bitcoin URL shortener/advertiser, please, use this referral: http://coin-ads.com/register.php?refid=noize
Give me money by visiting www.google.com here: http://coin-ads.com/6Ol83U
If you want a Bitcoin URL shortener/advertiser, please, use this referral: http://coin-ads.com/register.php?refid=noize
![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)
![[Image: OilyCostlyEwe.gif]](http://fat.gfycat.com/OilyCostlyEwe.gif)