| welcome to social.hackers | posts are made by Clocwork and Shadowdrifter | added some new hack diaries + podcasts |
Showing posts with label Python. Show all posts
Showing posts with label Python. Show all posts

Monday, June 6, 2011

Python Programming Lesson Four. ( beginning strings )

    Today’s lesson will be a short one since we will just be discussing Python’s ability to write a user’s input a text file. This code will do two things, it will take whatever you type and assign a variable to it and then it will print that variable to a text file which you will also choose the name of.

ttw = str(raw_input("Enter the text you would like to write to the file: "))
ftw = str(raw_input("What would you like to name the file: "))

textfile=open(ftw,'w')
textfile.write(ttw)

ttw, and ftw are simply the variables for what you want wrote to the file, and what to name the file. The “w” in textfile means to write. Python has three main ways to interact with text files, write, read, append.

Sunday, June 5, 2011

Python Programming Lesson Three.

     In programming lesson three we will be covering the os module of Python, which allows you to use command line functions inside a Python program. Now since most programs can be run from command line this has nearly unlimited possibilities. Unlike my other lesson this one requires some knowledge of command line depending on your operating system. Windows and Mac/Linux use somewhat different commands so this program will also be teaching you how to take a user’s input and use an IF command.

import os
opsys = raw_input("Are you using a Windows machine yes/no ")
if opsys =='yes':
                print 'This will use the windows echo and %random% function'
                os.system('echo %random%')
if opsys =='no':
                print 'This will use the linux echo command'
                os.system('echo hello')

      You may notice the indentions which is very important in Python.   We are using the IF command to determine which O.S the user is running so we can determine the appropriate commands to use.

Programming Lesson Number Two ( Math.py )

                Today’s lesson will be covering use of the Python Math module, and Python’s built-in math functions. The Math module is a module specifically designed to expand on Python’s mathematical functionality by adding things such as square roots, sin, cos , tan. Now if you have ever tried to make a program to solve certain math problems, and have found yourself lacking in certain functions; you will be lacking no longer! The built-in math functions for python are addition, subtraction, multiplication, and division. I will be once more adding code that uses Math.py, and each of the built-in math functions.

import math
print 5+5
print 5*5
print 5/5
print 5-5
print math.sqrt(25)
raw_input()

     Import math is importing the math.py module, which allows you to use the math.sqrt function. Now you may have not seen raw_input() before, but it is a simpler way to pause the program until the user wishes to continue.

Friday, June 3, 2011

Programming Lesson Number one.

This is the first edition to the Shadowdrift programming lessons. During these lessons I will be teaching you the basics of the Python language. Today’s lesson will be on installing Python, using modules, and assigning variables. Installing Python is very straightforward go to this link and download the first file . After running the MSI installer you will be able to run Python programs. Now similar to headers in C/C++ Python stores functions in modules which are easily imported with something as simple as import modulename. At the end of this lesson I will include some code you can easily use to test these modules. The third, and final part of our lesson is assigning variables. To assign a variable in python you will write it like this variablename = variable i.e a = ‘123’. The following code uses Python of course, and the two things we have covered modules and variables.

    import time
    a = time.time()
    print a
    time.sleep(3)

Doxing Assistant V4 or AIO.

I have recently added the finishing touches to my doxing tool version 4.0. For those unfamiliar with the doxing assistant it is based on a simple tool Clocwork made over a year ago. Inspired by his design I started by learning his code, and then added some of my own. It has become one of my biggest projects, and one I am incredibly proud of. The program, and its needed module has been uploaded to Sourceforge. The program uses many Python functions to complete tasks ranging from, decrypting hashes,encrypting hashes,html extracting for sql, sql table bruteforcing,custom password generating, random password generating,dox assistance,and even console based doxing. If you do not understand any of the code please comment, and I will respond as soon as possible.