Attack Tactics to hack into linux servers

Source: Internet
Author: User
Today, I tested a website with ay520, but the website was so powerful that I didn't find any vulnerabilities. So I started a roundabout attack strategy. What is a roundabout attack? When we attack a website, because we do not understand the website source code structure and have no common vulnerabilities, we can first find out some features of the website source code.

Today, I tested a website with ay520, but the website was so powerful that I didn't find any vulnerabilities. So I started a roundabout attack strategy. What is a roundabout attack? I will introduce it as follows:

When we attack a website, because we do not know the website source code structure and have no common vulnerabilities, we can first find some characteristic characters of the website source code, then google is used to search for websites with the same source code as this website. The websites to be attacked may have no vulnerabilities, but the websites we have found may not have any vulnerabilities, which may be due to configuration problems, then we can use shell to view the website source code and then return to the target site to attack the target site. This is what I call a detour, of course, it can also be a social engineering website administrator on another website orBbs'Target = '_ blank'>ForumThe above registration username and password are then returned to test the target site, and it is OK to win the target site. After a few minutes, let's start my infiltration journey today ......

 

Because the target site has no vulnerabilities, the configuration of the vulnerability above is not, I found a website http://www.xxx.com with the same source code as him through google Search: 9999/WcM/loginpage.htm and then the common password to guess the solution, but also did not find weak password and other vulnerabilities, so remove wcm and the following, direct http://www.xxx.com: 9999/results foundMcAt, the user name and password are tested as follows: admin/null. After successful access, the war Trojan is uploaded, And the webshell of the website that is attacked is run.CommandUname-A: Obtain the kernel version of the Server Linux www.xxx.com 2.6.18-128. el5 #1 smp w.EdJan 21 10:44:23 EST 2009 i686 i686 i386 GNU/Linux the linux 2.6 kernel has a udev local overflow vulnerability. First, let's take a look at the webshell running permission and commandIdAs a result, uid = 0 (root) gid = 0 (root) groups = 0 (root), 1 (bin), 2 (daemon), 3 (sys ), 4 (adm), 6 (disk), 10 (wheel) contExT = user_u: system_r: uNcOnfined_t is the root permission. Since it is the root permission, we can use webshell to establish a user, and then use putty to connect to it for local overflow and Elevation of Privilege ...... HoweverDdThe User Password added by username is empty. If you want to usePasswdIf username is used to set the password, our webshell cannot enter the password, so we are depressed to use its parameter-p for the operation. The result is to search and run the following command:Useradd-P $1 $ Bj. BPMBM $ pr3Vte2A9DW6jCzljcZNT1 liang // a string after-p is a string that I add a user to the virtual machine, and then copy his password as the password here, in this way, I will successfully Add a user liang to open putty, enter the user name and password, connect, everything is OK, and the permission is $ as a normal user. The following uses udev overflow to escalate permissions.

 

I originally wrote according to this article overflow http://www.waitalone.cn/post/466.html results failed, after checking, may be Overflow Code problems, so I directly open http: // www. milw0Rm. Com/exploits/8478 run the following command in putty:

[Liang @ www ~] $ Vi test paste the above Code

[Liang @ www ~] $ Wq: Save and exit

[Liang @ www ~] $Chmod777 add executable permissions for any user to test

[Liang @ www ~] $ Ps ax |GrepUdev | grep-v grep | awk {'print $ 1'} to obtain the udev process number. The result is 479, and then 1 is subtracted as the test parameter.

[Liang @ www ~] $ Sh test 478 returns the result

Sh-3.2 $ the returned result indicates it is unsuccessful. We will try it several times.

Sh-3.2 $ sh test 478 I tried three times, but I still cannot

Sh-3.2 $ sh test 476 succeeded this time. I saw the cute #. Haha's character exploded.

 

Then vi/etc/passwd changes the uid and gid of the user name liang to 0, so the liang is the root permission, haha. Work done!

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.