Slavi 94 Master Poster Featured Poster

You can try running process monitor and try to find out what exactly it does, what it accesses, what registries its modifying if any etc

Slavi 94 Master Poster Featured Poster

Probably because a double and a float are values with a decimal point such as 1.2345 while you set the initial value of your fields to be a whole number, "0" in your case. Should be fixed if you set it to 0.0

Slavi 94 Master Poster Featured Poster

If parted -l doesn't work for you, I would try fdisk -l and see if that works, in fact fdisk would be my primary choice, it should list all partitions

Slavi 94 Master Poster Featured Poster

ssh root@IP address should create connection, although I would expect it to require root password before log in in fact for any case. Could you maybe share some of the instructions?

Slavi 94 Master Poster Featured Poster

the original description even 32 bit win8 is going to bug the shit out of it, if you open chrome with 2 tabs it will most likely shut down due to reaching 100% ram usage, the celeron one might be able to handle it but then again its celeron cpu

Slavi 94 Master Poster Featured Poster

which Linux distribution are you talking about?

Slavi 94 Master Poster Featured Poster

@sneekula,
the majority of windows users have no idea on computers or what so ever, their daily use is Facebook, Twitter, google and clicking links such as "OMFG YOU MUST SEE THIS!!" - with some attractive image under the title. As you are technically running windows as root, it is easy to get malware to self install and in a way easy to distribute it by hiding it in stuff that the mass of people would fall for. On the other hand, Linux is not so much used as a general os, people are unaware of it and its capability. I mean, just the idea of making everything(kind of) to be what you want it to is a reason to really go for it. For malware authors, they would indeed aim at an audiance that is easier to get infected, grow their botnets or spread their RATs

Slavi 94 Master Poster Featured Poster

Exactly, as rubben said tcp assures you that the information will be delivered, and no guarantees at all with udp, it just fires out packets. Streaming/skype etc find use of it

Slavi 94 Master Poster Featured Poster

Get universal usb installer and make a bootable flash drive, plug it in, choose option to start from the usb in the bios settings, the installation should be pretty much just next next etc(I assume you want to replace windows 7 with linux, otherwise might be nice to create a partition for linux before hand using ubuntu live usb for example, and a program called gparted)

Slavi 94 Master Poster Featured Poster

oh did u mean to be able to call them separately

Slavi 94 Master Poster Featured Poster
#!/usr/bin/env python3
# -*-coding: utf8-*-
def sayhi():
    print('hi everybody!')
def goodbye():
    print('see you soon!')
if __name__ == "__main__":
    sayhi()
    goodbye()
Slavi 94 Master Poster Featured Poster

python file.py

Slavi 94 Master Poster Featured Poster

Hey Tony,
changed it to zf = open('file.zip','rb'), works great thanks

Slavi 94 Master Poster Featured Poster

Do I need to supply a file that is part of that zip file in the read? :o

Like my purpose is to attach the entire zip file not files in it separately

Slavi 94 Master Poster Featured Poster

Use Linux, problem solved =)

Slavi 94 Master Poster Featured Poster

Hey guys,
I am making a small script here and I got stuck on it a bit ... perhaps one of you could help me out

The idea is to send an email that has attached zip file to it. My script is

import smtplib
import zipfile
import time
from email.mime.multipart import MIMEMultipart 
from email.mime.base import MIMEBase 
from email.mime.text import MIMEText
from email.utils import COMMASPACE, formatdate 
from email import encoders




def sendGmail(user = "hidden",pwd = "hidden",FROM = "hidden",\
TO = ['hidden'],SUBJECT = 'email',textMessage = 'Sample Massage'):
    #message = """\From: %s\nTo: %s\nSubject: %s\n\n%s
    #""" % (FROM, ", ".join(TO), SUBJECT, textMessage)

    zf = zipfile.ZipFile("file.zip")

    msg = MIMEMultipart()
    msg['From'] = FROM
    msg['To'] = TO
    msg['Date'] = formatdate(localtime = True)
    msg['Subject'] = SUBJECT
    msg.attach (MIMEText(textMessage))

    part = MIMEBase('application', "octet-stream")
    part.set_payload(zf.read())
    encoders.encode_base64(part)
    part.add_header('Content-Disposition', 'attachment; filename="file.zip"')
    msg.attach(part)






    try:
        server = smtplib.SMTP_SSL("smtp.gmail.com", 465)
        server.ehlo()
        server.login(user, pwd)
        server.sendmail(FROM, TO, str(msg))
        server.close()
        print 'successfully sent the mail'
    except Exception, e:
        print e

