Skip to content

Commit

Permalink
Added a ton of print statements to make the example mission bot incre…
Browse files Browse the repository at this point in the history
…dibly verbose
  • Loading branch information
bamhm182 committed Nov 10, 2022
1 parent 18d486e commit 264f06e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Binary file removed docs/src/usage/examples/.mission-templates.md.swp
Binary file not shown.
13 changes: 11 additions & 2 deletions docs/src/usage/examples/mission-bot.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,28 @@ All plugins are a part of the handler, which allows us to use `h.missions.get_co
import time
import synack

h = synack.Handler()
h = synack.Handler(login=True)
print("I just logged in and if it was the first time I logged in, I successfully filled out my credentials!")

known_missions = 0
print("Since I just started looking, I don't know about any missions!")

while True:
print("I had better sleep for a while so that I don't blow up the API, get everyone mad at me, and get myself banned!")
time.sleep(30)
curr_missions = h.missions.get_count()
print(f"There are {curr_missions} missions")
if curr_missions and curr_missions > known_missions:
print("There are new missions I didn't know about!")
known_missions = curr_missions
missions = h.missions.get_available()
print(f"I grabbed a list of {len(missions)} missions!")
for m in missions:
print("I had better sleep for a while so that I don't blow up the API, get everyone mad at me, and get myself banned!")
time.sleep(1)
h.missions.set_claimed(m)
outcome = h.missions.set_claimed(m)
print(f"I tried to claim a mission. You can see the outcome here: {outcome}")
elif curr_missions == 0:
print("There are currently no missions, I'd better remember that!")
known_missions = 0
```
2 changes: 1 addition & 1 deletion docs/src/usage/examples/mission-templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ It is important to understand the file structure of your mission templates.
The default location for templates is `~/Templates`, but this could be overridden by setting `template_dir` in the [State](../main-components/state.md).

Each mission from the Synack API has a couple of attributes I use to build the file structure.
There is the `taskType` (`MISSION`, `SV2M`, etc), the `asset`/`assetTypes` (`host', 'web', 'ios', 'android', etc.), and the `title` (Name of the mission).
There is the `taskType` (`MISSION`, `SV2M`, etc), the `asset`/`assetTypes` ('host', 'web', 'ios', 'android', etc.), and the `title` (Name of the mission).
Each of these attributes are run thorough `templates.build_safe_name()`, which makes everything lowercase and removes special characters to make sure there are no issuer with the name of the file.

As an example, the following mission will turn into the following filepath:
Expand Down

0 comments on commit 264f06e

Please sign in to comment.