Advertisment


Author Topic: Simple Port scanner using the cmd prompt  (Read 16622 times)

0 Members and 1 Guest are viewing this topic.

Offline co|d3c|0ok

  • Newbie
  • *
  • Posts: 30
  • Reputation 55
    • View Profile
Simple Port scanner using the cmd prompt
« on: April 03, 2009, 02:51:09 pm »
this cmd  will keep looping starting on port 1 - port 10 on ip 127.0.0.1 until it finds an open port

for /l %a in (1,1,10) do @(telnet 127.0.0.1: %a)


where it says 127.0.0.1 replace the victum ip.

in (1,1,10)
the first 1 is what port you want to start scanning at
the second one is how many times you want to increment each port so i put 1 so the next port it scans would be 2 etc.
the 10 is what port you want to scan up to.

so in this case this scans ports 1-10 on the ip 127.0.0.1 for an open connection.

stay tuned for more handy tricks in the cmd prompt

Online Celestialkey

  • Administrator
  • Hero Member
  • *
  • Posts: 3953
  • Reputation 4874
  • Gender: Male
  • Its Alive!!
    • View Profile
    • www.CelestialCoding.com
Re: Simple Port scanner using the cmd prompt
« Reply #1 on: April 03, 2009, 11:18:21 pm »
A trick... yes, I guess so. But this is a pretty slow method to use. Emergency use I guess.
Normal port scanners work by trying to connect a socket to the port and if it failed, the socket is closed. Telnet does the same, but it retries a few times, so it takes a bit longer.

Nice post though.
Created By: Eczuo
Quote
I have noticed that people who claim that everything is predestined, and we can do nothing to change it, look both ways before they cross the road.
Quote
I'd prefer to die standing, than to live on my knees - Che Guevara
Quote
If you change the way you look at something, does that something change in any way?
- Quantum Theory

Hacking
Quote
Never in the field of human conflict was so much owed by so many to so few. - Winston Churchill


Quote from: Revelations 12:4
And his tail drew the third part of the stars of heaven, and did cast them into the earth; and the dragon stood before the woman which was ready to be delivered, for to devour her child as soon as it was born.

Quote
It takes skill to build an empire. It takes an idiot to maintain it.

Offline Nathan

  • Administrator
  • Hero Member
  • *
  • Posts: 1423
  • Reputation 1768
  • Gender: Male
  • woof woof
    • View Profile
Re: Simple Port scanner using the cmd prompt
« Reply #2 on: April 04, 2009, 08:44:30 am »
A trick... yes, I guess so. But this is a pretty slow method to use. Emergency use I guess.
Normal port scanners work by trying to connect a socket to the port and if it failed, the socket is closed. Telnet does the same, but it retries a few times, so it takes a bit longer.

Nice post though.
Also most port scanners are multi-threaded which makes them a lot faster to scan.
Projects:
[ Axios Engine ]
Compilers: Microsoft Visual Studio 2008, GNU C++, FASM, MASM, VB 6/.Net.
Languages: C++, PHP, ASM, JS, VB6/.Net, BASIC, HTML, MySQL
Please buy me some books: Amazon Wishlist

Online Celestialkey

  • Administrator
  • Hero Member
  • *
  • Posts: 3953
  • Reputation 4874
  • Gender: Male
  • Its Alive!!
    • View Profile
    • www.CelestialCoding.com
Re: Simple Port scanner using the cmd prompt
« Reply #3 on: April 04, 2009, 09:30:23 am »
That too.
Created By: Eczuo
Quote
I have noticed that people who claim that everything is predestined, and we can do nothing to change it, look both ways before they cross the road.
Quote
I'd prefer to die standing, than to live on my knees - Che Guevara
Quote
If you change the way you look at something, does that something change in any way?
- Quantum Theory

Hacking
Quote
Never in the field of human conflict was so much owed by so many to so few. - Winston Churchill


Quote from: Revelations 12:4
And his tail drew the third part of the stars of heaven, and did cast them into the earth; and the dragon stood before the woman which was ready to be delivered, for to devour her child as soon as it was born.

Quote
It takes skill to build an empire. It takes an idiot to maintain it.

Offline co|d3c|0ok

  • Newbie
  • *
  • Posts: 30
  • Reputation 55
    • View Profile
