forked from CaiJiJi/VulScritp
-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.port.scan; | ||
|
||
import java.io.BufferedReader; | ||
import java.io.File; | ||
import java.io.FileInputStream; | ||
import java.io.FileWriter; | ||
import java.io.InputStreamReader; | ||
import java.io.PrintWriter; | ||
|
||
public class IP { | ||
public static void main(String[] args) throws Exception { | ||
String DbPath=System.getProperty("user.dir")+"\\ip.txt"; | ||
String encoding="utf-8"; | ||
File file=new File(DbPath); | ||
if(file.isFile() && file.exists()){ //判断文件是否存在 | ||
InputStreamReader read = new InputStreamReader( | ||
new FileInputStream(file),encoding);//考虑到编码格式 | ||
BufferedReader bufferedReader = new BufferedReader(read); | ||
String lineTxt = null; | ||
while((lineTxt = bufferedReader.readLine()) != null){ | ||
for (int i = 1; i <=255; i++) { | ||
System.out.println(lineTxt+"."+i); | ||
writeurl(lineTxt+"."+i+"\r\n"); | ||
} | ||
} | ||
} | ||
|
||
} | ||
|
||
public static void writeurl(String resulturl) throws Exception{ | ||
String DbPath=System.getProperty("user.dir")+"\\result.txt"; | ||
PrintWriter pw = new PrintWriter( new FileWriter( "result.txt",true ) ); | ||
pw.print(resulturl); | ||
pw.close(); | ||
} | ||
} |