Posts

Showing posts with the label Programming

ip_classifier.py for ipv32

Written simple program to find the class for an ip address of 32bit version #!/usr/bin/python import sys, getopt def __help(): sys.stderr.write('\n Usage: \n ip_classifier.py -h \n ip_classifier.py --help \n ip_classifier.py -i 128.12.14.23 \n ip_classifier.py --ipv4=128.12.14.23 \n ') sys.exit() def __input_validator(check): if len(check) <> 0: check = list(check) c = 0; n = 0 for v in check: if v in ['.','1','2','3','4','5','6','7','8','9','0']: n += 1 test = True if v is '.': c += 1 else: test = False break if test and c < 4 and n > 6: return check else: sys.stderr.write('**** Enter correct ip address **** \n') __help() def __validator(ip): if ip in range(0,256): return True else: sys.stderr.write('**** Enter correct ip address **** \n') __help() def __class_finder(ip, class_ip, bin_

Nullcon HackIM 2014 - Programming 100 Writeup

''' Well I am a beginner. netcat 23.23.190.204 2002 Welcome Enter 20 spam words to authenticate yourself. 01/20: spam 02/20: maps 03/20: hot Authenticate failed. hot(125) is not a palprime. (Hint) Tried with different test cases and found the value for each alphabet. Since in the challenge only lower-case should be used (condition). so I written a big program ( Once again I am a beginner, to find the palprime words available in dictionary. For the words list I downloaded the dataset from infochimps.com Thank you !!! ''' #!/usr/bin/python import string import sys,math import random my_dict ={} a =1 s = 361 t = 762 - s - a n = 196 b = 405 - a -t c = 410 - a - t d =213 - a - n e = 426 - a -t f = 437 -a -t g = 306 - 1 -256 i = 442 - s h = 506 - i - s j = 525 - e -t k = 627 -i -t -e l = 738 -i -g -h -t p = 256 m = 169 o = 274 - g u = 833 - 2*n q = 1211 - u -i -t r = 918 -i -g -h -t v = 885 -a -t w = 651 -i -d -e x = 962 -e -s y = 1587 -e -s -x z = 103