Month: December 2014
RedHat / Centos Repository you must have
RedHat and centos come with the default repo so you have to install additional repos to get all your software from yum epel ius remi rpmfroge
1 2 3 4 |
rpm -ivh http://dl.iuscommunity.org/pub/ius/stable/RedHat/7/x86_64/ius-release-1.0-13.ius.el7.noarch.rpm rpm -ivh http://dl.iuscommunity.org/pub/ius/stable/RedHat/7/x86_64/ius-release-1.0-13.ius.el7.noarch.rpm rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm |
enjoy this list for 64bit system centos 7 u can customise the links as you got the link
MySQL force delete rows
MySQL check if there is a relation between rows before deleting it it will raise an error can’t delete or update a parent row we need to till mysql to stop this check
1 |
SET FOREIGN_KEY_CHECKS = 0 |
to reactivate it
1 |
SET FOREIGN_KEY_CHECKS =1 |
enjoy
SMASH THE STACK LEVEL6
Smash The Stack Level 6
1 2 |
level6@io:/levels$ ./level06 a b Hi a |
this app take 2 argument 1 – username 2- password it takes it then say hi also, it checks ur env language and change the msg
1 2 3 4 5 6 7 8 |
level6@io:/levels$ export LANG=fr level6@io:/levels$ ./level06 a b Bienvenue a level6@io:/levels$ export LANG=de level6@io:/levels$ ./level06 a b Willkommen a level6@io:/levels$ |
let’s make some love with gdb btw without change ur language, it will not overwrite the EIP
Get Environment Variable memory Address
some time u put the shellcode inside the environment and u will need the address of it to build ur payload here is a simple C code to get the address
1 2 3 4 5 6 7 8 9 |
1 #include <stdio.h> 2 #include <stdlib.h> 3 4 int main(int argc, char *argv[]) 5 { 6 char *nix = getenv("NIX"); 7 printf("%p\n", nix); 8 return 0; 9 } |
Python Progress Bar
simple standalone bar u can implement it on your code it will show a progress bar of items range
1 2 3 4 5 6 7 8 |
from time import sleep import sys for i in range(21): sys.stdout.write('\r') # the exact output you're looking for: sys.stdout.write("[%-20s] %d%%" % ('='*i, 5*i)) sys.stdout.flush() sleep(0.25) |
Duplicate File Finder By MD5SUM
Hello this is a simple script to find the duplicated files by md5sum so if u have 2 files with the same content but with different names, u still can catch them
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
#duplicate file finder by file md5sum #author N1X import sys import os import subprocess from os.path import join, abspath from os import walk from time import sleep try: sys.argv[1] except IndexError: print "usage: python filedub.py /full/path/to/dir/" sys.exit() fileList = {} targetdir = sys.argv[1] totalfiles = 0 devnull = open('/dev/null', 'w') print "#" * 20 print '#' * 5 , 'Scan Start on :' , targetdir print '#' * 20 print 'Total Founded:' for root, dirs, files in os.walk(targetdir, topdown=True, onerror=None, followlinks=False): totalfiles += len(files) for file in files: file = abspath(join(root, file)) cmd = 'md5sum "%s"' % file sum = subprocess.Popen(cmd , stderr=subprocess.PIPE, shell=True, stdout=subprocess.PIPE) sum = sum.communicate()[0] print sum sum = sum.split() try: sum[0] except IndexError: continue sum = sum[0] if fileList.has_key(sum): fileList[sum].append(file) else: fileList[sum] = [file] print '\r%s'%totalfiles, sys.stdout.flush() sleep(0.5) for key in fileList.keys(): if len(fileList[key]) > 1 : print "\n" print "Total Duplicate for checksum[%s] is : %s)" %(key,len(fileList[key])) i=0 for dub in fileList[key]: i = i + 1 print i,":" ,dub,"if you want to delete this file pres y" action = raw_input('--> ') if action == "y": os.remove(dub) |
TrueCrypt Password bruteforce
hello, guys, this script will simply mount the container with the password form the given password list
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
#!/usr/bin/env python #TrueCrypt Crack Passowrd Based In Dic Attack #Author : N1X import subprocess import sys file = open(sys.argv[2]) passlist=file.readlines() for password in passlist: print password.strip() command = "truecrypt -t --non-interactive %s -p %s" %(sys.argv[1],password.strip()) p = subprocess.Popen(command,shell=True,stderr=subprocess.PIPE) r = p.stderr.read() if r.startswith('Error'): pass else: print "Found Passowrd is :" + password exit() |
Django Notes
ORM Notes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
objects.all() objects.all().count() objects.filter(published=True).count() objects.filter(published=True).exists() objects.filter(published=True)[:2] objects.filter(published=True).values('title','created')[:2] objects.filter(published=True).order_by('created') objects.filter(published=True).order_by('-created') objects.filter(published=True, created__gt=datetime(2011,05,01)) objects.filter(published=True, created__lt=datetime(2011,05,01)) objects.filter(published=True, created__lt=datetime(2011,05,01)).count() objects.filter(published=True, created__lt=datetime(2011,05,01)).order_by('id') objects.filter(published=True, created__year=2011.order_by('id') objects.filter(published=True, created__month=5, created__year=2011.order_by('id') |
Automatic flight ticket script
python script to demonstrate the splinter library this script keep searching till finding a ticket and book it 🙂 rest and wait your reservation number
Bitcoin Speech Price Tracker
simple python script to bitcoin price speech is the target price reached it takes argument 1 as a target price simple but still useful to monitor bitcoin price via speech