Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - MadJ0ker

Pages: [1]
1
Scripting Languages / [Python] Prime Numbers Script
« on: December 31, 2014, 02:23:19 am »
Hello :)

I was starting to code again in python so to practice my skills I was solving some of the problems of SPOJ.
I'd like to hear your opinion about this code. I know python has some libraries to do this faster and easier, but the point was to practice, so I just used built-in stuff.

What this piece of code does is asking user for t lines. Each t line has m and n (separated by space). Then it outputs the prime numbers between m and n. There's some limitations on m and n tho'.

Any kind of suggestions, tips, recommendations are welcome!
Thank you in advance.
Code: [Select]
#Asks for t
while True:
    t = int(raw_input("Input number of lines: "))
    if t > 10 or t <= 0:
        print "This value can't be greater than ten, equal or less than zero!"
    else:
        break

#Ask for m and n
lines = []
count = 0
while count < t:
    for i in range(1, (t + 1)):
        line = raw_input("Input m y n: ")
        line = line.split()
        line = [int(i) for i in line]             
        m, n = line[0], line[1]
        if (m >= 1) and (n <= 1000000000):
            if (n - m <= 100000) and (m < n):
                lines.append(line)
                count += 1
            else:
                print "Invalid values"
        else:
            print "Invalid values"

#Gets lists to iterate next
num_ran = []
for i in lines:
    r = range(i[0], (i[1] + 1))
    num_ran.append(r)

#Search the prime numbers
for i in range(0, len(num_ran)):
    for j in num_ran[i][:]:
        if j == 1 or j == 4:
            num_ran[i].remove(j)
        for k in range(2, (j/2)):
            if j%k == 0:
                num_ran[i].remove(j)
                break

#Just a little bit of decent output
c = 0
for i in lines:
    print "Prime numbers between %s and %s are:"%(i[0], i[1])
    print num_ran[c]
    c = c + 1
raw_input()


2
Hacking and Security / Re: Router Cracking
« on: December 24, 2014, 01:41:35 am »
@madf0x: Your argumentation is so poor, that I won't reply you in any way. All of my replies have been respectful, as well as @gray-fox's, because unlike you, I think courtesy is important in any human interaction. Good for you if you're a badass that respect no one. That's all I have to say to someone who expresses like you.

@gray-fox: It's not my fault, again, if you can't catch my figures of speech. But as you say, it's not the place to discuss about it. What OP does after he reach his goals is his problem, not ours. Maybe he just want to break the security just for the challenge, maybe he wants to try some of the attacks that you mentioned, but he's not asking for that. Clearly I'm limiting my reply to what OP asked.
I don't have any interest in becoming admin. and no, you didn't do anything else than sharing your opinions. As well as I did.
Good luck.

3
Hacking and Security / Re: Router Cracking
« on: December 23, 2014, 10:42:03 pm »
Okay, i just answered because you asked what op mean exactly and i thought it was kind of obvious, even tho he didn't use the right words.
It is called a rethorical question.

Yes you are right, knowledge of internet protocol suite doesn't directly has anything to do with wireless cracking and nobody really didn't event said so.
Well, you said:
But for OP,just do what syntax990 said and learn about basic networking and stuff..
The very basic of networking includes TCP/IP.

But, let me ask it this way, what is use for someone intrested in computing/hacking to know how to crack wireless network if you don't even have basic knowledge (for example) about tcp/ip model?
Also networking isn't so directly only about internet protocol suit. For example if you build LAN which includes wirelles AP, configuring it's authentication and other stuff also drops under the concept of networking. So the point was to learn how things work before starting to crack stuff.
So, why didn't you tell him to study databases? or, going to an extreme, wave physics? because all of that topics are some of the basis of "how things works" (this was another example of a rethorical question). Despite we are agree in that those topics are about "computing/hacking", they're not relevant in this question. I'm totally agree with you, @gray-fox, that @itIsMe needs to know how things work before even trying to crack them, and that's why my advice was "study crypto", because in my opinion that's one of the most relevant topics if you want to attack a wireless network.

Finally excuse me, but I don't need you to clarify me what's networking about, for some reason I'm a networking professional. This is a forum, you share your opinion, I'm not agree with it, I explain why and share mine, both being respectful. It's just how forums works.

4
Hacking and Security / Re: Router Cracking
« on: December 23, 2014, 07:42:32 pm »
That's exactly what I wanted to point out. Saying "cracking a router" is not the same as cracking a network. Things must be called by their correct names.

But for OP,just do what syntax990 said and learn about basic networking and stuff..
Despite basic networking is important, for cracking a wireless network is not relevant. What's the use of knowing the OSI and TCP/IP models on cracking a wireless network? what's the use of knowing about Layer 4 multiplexing, or Layer 2 framing, or IP Subnetting on cracking a wireless network? Nothing. And all of that topics are basic networking. Other thing is if we talk about attacks to IP Networks.
My advice is, read about crypto.

5
Hacking and Security / Re: Router Cracking
« on: December 23, 2014, 04:30:57 pm »
What you mean exactly?
Because if what you want to do is to crack the admin password to get access to the router configuration, networking knowledge won't help you a lot. Why? because cracking a router doesn't have nothing to do with packets, hand-shakes, routing protocols, etc. Cracking a router IS NOT related with networking.
In the other hand, if what you want is crack a NETWORK offered by that router you can play with, then some basic networking concepts are needed. For what you said, it seems it's a Wireless Network, so the specific thing you have to study is Wireless security (WEP, WPA, TKIP, PSK, AES, maybe RADIUS), and that's not precisely networking but crypto.

Good luck.

Pages: [1]