CMD Batch: Get Time
Posted 05 October 2011 - 10:06 PM
I need to get the correct date from Internet (only the current day, month and year, not hours, minutes and seconds) Here there is a working AutoIt script, but i need to do it with a CMD batch...
Posted 05 October 2011 - 11:16 PM
Posted 06 October 2011 - 12:37 AM
Also i don't understand at all why you'd want to get the date from internet (and if it's for a software protection of some kind, this won't be reliable at all as everyone can just add nist.time.gov in their hosts file and create a fake web page with any date) and making it in batch would only make it weaker.
Posted 06 October 2011 - 05:27 AM
(already invented wheel)
Or check the use of W32TM.EXE....
Also, it depends on the accuracy you need/want, since you want "day" resolution you can use also httpget.:
or curl or wget and download a page such as:
and parse it
Posted 06 October 2011 - 08:48 AM
If your "software" (or it's protection method) is written in batch (or any plain text, interpreted language) a five years old, blind-folded and with BOTH arms tied behind his/her back can crack it faster than you can say "Jack":
(or "mango" for that matters), let alone "Jack Robinson":
Posted 06 October 2011 - 11:53 AM
Any ideas (not sarcastic)?
Posted 06 October 2011 - 12:05 PM
Yet, there's insight hiding in there. A protection written in batch will only get in the way of complete n00bs.
I might be repeating myself here, but I'd start by not using batch files. Then again it's very easy recreating whatever a batch file can accomplish from scratch (in a few minutes) so I wouldn't worry so much about protecting it in the first place. Your call...
Posted 06 October 2011 - 12:47 PM
Now, the following are facts:
- there is NO "UNcrackable" software protection based on software
- there is NOT EVEN ANY "UNcrackable" software protection based on hardware
- having the app checking from a batch (or any plain-text interpreted language) a date on the internet is VERY EASILY crackable
- having the app sending a "challenge code" (encrypted) to a given site in order to receive an (encrypted) "authentication code" might seem a better idea, but it is NOT (generally speaking) a very good idea
 It all depends on how valuable is your software and the amount of time and resources one is willing to dedicate to it's cracking. (ANYTHING created by man can be re-created by another man)
 Say that you have a (temporary) failure (of *any* kind) of your server, guess WHICH software your customers will decide to throw in the dumpbin as soon as they find out that the software they bought isn't working when they need it? Are you prepared to deal with a few tens/hundreds/thousands/zillions angry customers?
Of course if you don't care about your customers' satisfaction with your software, go ahead with your "server" approach.
There are companies that make money by selling to other developers a protection tool, software, or hardware, or Internet based (which BTW is regularly cracked, sooner or later, at each release), do you really think you can do something better than that? (and with batch files? )
BTW, if you think so, you are wrong , by definition of CATCH22:
- If you know how to create a safe protection, you don't ask for help on a forum about it..
- If you ask for help on a forum about it you don't know how to create it.
MInd you I am not trying to put you down or anything like that , I am simply trying to help you being in contact with reality.
Posted 06 October 2011 - 01:46 PM
Posted 06 October 2011 - 02:59 PM
- you setup a secured/hardened server
- configure your application on this server with any protection or a minimal one (like checking the partition signature).
- allow users with very restricted rights to access and run your application on the server.
The worst case could be that someone find a way to hack your server.
Posted 07 October 2011 - 04:36 PM
You mean, totally without knowing what you're trying to do or for what purpose, your skill level (with computers in general, or at scripting/programming) , languages you might know, your preferences, what resources (time, money or otherwise) are available, who the end user is, what platform(s) it should run onto, performance goals you might have, what support you may need, features you require, etc?
I might as well recommend a banana then. That's the thing with guessing based on no information whatsoever. The results tend to suck.
It's a bit like asking "pick a vehicle for me", without knowing if it needs to fly, float, carry cargo, budget limits or anything like that. You need a bit of infos first, before you can actually make any sensible recommendations.
Not even knowing what kind of thing it's meant to protect I'm not sure you're not totally wasting your time in the first place. It could be something as trivial as this for all we know, which TONS of people could easily write from scratch in a variety of languages in less than 5 minutes anyway (or perhaps find other tools that do the same thing but without restrictions). There's no point in even wasting time protecting something simple like that. Then again, I have absolutely no idea what you're working onto here so I might be completely off.
Posted 08 October 2011 - 07:15 AM
net time /setsntp:pool.ntp.org
or W32TM as was mentioned in an earlier thread here. Either will work just make sure your firewall is set to allow UDP traffic port 123.
- ← [VBS] Shell.run running too many times
- Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
- vbScript or batch script to find AD groups with two members or less →