0%

SQL注入

所谓SQL注入,就是通过把SQL命令插入到Web表单提交或输入域名或页面请求的查询字符串,最终达到欺骗服务器执行恶意的SQL命令。

发现

NEUMathe的登陆表单内输入了‘,没有正常的显示登陆失败,而是弹出以下界面:

### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near at line 2 ### The error may exist in ssm/mapper/StudentMapperCustom.xml ### The error may involve ssm.mapper.StudentMapperCustom.checkStudentExits-Inline ### The error occurred while setting parameters ### SQL: SELECT * FROM Student WHERE Code = and Pwd =

很明显,这是数据库错误的提示信息,注意到这一行,
SELECT * FROM Student WHERE Code = and Pwd =
服务器把单引号传入sql语句中导致这句查询执行错误,于是,找到注入点,输入2016xxxx' or '1'='1,此时,原来正常的语句由select * from student where code = '2016xxxx' and pwd = 'xxxx'
成了select * from student where code = '2016xxxx' or '1'='1' and pwd = 'xxxx',点击登陆,居然能成功登陆,pwd密码项被or后面一个恒等式架空了,于是这个语句恒为真,即可以登陆任何人的>账号。

阅读全文 »

以centos为例

  1. 安装composer
    wget https://dl.laravel-china.org/composer.phar -O /usr/local/bin/composer
    chmod a+x /usr/local/bin/composer
    composer global require "laravel/installer"
  2. 查看版本
    composer -v
阅读全文 »

直接通过yum包管理器安装
yum install php70
发现报错

Loaded plugins: fastestmirror  
Loading mirror speeds from cached hostfile
* webtatic: us-east.repo.webtatic.com
Resolving Dependencies
--> Running transaction check
---> Package php56w-gd.x86_64 0:5.6.32-1.w7 will be installed
--> Processing Dependency: php56w-common(x86-64) = 5.6.32-1.w7 for package: php56w- gd-5.6.32-1.w7.x86_64
--> Running transaction check
---> Package php56w-common.x86_64 0:5.6.32-1.w7 will be installed
--> Processing Conflict: php56w-common-5.6.32-1.w7.x86_64 conflicts php-common < 5.6
--> Finished Dependency Resolution
Error: php56w-common conflicts with php-common-5.4.16-43.el7_4.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
```
<!-- more -->

发现版本冲突,列出php相关的所有包
` yum list installed | grep php`
显示:

php-cli.x86_64 5.4.16-43.el7_4 @updates
php-common.x86_64 5.4.16-43.el7_4 @updates
php-gd.x86_64 5.4.16-43.el7_4 @updates
php-imap.x86_64 5.4.16-7.el7 @epel
php-ldap.x86_64 5.4.16-43.el7_4 @updates

一一删除之  
`yum remove php-cli.x86_64 `
`...`

重新安装
`yum install php70`
完成

~ php -v
PHP 7.0.25 (cli) (built: Oct 29 2017 13:43:03) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
```

写在大学的三分之一

从哈尔滨打铁耻辱回程,本该早早发篇文章反省的,却因为一系列的不可控事件(概率论考试什么的。。。)拖到今天。

距离大学刚军训完踏入304的那天起,已经走过了一年。当时我在ACM新手群水群,自称“有OI基础”,(实际上也就是个初赛都过不了的滑水的),然后就被大腿带去304的ACM基地,第一次看到了乱七八糟的训练室,白板上涂鸦着List学长的画像,被告知ACM比赛的队员就在这里比赛,甚至就住这里,感觉立马不想参加了。。。之后,就被安排了第一场新生赛。第一场比赛,学校的OJ还只支持C/C++,只会一点pascal的我立马慌了,挨着面子没有揭露我这个“伪OIer”的身份。高中的NOIP屡受挫折,也得不到家长支持,付出了对我而言挺大的代价,却没有收获,于是大学不再想跳坑。因为没有打算将来去打比赛,z直到新生赛那天,才开始看C的语法,一边搜题目,对应着pascal的思路一行行翻译成C(实际上,感谢这场比赛,奇迹般的让我在5个小时内学会了大部分的大一C语言语法)。比赛结果,被高中国奖的大腿屠榜无误。。。

阅读全文 »

wget是linux下常用的命令行下载工具,是Linux用户是必不可少的工具,尤其对于网络管理员,经常要下载一些软件。而tget是一个简单的命令行BT下载工具,可以用于BT种子和磁力链接的下载。

tget源代码
类似的项目

安装tget:

npm install -g t-get

阅读全文 »