代码修改mac地址(需要root)

import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.util.ArrayList;
import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.os.Bundle;
import android.os.Handler;
import android.telephony.TelephonyManager;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;

/**
 * 获取root权限,读取并修改系统文件
 *
 */
public class RootTestActivity extends Activity {
    private final static int CHANGE_OK = 1;
    private final static int WIFI_OK = 2;

    private ListView contentList;
    private FileAdapter adapter;
    private ArrayList<String> datas = new ArrayList<String>();
    private TextView resultTxt;
    private WifiManager wifi;
    private WifiReceiver wifiReceiver = null;

    private Button send;
    private Button change;

    /**
     * 是否是第一次执行
     */
    private boolean isFirst = true;

    private Handler handler = new Handler(){
        public void handleMessage(android.os.Message msg) {
            switch (msg.what) {
            case CHANGE_OK:
                // 改完后重启wifi
                changeWifiState();
                break;
            case WIFI_OK:
                // 重启wifi结束
                resultTxt.setText("修改完成,mac为: " + getLocalMacAddress());
                changeBtnState();
                break;

            default:
                break;
            }
        };
    };

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_su);

        wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);
        wifiReceiver = new WifiReceiver();
        IntentFilter filter=new IntentFilter();
        filter.addAction(WifiManager.WIFI_STATE_CHANGED_ACTION);
        registerReceiver(wifiReceiver, filter);

        send = (Button) findViewById(R.id.send);
        change = (Button) findViewById(R.id.change);
        resultTxt = (TextView) findViewById(R.id.content_edit);
        contentList = (ListView) findViewById(R.id.content);
        searchFile("");
        adapter = new FileAdapter(this, datas);
        contentList.setAdapter(adapter);
        contentList.setOnItemClickListener(new OnItemClickListener() {

            @Override
            public void onItemClick(AdapterView<?> parent, View view,
                    int position, long id) {
                String filePath = datas.get(position);
                runRootCommand("chmod  755 " + filePath);
                searchFileByPath(filePath);
                adapter.notifyDataSetChanged();
                contentList.setSelection(0);
            }
        });

        resultTxt.setText(getIMEI());
    }

    public String searchFile(String keyword) {
        datas.clear();
        String result = "";
        File parentFile = new File("/");
        File[] files = parentFile.listFiles();
        for (File file : files) {
            if (file.getName().indexOf(keyword) >= 0) {
                result += file.getPath() + "\n";
                datas.add(file.getPath());
            }
        }
        if (result.equals("")) {
            result = "找不到文件!!";
        }
        return result;
    }

    public String searchFileByPath(String path) {
        String result = "";
        File parentFile = new File(path + "/");

        if (parentFile.isFile()) {
            runRootCommand("chmod  777 " + path + "/");

            try {
                // 重写文件
//                reWriteFile(path + "/");
                writeSDFile(path, parentFile);

//                result = readSDFile(parentFile);
//                runRootCommand("chmod  660 " + path + "/");
                isFirst = false;
                changeBtnState();
                handler.sendEmptyMessageDelayed(CHANGE_OK, 500);
                resultTxt.setText("请稍等...");
            } catch (IOException e) {
                e.printStackTrace();
                resultTxt.setText("修改失败");
            }

            return result;
        }

        File[] files = parentFile.listFiles();
        if (files != null && files.length > 0) {
            datas.clear();
            for (File file : files) {
                datas.add(file.getPath());
            }
        } else {
            Toast.makeText(RootTestActivity.this, "找不到文件!!",
                    Toast.LENGTH_SHORT).show();
        }
        return result;
    }

    public static boolean runRootCommand(String command) {
        Process process = null;
        DataOutputStream os = null;
        try {
            process = Runtime.getRuntime().exec("su");
            os = new DataOutputStream(process.getOutputStream());
            os.writeBytes(command + "\n");
            os.writeBytes("exit\n");
            os.flush();
            process.waitFor();
        } catch (Exception e) {
            Log.d("*** DEBUG ***", "Unexpected error - Here is what I know: "
                    + e.getMessage());
            return false;
        } finally {
            try {
                if (os != null) {
                    os.close();
                }
                process.destroy();
            } catch (Exception e) {
                // nothing
            }
        }
        return true;
    }

    public void onClick(View view) {
        switch (view.getId()) {
        case R.id.send:
            String filePath = datas.get(0);
            int index = filePath.lastIndexOf("/");
            if (index > 1) {
                filePath = filePath.substring(0, index);
                index = filePath.lastIndexOf("/");
                // if (index > 1) {
                filePath = filePath.substring(0, index);
                runRootCommand("chmod  755 " + filePath);
                searchFileByPath(filePath);
                adapter.notifyDataSetChanged();
                // } else {
                // Toast.makeText(RootTestActivity.this, "已经是最上层",
                // Toast.LENGTH_SHORT).show();
                // }
            } else {
                Toast.makeText(RootTestActivity.this, "已经是最上层",
                        Toast.LENGTH_SHORT).show();
            }
            break;
        case R.id.change:
            // 一键修改mac
            changeMac();
            break;

        default:
            break;
        }
    }

    // 读文件
    public String readSDFile(File file) throws IOException {
        String res = "";
//        File file = new File(fileName);

        FileInputStream fis = new FileInputStream(file);

        int length = fis.available();

        byte[] buffer = new byte[length];
        fis.read(buffer);

//        res = EncodingUtils.getString(buffer, "UTF-8");
        res = bytesToHexString(buffer);

        fis.close();
        return res;
    }

    public static String bytesToHexString(byte[] bytes) {
        String result = "";
        for (int i = 0; i < bytes.length; i++) {
            if (i > 3 && i < 10) {
                String hexString = Integer.toHexString(bytes[i] & 0xFF);
                if (hexString.length() == 1) {
                    hexString = ‘0‘ + hexString;
                }
                result += hexString.toUpperCase();
            }

        }
        return result;
    }

    // 写文件
    public void writeSDFile(String fileName, String write_str)
            throws IOException {

        File file = new File(fileName);

        FileOutputStream fos = new FileOutputStream(file);

        byte[] bytes = write_str.getBytes();

        fos.write(bytes);

        fos.close();
    }

    // 写文件
    public void writeSDFile(String fileName,  File fileParent) throws IOException {
        // 先读取文件
        FileInputStream fis = new FileInputStream(fileParent);

        int length = fis.available();

        byte[] bytes = new byte[length];
        fis.read(bytes);
        fis.close();
        // 修改其中的内容
        for (int i = 0; i < bytes.length; i++) {
            if (i > 3 && i < 10) {
                bytes[i] = (byte) (Math.random() * 128);
            }

        }
        // 删除源文件
        runRootCommand("chmod  777 " + fileName + "/");
        fileParent.delete();
        // 写入文件
        File file = new File(fileName);

        FileOutputStream fos = new FileOutputStream(file);

        fos.write(bytes);

        fos.close();
    }

    /**
     * 修改固定位置文件内容
     * @throws IOException
     */
    public void reWriteFile(String file) throws IOException {
        // 以读写方式打开文件
        RandomAccessFile raf = new RandomAccessFile(file, "rw");
        byte[] buff = new byte[1024 * 1024];

        // 整个数组的偏移,也可以理解为字符数
        int pos = 0;
        // 行数,以‘\n‘为行标记
        int lineNum = 1;
        // 第五行的开始字节数
        int startPos = 3;
        // 第五行的结束字节数
        int endPos = 10;

//        int read = -1;
//        do {
//            read = raf.read(buff);
//            for (int i = 0; i < read; i++) {
//                pos++;
//                // 行尾
//                if (buff[i] == ‘\n‘) {
//                    lineNum++;
//                    if (lineNum == 5) {
//                        startPos = pos;
//                    }
//                    if (lineNum == 6) {
//                        endPos = pos - 2;
//                        break;
//                    }
//                }
//            }
//        } while (lineNum < 6 && read != -1);

        if (endPos > startPos) {
            // 指针偏移到第五行的第一个字节
            raf.seek(startPos);
            for (int i = 0, len = endPos - startPos; i < len; i++) {
                // 替换第五行的所有字节
                raf.write(‘X‘);
            }
        }
        raf.close();
    }

    /**
     * 获取mac地址
     * @return
     */
    public String getLocalMacAddress() {
        WifiInfo info = wifi.getConnectionInfo();
        return info.getMacAddress();
    } 

    /**
     * @return        获取串号
     */
    public String getIMEI() {
        TelephonyManager tm = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
//        String DEVICE_ID = android.os.SystemProperties.get("gsm.imei");//tm.getDeviceId();
        String DEVICE_ID = tm.getDeviceId();
        String te1  = tm.getLine1Number();
        return DEVICE_ID + "\n" + te1;
    }

    /**
     * 改变wifi状态
     */
    public void changeWifiState() {
        if (wifi.isWifiEnabled()) {
            wifi.setWifiEnabled(false);
            } else {
                wifi.setWifiEnabled(true);
            }
    }

    class WifiReceiver extends BroadcastReceiver{

        @Override
        public void onReceive(Context context, Intent intent) {
            if(intent.getAction().equals(WifiManager.WIFI_STATE_CHANGED_ACTION)){//wifi打开与否
                int wifistate = intent.getIntExtra(WifiManager.EXTRA_WIFI_STATE, WifiManager.WIFI_STATE_DISABLED);

                if(wifistate == WifiManager.WIFI_STATE_DISABLED){
                    // 如果关闭则打开
                    Toast.makeText(RootTestActivity.this, "系统关闭wifi",
                            Toast.LENGTH_SHORT).show();
                    changeWifiState();
                }
                else if(wifistate == WifiManager.WIFI_STATE_ENABLED && !isFirst){
                    isFirst = false;
                    Toast.makeText(RootTestActivity.this, "系统开启wifi",
                            Toast.LENGTH_SHORT).show();
                    handler.sendEmptyMessage(WIFI_OK);
                }
            }
        }

    }

    /**
     * 一键修改mac
     */
    public void changeMac() {
        searchFileByPath("/data");
        searchFileByPath("/data/nvram");
        searchFileByPath("/data/nvram/APCFG");
        searchFileByPath("/data/nvram/APCFG/APRDEB");
        searchFileByPath("/data/nvram/APCFG/APRDEB/WIFI");
    }

    /**
     * 改变按钮状态
     */
    private void changeBtnState() {
        boolean state = send.isEnabled();
        send.setEnabled(!state);
        change.setEnabled(!state);
    }

    @Override
    protected void onDestroy() {
        if (null != wifiReceiver) {
            unregisterReceiver(wifiReceiver);
        }
        super.onDestroy();
    }
}

