Attacking
From Hack Wars Wiki
Contents |
[edit] Introduction
One of your main Hack Wars skills is Attacking. Attacks can be performed on other players or NPCs. To use the Attack function, first do a Port Scan on an IP address to determine which ports your victim is using. The Port Scan window allows you to start an Attack directly after a scan. In order to perform an attack, you must have an attack application installed on one of your ports, which you do through your Port Manager. A basic Attack script can be found in the Game Store.
[edit] Gaining Experience
Each time you attack an opponent, you receive Attack experience. You gain attack experience equal to your base damage (including card effects) every attack turn.
[edit] Successfully Attacking an Opponent's Port
When an Attack is finalized, you may choose to install a malicious script on your opponent’s system, or choose one of the options that come up depending on what type of port you’ve attacked. No matter what kind of port you attack, there are always two options:
- Peek At Code - This allows you to see the code of the application running on the port you hacked.(Not working on HTTP ports or any NPC ports by design)
- Peek At Logs - This allows you to see the Log File of the player you just hacked.
In addition to these choices, depending on what port you have attacked, you will have another choice:
- FTP: Steal a file.
- HTTP: Change Daily Pay.
- Bank: Empty Petty Cash.
[edit] Multiple Attacks
HackWars allows you (with a good CPU) to perform multiple attacks at the same time by using multiple attack programs (that are installed on multiple ports, as you can only install one application per port).
[edit] Attack Window Interface
Bank Script:
Indicates the compiled bank script that you wish to install when the installScript() function is called upon an attack finalizing. This is only applicable if the attack is targeting a port with a banking program installed.
Attack Script:
Indicates the compiled attacking script that you wish to install when the installScript() function is called upon an attack finalizing. This is only applicable if the attack is targeting a port with an attacking program installed.
FTP Script:
Indicates the compiled FTP script that you wish to install when the installScript() function is called when an attack finalizes. This is only applicable if the attack is targeting a port with an FTP program installed.
Secondary Ports:
Advanced attacking programs can use switchAttack() to cycle through a list of alternate ports to target with the attack. This list of alternate ports is specified here.
Petty Cash Target:
Attacking scripts can check the value provided here and use it to come to a logical decision as to what should be done when an attack is finalized (that is, when it successfully gets the opponent’s port down to 0 health).
Once you have filled out the applicable parameters, click on attack to begin the attack. Information about the attack’s progression will show up in the terminal. You can note that as damage is dealt, you will gain attacking experience. As your attack level increases, you will progressively do more damage and unlock powerful new API functions.
[edit] Finding Opponents
In Hack Wars you can attack NPCs and other players to gain attack experience and items. You can find NPCs and other players using the in-game search engine Applications -> Web Browser. You can find opponents to attack through various other means:
- the high-scores
- logging them using your watch scripts
- viewing other people's logs when you successfully attack them
The websites of NPCs in the game consist of public domain novels. The easiest target are the Script Kiddies which consist of several IPs, their IP range starting at 900.800.6.001 and end at 900.800.6.029
Tip: Try searching for frequently used words in the search engine to hunt down computers to hack, e.g., agency, store, Toto.
[edit] Scanning
Prior to attacking an opponent, it’s a good idea to scan them to find out what applications they have installed on which ports, and what firewall they are running on those ports. Scanning an opponent costs $10.
[edit] Overheating
If you are attacking an opponent, and they attack the port you're attacking them with, then it's possible for your computer to overheat.
[edit] Anatomy of an Attack Script
Programs in HackWars are based around entry-points. When an event fires to trigger one of these entry-points, the code in your program executes. All programs work in the same way, regardless of whether they’re purchased from the store, dropped by an NPC or bought from another player. Attack has three of these entry-points, each one serving a unique purpose:
Initialize: The code in initialize runs when an attack is first starting. This is a good place to cancel an attack before it really even begins. It is also where you provide malicious hooks into a program for Trojan virus applications that use functions like zombie. What follows is some sample code that you might put into initialize to make sure you do not attack one of your friends:
string friend="192.168.2.002"; if(equal(getTargetIP(),friend)){ cancelAttack(); } |
continue: Each time that an attack is about to perform its next round of damage on an opponent, continue is called. This is a good place to to come to a decision as to whether or not an attack should be canceled. The following sample code demonstrates how to cancel an attack if it is taking too long to finish:
int max_iterations=15; if(getIterations()>max_iterations){ cancelAttack(); } |
finalize: Finalize is called when the health of the port you were attacking has been brought down to 0. You can only perform one finalize function in finalize, a list of which follows (you can combine these with functions that do not finalize, such as message):
showChoices(): Displays a dialog on your desktop allowing you to perform a malicious operation on the port that has been weakened. The options available depend on the type of port that was attacked, and include: stealing petty cash, taking over a player’s website, stealing a file, and peeking at code.
installScript(): Allows you to install your own malicious application over top of an opponent’s existing application. The program you wish to install is provided as a parameter before beginning the attack. These parameters will be discussed in detail in the next section.
emptyPettyCash(): Empties an opponent’s petty cash into your petty cash.
deleteLogs(): Deletes all log entries caused by your IP in the opponent’s log.
destroyWatches(): Destroys all the watches attached to the opponent’s port you are attacking.
What follows is some sample code for finalize that either shows choices or steals petty cash, depending on how much money is present in your opponent’s petty cash:
float steal_amount=1000.0; if(checkPettyCash()>=steal_amount){ emptyPettyCash(); }else{ showChoices(); } |
[edit] Parameters
There are several settings that you can set before an attack begins. These determine what gets installed as a result of installScript() and provide settings that can be fetched from within an application. Whether the specific parameters are used depends on the functions called in your Attack script, e.g., installScript() must be called, and on the type of port you are attacking—if your opponent’s port is a Bank port, the Bank script you indicate will be used.
[edit] Settings When Choosing Script
Malicious IP: This value can be fetched from within a program using the function getMaliciousIP() and can be used to set an IP for purchased programs and programs dropped by NPCs.
Petty Cash Target: This value can be fetched from within a program using the value checkPettyCashTarget(). This allows you to change the behavior of a script at runtime.
[edit] Special Attack Functions
[edit] Berserk
berserk() is a method that you can use in continue to deal double damage. On the downside, berserk deals damage to you. If used creatively, berserk can be very powerful. The following code demonstrates berserk in use:
float percent_used=getCPULoad()/getMaximumCPULoad(); if(percent<0.95){ berserk(); } |
[edit] Zombies
Zombies are a very important/useful part of HackWars. To acquire a zombie, you need to install a zombie script over another player's attack application (using an attack application that installs scripts). Once you have done this, you can remotely launch attacks from the zombied attack application.
The function zombie() can be compiled into the initialize entry-point of an attack program. The IP indicates a player who is allowed to remotely take control of an attack program. If an application using zombie(ip) is installed over top of an opponent’s attack application, you can use that player to perform attacks on your behalf. An example of a zombie application follows:
In Initialize:
zombie(getMaliciousIP()); |
This allows the individual indicated by the malicious IP to hook into this player’s attack port.
In Finalize:
if(isZombie()){ emptyPettyCash(); }else{ showChoices(); } |
You can use isZombie() to determine whether the attack currently taking place is a malicious zombie attack. In this way you can provide different functionality when an opponent uses their port than when you maliciously take it over.
[edit] Freeze
freeze() can be used to temporarily disable an opponent's ports.
