์œ ์šฉํ•œ ONSIT ์‚ฌ์ดํŠธ(geo location)
ยท
๐Ÿค–์ •๋ณด๋ณด์•ˆ/โค๏ธ๋ ˆ๋“œํŒ€
COUNTRY.IS IP ์งˆ์˜๋ฅผ ํ†ตํ•œ ๊ตญ๊ฐ€ ์กฐํšŒ https://country.is/ IP Geolocation API | Country.is Country has a minimal ๐Ÿ”ฅ interface. Have your browser or app query its own IP address. Query an abitrary IP. https://api.country.is/9.9.9.9 See the data sources. Country automatically checks for new MaxMind data every 24 hours. If you prefer not to use t country.is MAXMIND ASN ๋ฐ IP ๋Œ€์—ญ ๋ณ„ ๊ตญ๊ฐ€ ์ •๋ณด ๋ฐ์ดํ„ฐ ํŒŒ์ผ ์ œ๊ณต https://www.maxm..
[Post-Explotation] Linux Priviledge Escalation
ยท
๐Ÿค–์ •๋ณด๋ณด์•ˆ/โค๏ธ๋ ˆ๋“œํŒ€
์ผ๋ฐ˜์ ์œผ๋กœ ํ˜ธ์ŠคํŠธ ์‰˜์„ ํš๋“ํ•˜๋ฉด ์ƒ์œ„ ๊ถŒํ•œ ํƒˆ์ทจ๋ฅผ ์œ„ํ•˜์—ฌ ์ •๋ณด๋ฅผ ์ˆ˜์ง‘ํ•ด์•ผํ•œ๋‹ค. ์ด ์ˆ˜์ง‘ํ•˜๋Š” ํ–‰์œ„๋ฅผ Enumeration๋ผ๊ณ  ํ•œ๋‹ค. ๊ธฐ์ดˆ ์ •๋ณด๋ฅผ ํš๋“ํ•˜๊ธฐ ์œ„ํ•˜์—ฌ ๋‹ค์Œ์˜ ์ •๋ณด๋ฅผ ์ˆ˜์ง‘ํ•˜์ž. ์šด์˜์ฒด์ œ ๋ฒ„์ „ - ์ฃผ๋กœ ์•Œ๋ ค์ง„ ์šด์˜์ฒด์ œ์— ๋”ฐ๋ผ ์‚ฌ์šฉํ•˜๋Š” ํˆด ๋˜๋Š” ์ต์Šคํ”Œ๋กœ์ž‡ ์—ฌ๋ถ€๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค. ์ปค๋„ ๋ฒ„์ „ - ์ž˜์•Œ๋ ค์ง„ ์ปค๋„์ด๋ผ๋ฉด ์ทจ์•ฝ์  ์ •๋ณด๋ฅผ ํš๋“ํ•  ์ˆ˜ ์žˆ๋‹ค. ์ด์— ์“ฐ์ด๋Š” ์ทจ์•ฝ์ ์€ ์‹œ์Šคํ…œ์„ ์‚ฌ์šฉ๋ถˆ๊ฐ€ ํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•˜๋ฏ€๋กœ ์‹คํ–‰ํ•˜๊ธฐ์ „ ํŒŒ๊ธ‰ํšจ๊ณผ๋ฅผ ์ธ์ง€ํ•˜๋„๋ก ํ•˜ ์‹ฑํ–‰์ค‘์ธ ์„œ๋น„์Šค - ์‹คํ–‰์ค‘์ธ ํ”„๋กœ์„ธ์Šค์˜ ๊ถŒํ•œ์„ ํ™•์ธํ•œ๋‹ค. ์ž˜๋ชป๋œ ์„ค์ •์œผ๋กœ root๋กœ ์‹คํ–‰๋˜๊ฒŒ ํ•  ์ˆ˜๋„์žˆ๋‹ค. Cy3erLuna@htb[/htb]$ ps aux | grep root root 1 1.3 0.1 37656 5664 ? Ss 23:26 0:01 /sbin/i..
[์ •๋ณด] Blutooth ํ•ดํ‚น ๊ธฐ๋ฒ• ์ข…๋ฅ˜
ยท
๐Ÿค–์ •๋ณด๋ณด์•ˆ/โค๏ธ๋ ˆ๋“œํŒ€
๋ฌด์„  ๊ธฐ์ˆ  ํ‘œ์ค€์ธ Bluetooth๋Š” ๊ณ ์ • ๋ฐ ๋ชจ๋ฐ”์ผ ์žฅ์น˜์—์„œ ๋‹จ๊ฑฐ๋ฆฌ๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ์ „์†กํ•˜๊ธฐ ์œ„ํ•ด ์„ค๊ณ„๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ์ด ๊ธฐ์ˆ ์€ 2.402GHz ~ 2.480GHz์˜ ISM ๋Œ€์—ญ์—์„œ ๋ฌด์„  ์ฃผํŒŒ์ˆ˜๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๊ฐœ์ธ ์˜์—ญ ๋„คํŠธ์›Œํฌ(PAN)๋ฅผ ๊ตฌ์ถ•ํ•˜๋Š” ๋ฐฉ์‹์œผ๋กœ ์ž‘๋™ํ•ฉ๋‹ˆ๋‹ค ์žฅ์น˜ ๊ฐ„ ๋‹จ๊ฑฐ๋ฆฌ ๋ฌด์„  ํ†ต์‹ ์„ ์œ„ํ•ด ์„ค๊ณ„๋œ Bluetooth ๊ธฐ์ˆ ์€ ์˜ค๋Š˜๋‚ ์˜ ๋””์ง€ํ„ธ ์‹œ๋Œ€์— ์–ด๋””์—๋‚˜ ์กด์žฌํ•ฉ๋‹ˆ๋‹ค. ์ด๋Ÿฌํ•œ ํŽธ๋ฆฌํ•จ์—๋„ ๋ถˆ๊ตฌํ•˜๊ณ  ํ•ด์ปค์—๊ฒŒ๋Š” ์ƒˆ๋กœ์šด ๊ณต๊ฒฉ ๋Œ€์ƒ์ด ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋ช‡ ๊ฐ€์ง€ ์œ ํ˜•์˜ ๋ธ”๋ฃจํˆฌ์Šค ํ•ดํ‚น ์ข…๋ฅ˜๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค. ๋ธ”๋ฃจ์Šค๋‚˜ํ•‘(Bluesnarfing): ๋ธ”๋ฃจํˆฌ์Šค๋ฅผ ํ†ตํ•ด ๋ฌด์„  ๋””๋ฐ”์ด์Šค์˜ ์ •๋ณด์— ๋ฌด๋‹จ์œผ๋กœ ์•ก์„ธ์Šคํ•˜๋Š” ์‚ฌ์ด๋ฒ„ ๊ณต๊ฒฉ์ž…๋‹ˆ๋‹ค. ๋ธ”๋ฃจ์žฌํ‚น(Bluejacking): ๋ธ”๋ฃจํˆฌ์Šค ์‚ฌ์šฉ ์žฅ์น˜์— ์›์น˜ ์•Š๋Š” ๋ฉ”์‹œ์ง€๋ฅผ ๋ณด๋‚ด๋Š” ๊ณต๊ฒฉ์ž…๋‹ˆ๋‹ค. ๋ธ”..
[์ •๋ณด] ํ•ด์‹œ
ยท
๐Ÿค–์ •๋ณด๋ณด์•ˆ/โค๏ธ๋ ˆ๋“œํŒ€
๋Œ€๋ถ€๋ถ„์˜ ํ•ด์‹œ ์•Œ๊ณ ๋ฆฌ์ฆ˜์€ ์ผ์ •ํ•œ ๊ธธ์ด์˜ ํ•ด์‹œ๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค. ํŠน์ • ํ•ด์‹œ์˜ ๊ธธ์ด๋Š” ํ•ด์‹œ๊ฐ€ ํ•ด์‹œ๋œ ์•Œ๊ณ ๋ฆฌ์ฆ˜์— ๋งคํ•‘ํ•˜๋Š” ๋ฐ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด 32์ž ๊ธธ์ด์˜ ํ•ด์‹œ๋Š” MD5 ๋˜๋Š” NTLM ํ•ด์‹œ์ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํ•ด์‹œ ๊ฐ’์ด ์žˆ์œผ๋ฉด hashid๋กœ ์–ด๋–ค ์œ ํ˜•์˜ ํ•ด์‹œ์ธ์ง€ ์•Œ ์ˆ˜ ์žˆ๋‹ค.
[์ •๋ณด] http ๊ณต๊ฒฉ ์Šคํ‚ฌ
ยท
๐Ÿค–์ •๋ณด๋ณด์•ˆ/โค๏ธ๋ ˆ๋“œํŒ€
CRLF -> ๋กœ๊ทธ ์ธ์ ์…˜, ๋กœ๊ทธ ํฌ์ด์ฆˆ๋‹ -> XSS, RCE redirection ์ฒ˜๋ฆฌ๋˜๋Š” ํŒŒ๋ผ๋ฏธํ„ฐ์— Response ํŒจํ‚ท์— CRLF ๊ณต๊ฒฉ์„ ํ†ตํ•˜์—ฌ ์ž„์˜์˜ ๋ฐ์ดํ„ฐ(html ๊ตฌ์กฐ ๋“ฑ)๋ฅผ ์‚ฝ์ž…ํ•  ์ˆ˜ ์žˆ๋‹ค. ๊ฐœํ–‰๋ฌธ์ž๋ฅผ ์‚ฝ์ž…ํ•˜์—ฌ ๊ทธ๋Œ€๋กœ ์‹œ์Šคํ…œ์—์„œ ์ธ์‹ํ•˜๋Š” ๊ฒƒ์ด ์ทจ์•ฝํ•˜๋‹ค ์ด๋ฅผ ๋ฐฉ์ง€ํ•˜๊ธฐ ์œ„ํ•ด์„œ URL๋กœ ์ธ์ฝ”๋”ฉ๋˜๋„๋ก ํ•˜์—ฌ CRLF ์ธ์ ์…˜์„ ๋ฐฉ์ง€ ํ•œ๋‹ค. ์œ„์˜ ๊ณต๊ฒฉ์€ HTTP Request ํŒจํ‚ท์˜ ํŒŒ๋ผ๋ฏธํ„ฐ ๋“ฑ์„ ์กฐ์ž‘ํ•˜์—ฌ ์‚ฌ์šฉ์ž์—๊ฒŒ ์˜ค๋Š” Response ํŒจํ‚ท์˜ ์‘๋‹ต์„ ์กฐ์ž‘ํ•˜๋Š” ๋ฐฉ๋ฒ•์ด๋‹ค. ํ…Œ์ŠคํŒ… ํˆด๋กœ๋Š” ํŒŒ์ด์ฌ์˜ crlfsuite๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ๋œ๋‹ค pip3 install crlfsuite KoCOnU72@htb[/htb]$ crlfsuite -h usage: crlfsuite [-h] [-t TARGET] [-iT TARG..
[์ •๋ณด] DLL Injection ํŒŒ์ด์ฌ ์ฝ”๋“œ
ยท
๐Ÿค–์ •๋ณด๋ณด์•ˆ/โค๏ธ๋ ˆ๋“œํŒ€
DLL Injection ๊ณต๊ฒฉ ํ๋ฆ„ ์‹คํ–‰ ์ค‘์ธ ํ”„๋กœ์„ธ์Šค๋ฅผ ๋Œ€์ƒ์œผ๋กœ ํ•ฉ๋‹ˆ๋‹ค. ํ”„๋กœ์„ธ์Šค ์ฃผ์†Œ ๊ณต๊ฐ„์— ๋ฉ”๋ชจ๋ฆฌ๋ฅผ ํ• ๋‹นํ•ฉ๋‹ˆ๋‹ค. DLL ๊ฒฝ๋กœ๋ฅผ ํ•ด๋‹น ๋ฉ”๋ชจ๋ฆฌ์— ์”๋‹ˆ๋‹ค. ๋Œ€์ƒ ํ”„๋กœ์„ธ์Šค์˜ ์Šค๋ ˆ๋“œ์—์„œ DLL์„ ๋กœ๋“œํ•˜๋Š” ํ•จ์ˆ˜๋ฅผ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค. import ctypes # ctypes ๋ชจ๋“ˆ ์ž„ํฌํŠธ import sys # sys ๋ชจ๋“ˆ ์ž„ํฌํŠธ import os # os ๋ชจ๋“ˆ ์ž„ํฌํŠธ import psutil # psutil ๋ชจ๋“ˆ ์ž„ํฌํŠธ def inject_dll(target_process_name, dll_path): # ๋Œ€์ƒ ํ”„๋กœ์„ธ์Šค๋ฅผ ์ฐพ์Šต๋‹ˆ๋‹ค. target_pid = None for process in psutil.process_iter(['name', 'pid']): if process.info['name'] == target_..
[ํŒŒ์ด์ฌ] ๊ถŒํ•œ ์ƒ์Šน ๋ช…๋ น์–ด(๊ฐ„๋‹จ ์ตœ์ข…)
ยท
๐Ÿค–์ •๋ณด๋ณด์•ˆ/โค๏ธ๋ ˆ๋“œํŒ€
ํ•ด๋‹น ํŒŒ์ด์ฌ ํ•จ์ˆ˜๋กœ ์•„๋ž˜์™€ ๊ฐ™์ด ์ตœ๊ณ  ๊ถŒํ•œ์˜ ํ”„๋กœ๊ทธ๋žจ ์‹คํ–‰์„ ํ•  ์ˆ˜ ์žˆ๋‹ค. os.system(f'SCHTASKS /Create /TN {SVC_NAME} /SC ONLOGON /TR {SVC_PROG_PATH} /RL HIGHEST') ๋˜๋Š” ์ผ๋ฐ˜ ๋ช…๋ น์–ด๋กœ SCHTASKS /Create /TN "Go" /SC ONSTART /TR "C:\Users\AidenLee\Downloads\go.exe" /RL HIGHEST /RU "SYSTEM" ์‘์šฉ os.system()์„ ์‚ฌ์šฉํ•˜์—ฌ Windows์—์„œ ๊ถŒํ•œ ์ƒ์Šน์„ ์š”์ฒญํ•˜๋Š” ๋ฐฉ๋ฒ• ์ค‘ ํ•˜๋‚˜๋Š” ์ž‘์—… ์Šค์ผ€์ค„๋Ÿฌ(Task Scheduler)๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค. ์ด๋ฏธ ์‚ฌ์šฉํ•˜๊ณ  ๊ณ„์‹  SCHTASKS ๋ช…๋ น์€ ์ด ๋ฐฉ๋ฒ• ์ค‘ ํ•˜๋‚˜์ž…๋‹ˆ๋‹ค. ์•„๋ž˜๋Š” ๋‹ค๋ฅธ ๋ช‡ ๊ฐ€์ง€ ๋ฐฉ๋ฒ•์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ru..
[ํŒŒ์ด์ฌ] ๊ถŒํ•œ ์ƒ์Šน ์š”์ฒญ ์ฝ”๋“œ(2022 ์ตœ์‹ )
ยท
๐Ÿค–์ •๋ณด๋ณด์•ˆ/โค๏ธ๋ ˆ๋“œํŒ€
์˜จ๋ผ์ธ์—์„œ ๋ฐœ๊ฒฌ๋˜๋Š” ๊ธฐ์กด ํŒŒ์ด์ฌ ๊ถŒํ•œ ์ƒ์Šน ์š”์ฒญ ์ฝ”๋“œ์˜ ๊ฒฝ์šฐ ํŒจํ‚ค์ง€ ์ด๋ฆ„์ด win32com์—์„œ shell์„ ์š”์ฒญํ•˜์ง€๋งŒ 2022๋…„ ๊ธฐ์ค€ win32comext์— ์กด์žฌํ•œ๋‹ค. import os import sys # win32com.shell์ด ์•„๋‹Œ win32comext ์ด๋‹ค from win32comext.shell import shell ASADMIN = 'asadmin' print(sys.argv) if sys.argv[-1] != ASADMIN: script = os.path.abspath(sys.argv[0]) params = ' '.join([script] + sys.argv[1:] + [ASADMIN]) shell.ShellExecuteEx(lpVerb='runas', lpFile=sys.execut..
[ํŒŒ์ด์ฌ] WebGoat Brute Force ํŒŒ์ด์ฌ ์ฝ”๋“œ
ยท
๐Ÿค–์ •๋ณด๋ณด์•ˆ/โค๏ธ๋ ˆ๋“œํŒ€
import requests password = str() cre = "created" url = "http://localhost:8080/WebGoat/SqlInjection/challenge" cookie = {'JSESSIONID':'8B10E84050C998DD12174E500DBA38F6'} print ('[*] Get password length...') password_length = int() for length in range(1,30): datas = {'username_reg' : "tom' and length(password) = %d and '1'='1" % length, 'email_reg' : 'test@test.com', 'password_reg' : '1111', 'conf..