Re: Simple Port scanner using the cmd prompt
« Reply #4 on: April 04, 2009, 12:04:12 pm »
There is a better way of doing it in cmd; I'll figure it out and post it. But this method is or tested by most security penetration experts; because it doesn't require tools; and most employees at an office job have access to cmd prompt. This same method can also be used in hacking an ftp user name and pass. by using a nested loop and reading from 2 dictionary files. Or can be used to hack a shared drive.  Definitely not the best way to do it I agree; but you'd be surprised how much an employee would go through to find a connection;  most regular employees have access to cmd at work; but are proxied and can;'t download things or have internet access.
« Last Edit: April 04, 2009, 12:06:51 pm by co|d3c|0ok »

Offline Dawood

  • Jr. Member
  • **
  • Posts: 80
  • Reputation 102
  • Gender: Male
    • View Profile
Re: Simple Port scanner using the cmd prompt
« Reply #5 on: April 06, 2009, 01:55:05 pm »
Man this is too old i got ""tricks"" better than this and softwares too i just need sometime to post them coz i got exams now :D
""" I Am The Lie Living For You So You Can Hide """

Offline co|d3c|0ok

  • Newbie
  • *
  • Posts: 30
  • Reputation 55
    • View Profile
Re: Simple Port scanner using the cmd prompt
« Reply #6 on: April 22, 2009, 09:11:50 pm »
lol i have a bachelor in CIS and run a hacking forum http://hackerdox.org an affiliate of milw0rm. You think I don't know of better ways? I know there is better tools like backtrack3 metasploit and others. Far as port scanning NMAP is one of the best.
« Last Edit: April 22, 2009, 09:14:21 pm by co|d3c|0ok »

Online Celestialkey

  • Administrator
  • Hero Member
  • *
  • Posts: 3953
  • Reputation 4874
  • Gender: Male
  • Its Alive!!
    • View Profile
    • www.CelestialCoding.com
Re: Simple Port scanner using the cmd prompt
« Reply #7 on: April 23, 2009, 06:33:01 am »
Interesting site you have there. And Dawood, even if it is old, it is a method you can use if you have no software or are stuck in a situation where you cant use external software.
Created By: Eczuo
Quote
I have noticed that people who claim that everything is predestined, and we can do nothing to change it, look both ways before they cross the road.
Quote
I'd prefer to die standing, than to live on my knees - Che Guevara
Quote
If you change the way you look at something, does that something change in any way?
- Quantum Theory

Hacking
Quote
Never in the field of human conflict was so much owed by so many to so few. - Winston Churchill


Quote from: Revelations 12:4
And his tail drew the third part of the stars of heaven, and did cast them into the earth; and the dragon stood before the woman which was ready to be delivered, for to devour her child as soon as it was born.

Quote
It takes skill to build an empire. It takes an idiot to maintain it.

Offline Nathan

  • Administrator
  • Hero Member
  • *
  • Posts: 1423
  • Reputation 1768
  • Gender: Male
  • woof woof
    • View Profile
Re: Simple Port scanner using the cmd prompt
« Reply #8 on: April 23, 2009, 07:28:43 am »
lol i have a bachelor in CIS
Lets not start coughing out credentials ;). I once talked to a "A+ Certified" CSR at AT&T awhile back and said that VPN uses SMS.

and run a hacking forum http://hackerdox.org an affiliate of milw0rm. You think I don't know of better ways? I know there is better tools like backtrack3 metasploit and others.
No offense, yours is more considered a fan site than anything. It's not even close to complete. You only have one page + a forum so don't get too excited now :).

Far as port scanning NMAP is one of the best.
I agree, but it is also considered to be the nosiest.
Projects:
[ Axios Engine ]
Compilers: Microsoft Visual Studio 2008, GNU C++, FASM, MASM, VB 6/.Net.
Languages: C++, PHP, ASM, JS, VB6/.Net, BASIC, HTML, MySQL
Please buy me some books: Amazon Wishlist

Offline co|d3c|0ok

  • Newbie
  • *
  • Posts: 30
  • Reputation 55
    • View Profile
Re: Simple Port scanner using the cmd prompt
« Reply #9 on: April 23, 2009, 10:28:34 am »
Give me a break my site started 3 weeks ago. Also yes you are right on the NMAP it is too noisy if you're scanning a bunch of ports at once. But if you paramarterize the query(narrow it) it's not as bad. Um... yea and you're right on the throwing the credentials out. It's just sometimes people piss me off. I just started python and programmed a port scanner in it as my first program using the same method(in a sense) takes about 20 seconds to scan about 6000 ports. So might check that out.