def main():
    textMessage = '''
        Email from a script
        The information in here is
        a zip file.
    '''
    sendGmail(TO = [hidden'],textMessage = textMessage)

if __name__ == '__main__':
    main()

It works fine if I send only a message without attaching a file such as:

def sendGmail(user = "",pwd = "",FROM = "",\
TO = [''],SUBJECT = 'email',textMessage = 'Sample Massage'):
    message = """\From: %s\nTo: %s\nSubject: %s\n\n%s
    """ % (FROM, ", ".join(TO), SUBJECT, textMessage)


    try:
        server = smtplib.SMTP_SSL("smtp.gmail.com", 465)
        server.ehlo()
        server.login(user, pwd)
        server.sendmail(FROM, TO, message)
        server.close()
        print 'successfully sent the mail'
    except Exception, e:
        print …
Slavi 94 Master Poster Featured Poster

Hey Grib,
I just got it running. The problem was that I had to delete python 32bit and install python 64 bit instead, works like a charm =) (Found it as a solution somewhere else on the net)

Slavi 94 Master Poster Featured Poster

Jagex can sui you for that, it is illegal to do

Slavi 94 Master Poster Featured Poster

Hey guys,
I am making a script here to read from windows registry. The problem that I am facing is that at a certain point I start getting an error that the file does not exist. First Here is what I am doing

net = r"SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\Unmanaged"
key = OpenKey(HKEY_LOCAL_MACHINE, net)

and I get an error that the file does not exist ..

so I tried going through the path and it works until the part where I place Signatures at the file path. I tried changing signatures to other directories in NetworkList but it always keeps complaining that it doesn't exist although I can see it in ragedit that there is a directory Signatures, Permissions, Profiles etc ..

Any ideas?

Slavi 94 Master Poster Featured Poster

Your code is not well described in my opinion, do you always want to get the last word from the sentance "You want a" which will always be "a" or do you want to get the last string in the string array that you had previous defined as items? I think your idea is something like ask a user for an item, the item is expected to be the last word in a sentance right? If that item exists in a previously defined list, then print to the user that he is getting that item, if it does not exist, print to the user that there is no such item, correct? If so ...

import java.util.Arrays;
import java.util.Scanner;

public class Test {
    static String[] items = { "Iphone", "Computer", "Car" };
    public static void main(String[] args) {                                         
            System.out.println("What would you like to order?");
            Scanner scan = new Scanner(System.in); //in case of reading input from console
            //I assume that scan will be used to get a sentance from the user
            String sentance = scan.nextLine(); // Example "I want a computer"
            String[] bits = sentance.split(" ");
            String last = bits[bits.length-1];
            if(Arrays.asList(items).contains(last))
                System.out.println("You have ordered " + last + ".");
            else
                System.out.println("Item "+ last + " was not found in our system.");
        }
}

In this case you have to be careful that "computer" will not be recognised just "Computer would". You can make the words in the array to be all lower case letters and the same with the input …

Slavi 94 Master Poster Featured Poster

Oh wow ... that was actually the problem, can't believe I didn't think of it .. just copied the file while on Linux and it works as expected, Thank you guys

Slavi 94 Master Poster Featured Poster

Okay, here is some more information on the methods I proposed but as James said the first one in there is the recommended one, the one liner still works though

Let's break this a bit ..
String last = yourSentance.substring(yourSentance.lastIndexOf(' ') + 1);

yourSentance is a string variable that you get from the user, let's make an example where:
String yourSentance = "I am a sentance";
what substring does is it cuts the string from a starting position in it until a stop position. For example if we call split with parameters 2 and 4 such as

String yourSentance = "I am a sentance";
System.out.println(yourSentance.substring(2,4));

it will print out "am" as that is on position 2 to 4 in the string yourSentance. Now the way that we have it in the example above is
substring(last occurance of space + 1) - means the first character after the last space that exists in the string sentance. Second parameter is not specified so the return gives you the rest of the string from the last occurance of last 'space' if there are multiple ones of course.

The split method is similiar. It splits the entire sentance based on a specified regex. For example our string "I am a sentance" if we use split on this with a regex that is just space such as " " then the result returned to us will be an array of strings, where the original string is cut on each occurance of …

Slavi 94 Master Poster Featured Poster

Still makes no sense to me, when executed in Linux's terminal, I don't get the print being executed, it works just fine in IDLE on windows. confused

Slavi 94 Master Poster Featured Poster

Use split on the string(with space regex), it will return an array of strings, then you can get the last item in the array will be your last word

String[] bits = yourSentance.split(" ");
String lastOne = bits[bits.length-1];

Another option could be this
String last = yourSentance.substring(yourSentance.lastIndexOf(' ') + 1);

Slavi 94 Master Poster Featured Poster

Hmm, I just ran the script on Windows instead and it works, uh ?

Slavi 94 Master Poster Featured Poster

Hey guys, I am a bit confused here ... making a script to brute force through a dictanary the password of a zip file and it seems to work fine except that it won't stop when the password is found. And when it prints the password it just prints the last one in the dictionary file

Here is my script

def attackZip(filename):

    zFile = zipfile.ZipFile(filename)
    passFile = open('dictionary.txt')

    for line in passFile.readlines():
        password = line.strip('\n')

        try:
            zFile.extractall(pwd=password)
            print '[+] Password = %s + \n' %(password) 
            exit(0)

        except Exception, e:
            pass

As an example if I have a zip with password "password" and then
dictionary file contains
monkey
123
password
321

I don't get anything printed back and if I try to return the password, it just returns the last word that was on the list '321' in the example above

Slavi 94 Master Poster Featured Poster

Didn't that make grub your MBR? as in overwrite easyBCD?

The idea I was giving was to use super grub to get into your ubuntu and once there to reinstall the grub from inside

Slavi 94 Master Poster Featured Poster

Where does it say that the checksum is mismatch? Do you calculate it yourself and compare with the one provided on the server that the iso came from?

Slavi 94 Master Poster Featured Poster
Slavi 94 Master Poster Featured Poster

Did you import it? Is PySide.py in the same directory as your main.py?

Slavi 94 Master Poster Featured Poster

The easiest is probably to use a tool called Universal USB Installer, if you are putting on a Linux distro it can download it even for you, literally do all the job. Or you could just select an iso file and it will make a bootable flash for you.

If you want to do it using Linux, then you can use the following command:
sudo dd if=/path-to-the-iso-file/filename.iso of=/dev/sdb , where /dev/sdb is the location of the flash drive, which could be different for you, so make sure to check out. Something important here is that you need to unmount the flash drive before writing to it, this could be done using the following:
sudo umount /dev/sdb

There are a couple of more ways for doing this but those 2 are the main ones I use depends whether I am using Windows or Linux to make it

Slavi 94 Master Poster Featured Poster

Get a tool called Super_Grub2(Make a bootable flash of it), using that you should be able to boot in any OS that is installed on your computer.

If the image of the operating system is fine, you will have no problems booting in any of them and once in there you can try to configure your GRUB(I didn't read all the thread so not sure what exactly your problem is but limited with time right now)

If super grub2 can't boot you in, there has to be something wrong with the OS images themselves, in which case I guess you'd have to reinstall your operating systems.

Other thing that you could do is run live Ubuntu and from there run gparted as in sudo gparted and then show us how your HDD partitions from there.

If you got any further questions please do not hesitate to get back here

Slavi 94 Master Poster Featured Poster

My home PC is using "ElementaryOS" , it is built on Ubuntu and has a desktop environment that is close to "iOS". It fits well my needs as for home OS

Slavi 94 Master Poster Featured Poster

Do you mean like this?

import time
run = input("Start? Y/N> ")
secs = 0
#if user's input starts with 'y' / 'Y' start counting
if run.upper().startswith('Y'):
    # Loop until we reach 20 minutes running
    while secs != 1200:
        print (">>>>>>>>>>>>>>>>>>>>>", secs)
        # Sleep for a second
        time.sleep(1)
        # Increment the second total
        secs += 1
Slavi 94 Master Poster Featured Poster

Quite a few, kind of depends on what you are fan of. I am running Elementary OS on my home pc mainly due to the desktop environment that it has(looks like iOS).

Also I have Kali Linux on my laptop(Mainly because it comes with a lot of pentesting tools preinstalled, as I am doing a masters in Computer security) and I was really not fan of the gnome desktop environment so the first thing I did was to change it straight away as soon as I installed it :D

As for clipboard ... I am getting into python now so I've been reading some books and I came accross one called hacking ciphers with python. The book uses pyperclip for copy/paste to/from clipboard. This is the source code from them it also should work on all operating systems as it detects which is the os it is been ran on

import platform, os

def winGetClipboard():
    ctypes.windll.user32.OpenClipboard(0)
    pcontents = ctypes.windll.user32.GetClipboardData(1) # 1 is CF_TEXT
    data = ctypes.c_char_p(pcontents).value
    #ctypes.windll.kernel32.GlobalUnlock(pcontents)
    ctypes.windll.user32.CloseClipboard()
    return data

def winSetClipboard(text):
    text = str(text)
    GMEM_DDESHARE = 0x2000
    ctypes.windll.user32.OpenClipboard(0)
    ctypes.windll.user32.EmptyClipboard()
    try:
        # works on Python 2 (bytes() only takes one argument)
        hCd = ctypes.windll.kernel32.GlobalAlloc(GMEM_DDESHARE, len(bytes(text))+1)
    except TypeError:
        # works on Python 3 (bytes() requires an encoding)
        hCd = ctypes.windll.kernel32.GlobalAlloc(GMEM_DDESHARE, len(bytes(text, 'ascii'))+1)
    pchData = ctypes.windll.kernel32.GlobalLock(hCd)
    try:
        # works on Python 2 (bytes() only takes one argument)
        ctypes.cdll.msvcrt.strcpy(ctypes.c_char_p(pchData), bytes(text))
    except TypeError:
        # works on Python 3 (bytes() requires an encoding)
        ctypes.cdll.msvcrt.strcpy(ctypes.c_char_p(pchData), bytes(text, 'ascii'))
    ctypes.windll.kernel32.GlobalUnlock(hCd)
    ctypes.windll.user32.SetClipboardData(1, hCd)
    ctypes.windll.user32.CloseClipboard()

def macSetClipboard(text):
    text = …
TrustyTony commented: Thanks for sharing! +12
Slavi 94 Master Poster Featured Poster

Since you encrypt using XOR and decrypt using XOR, wouldn't it work if you just run the same method encryptData twice? Once to encrypt it and once to decrypt it, however in the first case you use the plain text message and in the second you use the cipher text

Slavi 94 Master Poster Featured Poster

Thanks vega,
I think that time will come =)

Just as information in case someone unders what I did (On Windows Machine right now)

installed both python2 and python3, directories that they are installed in are Python27 and Python34. I added both to the "path" of my machine, and since both have python.exe and pythonw.exe the word around is to rename the one you are not using. For example if you want to use python3's python.exe, just rename python.exe in python27 to something else such as "python2.exe"

I think both IDLE's should solve it too, thank you for that, didn't think of it :)