手机为联想手机,其他手机的WiFi文件位置可能不一样。修改完成后需要断开重连WiFi才能生效

import java.io.DataOutputStream;import java.io.File;import java.io.FileInputStream;import java.io.FileOutputStream;import java.io.IOException;import java.io.RandomAccessFile;import java.util.ArrayList;
import org.feng.sockettest.R;
import android.app.Activity;import android.content.BroadcastReceiver;import android.content.Context;import android.content.Intent;import android.content.IntentFilter;import android.net.wifi.WifiInfo;import android.net.wifi.WifiManager;import android.os.Bundle;import android.os.Handler;import android.telephony.TelephonyManager;import android.util.Log;import android.view.View;import android.view.Window;import android.widget.AdapterView;import android.widget.AdapterView.OnItemClickListener;import android.widget.Button;import android.widget.ListView;import android.widget.TextView;import android.widget.Toast;
/** * 获取root权限,读取并修改系统文件 * @author ChenLong * */public class RootTestActivity extends Activity {private final static int CHANGE_OK = 1;private final static int WIFI_OK = 2;private ListView contentList;private FileAdapter adapter;private ArrayList<String> datas = new ArrayList<String>();private TextView resultTxt;private WifiManager wifi;private WifiReceiver wifiReceiver = null;private Button send;private Button change;/** * 是否是第一次执行 */private boolean isFirst = true;private Handler handler = new Handler(){public void handleMessage(android.os.Message msg) {switch (msg.what) {case CHANGE_OK:// 改完后重启wifichangeWifiState();break;case WIFI_OK:// 重启wifi结束resultTxt.setText("修改完成,mac为: " + getLocalMacAddress());changeBtnState();break;
default:break;}};};
@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);requestWindowFeature(Window.FEATURE_NO_TITLE);setContentView(R.layout.activity_su);wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE); wifiReceiver = new WifiReceiver();IntentFilter filter=new IntentFilter();          filter.addAction(WifiManager.WIFI_STATE_CHANGED_ACTION);  registerReceiver(wifiReceiver, filter);send = (Button) findViewById(R.id.send);change = (Button) findViewById(R.id.change);resultTxt = (TextView) findViewById(R.id.content_edit);contentList = (ListView) findViewById(R.id.content);searchFile("");adapter = new FileAdapter(this, datas);contentList.setAdapter(adapter);contentList.setOnItemClickListener(new OnItemClickListener() {
@Overridepublic void onItemClick(AdapterView<?> parent, View view,int position, long id) {String filePath = datas.get(position);runRootCommand("chmod  755 " + filePath);searchFileByPath(filePath);adapter.notifyDataSetChanged();contentList.setSelection(0);}});resultTxt.setText(getIMEI());}
public String searchFile(String keyword) {datas.clear();String result = "";File parentFile = new File("/");File[] files = parentFile.listFiles();for (File file : files) {if (file.getName().indexOf(keyword) >= 0) {result += file.getPath() + "\n";datas.add(file.getPath());}}if (result.equals("")) {result = "找不到文件!!";}return result;}
public String searchFileByPath(String path) {String result = "";File parentFile = new File(path + "/");
if (parentFile.isFile()) {runRootCommand("chmod  777 " + path + "/");try {// 重写文件//reWriteFile(path + "/");writeSDFile(path, parentFile);//result = readSDFile(parentFile);//runRootCommand("chmod  660 " + path + "/");isFirst = false;changeBtnState();handler.sendEmptyMessageDelayed(CHANGE_OK, 500);resultTxt.setText("请稍等...");} catch (IOException e) {e.printStackTrace();resultTxt.setText("修改失败");}return result;}
File[] files = parentFile.listFiles();if (files != null && files.length > 0) {datas.clear();for (File file : files) {datas.add(file.getPath());}} else {Toast.makeText(RootTestActivity.this, "找不到文件!!",Toast.LENGTH_SHORT).show();}return result;}
public static boolean runRootCommand(String command) {Process process = null;DataOutputStream os = null;try {process = Runtime.getRuntime().exec("su");os = new DataOutputStream(process.getOutputStream());os.writeBytes(command + "\n");os.writeBytes("exit\n");os.flush();process.waitFor();} catch (Exception e) {Log.d("*** DEBUG ***", "Unexpected error - Here is what I know: "+ e.getMessage());return false;} finally {try {if (os != null) {os.close();}process.destroy();} catch (Exception e) {// nothing}}return true;}
public void onClick(View view) {switch (view.getId()) {case R.id.send:String filePath = datas.get(0);int index = filePath.lastIndexOf("/");if (index > 1) {filePath = filePath.substring(0, index);index = filePath.lastIndexOf("/");// if (index > 1) {filePath = filePath.substring(0, index);runRootCommand("chmod  755 " + filePath);searchFileByPath(filePath);adapter.notifyDataSetChanged();// } else {// Toast.makeText(RootTestActivity.this, "已经是最上层",// Toast.LENGTH_SHORT).show();// }} else {Toast.makeText(RootTestActivity.this, "已经是最上层",Toast.LENGTH_SHORT).show();}break;case R.id.change:// 一键修改macchangeMac();break;
default:break;}}
// 读文件public String readSDFile(File file) throws IOException {String res = "";//File file = new File(fileName);
FileInputStream fis = new FileInputStream(file);
int length = fis.available();
byte[] buffer = new byte[length];fis.read(buffer);
//res = EncodingUtils.getString(buffer, "UTF-8");res = bytesToHexString(buffer);
fis.close();return res;}public static String bytesToHexString(byte[] bytes) {        String result = "";        for (int i = 0; i < bytes.length; i++) {        if (i > 3 && i < 10) {        String hexString = Integer.toHexString(bytes[i] & 0xFF);                if (hexString.length() == 1) {                    hexString = ‘0‘ + hexString;                }                result += hexString.toUpperCase();}                    }        return result;    }
// 写文件public void writeSDFile(String fileName, String write_str)throws IOException {
File file = new File(fileName);
FileOutputStream fos = new FileOutputStream(file);
byte[] bytes = write_str.getBytes();
fos.write(bytes);
fos.close();}// 写文件public void writeSDFile(String fileName,  File fileParent) throws IOException {// 先读取文件FileInputStream fis = new FileInputStream(fileParent);
int length = fis.available();
byte[] bytes = new byte[length];fis.read(bytes);fis.close();// 修改其中的内容for (int i = 0; i < bytes.length; i++) {        if (i > 3 && i < 10) {        bytes[i] = (byte) (Math.random() * 128);}                    }// 删除源文件runRootCommand("chmod  777 " + fileName + "/");fileParent.delete();// 写入文件File file = new File(fileName);
FileOutputStream fos = new FileOutputStream(file);
fos.write(bytes);
fos.close();}/** * 修改固定位置文件内容 * @throws IOException */public void reWriteFile(String file) throws IOException {// 以读写方式打开文件RandomAccessFile raf = new RandomAccessFile(file, "rw");byte[] buff = new byte[1024 * 1024];
// 整个数组的偏移,也可以理解为字符数int pos = 0;// 行数,以‘\n‘为行标记int lineNum = 1;// 第五行的开始字节数int startPos = 3;// 第五行的结束字节数int endPos = 10;//int read = -1;//do {//read = raf.read(buff);//for (int i = 0; i < read; i++) {//pos++;//// 行尾//if (buff[i] == ‘\n‘) {//lineNum++;//if (lineNum == 5) {//startPos = pos;//}//if (lineNum == 6) {//endPos = pos - 2;//break;//}//}//}//} while (lineNum < 6 && read != -1);
if (endPos > startPos) {// 指针偏移到第五行的第一个字节raf.seek(startPos);for (int i = 0, len = endPos - startPos; i < len; i++) {// 替换第五行的所有字节raf.write(‘X‘);}}raf.close();}/** * 获取mac地址 * @return */public String getLocalMacAddress() {         WifiInfo info = wifi.getConnectionInfo();         return info.getMacAddress();     } /** * @return获取串号 */public String getIMEI() {TelephonyManager tm = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE); //String DEVICE_ID = android.os.SystemProperties.get("gsm.imei");//tm.getDeviceId(); String DEVICE_ID = tm.getDeviceId(); String te1  = tm.getLine1Number();return DEVICE_ID + "\n" + te1;}/** * 改变wifi状态 */public void changeWifiState() {if (wifi.isWifiEnabled()) {  wifi.setWifiEnabled(false);  } else {  wifi.setWifiEnabled(true);  }}
class WifiReceiver extends BroadcastReceiver{
@Overridepublic void onReceive(Context context, Intent intent) {if(intent.getAction().equals(WifiManager.WIFI_STATE_CHANGED_ACTION)){//wifi打开与否int wifistate = intent.getIntExtra(WifiManager.EXTRA_WIFI_STATE, WifiManager.WIFI_STATE_DISABLED);if(wifistate == WifiManager.WIFI_STATE_DISABLED){// 如果关闭则打开Toast.makeText(RootTestActivity.this, "系统关闭wifi",Toast.LENGTH_SHORT).show();changeWifiState();}else if(wifistate == WifiManager.WIFI_STATE_ENABLED && !isFirst){isFirst = false;Toast.makeText(RootTestActivity.this, "系统开启wifi",Toast.LENGTH_SHORT).show();handler.sendEmptyMessage(WIFI_OK);}}}}/** * 一键修改mac */public void changeMac() {searchFileByPath("/data");searchFileByPath("/data/nvram");searchFileByPath("/data/nvram/APCFG");searchFileByPath("/data/nvram/APCFG/APRDEB");searchFileByPath("/data/nvram/APCFG/APRDEB/WIFI");}/** * 改变按钮状态 */private void changeBtnState() {boolean state = send.isEnabled();send.setEnabled(!state);change.setEnabled(!state);}@Overrideprotected void onDestroy() {if (null != wifiReceiver) {unregisterReceiver(wifiReceiver);}super.onDestroy();}}

时间: 2024-10-13 22:27:49

代码修改mac地址(需要root)的相关文章

macOS 自动修改mac地址脚本

介于 某公众号提供了通过修改mac地址来链接BUPT_mobile 的推送,上网上查了一下咋写脚本,实现一键修改mac地址的功能 网上有自动修改mac地址的程序,但是很坑爹的要收费,所以不如自力更生写一个靠谱的脚本 新建记事本文件(用xcode或者textedit都可以) 代码如下: /////// #!/usr/bin/expect -fset timeout 10set password "111111" //这里是你的密码spawn sudo ifconfig en0 lladd

Linux下永久修改MAC地址和ifconfig命令总结

1. 固定一个MAC地址,特别是在使用多个虚拟机的时候 linux环境下: 用root身份登录,在/etc/rc.d/rc.local里加上这三句 ifconfig eth0 down ifconfig eth0 hw ether 00:0C:18:EF:FF:ED ifconfig eth0 up 这样重新reboot后就不怕MAC复原了. 2. ifconfig命令(转载http://www.cnblogs.com/taobataoma/archive/2007/12/27/1016689.

用派克斯出现651 查看&修改mac地址的方法

1.winxp查看mac地址的方法 2.winxp修改mac地址的方法 电脑MAC地址是网卡适配器在出厂时就已经被固定了的,也叫物理地址,每块网卡适配器有全球唯一的MAC地址,一般情况是不需要修改MAC地址的,但有些特殊情况需要更改MAC地址来实现一些特殊的要求,修改之前大家先知道如何查看 第一种方法 1.在开始菜单栏选择"运行" 2.在运行中输入"cmd" 3.我们会看到有一个黑色窗口弹出,在里边输入"ipconfig /all"然后按回车键

linux下修改MAC地址的问题解决

在linux中,修改MAC地址 # ifdown eth0 # ifconfig eth0 hw ether 12:34:56:78:90:12 (修改的MAC地址跟原来的地址不同) # ifup eth0 (修改成功) 后,用# ifconfig 查看,MAC地址改变了,但之后输入#service network restart 或ifdown eth0命令时,会出现如下错语信息: Device eth0 has MAC address 12:34:56:78:90:12, instead o

手动修改MAC地址可以突破IP-MAC绑定吗?

这个世界有矛就有盾,既然有IP-MAC绑定的技术,总归就有人会尝试去突破这个绑定.一般来说,无非是通过"修改IP地址"和"修改MAC地址"两种方式. 1. IP地址的修改很简单,在"本地连接"里面,修改TCP/IP的属性就可以,如图: 2. 大多数人不知道,其实电脑还可以修改"MAC地址".如下图: 3. 所以,要防止客户机通过修改IP地址和mac地址来突破IP-MAC绑定策略,不但要对绑定列表外的IP地址禁止其上网,而且要屏

vmware克隆centos修改mac地址

故障背景: 克隆完虚拟机后,连不上网,ifconfig查看后,发现网卡eth0没有启动,于是ifconfig eth0 up 启动eth0网卡,结果启动不了,进入/etc/sysconfig/network-scripts/ifcfg-eth0查看后,发现MAC地址和IP地址与原机相同,于是修改IP后service network restart 重启网络服务,发现提示提示 Bringing up interface eth0: Device eth0 does not seem to be p

unbntu修改mac地址

分享下Ubuntu下更改MAC地址的简单方法: 首先把网卡设备给 down 掉,否则会报告系统忙,无法更改. sudo ifconfig eth0 down 然后修改 MAC 地址,这一步较 Windows 中那图形化的修改要简单得多. sudo ifconfig eth0 hw ether 00:AA:BB:CC:DD:EE (你的MAC地址,随便啦,XXOO的,反正是0-9.A-F就行) 改好了在把网卡设备给 up 起来,然后为了保险起见可以再重启一下网络服务,赶紧继续看 F1 . sudo

Windows修改MAC地址

谈起mac地址我想大多数人都比较清楚,一旦我们设置了它就能在局域网防止别人盗用你的ip,不过如果mac地址被别人知道了就得修改一下,很多用户不知道Win7怎么改mac地址?其实这个问题很简单,不知道的朋友可以看看小编整理的Win7改mac地址方法. 方法/步骤: 1.打开开始菜单,选择控制面板. 2.打开控制面板项,选择网络和共享中心. 3.选择更改适配器设置. 4.选择本地要修改mac地址的网卡. 5.右键该网卡,选择属性. 6.从弹出的属性设置框中选择配置. 7.进行配置设置框,选择高级选项

dSploitzANTI渗透教程之修改MAC地址与Wifi监听器

dSploitzANTI渗透教程之修改MAC地址与Wifi监听器 dSploitzANTI基本配置 渗透测试是一种安全性较大的工作.所以,在实施渗透测试之前进行一些简单设置.如修改MAC地址.了解网络等.通过进行简单的配置,不仅可以保护自己的身份被暴漏,而且还可以提高渗透效率.因此,本章将介绍一些基本配置. 修改MAC地址 由于zANTI是一款渗透测试工具,所以在扫描时可能会被一些安全软件拦截,如360.因此,为了不暴漏自己的真实身份,用户可以在渗透之前修改自己的MAC地址.下面将介绍修改MAC