Online Celestialkey

  • Administrator
  • Hero Member
  • *
  • Posts: 3953
  • Reputation 4874
  • Gender: Male
  • Its Alive!!
    • View Profile
    • www.CelestialCoding.com
Re: Simple Port scanner using the cmd prompt
« Reply #10 on: April 23, 2009, 12:09:17 pm »
Lol.. A++ certification is easy to get. IT just means you know basic hardware and software repair.
Hell, I'M A++ certified. (Literally, I have the freaking card as well lulz.)
Also, after looking at your site, I liked it, but when you look at the material in the forums, there really is not much to offer yet. But it is still going at a steady pace it seemed. I did not check the last post data, but it seemed active, there was 2 other on it besides me this morning. As for the port scanner, I don't use others, so I had not a clue what NMAP was until it was just mentioned, and did you mean 'nosiest' or 'noisiest', if it meant nosiest, then I think your talking about it being easily detected? And by noisiest, do you mean excess data is being gathered?

Either way, the method for the batch file still works no matter what is said when all is said and done. You can not complain about a working non-blocked method to use when you have nothing else on you and need it.
Created By: Eczuo
Quote
I have noticed that people who claim that everything is predestined, and we can do nothing to change it, look both ways before they cross the road.
Quote
I'd prefer to die standing, than to live on my knees - Che Guevara
Quote
If you change the way you look at something, does that something change in any way?
- Quantum Theory

Hacking
Quote
Never in the field of human conflict was so much owed by so many to so few. - Winston Churchill


Quote from: Revelations 12:4
And his tail drew the third part of the stars of heaven, and did cast them into the earth; and the dragon stood before the woman which was ready to be delivered, for to devour her child as soon as it was born.

Quote
It takes skill to build an empire. It takes an idiot to maintain it.

Offline Nathan

  • Administrator
  • Hero Member
  • *
  • Posts: 1423
  • Reputation 1768
  • Gender: Male
  • woof woof
    • View Profile
Re: Simple Port scanner using the cmd prompt
« Reply #11 on: April 23, 2009, 05:13:37 pm »
Lol.. A++ certification is easy to get. IT just means you know basic hardware and software repair.
Hell, I'M A++ certified. (Literally, I have the freaking card as well lulz.)
Also, after looking at your site, I liked it, but when you look at the material in the forums, there really is not much to offer yet. But it is still going at a steady pace it seemed. I did not check the last post data, but it seemed active, there was 2 other on it besides me this morning. As for the port scanner, I don't use others, so I had not a clue what NMAP was until it was just mentioned, and did you mean 'nosiest' or 'noisiest', if it meant nosiest, then I think your talking about it being easily detected? And by noisiest, do you mean excess data is being gathered?

Either way, the method for the batch file still works no matter what is said when all is said and done. You can not complain about a working non-blocked method to use when you have nothing else on you and need it.
I was refering to that it generates a lot of traffic aka noisy.
Projects:
[ Axios Engine ]
Compilers: Microsoft Visual Studio 2008, GNU C++, FASM, MASM, VB 6/.Net.
Languages: C++, PHP, ASM, JS, VB6/.Net, BASIC, HTML, MySQL
Please buy me some books: Amazon Wishlist

Online Celestialkey

  • Administrator
  • Hero Member
  • *
  • Posts: 3953
  • Reputation 4874
  • Gender: Male
  • Its Alive!!
    • View Profile
    • www.CelestialCoding.com
Re: Simple Port scanner using the cmd prompt
« Reply #12 on: April 23, 2009, 06:26:45 pm »
Ah, okay.
Created By: Eczuo
Quote
I have noticed that people who claim that everything is predestined, and we can do nothing to change it, look both ways before they cross the road.
Quote
I'd prefer to die standing, than to live on my knees - Che Guevara
Quote
If you change the way you look at something, does that something change in any way?
- Quantum Theory

Hacking
Quote
Never in the field of human conflict was so much owed by so many to so few. - Winston Churchill


Quote from: Revelations 12:4
And his tail drew the third part of the stars of heaven, and did cast them into the earth; and the dragon stood before the woman which was ready to be delivered, for to devour her child as soon as it was born.

Quote
It takes skill to build an empire. It takes an idiot to maintain it.