Slavi 94 Master Poster Featured Poster

xD =)

Slavi 94 Master Poster Featured Poster

Hey guys, I have a quick question here,
I have Python 2 installed on my machine and I read a book on Python and Vega's great threads. However, my next book that I am about to read states that I need Python 3 to compile the code on their examples, I was wondering whether it is possible to have Python 2 and 3 on the same machine installed, or do I need to remove python 2 before installing 3?

Slavi 94 Master Poster Featured Poster

Merry xmas and Happy New year guyzzzz :)))

Dani commented: Thanks for starting this! +0
Slavi 94 Master Poster Featured Poster

What do you mean by "Adobe" ?

Slavi 94 Master Poster Featured Poster

Thank you

Slavi 94 Master Poster Featured Poster

Hey guys, some of you might know me from other sub sections of Dani Web. I am about (just started) to learn Python. And not just learn but possibly make it my prefered language over all. So, I've read the thread from vegaseat for beginners and it has a link to a couple of examples provided by google. This is the source code of the first one

#!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0

# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/

"""A tiny Python program to check that Python is working.
Try running this program from the command line like this:
  python hello.py
  python hello.py Alice
That should print:
  Hello World -or- Hello Alice
Try changing the 'Hello' to 'Howdy' and run again.
Once you have that working, you're ready for class -- you can edit
and run Python code; now you just need to learn Python!
"""

