======================================================
Name: CVE-1999-0004
Status: Candidate
URL: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-1999-0004
Phase: Modified (19990621-01)
Category: SF
Reference: CERT:CA-98.10.mime_buffer_overflows
Reference: XF:outlook-long-name
Reference: SUN:00175
Reference: MS:MS98-008
Reference: URL:http://www.microsoft.com/technet/security/bulletin/ms98-008.asp MIME buffer overflow in email clients, e.g. Solaris mailtool
and Outlook.
Current Votes:
ACCEPT(8) Magdych, Northcutt, Wall, Baker, Landfield, Cole, Dik, Collins
MODIFY(1) Frech
NOOP(1) Christey
REVIEWING(1) Shostack Voter Comments:
Frech> Extremely minor, but I believe e-mail is the correct term. (If you reject
this suggestion, I will not be devastated.) :-)
Christey> This issue seems to have been rediscovered in
BUGTRAQ:20000515 Eudora Pro & Outlook Overflow - too long filenames again
http://marc.theaimsgroup.com/?l=bugtraq&m=95842482413076&w=2
Also see
BUGTRAQ:19990320 Eudora Attachment Buffer Overflow
http://marc.theaimsgroup.com/?l=bugtraq&m=92195396912110&w=2
Christey>
CVE-2000-0415 may be a later rediscovery of this problem
for Outlook.
Dik> Sun bug 4163471,
Christey> ADDREF BID:125
Christey> BUGTRAQ:19980730 Long Filenames & Lotus Products
URL:http://marc.theaimsgroup.com/?l=bugtraq&m=90221104526201&w=2
======================================================
Name: CVE-1999-0005
Status: Entry
Reference: CERT:CA-98.09.imapd
Reference: SUN:00177
Reference: URL:http://sunsolve.sun.com/pub-cgi/retrieve.pl?doctype=coll&doc=secbull/177
Reference: BID:130
Reference: URL:http://www.securityfocus.com/bid/130
Reference: XF:imap-authenticate-bo Arbitrary command execution via IMAP buffer overflow in authenticate
command.
Name: CVE-1999-0004
Status: Candidate
URL: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-1999-0004
Phase: Modified (19990621-01)
Category: SF
Reference: CERT:CA-98.10.mime_buffer_overflows
Reference: XF:outlook-long-name
Reference: SUN:00175
Reference: MS:MS98-008
Reference: URL:http://www.microsoft.com/technet/security/bulletin/ms98-008.asp MIME buffer overflow in email clients, e.g. Solaris mailtool
and Outlook.
Current Votes:
ACCEPT(8) Magdych, Northcutt, Wall, Baker, Landfield, Cole, Dik, Collins
MODIFY(1) Frech
NOOP(1) Christey
REVIEWING(1) Shostack Voter Comments:
Frech> Extremely minor, but I believe e-mail is the correct term. (If you reject
this suggestion, I will not be devastated.) :-)
Christey> This issue seems to have been rediscovered in
BUGTRAQ:20000515 Eudora Pro & Outlook Overflow - too long filenames again
http://marc.theaimsgroup.com/?l=bugtraq&m=95842482413076&w=2
Also see
BUGTRAQ:19990320 Eudora Attachment Buffer Overflow
http://marc.theaimsgroup.com/?l=bugtraq&m=92195396912110&w=2
Christey>
CVE-2000-0415 may be a later rediscovery of this problem
for Outlook.
Dik> Sun bug 4163471,
Christey> ADDREF BID:125
Christey> BUGTRAQ:19980730 Long Filenames & Lotus Products
URL:http://marc.theaimsgroup.com/?l=bugtraq&m=90221104526201&w=2
======================================================
Name: CVE-1999-0005
Status: Entry
Reference: CERT:CA-98.09.imapd
Reference: SUN:00177
Reference: URL:http://sunsolve.sun.com/pub-cgi/retrieve.pl?doctype=coll&doc=secbull/177
Reference: BID:130
Reference: URL:http://www.securityfocus.com/bid/130
Reference: XF:imap-authenticate-bo Arbitrary command execution via IMAP buffer overflow in authenticate
command.
连接数据库
insert 就可以了!
你不是想格式化文本吧!
看你的文件格式挺规矩的,一行一行的自己解析啊!
还有,有些记录是有URL,STATUS,PHASE,但有些记录又没有这些字段,怎么导啊?
那个文本文件有18M那么大啊!
1 一那个等号作为分隔符,划分成不同的片断
2 在一个片断里,找到各个元素的标志,比如
Name
Status
URL
Voter Comments: 3 注意他们如果出现,则顺序是固定的OK 我只能提供这么多了!自己加油!如果在说,得付费了! 1000亿英镑吧!给你打95折
楼主发了n个帖子,sql版也是,哈哈。
偶写了一个很烂的,仅供参考了,希望达人能够补充。
http://topic.csdn.net/u/20080316/10/e79186a3-3e2f-4bb8-af81-0cef4ff15234.html
楼主的要求:去掉连等号,每行第一个冒号之前的为字段共7个字段:name,status,url,phase,
category,reference,dis.其中相同的referende为一个字段,没有表明字段的所有内容
(最后一个reference一下的内容)去掉多余的回车,全部都归到dis字段里不知如何导入到mysql数据库中呢?或者大家可以帮我写个操作文本文件的程序也可以实例文件:
======================================================
Name: CVE-1999-0004
Status: Candidate
URL: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-1999-0004
Phase: Modified (19990621-01)
Category: SF
Reference: CERT:CA-98.10.mime_buffer_overflows
Reference: XF:outlook-long-name
Reference: SUN:00175
Reference: MS:MS98-008
Reference: URL:http://www.microsoft.com/technet/security/bulletin/ms98-008.asp MIME buffer overflow in email clients, e.g. Solaris mailtool
and Outlook.
Current Votes:
ACCEPT(8) Magdych, Northcutt, Wall, Baker, Landfield, Cole, Dik, Collins
MODIFY(1) Frech
NOOP(1) Christey
REVIEWING(1) Shostack Voter Comments:
Frech> Extremely minor, but I believe e-mail is the correct term. (If you reject
this suggestion, I will not be devastated.) :-)
Christey> This issue seems to have been rediscovered in
BUGTRAQ:20000515 Eudora Pro & Outlook Overflow - too long filenames again
http://marc.theaimsgroup.com/?l=bugtraq&m=95842482413076&w=2
Also see
BUGTRAQ:19990320 Eudora Attachment Buffer Overflow
http://marc.theaimsgroup.com/?l=bugtraq&m=92195396912110&w=2
Christey>
CVE-2000-0415 may be a later rediscovery of this problem
for Outlook.
Dik> Sun bug 4163471,
Christey> ADDREF BID:125
Christey> BUGTRAQ:19980730 Long Filenames & Lotus Products
URL:http://marc.theaimsgroup.com/?l=bugtraq&m=90221104526201&w=2
======================================================
Name: CVE-1999-0005
Status: Entry
Reference: CERT:CA-98.09.imapd
Reference: SUN:00177
Reference: URL:http://sunsolve.sun.com/pub-cgi/retrieve.pl?doctype=coll&doc=secbull/177
Reference: BID:130
Reference: URL:http://www.securityfocus.com/bid/130
Reference: XF:imap-authenticate-bo Arbitrary command execution via IMAP buffer overflow in authenticate
command.
======================================================
private static ConnectionFactory ref = new ConnectionFactory();
private static final String DRIVER = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
private static final String URL_LOCAL = "jdbc:sqlserver://localhost:1433;DatabaseName=test";
private static final String USER_NAME = "test";
private static final String USER_PWD = "password";
private ConnectionFactory(){
try{
Class.forName(DRIVER);
}catch(ClassNotFoundException cnfe){
cnfe.printStackTrace();
}
}
public static Connection getConnection(int mode){
try{
switch(mode){
case 0:
return DriverManager.getConnection(URL_LOCAL,USER_NAME,USER_PWD);
case 1:
// todo
default:
return null;
}
}catch(SQLException sqle){
sqle.printStackTrace();
return null;
}
}
public static void close(ResultSet rst){
if(rst != null){
try{
rst.close();
}catch(SQLException sqle){
sqle.printStackTrace();
}
}
}
public static void close(Statement stmt){
if(stmt != null){
try{
stmt.close();
}catch(SQLException sqle){
sqle.printStackTrace();
}
}
}
public static void close(Connection conn){
if(conn != null){
try{
conn.close();
}catch(SQLException sqle){
sqle.printStackTrace();
}
}
}
}
import java.io.*;
import java.sql.*;public class TransferItems {// create table info(
// Name varchar(800),
// Status varchar(800),
// URL varchar(800),
// Phase varchar(800),
// Category varchar(800),
// Reference varchar(800),
// dis varchar(3000)
// )
private String name;
private String status;
private String url;
private String phase;
private String category;
private String reference;
private String dis;
/**
* 填充一下
*
* */
private void fill(String name,String status,String url,String phase,
String category,String reference,String dis){
this.name = name;
this.status = status;
this.url = url;
this.phase = phase;
this.category = category;
this.reference = reference;
this.dis = dis;
} /**
* 清理一下
*
* */
private void clean(){
this.name = "";
this.status = "";
this.url = "";
this.phase = "";
this.category = "";
this.reference = "";
this.dis = "";
}
/**
* 从
*
* */
public void doSomething(String filePath){
File f = new File(filePath);
if (!f.isFile()){
System.out.println("文件不存在!");
return;
}
try{
FileReader fr = new FileReader(f);
BufferedReader br = new BufferedReader(fr);
String tmpLine = ""; // 临时存放行内容
boolean isBeginFlag = true; // 标志 开始 ===================
while( ((tmpLine = br.readLine())) != null ){
if(!tmpLine.startsWith("=======================") && !"".equals(tmpLine) ){
String strPrefix = tmpLine.substring(0,tmpLine.indexOf(":")>=0?tmpLine.indexOf(":")+1:1);
// System.out.println(strPrefix);
if (strPrefix.compareToIgnoreCase("Name:") == 0) {
tmpLine = tmpLine.substring(tmpLine.indexOf(strPrefix) + strPrefix.length());
name += tmpLine;
}
else if(strPrefix.compareToIgnoreCase("Status:") == 0) {
tmpLine = tmpLine.substring(tmpLine.indexOf(strPrefix) + strPrefix.length());
status += tmpLine;
}
else if(strPrefix.compareToIgnoreCase("URL:") == 0) {
tmpLine = tmpLine.substring(tmpLine.indexOf(strPrefix) + strPrefix.length());
url += tmpLine;
}
else if(strPrefix.compareToIgnoreCase("Phase:") == 0) {
tmpLine = tmpLine.substring(tmpLine.indexOf(strPrefix) + strPrefix.length());
phase += tmpLine;
}
else if(strPrefix.compareToIgnoreCase("Category:") == 0) {
tmpLine = tmpLine.substring(tmpLine.indexOf(strPrefix) + strPrefix.length());
category += tmpLine;
}
else if(strPrefix.compareToIgnoreCase("Reference:") == 0) {
tmpLine = tmpLine.substring(tmpLine.indexOf(strPrefix) + strPrefix.length());
reference += tmpLine;
}
else{
dis += tmpLine;
}
}
else if(tmpLine.startsWith("=======================")){
// tmpLine = "分隔符";
if(isBeginFlag){ // 如果是第一次的 ===================== 就跳过,以后遇到代表提交
isBeginFlag = false;
clean(); // 清理
continue;
}
fill(name,status,url,phase,category,reference,dis); // 准备
doInsert(); // 插入
clean(); // 清理
}
// 显示文件内容
System.out.println(tmpLine);
}
}catch(FileNotFoundException e){
e.printStackTrace();
}catch(IOException ioe){
ioe.printStackTrace();
}
}
/**
* 插入
*
* */
private void doInsert(){
Connection conn = null;
PreparedStatement pstmt = null;
String strSQL = "INSERT INTO info VALUES(?,?,?,?,?,?,?)";
try {
conn = ConnectionFactory.getConnection(0);
pstmt = conn.prepareStatement(strSQL);
pstmt.setString(1, this.name);
pstmt.setString(2, this.status);
pstmt.setString(3, this.url);
pstmt.setString(4, this.phase);
pstmt.setString(5, this.category);
pstmt.setString(6, this.reference);
pstmt.setString(7, this.dis);
pstmt.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
} finally{
ConnectionFactory.close(pstmt);
ConnectionFactory.close(conn);
}
}
public static void main(String[] args){
new TransferItems().doSomething("C:/a.txt");
}
}