Skip to content

Commit

Permalink
修复由于某些Mysql配置问题导致的无法正常使用塞拉斯的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
0Chencc committed May 27, 2022
1 parent 948e32f commit 48b6e0e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/utils/DbUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.google.common.net.InternetDomainName;

import java.util.HashSet;
import java.util.Locale;
import java.util.concurrent.BlockingQueue;

import static java.lang.Thread.sleep;
Expand Down Expand Up @@ -105,22 +106,22 @@ private void initMysql(String db){
HashMap<String, String> tables = new HashMap<String, String>(6){
{
//项目表
put("Project","CREATE TABLE `Project` (\n" +
put("PROJECT","CREATE TABLE `Project` (\n" +
" `id` int(11) NOT NULL AUTO_INCREMENT,\n" +
" `projectName` varchar(64) NOT NULL,\n" +
" PRIMARY KEY (`id`),\n" +
" UNIQUE KEY `Project_projectName_uindex` (`projectName`)\n" +
");");
//根域名表
put("RootDomain","CREATE TABLE `RootDomain` (\n" +
put("ROOTDOMAIN","CREATE TABLE `RootDomain` (\n" +
" `id` int(11) NOT NULL AUTO_INCREMENT,\n" +
" `rootDomainName` varchar(64) NOT NULL,\n" +
" `projectName` varchar(64) NOT NULL,\n" +
" PRIMARY KEY (`id`),\n" +
" UNIQUE KEY `RootDomain_domainName_uindex` (`rootDomainName`)\n" +
");");
//子域名表
put("SubDomain","CREATE TABLE `SubDomain` (\n" +
put("SUBDOMAIN","CREATE TABLE `SubDomain` (\n" +
" `id` int(11) NOT NULL AUTO_INCREMENT,\n" +
" `subDomainName` varchar(128) NOT NULL,\n" +
" `rootDomainName` varchar(64) DEFAULT NULL,\n" +
Expand All @@ -131,7 +132,7 @@ private void initMysql(String db){
" UNIQUE KEY `SubDomain_subDomainName_uindex` (`subDomainName`)\n" +
");");
//url表
put("Url","CREATE TABLE `Url` (\n" +
put("URL","CREATE TABLE `Url` (\n" +
" `id` int(11) NOT NULL AUTO_INCREMENT,\n" +
" `url` varchar(256) NOT NULL,\n" +
" `projectName` varchar(64) NOT NULL,\n" +
Expand All @@ -140,7 +141,7 @@ private void initMysql(String db){
" UNIQUE KEY `Url_url_uindex` (`url`)\n" +
");");
//相似域名表
put("SimilarSubDomain","CREATE TABLE `SimilarSubDomain`(\n" +
put("SIMILARSUBDOMAIN","CREATE TABLE `SimilarSubDomain`(\n" +
" `id` int(11) NOT NULL AUTO_INCREMENT,\n" +
" `subDomainName` varchar(128) NOT NULL,\n" +
" `rootDomainName` varchar(64) DEFAULT NULL,\n" +
Expand All @@ -151,7 +152,7 @@ private void initMysql(String db){
" UNIQUE KEY `SimilarSubDomain_similarDomainName_uindex` (`subDomainName`)\n" +
");");
//相似域名子域名表
put("SimilarUrl","CREATE TABLE `SimilarUrl`(\n" +
put("SIMILARURL","CREATE TABLE `SimilarUrl`(\n" +
" `id` int(11) NOT NULL AUTO_INCREMENT,\n" +
" `url` varchar(64) NOT NULL,\n" +
" `projectName` varchar(64) NOT NULL,\n" +
Expand All @@ -173,7 +174,7 @@ private void initMysql(String db){
this.bscanReady = true;
BurpExtender.getStdout().println("Bscan ready");
}
tables.remove(table);
tables.remove(table.toUpperCase());
}
for (String sql:tables.values()){
conn.createStatement().executeLargeUpdate(sql);
Expand Down

0 comments on commit 48b6e0e

Please sign in to comment.