import sys

# Define a main() function that prints a little greeting.
def main():
  # Get the name from the command line, using 'World' as a fallback.
  if len(sys.argv) >= 2:
    name = sys.argv[1]
  else:
    name = 'World'
  print 'Hello', name

# This is the standard boilerplate that calls the main() function.
if __name__ == '__main__':
  main()

Okay, so I have a couple of questions concerning the syntax, also I noticed that this code is in Python2 while Python3 is now the standard I believe.

Anyway so …

Slavi 94 Master Poster Featured Poster

About the design? I can't afford a mac so I have elementary os on my home pc, kind of gives me the feeling of having a mac but at the same time is Linux, win win :D

Slavi 94 Master Poster Featured Poster

Your loggin would be using a java applet, when its loading you see Java in the box for a couple of seconds, and if you don't have java plugin installed on your browser it usually notifies you and won't work until you install one

Slavi 94 Master Poster Featured Poster

Welcome

Slavi 94 Master Poster Featured Poster

use a for loop,to loop through the individual numbers and make a count variable which increases each time you hit a 0

Slavi 94 Master Poster Featured Poster

At least you have something .. =)

Slavi 94 Master Poster Featured Poster

I've had similiar problems caused by gfx drivers, can you try to boot into safemode?

Slavi 94 Master Poster Featured Poster

Great answer Mike, Thank you and Gribouillis for helping me out