情感     

asdasda 风炫安全web安全学习第三十节课 命令执行&代码执行基础

2022-02-16 14:41情感

Windy Security网络安全学习第30课命令执行&代码执行基础

代码执行&命令执行

RCE漏洞允许攻击者直接和远程地将操作系统命令或代码注入后台服务器,从而控制后台系统。

远程系统的命令执行

通常,出现这种漏洞是因为应用系统需要为用户提供远程命令操作的指定界面

比如在我们常见的路由器、防火墙、入侵检测设备等的web管理界面上。

一般会给用户提供ping web界面,用户从web界面输入目标IP。提交后,后台会ping IP地址一次,返回测试结果。但是,如果设计者在完成此功能时没有进行严格的安全控制,则可能会导致攻击者通过此界面提交“意外”命令,以便后台可以执行这些命令并控制整个后台服务器

Windows系统命令拼接

“|”:管道符,前面命令标准输出,后面命令的标准输入。例如:help |more“&” commandA & commandB 先运行命令A,然后运行命令B“||” commandA || commandB 运行命令A,如果失败则运行命令B“&&” commandA && commandB 运行命令A,如果成功则运行命令B

LINUX下的系统命令拼接

;分号 可以进行多条命令的无关联执行,每一条执行结果不会影响其他命令的执行ls ; cat file&& 逻辑与, 左边的command1执行成功后,&&右边的command2才能被执行。➜ asdasdasd && cat testfilezsh: command not found: asdasdasd➜ ls && cat testfiledvwa pikachu subject01 subject02 test.html test2.html test3.html testenv testfiletest 30hello 95linux 85|| 逻辑或,如果 || 左边的command1执行失败,才执行||右边的command2,否则不执行command2,具有短路功能。➜ asdasda || cat testfilezsh: command not found: asdasdatest 30hello 95linux 85➜ ls || cat testfiledvwa pikachu subject01 subject02 test.html test2.html test3.html testenv testfile| 管道符,当用此连接符连接多个命令时,前面命令执行的正确输出,会交给后面的命令继续处理。若前面的命令执行失败,则会报错,若后面的命令无法处理前面命令的输出,也会报错。➜ cat testfiletest 30hello 95linux 85➜ cat testfile | grep -n "hello"2:hello 95➜ grep -n "hello" testfile2:hello 95 如果想执行几个命令,则需要用命令分隔符分号隔开每个命令,并使用圆括号把所有命令组合起来。结合||和&&可以实现复杂的功能。➜ sort testfilehello 95linux 85test 30➜ sort testfile > test.sort && hello 95linux 85test 30BashCopyfile_put_contents;?>')

后置导航

点击展开全文