1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Need script that changes MAC address and releases IP

Discussion in 'BlackHat Lounge' started by craigs, Feb 2, 2010.

  1. craigs

    craigs Regular Member

    Joined:
    Apr 29, 2009
    Messages:
    230
    Likes Received:
    547
    Occupation:
    student
    Location:
    The great white north
    As the title states, I'm looking for a script that will automatically change my mac address and release/renew my ip.

    I'm not even sure if this is possible but any help is appreciated

    Thanks!
     
  2. antx16

    antx16 Power Member

    Joined:
    Nov 25, 2007
    Messages:
    672
    Likes Received:
    1,536
    Use this batch file below to release ip address

    @echo off
    if "%1"=="static" goto static
    if "%1"=="dhcp" goto dhcp
    echo Usage: %0 (static^|dhcp)
    goto end2
    :static
    echo Setting static IP of 192.168.xxx.xxx
    netsh int ipv4 set address "Local Area Connection" static 192.168.xxx.xxx 255.255.255.0 192.168.xxx.xxx 1
    echo Setting primary DNS server to 192.168.xxx.xxx
    netsh int ipv4 set dnsservers "Local Area Connection" static 192.168.xxx.xxx primary
    goto end
    :dhcp
    echo Setting Dynamic (DHCP) IP
    netsh int ipv4 set address "Local Area Connection" dhcp
    echo Setting Dynamic (DHCP) DNS
    netsh int ipv4 set dnsservers "Local Area Connection" dhcp
    goto end
    :end
    echo Waiting for IP config to update...
    @choice /c 12 /T 3 /d 1 > NUL
    ipconfig /all
    pause
    :end2
     
    • Thanks Thanks x 1