forked from pry0cc/axiom
-
Notifications
You must be signed in to change notification settings - Fork 22
/
axiom-scan
executable file
·1617 lines (1467 loc) · 71.9 KB
/
axiom-scan
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/bash
###########################################################################################################
# Header
#
AXIOM_PATH="$HOME/.axiom"
source "$AXIOM_PATH/interact/includes/vars.sh"
source "$AXIOM_PATH/interact/includes/functions.sh"
source "$AXIOM_PATH/interact/includes/system-notification.sh"
begin=$(date +%s)
start="$(pwd)"
BASEOS="$(uname)"
case $BASEOS in
'Darwin')
PATH="$(brew --prefix coreutils)/libexec/gnubin:$(brew --prefix gnu-sed)/libexec/gnubin:$PATH"
;;
*) ;;
esac
###########################################################################################################
# formatSeconds Function
#
function formatSeconds (){
declare format='%02dh:%02dm:%02ds' # time format hh:mm:sshconfig
declare timepassed=$1
declare seconds minutes hours
((seconds=timepassed%60))
((minutes=timepassed/60))
((hours=minutes/60))
((minutes=minutes%60))
printf "$format" $hours $minutes $seconds
}
###########################################################################################################
# List path of all axiom modules and their commands axiom-scan --list
#
function list_modules() {
echo -e "${BGreen}Printing available modules from ~/.axiom/modules${Color_Off}"
# header
printf "${BWhite}%-23s %-8s %s${Color_Off}\n" "MODULE" "EXT" "COMMAND"
echo "-----------------------------------------------------------------------------------------------------"
# format module list
find "$AXIOM_PATH/modules" -name '*.json' | sort | while read -r module_file; do
module_name=$(basename "$module_file" .json)
# truncate module_name if it's longer than 30 characters
if [[ ${#module_name} -gt 23 ]]; then
module_name="${module_name:0:20}..." # Keep the first X characters, then add "..."
fi
# loop through each command and extension
jq -c '.[]' "$module_file" | while read -r module_info; do
command=$(echo "$module_info" | jq -r '.command')
ext=$(echo "$module_info" | jq -r '.ext')
# set default extension to 'dir' if it's blank
[ -z "$ext" ] && ext="dir"
# check if the command contains '_target_' or '_safe-target_' to mark it as one-shot
if [[ "$command" == *"_target_"* || "$command" == *"_safe-target_"* ]]; then
one_shot="${BRed} (One-Shot)${Color_Off}"
else
one_shot=""
fi
# Print the list
printf "${BYellow}%-23s ${BCyan}%-8s ${BWhite}%s${one_shot}${Color_Off}\n" "$module_name" "$ext" "$command"
done
done
}
###########################################################################################################
# Parsing the modules with jq
#
function parse_module() {
module="$1"
ext="$2"
if [[ -f "$AXIOM_PATH/modules/$module.json" ]]; then
if [[ "$ext" != "" ]]; then
if [[ "$ext" == "dir" ]]; then
cat "$AXIOM_PATH/modules/$module.json" | jq -r '(.[] | select(.ext=="'$ext'")) // (.[] | select(.ext==""))'
else
cat "$AXIOM_PATH/modules/$module.json" | jq -r ".[] | select(.ext==\"$ext\")"
fi
else
cat "$AXIOM_PATH/modules/$module.json" | jq -r ".[0]"
fi
else
echo -e "${BRed}Module '$module' does not exist...${Color_Off}"
list_modules
fi
}
###########################################################################################################
# Help Menu:
# add --rm-duplicates ( remove duplicates from target list, sort -u equivalent )
# add option to supply different SSH key
#
function help(){
cat << EOF
axiom-scan provides easy distribution of arbitrary binaries and scripts.
axiom-scan optionally splits user-provided input files (target lists), and wordlists and uploads them to a unique scan working directory on the remote instance.
axiom-scan combines user-provided command-line arguments with commands in the module (~/.axiom/modules) and executes the final command on the remote instance.
axiom-scan downloads and merges scan output in a variety of different formats, specified by the extension in the module (dir, txt, oG, csv, xml, jsonl, none).
individual scanning operations are executed from a detacted tmux session (\$module+\$timestamp) inside a unique scan working directory (/home/op/scan/\$module+\$timestamp) on the remote instances.
Usage:
axiom-scan inputfile.txt -m ffuf -w /home/op/wordlist-on-remote-instance
axiom-scan inputfile.txt -m ffuf -wL /home/localuser/local-wordlist-to-upload
axiom-scan inputfile.txt -m ffuf -wD /home/localuser/local-wordlist-to-split-and-upload
axiom-scan inputfile.txt -m nuclei --remote-folder /home/op/nuclei-templates-on-remote-instances -o outputfile.txt
axiom-scan inputfile.txt -m nuclei --local-folder /home/localuser/local-custom-nuclei-template-folder-to-upload/ -o outputfile.txt
axiom-scan inputfile.txt -m nuclei --local-config /home/localuser/local-custom-nuclei-config-file-to-upload.yaml -o outputfile.txt --anew
axiom-scan inputfile.txt -m gowitness -oD screenshots-folder --spinup 10
axiom-scan inputfile.txt -m nmapx -p- -sV -T4 -v --open -oA nampx-scan --spinup 100 --rm-when-done --regions dal13,lon06,fra05,sjc04
Flags:
INPUT:
string[] required positional first argument must always be an input file, this can be a list of URLs, IPs, hostnames, etc
--dont-shuffle do not randomize input file before uploading (default is to randomize)
--dont-split do not split input file, upload entire input file to every instance (default is to split the input file)
--expand-cidr automatically expand any subnet in the input file (default does not expand subnets)
MODULE:
-m string[] the axiom-scan module to use with the scan (must be a JSON file in ~/.axiom/modules)
--list print all available modules located in ~/.axiom/modules
WORDLIST:
-w string[] replace _wordlist_ in module with user-provided wordlist (must be a path to a remote wordlist)
-wD,--distribute-wordlist string[] replace _wordlist_ in module with user-provided local wordlist to split and upload (default does not split the wordlist)
-wL,--local-wordlist string[] replace _wordlist_ in module with user-provided local wordlist (must be a path to a local wordlist)
FOLDER:
--remote-folder string[] replace _folder_ in module with user-provided remote folder (must be a path to a remote folder)
--local-folder string[] replace _folder_ in module with user-provided local folder to upload (must be a path to a local folder)
CONFIGURATIONS:
--remote-config string[] replace _config_ in module with user-provided configuration file (must be a configuration file on the remote instances)
--local-config string[] replace _config_ in module with user-provided local configuration file to upload (must be a local configuration file)
ONE-SHOT:
--disable-oneshot by default, if a module contains the string _target_ or _safe-target_ it is executed as a one-shot module. Use this flag to force disable
--unsafe for one-shot modules only, axiom will transparently replace _target_ with _safe-target_ in modules at runtime, use this flag to force disable
--track-finished for one-shot modules only, add this flag to track finished targets (creates a file in the remote scan working directory named finished.txt)
--threads int[] specify the number of threads to use with one-shot modules (default uses "threads": \$N key:value pair in the module)"
OPTIMIZATIONS:
--upload string[] before the scan, upload a file to the unique scan working directory (/home/op/scan/\$module+\$timestamp) on remote instances (must be a path to a local file)
--download string[] after the scan, download a file from the unique scan working directory (/home/op/scan/\$module+\$timestamp) on remote instances (must be a path to a remote file)
--max-runtime DURATION[] kill scan if still running after DURATION, DURATION is a floating point number with an required suffix: 'm' for minutes, 'h' for hours or 'd' for days
--preflight-timeout int[] specifies the timeout (in seconds) used when connecting to the SSH server, instead of using the default 15 seconds
--skip-preflight do not automatically remove instances that can not be reached (default removes instances from the queue that can not be reached)
--anew pipe the output to anew before creating the final output file (also requires extension "ext":"txt", "ext":"oG" or "ext":"csv" to be in the module)
OUTPUT:
-o string[] output as default (the first ext mentioned in the module)
-oT/-txt string[] output as text (must also be supplied in the module using "ext":"txt")
-oD/-oA string[] output as directory (must also be supplied in the module using "ext":"dir" or "ext":"")
-oG string[] output as greppable, merge and sort unique (must also be supplied in the module using "ext":"oG")
-oJ string[] output as json lines, newline characters are used to delimit JSON data (must also be supplied in the module using "ext":"jsonl")
-oX string[] output as XML/HTML (supported for nmap and masscan)(must also be supplied in the module using "ext":"xml")
-csv string [] output as csv, extract csv header, merge and sort unique (must also be supplied in the module using "ext":"csv")
-none string [] do not attempt to merge the output at all (must also be supplied in the module using "ext":"none")
--quiet do not display findings to terminal
--rm-logs delete remote and local logs after scan completes, except for the unmered output files in ~/.axiom/logs/\$module+\$timestamp/output
--no-logs do not store any logs at all, do not tail terminal output. Delete all logs even the unmerged output files in ~/.axiom/logs/\$module+\$timestamp/output
--stdout only display stdout results to terminal (default displays stdout and stderr to the terminal)
FLEET:
--custom-ssh string[] path to custom SSH config file (default is located at ~/.axiom/.sshconfig)
--cache do not regenerate SSH config prior to scan, instead use cached config (located at ~/.axiom/.sshconfig)
--fleet string[] supply fleet prefix to use (default uses instances in ~/.axiom/selected.conf)
--regions string[] round-robin region distribution using comma-separated regions to cycle through (default is region in ~/.axiom/axiom.json)
--rm-when-done delete the instance when finished with its job (does not wait for all instances to complete)
--shutdown-when-done shutdown the instance when finished with its job (does not wait for all instances to complete)
--spinup int[] number of instances to spin up prior to scanning (default uses instances in ~/.axiom/selected.conf)
DEBUG:
--debug run with set -xv, warning: very verbose (use with --cache for less output)
EXTRA ARGS:
string[] supply additional arguments to be passed to the module
--extra-args string[] explicitly define extra args to be passed to the module, must be wrapped single or double quotes (depending on intended variable expansion)
EOF
}
###########################################################################################################
# Kill 'remotetailPID' and 'downloaderPID'. If Ctrl+C was pressed, set scan status to cancelled and download results
# Kill 'tailPid' and merge the results. --download --rm-logs and --no-logs logic
# Kill remote tmux sessions and exit socket. Mv scan tmp to logs folder and display exit stats
#
clean_up() {
trap exit SIGINT SIGTERM
if kill -0 $remotetailPID &> /dev/null; then
kill -9 $remotetailPID &> /dev/null
wait $remotetailPID &> /dev/null
fi
if kill -0 $downloaderPID &> /dev/null; then
kill -9 $downloaderPID &> /dev/null
wait $downloaderPID &> /dev/null
fi
if kill -0 $tailPID &> /dev/null; then
kill -9 $tailPID &> /dev/null
wait $tailPID &> /dev/null
fi
# Check if Ctrl+C was pressed, if it was set scan_status to cancelled
if [ "$ctrl_c_pressed" = true ]; then
echo ""
echo -e "${Green}CTRL+C Interrupt, cleaning up and downloading output, please wait...${Color_Off}"
scan_status=cancelled
else
scan_status=completed
fi
# Check if any instance can not be reached. If it can't be reached, exit the socket
warn_log=$(mktemp)
$interlace_cmd_nobar -c "$ssh_check_command _target_ 2> /dev/null \
&& (timeout $preflight_timeout $ssh_command_preflight _target_ exit \
|| { $ssh_exit_command _target_ 2>/dev/null; echo _target_ unable to reconnect, relying on results already downloaded; } ) >> $warn_log 2>&1"
# Execute the commands if Ctrl+C was pressed or rm_when_done is "false"
if [ "$ctrl_c_pressed" = true ] || [ "$rm_when_done" = "false" ]; then
# Warn if any instance didn't create their $(hostname) file
$interlace_cmd_nobar -c "$ssh_command _target_ \
'[ -f $scan_dir/_target_ ] && echo _target_ scan finished || echo _target_ scan was still running but downloading partial results' >> $warn_log 2>&1"
cat $warn_log | sort -n
# Download the results
$interlace_cmd_nobar -c "axiom-scp _target_:$scan_dir/output $tmp/output/_target_ --cache -F=$sshconfig >/dev/null 2>&1"
fi
# Merge the downloaded results
merge_output
# If --download is used, download a user provided file from tmp scan working dir
if [[ "$download_user_arg" != "false" ]]; then
if [ -e "$outfile-download" ]; then
backup_timestamp=$(date +%Y-%m-%d_%H-%M-%S)
echo -e "${BYellow}File or folder already exists at ${Color_Off}[ ${BBlue}$outfile-download ${Color_Off}]${BYellow} backing up to ${Color_Off}[ ${BBlue}$outfile-download-$backup_timestamp ${Color_Off}]${BYellow} just in case.${Color_Off}"
mv "$outfile-download" "$outfile-download-$backup_timestamp"
fi
mkdir -p "$outfile-download"
echo -e "${BGreen}downloading arbitrary remote file ${BGreen}to${Color_Off}: ${Color_Off}[ ${BBlue}$outfile-download${Color_Off} ]"
$interlace_cmd_nobar -c "$AXIOM_PATH/interact/axiom-scp _target_:/home/op/scan/$uid/$download_file_path $outfile-download/_target_ --cache -F=$sshconfig >/dev/null 2>&1" | grep -v "Gen"
echo -e "${Green}arbitrary remote file downloaded successfully!${Color_Off}"
fi
# If delete logs is set to true, execute delete_logs function. if remove_all_logs is set to true, even remove the output folder in log file
if [[ "$keeplogs" == "false" ]]; then
if [[ "$remove_all_logs" == "true" ]]; then
delete_logs all
else
delete_logs
fi
else
# Kill tmux sessions with any orphaned proceses, exit all multiplexed SSH connections
echo -e "${BBlue}killing remote processes...please wait${Color_Off}"
$interlace_cmd_nobar -c "$ssh_command _target_ 'tmux kill-session -t $uid'" >/dev/null 2>&1
$interlace_cmd_nobar -c "$ssh_exit_command _target_ " >/dev/null 2>&1
fi
# Move downloaded raw results to log file
mv "$AXIOM_PATH/tmp/$uid/" "$AXIOM_PATH/logs/"
# Get some runtime stats
end=$(date +%s)
runtime=$((end-begin))
time=$(formatSeconds $runtime)
# Display exit stats about the scan such as log directory, normalize terminal
json_stats="{\"scan\":{\"$module\":{\"id\":\"$uid\",\"extra_args\":"$escaped_extra_args",\"instances\":\"$total_instances\",\"targets\":\"$lines\",\"results\":\"$output_lines\",\"runtime\":\"$time\",\"date\":\"$starttime\",\"command\":$escapedcommand,\"threads\":\"$threads\",\"local_logs\":\"$AXIOM_PATH/logs/$uid\",\"remote_logs\":\"/home/op/scan/$uid\",\"output\":\"$(realpath $outfile)\",\"status\":\"$scan_status\"}}}"
if jq -e . >/dev/null 2>&1 <<<"$json_stats"; then
echo -e "${BGreen}appending axiom-scan runtime statistics to:${Color_Off} [ ${BBlue}$AXIOM_PATH/stats.log${Color_Off} ]${BGreen} | ${Color_Off}"
echo "$json_stats" | tee -a $AXIOM_PATH/stats.log >> /dev/null 2>&1
else
echo -e "${Red}error parsing json runtime statistics, not appending axiom-scan statistics to${Color_Off}${BGreen} : $AXIOM_PATH/stats.log${Color_Off}"
fi
echo -e "${BGreen}module: ${Color_Off}[${BBlue} $module ${Color_Off}]${BGreen} | ${BGreen}module args: ${Color_Off}[${BBlue} $args ${Color_Off}] ${BGreen}| ${BGreen}instances: ${Color_Off}[${BBlue} $total_instances ${Color_Off}]${BGreen} | ${BGreen}targets: ${Color_Off}[${BBlue} $lines targets ${Color_Off}]${BGreen} | ${BGreen}results: ${Color_Off}[${BBlue} $output_lines results ${Color_Off}]${BGreen} |"
echo -e "${BGreen}runtime: ${Color_Off}[${BBlue} $time ${Color_Off}]${BGreen} | ${BGreen}date: ${Color_Off}[${BBlue} $starttime ${Color_Off}]${BGreen} | ${BGreen}id: ${Color_Off}[${BBlue} "$uid" ${Color_Off}]${BGreen} |"
echo -e "${BGreen}output: ${Color_Off}[${BBlue} $(realpath $outfile) ${Color_Off}]${BGreen} | ${BGreen}log: ${Color_Off}[${BBlue} "$AXIOM_PATH/logs/$uid" ${Color_Off}]${BGreen} | ${BGreen}remote: ${Color_Off}[${BBlue} "/home/op/scan/$uid" ${Color_Off}] ${BGreen} |"
echo -e "${BGreen}command: ${Color_Off}[${BBlue} $command ${Color_Off}]${BGreen} | ${BGreen}ext: ${Color_Off}[${BBlue} "$ext" ${Color_Off}]${BGreen} | ${BGreen}threads: ${Color_Off}[${BBlue} "$threads" ${Color_Off}]${BGreen}"
rm -r $socket_tmp >/dev/null 2>&1
stty sane
tput init
exit
}
###########################################################################################################
# axiom can take up a lot of space with logs. When --rm-logs option is present, after the scan is finished or canceled, axiom-exec will delete the remote logs.
# To avoid undesirable scan results after merging, we keep the original un-merged scan result as well as the final merged copy unless the 'all' argument is added.
# If the first argument passed to the delete_logs functions is 'all', everything pertaining to the scan deleted ('all' is passed to delete_logs and '--no-logs' option is used
#
delete_logs() {
if [[ -z "$uid" || ! "$uid" =~ ^[a-zA-Z0-9_+-]+$ ]]; then
echo -e "${Red}Error: Invalid or empty UID provided. Exiting.${Color_Off}"
exit 1
fi
echo -e "${BBlue}Deleting remote logs for UID: ${uid}${Color_Off}"
$interlace_cmd_nobar -c "$ssh_command _target_ 'if [ -d /home/op/scan/${uid} ]; then cd /home/op/scan/${uid} && sudo rm -r *; else echo Remote directory does not exist; fi'" >/dev/null 2>&1
echo -e "${BBlue}Killing remote processes for UID: ${uid}${Color_Off}"
$interlace_cmd_nobar -c "$ssh_command _target_ 'tmux kill-session -t $uid'" >/dev/null 2>&1
$interlace_cmd_nobar -c "$ssh_exit_command _target_" >/dev/null 2>&1
if [ -d "$AXIOM_PATH/tmp/$uid/" ]; then
echo -e "${BBlue}Changing to local directory: $AXIOM_PATH/tmp/$uid/${Color_Off}"
cd "$AXIOM_PATH/tmp/$uid/" || { echo -e "${Red}Error: Failed to change directory. Exiting.${Color_Off}"; exit 1; }
if [[ "$1" == "all" ]]; then
echo -e "${BBlue}Deleting all local logs, including ${Color_Off}[ ${BGreen}$AXIOM_PATH/logs/$uid/output/${Color_Off} ]"
find . -exec rm -r {} + >/dev/null 2>&1 # Delete everything, including output and status
else
echo -e "${BBlue}Deleting local logs, except for ${Color_Off} [${BGreen}$AXIOM_PATH/logs/$uid/output/${Color_Off} ]"
ls | grep -v output | xargs rm -r >/dev/null 2>&1
fi
else
echo -e "${Red}Error: Local log folder does not exist.${Color_Off}"
fi
}
###########################################################################################################
# Providing wordlists in modules can be done with _wordlist_, usually something like -w _wordlist_ is provided in the module. Think of this like a placeholder for wordlists
#
apply_wordlist() {
command="$1"
wordlist="$2"
wordlist_escaped="$(echo "$wordlist" | sed 's/\//\\\//g')"
if [[ "$command" =~ "_wordlist_" ]] ; then
echo "$command" | sed "s/_wordlist_/$wordlist_escaped/g"
else
echo "$command" | sed "s/$/ $wordlist_escaped/g"
fi
}
###########################################################################################################
# Providing a config in modules can be done with _config_, Think of this like a placeholder/variable replacement for config files
#
apply_config() {
command="$1"
config="$2"
config_escaped="$(echo "$config" | sed 's/\//\\\//g')"
if [[ "$command" =~ "_config_" ]] ; then
echo "$command" | sed "s/_config_/$config_escaped/g"
else
echo "$command" | sed "s/$/ $config_escaped/g"
fi
}
###########################################################################################################
# Providing a folder in modules can be done with _folder_, Think of this like a placeholder/variable replacement for a path to a folder
#
apply_folder() {
command="$1"
folder="$2"
folder_escaped="$(echo "$folder" | sed 's/\//\\\//g')"
if [[ "$command" =~ "_folder_" ]] ; then
echo "$command" | sed "s/_folder_/$folder_escaped/g"
else
echo "$command" | sed "s/$/ $folder_escpaed/g"
fi
}
###########################################################################################################
# Parse the extra arguments passed from the command line and add them to the final command
#
add_extra_args() {
command="$1"
new_command=""
args="$2"
args_set="false"
counter=0
pieces="$(echo "$command" | grep -o "|" | wc -l | awk '{ print $1 }')"
OLDIFS=$IFS
IFS="|"
for piece in $command
do
if [[ "$piece" != "" ]] && [[ ! "$piece" =~ "cat" ]] && [[ ! "$piece" =~ "tee" ]] && [[ "$args_set" != "true" ]]; then
new_command="$new_command $piece $args"
args_set=""true
else
new_command="$new_command$piece"
fi
if [[ "$counter" -lt "$pieces" ]]; then
new_command="$new_command|"
counter=$((counter+1))
fi
done
IFS=$OLDIFS
echo $new_command
}
###########################################################################################################
# divide the the target list by how many instances are selected (axiom-select). Equally distribute the total target list across the fleet.
#
split_file() {
file="$1"
divisor="$2"
tmp="$3"
lines="$(wc -l "$file" | awk '{ print $1 }')"
lines_per_file=$((lines / divisor))
extra_lines=$((lines % divisor))
# randomize the target list. To disable randomization, use the --dont-shuffle option
if [[ "$shuffle" != "false" ]]; then
shuf "$file" > "$tmp/split/targets"
else
cp "$file" "$tmp/split/targets"
fi
# split file
first=1
for ((i=1; i<=divisor; i++)); do
last=$((first+lines_per_file-1))
if [[ $i -le $extra_lines ]]; then
last=$((last+1))
fi
# echo "Splitting lines $first to $last to file $i"
head -n $last "$tmp/split/targets" | tail -n $((last - first + 1))> $tmp/split/$i
first=$((last+1))
done
rm $tmp/split/targets
# Rename "xaa" etc to 1 2 3 4 5
i=1
for f in $(find "$tmp/split/" -type f | tr '/' ' ' | awk '{ print $NF }')
do
instance="$(echo $instances | awk "{ print \$$i }")"
i=$((i+1))
mv "$tmp/split/$f" "$tmp/input/$instance"
done
total=$i
}
###########################################################################################################
# Merge the output in a certain way specified in the module or if the user specified -oX -oG or -oD it will overwrite the default (-o).
# If only supplying -o as an output argument via the command line, the output format will default to the first extension mentioned in the module.
#
merge_output() {
if [[ "$anew" != "true" ]]; then
if [ -e "$outfile" ]; then
backup_timestamp=$(date +%Y-%m-%d_%H-%M-%S)
echo -e "${BYellow}File or folder already exists at ${Color_Off}[${BBlue} "$outfile" ${Color_Off}]${BYellow} backing up to ${Color_Off}[${BBlue} "$outfile-$backup_timestamp" ${Color_Off}]${BYellow} just in case.${Color_Off}"
mv "$outfile" "$outfile-$backup_timestamp"
fi
else
if ! [ -x "$(command -v anew)" ]; then
if ! [ -x "$(command -v go)" ]; then
echo -e "${BRed}Warning: anew not installed and neither is Golang (so we cant install anew). Defaulting to the module extension without using anew${Color_Off}"
anew="false"
else
go install github.com/tomnomnom/anew@latest >> /dev/null 2>&1
fi
fi
fi
if [[ "$ext" == "txt" ]] ; then
echo "mode set to $ext.. combining results into one file."
find $tmp/output/ -type f -exec cat {} \; > $tmp/merge
if [[ "$anew" == "true" ]]; then
cat "$tmp/merge" | anew "$outfile"
else
mv "$tmp/merge" "$outfile"
fi
output_lines=$(wc -l $outfile | tr -s ' ' | cut -d ' ' -f 1)
elif [[ "$ext" == "oG" ]] || [[ "$ext" == "jsonl" ]]; then
echo "mode set to $ext.. sorting unique."
find $tmp/output/ -type f -exec cat {} \; | sort -u > $tmp/merge
if [[ "$anew" == "true" ]]; then
cat "$tmp/merge" | anew "$outfile"
else
mv "$tmp/merge" "$outfile"
fi
output_lines=$(wc -l $outfile | tr -s ' ' | cut -d ' ' -f 1)
elif [[ "$ext" == "xml" ]]; then
echo "Mode set to XML.. Merging Nmap XML output..."
mkdir $tmp/merge
find $tmp/output -type f -print0 | xargs -0 -I{} cp --backup=t {} $tmp/merge
output_lines=$(ls $tmp/merge | wc -l)
"$AXIOM_PATH/interact/nMap_Merger.py" -d "$tmp/merge" -o "$tmp/merge.xml" >> /dev/null
mv "$tmp/merge.xml" "$outfile"
mv "$tmp/merge.xml.html" "$outfile.html"
elif [[ "$ext" == "csv" ]]; then
echo "Mode set to CSV, merging..."
header="$(find $tmp/output/ -type f -exec head -n 1 {} \; | sort -u )"
echo "$header" > $tmp/merge
find $tmp/output/ -type f -exec cat {} \; | grep -v "$header" | sort -u -V >> $tmp/merge
if [[ "$anew" == "true" ]]; then
cat "$tmp/merge" | anew "$outfile"
else
mv "$tmp/merge" "$outfile"
fi
output_lines=$(wc -l $outfile | tr -s ' ' | cut -d ' ' -f 1)
elif [[ "$ext" == "none" ]]; then
echo "Mode set to none, not merging..."
mv $tmp/output "$outfile"
output_lines=$(ls $outfile | wc -l)
elif [[ "$ext" == "" ]] || [[ "$ext" == "dir" ]]; then
echo "Mode set to directory... Merging directories..."
mkdir $tmp/merge
find $tmp/output -type f -print0 | xargs -0 -I{} cp --backup=t {} $tmp/merge
output_lines=$(ls $tmp/merge | wc -l)
mv $tmp/merge "$outfile"
if [[ "$module" == "gowitness" ]]; then
if ! [ -x "$(command -v gowitness)" ]; then
echo -e "${BBlue}Installing gowitness...${Color_Off}"
go install github.com/sensepost/gowitness@latest
fi
echo "Downloading gowitness databases..."
mkdir -p "$tmp/dbs/"
$interlace_cmd_nobar -c "axiom-scp _target_:$scan_dir/gowitness.sqlite3 $tmp/dbs/_target_.sqlite3 --cache -F=$sshconfig>> /dev/null"
echo "Merging databases..."
gowitness report merge --source-path "$tmp/" --output-file "$outfile/gowitness.sqlite3"
echo -e "${Green}RUN: '${BBlue}gowitness report server --db-uri sqlite://$outfile/gowitness.sqlite3 --screenshot-path $outfile/${Color_Off}' for reporting"
fi
fi
}
###########################################################################################################
# Declare defaut variables
#
starttime=$(date)
wordlist=""
module=""
ext="default"
local_wordlist="false"
user_specified_wordlist="false"
cache="false"
fleet=""
threads=""
interactive=""
uid="$module+$(date +%m-%d_%H-%M-%S-%1N)"
sshconfig="$AXIOM_PATH/.sshconfig"
rm_when_done="false"
spinup=0
args=""
pass=()
keeplogs="true"
shuffle="true"
split="true"
disable_oneshot="false"
distribute_wordlist="false"
quiet="false"
local_folder="false"
user_specified_folder="false"
user_specified_config="false"
local_config="false"
pre_flight=true
preflight_timeout=15
max_scan_runtime=0
cycle_regions="false"
stdout_only="false"
undocumented_unsafe="false"
safe="true"
expand_cidr="false"
upload_user_arg="false"
download_user_arg="false"
no_logs="false"
track_finished="false"
extra_args=""
backwards_compatibility_nuclei_templates="false"
ctrl_c_pressed="false"
###########################################################################################################
# Parse command line arguments
#
i=0
for arg in "$@"
do
i=$((i+1))
if [[ ! " ${pass[@]} " =~ " ${i} " ]]; then
set=false
if [[ "$i" == 1 ]]; then
input="$1"
set=true
pass+=($i)
fi
if [[ "$arg" == "--debug" ]]; then
set -xv
set=true
pass+=($i)
fi
if [[ "$arg" == "-m" ]]; then
n=$((i+1))
module=$(echo ${!n})
set=true
pass+=($i)
pass+=($n)
fi
if [[ "$arg" == "-o" ]]; then
n=$((i+1))
outfile=$(echo ${!n})
set=true
pass+=($i)
pass+=($n)
fi
if [[ "$arg" == "-oT" ]] || [[ "$arg" == "-txt" ]]; then
n=$((i+1))
ext="txt"
outfile=$(echo ${!n})
set=true
pass+=($i)
pass+=($n)
fi
if [[ "$arg" == "-oJ" ]]; then
n=$((i+1))
ext="jsonl"
outfile=$(echo ${!n})
set=true
pass+=($i)
pass+=($n)
fi
if [[ "$arg" == "-oG" ]]; then
n=$((i+1))
ext="oG"
outfile=$(echo ${!n})
set=true
pass+=($i)
pass+=($n)
fi
if [[ "$arg" == "-csv" ]] || [[ "$arg" == "--csv" ]]; then
n=$((i+1))
ext="csv"
outfile=$(echo ${!n})
set=true
pass+=($i)
pass+=($n)
fi
if [[ "$arg" == "-oX" ]]; then
n=$((i+1))
ext="xml"
outfile=$(echo ${!n})
set=true
pass+=($i)
pass+=($n)
fi
if [[ "$arg" == "-oD" ]] || [[ "$arg" == "-oA" ]]; then
n=$((i+1))
ext="dir"
outfile=$(echo ${!n})
set=true
pass+=($i)
pass+=($n)
fi
if [[ "$arg" == "-anew" ]] || [[ "$arg" == "--anew" ]] ; then
anew="true"
set=true
pass+=($i)
fi
if [[ "$arg" == "-none" ]] || [[ "$arg" == "--none" ]] ; then
n=$((i+1))
ext="none"
outfile=$(echo ${!n})
set=true
pass+=($i)
pass+=($n)
fi
if [[ "$arg" == "--skip-preflight" ]]; then
pre_flight=false
set=true
pass+=($i)
fi
if [[ "$arg" == "--preflight-timeout" ]] ; then
n=$((i+1))
preflight_timeout=$(echo ${!n})
set=true
pass+=($i)
pass+=($n)
fi
if [[ "$arg" == "--custom-ssh" ]]; then
n=$((i+1))
sshconfig=$(echo ${!n})
cache="true"
set=true
pass+=($i)
pass+=($n)
fi
if [[ "$arg" == "--cache" ]]; then
cache="true"
set=true
pass+=($i)
fi
if [[ "$arg" == "--disable-oneshot" ]]; then
disable_oneshot="true"
set=true
pass+=($i)
fi
if [[ "$arg" == "--quiet" ]]; then
quiet="true"
set=true
pass+=($i)
fi
if [[ "$arg" == "--rm-when-done" ]]; then
rm_when_done="true"
set=true
pass+=($i)
fi
if [[ "$arg" == "--shutdown-when-done" ]] || [[ "$arg" == "--poweroff-when-done" ]] || [[ "$arg" == "--shutdown" ]]; then
shutdown_when_done="true"
set=true
pass+=($i)
fi
if [[ "$arg" == "--list" ]]; then
list_modules
exit
fi
if [[ "$arg" == "--threads" ]]; then
n=$((i+1))
user_specified_threads=$(echo ${!n})
set=true
pass+=($i)
pass+=($n)
fi
if [[ "$arg" == "-w" ]]; then
n=$((i+1))
user_specified_wordlist=$(echo ${!n})
set=true
pass+=($i)
pass+=($n)
fi
if [[ "$arg" == "-wL" ]] || [[ "$arg" == "--local-wordlist" ]]; then
n=$((i+1))
local_wordlist=$(echo ${!n})
set=true
pass+=($i)
pass+=($n)
fi
if [[ "$arg" == "--local-folder" ]]; then
n=$((i+1))
local_folder=$(echo ${!n})
set=true
pass+=($i)
pass+=($n)
fi
if [[ "$arg" == "--nuclei-templates" ]] ; then
n=$((i+1))
backwards_compatibility_nuclei_templates="true"
local_folder=$(echo ${!n})
set=true
pass+=($i)
pass+=($n)
fi
if [[ "$arg" == "--remote-folder" ]]; then
n=$((i+1))
user_specified_folder=$(echo ${!n})
set=true
pass+=($i)
pass+=($n)
fi
if [[ "$arg" == "--remote-config" ]]; then
n=$((i+1))
user_specified_config=$(echo ${!n})
set=true
pass+=($i)
pass+=($n)
fi
if [[ "$arg" == "--local-config" ]]; then
n=$((i+1))
local_config=$(echo ${!n})
set=true
pass+=($i)
pass+=($n)
fi
if [[ "$arg" == "--distribute-wordlist" ]] || [[ "$arg" == "-wD" ]]; then
n=$((i+1))
distribute_wordlist=$(echo ${!n})
set=true
pass+=($i)
pass+=($n)
fi
if [[ "$arg" == "--spinup" ]]; then
n=$((i+1))
spinup=$(echo ${!n})
set=true
pass+=($i)
pass+=($n)
fi
if [[ "$arg" == "--expand-cidr" ]]; then
expand_cidr="true"
set=true
pass+=($i)
fi
if [[ "$arg" == "--fleet" ]]; then
n=$((i+1))
fleet=$(echo ${!n})
set=true
pass+=($i)
pass+=($n)
fi
if [[ "$arg" == "--regions" ]]; then
n=$((i+1))
cycle_regions=$(echo ${!n})
set=true
pass+=($i)
pass+=($n)
fi
if [[ "$arg" == "--help" ]] ; then
set=true
pass+=($i)
fi
if [[ "$arg" == "--stdout" ]]; then
stdout_only="true"
set=true
pass+=($i)
fi
if [[ "$arg" == "--rm-logs" ]]; then
keeplogs="false"
set=true
pass+=($i)
fi
if [[ "$arg" == "--dont-shuffle" ]]; then
shuffle="false"
set=true
pass+=($i)
fi
if [[ "$arg" == "--dont-split" ]]; then
split="false"
set=true
pass+=($i)
fi
if [[ "$arg" == "--unsafe" ]]; then
safe="false"
set=true
pass+=($i)
fi
if [[ "$arg" == "--track-finished" ]]; then
track_finished="true"
set=true
pass+=($i)
fi
if [[ "$arg" == "--undocumented_unsafe" ]]; then
undocumented_unsafe="true"
set=true
pass+=($i)
fi
if [[ "$arg" == "--max-runtime" ]]; then
n=$((i+1))
max_scan_runtime=$(echo ${!n})
set=true
pass+=($i)
pass+=($n)
fi
if [[ "$arg" == "--download" ]]; then
n=$((i+1))
download_user_arg=true
download_file_path=$(echo ${!n})
set=true
pass+=($i)
pass+=($n)
fi
if [[ "$arg" == "--upload" ]]; then
n=$((i+1))
upload_user_arg=true
upload_file_path=$(echo ${!n})
set=true
pass+=($i)
pass+=($n)
fi
if [[ "$arg" == "--no-logs" ]]; then
no_logs="true"
set=true
pass+=($i)
fi
if [[ "$arg" == "--extra-args" ]]; then
n=$((i+1))
#extra_args=$(echo ${!n})
extra_args="${!n}"
set=true
pass+=($i)
pass+=($n)
fi
if [[ "$set" != "true" ]] ; then
space=" "
if [[ $arg =~ $space ]]; then
args="$args \"$arg\""
else
args="$args $arg"
fi
fi
fi
done
# add explicit extra args outside of the loop
if [[ -n "$extra_args" ]]; then
args="$args $extra_args"
fi
###########################################################################################################
# Display axiom banner and authors
#
banner() {
cat << EOF >&2
█████╗ ██╗ ██╗ ███████╗ ██████╗ █████╗ ███╗ ██╗
██╔══██╗╚██╗██╔╝ ██╔════╝██╔════╝██╔══██╗████╗ ██║
███████║ ╚███╔╝ ███████╗██║ ███████║██╔██╗ ██║
██╔══██║ ██╔██╗ ╚════██║██║ ██╔══██║██║╚██╗██║
██║ ██║██╔╝ ██╗ ███████║╚██████╗██║ ██║██║ ╚████║
╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═══╝
Maintainer: 0xtavian
EOF
echo ''
echo '
"𝓲𝓷𝓼𝓹𝓲𝓻𝓮𝓭 𝓫𝔂 𝓪𝔁𝓲𝓸𝓶: 𝓽𝓱𝓮 𝓭𝔂𝓷𝓪𝓶𝓲𝓬 𝓲𝓷𝓯𝓻𝓪𝓼𝓽𝓻𝓾𝓬𝓽𝓾𝓻𝓮 𝓯𝓻𝓪𝓶𝓮𝔀𝓸𝓻𝓴 𝓯𝓸𝓻 𝓮𝓿𝓮𝓻𝔂𝓫𝓸𝓭𝔂! - @𝓹𝓻𝔂0𝓬𝓬 @0𝔁𝓽𝓪𝓿𝓲𝓪𝓷"
"𝓽𝓱𝓮 𝓬𝓸𝓷𝓽𝓲𝓷𝓾𝓪𝓽𝓲𝓸𝓷 𝓸𝓯 𝓪𝔁𝓲𝓸𝓶: 𝓽𝓱𝓮 𝓭𝔂𝓷𝓪𝓶𝓲𝓬 𝓲𝓷𝓯𝓻𝓪𝓼𝓽𝓻𝓾𝓬𝓽𝓾𝓻𝓮 𝓯𝓻𝓪𝓶𝓮𝔀𝓸𝓻𝓴 𝓯𝓸𝓻 𝓮𝓿𝓮𝓻𝔂𝓫𝓸𝓭𝔂! - @𝓹𝓻𝔂0𝓬𝓬 @0𝔁𝓽𝓪𝓿𝓲𝓪𝓷"
"𝓬𝓸𝓷𝓽𝓲𝓷𝓾𝓮𝓭 𝓯𝓻𝓸𝓶: 𝓪𝔁𝓲𝓸𝓶: 𝓽𝓱𝓮 𝓭𝔂𝓷𝓪𝓶𝓲𝓬 𝓲𝓷𝓯𝓻𝓪𝓼𝓽𝓻𝓾𝓬𝓽𝓾𝓻𝓮 𝓯𝓻𝓪𝓶𝓮𝔀𝓸𝓻𝓴 𝓯𝓸𝓻 𝓮𝓿𝓮𝓻𝔂𝓫𝓸𝓭𝔂! - @𝓹𝓻𝔂0𝓬𝓬 @0𝔁𝓽𝓪𝓿𝓲𝓪𝓷"
"𝓫𝓪𝓼𝓲𝓬𝓪𝓵𝓵𝔂, 𝓪𝔁𝓲𝓸𝓶: 𝓽𝓱𝓮 𝓭𝔂𝓷𝓪𝓶𝓲𝓬 𝓲𝓷𝓯𝓻𝓪𝓼𝓽𝓻𝓾𝓬𝓽𝓾𝓻𝓮 𝓯𝓻𝓪𝓶𝓮𝔀𝓸𝓻𝓴 𝓯𝓸𝓻 𝓮𝓿𝓮𝓻𝔂𝓫𝓸𝓭𝔂! - @𝓹𝓻𝔂0𝓬𝓬 @0𝔁𝓽𝓪𝓿𝓲𝓪𝓷 "
"𝓶𝓲𝓰𝓱𝓽 𝓪𝓼 𝔀𝓮𝓵𝓵 𝓫𝓮 𝓪𝔁𝓲𝓸𝓶: 𝓽𝓱𝓮 𝓭𝔂𝓷𝓪𝓶𝓲𝓬 𝓲𝓷𝓯𝓻𝓪𝓼𝓽𝓻𝓾𝓬𝓽𝓾𝓻𝓮 𝓯𝓻𝓪𝓶𝓮𝔀𝓸𝓻𝓴 𝓯𝓸𝓻 𝓮𝓿𝓮𝓻𝔂𝓫𝓸𝓭𝔂! - @𝓹𝓻𝔂0𝓬𝓬 @0𝔁𝓽𝓪𝓿𝓲𝓪𝓷"
"𝓪𝓵𝓻𝓲𝓰𝓱𝓽, 𝔂𝓸𝓾 𝓰𝓸𝓽 𝓶𝓮, 𝓲𝓽𝓼 𝓳𝓾𝓼𝓽 𝓪𝔁𝓲𝓸𝓶: 𝓽𝓱𝓮 𝓭𝔂𝓷𝓪𝓶𝓲𝓬 𝓲𝓷𝓯𝓻𝓪𝓼𝓽𝓻𝓾𝓬𝓽𝓾𝓻𝓮 𝓯𝓻𝓪𝓶𝓮𝔀𝓸𝓻𝓴 𝓯𝓸𝓻 𝓮𝓿𝓮𝓻𝔂𝓫𝓸𝓭𝔂! - @𝓹𝓻𝔂0𝓬𝓬 @0𝔁𝓽𝓪𝓿𝓲𝓪𝓷"
"𝓼𝓽𝓸𝓵𝓮𝓷 𝓯𝓻𝓸𝓶: 𝓪𝔁𝓲𝓸𝓶: 𝓽𝓱𝓮 𝓭𝔂𝓷𝓪𝓶𝓲𝓬 𝓲𝓷𝓯𝓻𝓪𝓼𝓽𝓻𝓾𝓬𝓽𝓾𝓻𝓮 𝓯𝓻𝓪𝓶𝓮𝔀𝓸𝓻𝓴 𝓯𝓸𝓻 𝓮𝓿𝓮𝓻𝔂𝓫𝓸𝓭𝔂! - @𝓹𝓻𝔂0𝓬𝓬 @0𝔁𝓽𝓪𝓿𝓲𝓪𝓷"
' | xargs shuf -n1 -e
echo ''
}
banner
###########################################################################################################
# Display Help Menu
#
if [[ "$*" == "--help" ]] || [[ "$*" == "-h" ]] || [[ "$*" == "" ]]; then
help
exit
fi
###########################################################################################################
# Exit if the first command line argument doesnt not contain a target list
#
if [[ ! -f $input ]]; then
echo -e "${BRed}Error: Input file does not exist, please specify one as the first argument... ${Color_Off}"
exit 1
fi
###########################################################################################################
# Check if -m is in the command, if not, exit
#
if [[ "$*" != *-m* ]]
then
echo -e "${Red}Error: No module for axiom-scan defined. Pass one with -m.${Color_Off}"
exit 1
fi
###########################################################################################################
# Exit if module doesnt exist
#
if [ ! -f $AXIOM_PATH/modules/$module.json ]; then
echo -e "${Red}ERROR: Axiom module not found.${Color_Off}"
echo -e "Ensure module exists in $AXIOM_PATH/modules/$module.json"
echo -e "To print all available modules run axiom-scan --list"
exit 1
fi
###########################################################################################################
# Validate module is valid json
#
if ! jq -e . >/dev/null 2>&1 <<< "$(cat $AXIOM_PATH/modules/$module.json)"; then
echo -e "${Red}error parsing json module $AXIOM_PATH/modules/$module.json, not properly formatted json.. exiting${Color_Off}"
exit 1
fi
###########################################################################################################
# Check to make sure Interlace is installed
#
if ! command -v interlace &> /dev/null; then
echo -e "${Red}Error: Interlace is not installed.${Color_Off}"
echo -e "${Red}Please install Interlace by following the instructions at: https://github.com/codingo/Interlace${Color_Off}"
exit 1
fi
###########################################################################################################
# Create temporary directories and set tmp path to be used for logs
#
if [ -z "$outfile" ] ; then
outfile="$start/$module+$(date +%m-%d_%H-%M-%S-%1N)"
fi
uid="$module+$(date +%m-%d_%H-%M-%S-%1N)"
tmp="$AXIOM_PATH/tmp/$uid"
completed="$AXIOM_PATH/tmp/$uid/status/completed/"
inprogress="$AXIOM_PATH/tmp/$uid/status/inprogress/"
mkdir -p "$AXIOM_PATH/logs/" >> /dev/null 2>&1
mkdir -p "$tmp/input"
mkdir -p "$tmp/split"