Skip to content

Instantly share code, notes, and snippets.

View vijayanandrp's full-sized avatar
👑

Vijay Anand Pandian vijayanandrp

👑
View GitHub Profile
@vijayanandrp
vijayanandrp / Writeup for InCTF 2014 - Crypto 200 - Solved RSA 4096 bit .py
Created June 15, 2017 22:35
Writeup for InCTF 2014 - Crypto 200 - Solved RSA 4096 bit
#!/bin/python
import gmpy
n = 0x00d10ba0e9cd6dd6c3895fcdf417db21e581226089c6c7587fc41b3d78dff52c0f8c29dc6be9fccf316832e6ff6ff0496e9e566ecbc131064eb8475d6c1bc828be4af454ad62cbf0d1d2cd5a598a241c52b16d8ee1da0ca9cc56303cd070710e6c181f2a31c6887e52cf14bd76f62580a84692f88198a938490fb2de1941b11085833dedca16673f4ae54be60fe0da6624a53db232dca6c5887d723c7739c476ef306019a057f1c6be37a5b820d0919acffd1863d22c6fa730fe12e815359d68a4ece1c01ef7b0ecd95991b3d971d00927995ed66ed6c9933644c4f99ec752809eaf731e69c5c0f9b034e1b8330fefd40590c46fa179614f7ad28cd18b997369182f46f9e9ba2548c65380e53e22c99beaa69bf6f863874530bdce9a68ee6afba4e9ae0781be5b3df1a517c57ec1b52b4b84b71863a88a35f1c0df0a1f8ee36c9161d2ef60472a129db81666223edd07f3e9d1da4bfdd2171dbe58a036804deffd8fd58eb57a2a454b25c5de925a1654d5fe670204b840129b8bc5a2d397faf2157a8bb209a27aff89b2f8bf18abda5371e0c1cf3d68c20b5e3e195f6f6312a3f8ef9788cafb7661b79af752159f885017bde86c7a2eb34e277dac367d9f5633c5900ad115ef4c8fae5328da215cb220b8aefb09e302628a2be0569ee7dc171ef3147c6ace610271e06d5ba71403d3
@vijayanandrp
vijayanandrp / Writeup for InCTF 2014 - Crypto 200 - Solved RSA 4096 bit .sh
Created June 15, 2017 22:34
Writeup for InCTF 2014 - Crypto 200 - Solved RSA 4096 bit
root@Vijay:# openssl rsa -pubin -in pub.pem -text -noout -modulus
Public-Key: (4096 bit)
Modulus:
00:d1:0b:a0:e9:cd:6d:d6:c3:89:5f:cd:f4:17:db:
21:e5:81:22:60:89:c6:c7:58:7f:c4:1b:3d:78:df:
f5:2c:0f:8c:29:dc:6b:e9:fc:cf:31:68:32:e6:ff:
6f:f0:49:6e:9e:56:6e:cb:c1:31:06:4e:b8:47:5d:
6c:1b:c8:28:be:4a:f4:54:ad:62:cb:f0:d1:d2:cd:
5a:59:8a:24:1c:52:b1:6d:8e:e1:da:0c:a9:cc:56:
30:3c:d0:70:71:0e:6c:18:1f:2a:31:c6:88:7e:52:
@vijayanandrp
vijayanandrp / How to write Class in Python with examples.py
Created June 15, 2017 22:29
How to write Class in Python with examples
#!/usr/bin/env python
class Worker:
def __init__(self, name, pay):
self.name = name
self.pay = pay
def last_name(self):
return self.name.split()[-1]
@vijayanandrp
vijayanandrp / How to learn Python in a 15 Minutes !! Believe its very cool language to have fun and learn .py
Created June 15, 2017 22:27
How to learn Python in a 15 Minutes !! Believe its very cool language to have fun and learn :)
#!/usr/bin/env python
# I have learned these codes from Learning Python O'reilly
# Python 2.7
"""
#! is often called hash bang or shebang
/user/bin/python - path of the python executable
#!/usr/bin/python - Unix Styled Executable Scripts (If u know exact path of the python binary)
@vijayanandrp
vijayanandrp / Step by Step method to parse XML files and store into sqlite db and vice versa.py
Created June 15, 2017 22:24
Step by Step method to parse XML files and store into sqlite db and vice versa
__author__ = 'admin'
import sqlite3
db = sqlite3.connect('books_store.db')
cursor = db.cursor()
try:
cursor.execute('''DROP TABLE books''')
print 'Deleted the old table'
@vijayanandrp
vijayanandrp / Learn XML - parsing in python with simple examples.py
Created June 15, 2017 22:19
Learn XML - parsing in python with simple examples
# 1. How to read and XML file using Python ?
# For example purpose, kindly save the above XML content into a file named as 'data.xml'
# import a class named xml.etree.ElementTree
import xml.etree.ElementTree as element_tree
# Before reading we should parse the whole XML file content as tree
tree = element_tree.parse('data.xml')
# Now with tree we have to fetch the root
@vijayanandrp
vijayanandrp / ip_address_class_selector.py
Created June 15, 2017 22:08
How to do IP Address Class Identification using python program?
#!/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()
@vijayanandrp
vijayanandrp / Simple examples to understand Sets in Python.py
Created June 15, 2017 21:45
Simple examples to understand Sets in Python
#!/usr/bin/env python
"""
Set - an unordered collection of unique and immutable objects
"""
def main():
x = set('abcdef')
y = set('bdexyz')
@vijayanandrp
vijayanandrp / How to do I understand strings Python concepts in just 5 mins.py
Created June 15, 2017 21:43
How to do I understand strings Python concepts in just 5 mins!!
#!/usr/bin/env python
def main():
print int('5')
print ord('s')
print chr(115)
print bin(13)
print hex(26)
print hex(255)
print oct(255)
@vijayanandrp
vijayanandrp / List and Dict Python concepts.py
Created June 15, 2017 21:40
How to do I understand List and Dict Python concepts in just 5 mins!!
#!/usr/bin/env python
def lists_examples():
print 'List examples in Python\n', '======================================'
L = []
L = ['abc', 123, 1.23, {}]
L = ['Bob', 40.0, ['dev', 'mgr']]