hackernote 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +21 -0
- data/README.md +71 -0
- data/Rakefile +2 -0
- data/bin/hackernote +69 -0
- data/hackernote.gemspec +23 -0
- data/lib/hackernote.rb +21 -0
- data/lib/hackernote/extensions.rb +27 -0
- data/lib/hackernote/git.rb +41 -0
- data/lib/hackernote/gitbook_builder.rb +194 -0
- data/lib/hackernote/utils.rb +56 -0
- data/lib/hackernote/version.rb +3 -0
- metadata +68 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ff684139dfe33900c5be1dc93d3a8e4b11df8361
|
4
|
+
data.tar.gz: 360f8c7218cf83c8e506d827f4d1b6762bca228d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: cb496296e8f68ab5b89f272b1587538ed4d7056c13750d955a47d28eaec9aac6ffa5bb6ae05193e2d22a5cd5c3415d4971789fd13802967ece93fd12e7b99e50
|
7
|
+
data.tar.gz: 50dd1f61221d47b90fca8e044e93574bfc8338ab1b31db8debf19d3d382619b908cfcb4736c3ca1ab8cb659889790f0366cce8a02cf0750631f011f3c9881b51
|
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
.idea
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2018 KING SABRI
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
# Hacker's Note
|
2
|
+
|
3
|
+
It's a Ruby script creates a gitbook compatible structure for penetration test and red team projects
|
4
|
+
The main target of this script is to make building [gitbook](https://www.gitbook.com/editor) project for a new PT/RT engagement easily.
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
$ gem install hackernote
|
9
|
+
|
10
|
+
## Usage
|
11
|
+
|
12
|
+
```
|
13
|
+
$> hackernote -h
|
14
|
+
|
15
|
+
______ ____ ______ ____
|
16
|
+
| | .'. .~ ~.| ..''| |`````````, ..'''' |.. |.~ ~.`````|`````|
|
17
|
+
|_________| .''```. | |..'' |______ |'''|''''' .'' | ``.. | | | |______
|
18
|
+
| | .' `. | |``.. | | `. ..' | ``.. | | | |
|
19
|
+
| |.' `.`.______.'| ``..|__________| `....'' | ``|`.______.' | |___________
|
20
|
+
v1.0.0
|
21
|
+
|
22
|
+
Hacker's Note - Helps security professionals to organize their notes in a gitbook structure for PT/RT engagements.
|
23
|
+
|
24
|
+
Help menu:
|
25
|
+
-p, --project PROJECT_NAME Project Name
|
26
|
+
-l, --list TARGET_LIST The target name or a text file contains list of targets
|
27
|
+
-g, --git GIT_REPO_URL Configure git server URL
|
28
|
+
-h, --help Show this help message
|
29
|
+
|
30
|
+
Usage:
|
31
|
+
hackernote --project <project_name> --list <targets[.list]> --git <git server repository URL>
|
32
|
+
|
33
|
+
Example:
|
34
|
+
hackernote --project PT_CustomerName_WebApp_01-01-2030 --list target_list.txt
|
35
|
+
hackernote -p PT_CustomerName_WebApp_01-01-2030 -l example.com
|
36
|
+
hackernote -p PT_CustomerName_WebApp_01-01-2030 -l example.com -g https://github.com/[USERNAME]/PT_CustomerName_WebApp_01-01-2030.git
|
37
|
+
```
|
38
|
+
|
39
|
+
|
40
|
+
## Document Structure
|
41
|
+
The script create a tree of folders and files for each target
|
42
|
+
|
43
|
+
- Project Name
|
44
|
+
- Target1/
|
45
|
+
- target1.md
|
46
|
+
- scanning_and_enumeration.md
|
47
|
+
- critical
|
48
|
+
- high.md
|
49
|
+
- medium.md
|
50
|
+
- low
|
51
|
+
- informational.md
|
52
|
+
- notes
|
53
|
+
- TargetX/
|
54
|
+
- target1.md
|
55
|
+
- scanning_and_enumeration.md
|
56
|
+
- critical
|
57
|
+
- high.md
|
58
|
+
- medium.md
|
59
|
+
- low
|
60
|
+
- informational.md
|
61
|
+
- notes
|
62
|
+
- README.md
|
63
|
+
- book.json
|
64
|
+
|
65
|
+
## Contributing
|
66
|
+
|
67
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/hackernote.
|
68
|
+
|
69
|
+
## License
|
70
|
+
|
71
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/hackernote
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# Hacker's Note - A command-line tool creates gitbook compatible structure for pentest and read team projects.
|
4
|
+
#
|
5
|
+
# @Author: KING SABRI - @KINGSABRI
|
6
|
+
#
|
7
|
+
lib = File.dirname(__FILE__) + '/../lib'
|
8
|
+
if File.directory?(lib)
|
9
|
+
unless $:.include?(lib)
|
10
|
+
$:.unshift(lib)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
require 'hackernote'
|
14
|
+
include HackerNote::Utils
|
15
|
+
|
16
|
+
options = {}
|
17
|
+
option_parser = OptionParser.new
|
18
|
+
option_parser.banner = "#{"Hacker's Note".bold} - Helps security professionals to organize their notes in a gitbook structure for PT/RT engagements."
|
19
|
+
option_parser.set_summary_indent ' '
|
20
|
+
option_parser.separator "\nHelp menu:".underline
|
21
|
+
option_parser.on('-p', '--project PROJECT_NAME', "Project Name") {|v| options[:project] = v}
|
22
|
+
option_parser.on('-l', '--list TARGET_LIST' , 'The target name or a text file contains list of targets') {|v| options[:list] = v}
|
23
|
+
option_parser.on('-g', '--git GIT_REPO_URL' , 'Configure git server URL') {|v| options[:git_url] = v}
|
24
|
+
option_parser.on('-h', '--help', 'Show this help message') {puts HackerNote::Utils.banner, option_parser; exit!}
|
25
|
+
option_parser.on_tail "\nUsage:\n".underline + " hackernote --project <project_name> --list <targets[.list]> --git <git server repository URL>"
|
26
|
+
option_parser.on_tail "\nExample:".underline
|
27
|
+
option_parser.on_tail" hackernote --project PT_CustomerName_WebApp_01-01-2030 --list target_list.txt"
|
28
|
+
option_parser.on_tail" hackernote -p PT_CustomerName_WebApp_01-01-2030 -l example.com"
|
29
|
+
option_parser.on_tail" hackernote -p PT_CustomerName_WebApp_01-01-2030 -l example.com -g https://github.com/[USERNAME]/PT_CustomerName_WebApp_01-01-2030.git\n\n"
|
30
|
+
|
31
|
+
begin
|
32
|
+
option_parser.parse!
|
33
|
+
gitbook = HackerNote::GitbookBuilder.new
|
34
|
+
git = HackerNote::Git.new
|
35
|
+
case
|
36
|
+
when options[:project] && options[:list] && options[:git_url]
|
37
|
+
gitbook.build(options[:project], options[:list])
|
38
|
+
print "\r\n".cls_upline
|
39
|
+
git.setup(options[:project], options[:git_url])
|
40
|
+
puts "\n[+] ".green.bold + "Happy Hacking!".bold
|
41
|
+
when options[:project] && options[:list]
|
42
|
+
gitbook.build(options[:project], options[:list])
|
43
|
+
print "\r\n".cls_upline
|
44
|
+
git.git = nil
|
45
|
+
git.setup(options[:project], '[YOUR GIT REPOSITORY URL]')
|
46
|
+
puts "\n[+] ".green.bold + "Happy Hacking!"
|
47
|
+
when options[:project].nil? && options[:list].nil?
|
48
|
+
puts HackerNote::Utils.banner
|
49
|
+
puts option_parser
|
50
|
+
when options[:project].nil?
|
51
|
+
puts '[!] '.red + "Missing mandatory switch '-p/--project'"
|
52
|
+
puts option_parser
|
53
|
+
when options[:list].nil?
|
54
|
+
puts '[!] '.red + "Missing mandatory switch '-l/--list'"
|
55
|
+
puts option_parser
|
56
|
+
end
|
57
|
+
rescue OptionParser::MissingArgument => e
|
58
|
+
e.args.each {|arg| puts '[!] '.red + "#{e.reason.capitalize} for '#{arg}' option."}
|
59
|
+
puts option_parser
|
60
|
+
rescue OptionParser::InvalidOption => e
|
61
|
+
puts '[!] '.red + "#{e}"
|
62
|
+
puts option_parser
|
63
|
+
rescue Exception => e
|
64
|
+
puts e.backtrace
|
65
|
+
puts e.backtrace_locations
|
66
|
+
puts e
|
67
|
+
end
|
68
|
+
|
69
|
+
|
data/hackernote.gemspec
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "hackernote"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "hackernote"
|
8
|
+
spec.version = HackerNote::VERSION
|
9
|
+
spec.authors = ["KING SABRI"]
|
10
|
+
spec.email = ["king.sabri@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Hacker's Note - A command-line tool creates gitbook compatible structure for pentest and read team projects.}
|
13
|
+
spec.description = %Q{Hacker's Note - A command-line tool creates gitbook compatible structure for pentest and read team projects.\nHelps security professionals to organize their notes in a gitbook structure for PT/RT engagements.}
|
14
|
+
spec.homepage = "https://github.com/TechArchSA/HackersNote"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject {|f| f.match(%r{^(test|spec|features)/})}
|
18
|
+
spec.bindir = "bin"
|
19
|
+
spec.executables = ['hackernote']
|
20
|
+
spec.require_paths = ["lib"]
|
21
|
+
|
22
|
+
spec.post_install_message = HackerNote::Utils.logo
|
23
|
+
end
|
data/lib/hackernote.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# Standard libraries
|
2
|
+
require 'optparse'
|
3
|
+
require 'fileutils'
|
4
|
+
require 'pathname'
|
5
|
+
require 'find'
|
6
|
+
require 'mkmf'
|
7
|
+
require 'readline'
|
8
|
+
|
9
|
+
# HackerNote
|
10
|
+
require "hackernote/version"
|
11
|
+
require "hackernote/extensions"
|
12
|
+
require "hackernote/utils"
|
13
|
+
require "hackernote/gitbook_builder"
|
14
|
+
require "hackernote/git"
|
15
|
+
|
16
|
+
|
17
|
+
module HackerNote
|
18
|
+
String.class_eval do
|
19
|
+
include Extensions::String
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module HackerNote
|
2
|
+
module Extensions
|
3
|
+
module String
|
4
|
+
# Colors
|
5
|
+
def red; colorize(self, "\e[1m\e[31m"); end
|
6
|
+
def green; colorize(self, "\e[1m\e[32m"); end
|
7
|
+
def dark_green; colorize(self, "\e[32m"); end
|
8
|
+
def yellow; colorize(self, "\e[1m\e[33m"); end
|
9
|
+
def blue; colorize(self, "\e[1m\e[34m"); end
|
10
|
+
def dark_blue; colorize(self, "\e[34m"); end
|
11
|
+
def purple; colorize(self, "\e[35m"); end
|
12
|
+
def dark_purple; colorize(self, "\e[1;35m"); end
|
13
|
+
def cyan; colorize(self, "\e[1;36m"); end
|
14
|
+
def dark_cyan; colorize(self, "\e[36m"); end
|
15
|
+
def pure; colorize(self, "\e[0m\e[28m"); end
|
16
|
+
def underline; colorize(self, "\e[4m"); end
|
17
|
+
def bold; colorize(self, "\e[1m"); end
|
18
|
+
def reset; colorize(self, "\e[0m\e[28m"); end
|
19
|
+
def colorize(text, color_code) "#{color_code}#{text}\e[0m" end
|
20
|
+
|
21
|
+
# Cursor
|
22
|
+
def mv_down(n=1) cursor(self, "\033[#{n}B") end
|
23
|
+
def cls_upline; cursor(self, "\e[K") end
|
24
|
+
def cursor(text, position)"\r#{position}#{text}" end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module HackerNote
|
2
|
+
class Git
|
3
|
+
|
4
|
+
attr_accessor :git
|
5
|
+
def initialize
|
6
|
+
@git = find_executable0 'git'
|
7
|
+
end
|
8
|
+
|
9
|
+
# Setup git repo
|
10
|
+
def setup(project, git_url='')
|
11
|
+
puts '[+] '.bold + 'Git Setup:'.bold.underline
|
12
|
+
|
13
|
+
git_cmds =
|
14
|
+
[
|
15
|
+
"git init",
|
16
|
+
"git add -A",
|
17
|
+
"git commit -m 'Initial #{project} commit'",
|
18
|
+
"git remote add origin #{git_url}",
|
19
|
+
"git push origin master",
|
20
|
+
"git checkout -b YourName",
|
21
|
+
"git push origin YourName"
|
22
|
+
]
|
23
|
+
if @git
|
24
|
+
puts '[>] '.bold + "Found 'git' installed!"
|
25
|
+
puts '[-] '.bold + "Initiating local git repository."
|
26
|
+
git_cmds.first(4).each do |cmd|
|
27
|
+
puts "[>] ".bold + "executing: " + "#{cmd}".dark_green
|
28
|
+
`#{cmd}`
|
29
|
+
end
|
30
|
+
puts "[!] ".yellow + "Please do not forget to:".underline
|
31
|
+
git_cmds.last(3).each {|cmd| puts "$ ".bold + "#{cmd}".dark_green}
|
32
|
+
else
|
33
|
+
puts '[x] '.red.bold + "git command can't be found (or you didn't use '--git' switch)."
|
34
|
+
puts '[!] '.yellow + "Please install 'git' command then do the following (or use --git switch if git is installed):"
|
35
|
+
git_cmds.each {|cmd| puts "$> ".bold + "#{cmd}".dark_green}
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,194 @@
|
|
1
|
+
module HackerNote
|
2
|
+
#
|
3
|
+
# GitbookBuild class
|
4
|
+
# for all gitbook related work (build gitbook files, targets files, project readme, etc)
|
5
|
+
#
|
6
|
+
class GitbookBuilder
|
7
|
+
|
8
|
+
# Builder wrapper
|
9
|
+
def build(project_name, target_list)
|
10
|
+
@project_name = project_name
|
11
|
+
@target_list = target_list
|
12
|
+
|
13
|
+
puts '[+] '.bold + 'Gitbook Setup:'.bold.underline
|
14
|
+
set_env
|
15
|
+
build_gitbook_files
|
16
|
+
build_targets_files
|
17
|
+
build_project_readme
|
18
|
+
general_fixes
|
19
|
+
end
|
20
|
+
|
21
|
+
# set environment requirements
|
22
|
+
def set_env
|
23
|
+
set_project_dir
|
24
|
+
set_targets_list
|
25
|
+
Dir.chdir @project_path
|
26
|
+
end
|
27
|
+
|
28
|
+
# set the project main directory @see #set_env
|
29
|
+
def set_project_dir
|
30
|
+
@project_path = Pathname.new(@project_name).basename
|
31
|
+
|
32
|
+
if Dir.exist?(@project_path)
|
33
|
+
rename = "#{@project_path}_#{Time.now.to_i}"
|
34
|
+
puts '[-] '.bold + "Renaming Existing directory '#{@project_path}' to '#{rename}'"
|
35
|
+
FileUtils.mv(@project_path, rename)
|
36
|
+
end
|
37
|
+
|
38
|
+
puts '[-] '.bold + "Creating #{@project_name} directory"
|
39
|
+
Dir.mkdir @project_name
|
40
|
+
end
|
41
|
+
|
42
|
+
# check targets list, @see #set_env
|
43
|
+
# if file read each line as a target,
|
44
|
+
# if file not exists, consider the given name as a target
|
45
|
+
#
|
46
|
+
# @return Array of target names
|
47
|
+
def set_targets_list
|
48
|
+
if File.file? @target_list
|
49
|
+
@list_of_targets = File.open(@target_list).each_line(chomp: true).map(&:strip).reject(&:nil?).reject(&:empty?)
|
50
|
+
else
|
51
|
+
puts "[!] ".yellow + "No targets list file, assuming '#{@target_list}' as a target name."
|
52
|
+
@list_of_targets = [@target_list]
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
# build gitbook's main files such as book.json, SUMMARY.md and README.md
|
57
|
+
def build_gitbook_files
|
58
|
+
puts '[-] '.bold + "Creating gitbook's main files.'"
|
59
|
+
prj_files = %w[book.json SUMMARY.md README.md]
|
60
|
+
prj_files.each do |file|
|
61
|
+
File.write(file, "# #{file.split('.').first.capitalize}\n\n")
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
# build_targets_files builds project related files
|
66
|
+
#
|
67
|
+
# @example:
|
68
|
+
# targetX/
|
69
|
+
# scanning_and_enumeration.md
|
70
|
+
# critical.md
|
71
|
+
# high.md
|
72
|
+
# medium.md
|
73
|
+
# low.md
|
74
|
+
# informational.md
|
75
|
+
# notes.md
|
76
|
+
def build_targets_files
|
77
|
+
puts '[-] '.bold + "Creating targets' files and directories."
|
78
|
+
target_main_files = %W[scanning_and_enumeration.md critical.md high.md medium.md low.md informational.md notes.md]
|
79
|
+
|
80
|
+
@list_of_targets.each do |target|
|
81
|
+
target = fix_project_naming(target)
|
82
|
+
target_files = target_main_files.dup
|
83
|
+
target_files.unshift "#{target}.md"
|
84
|
+
Dir.mkdir(target)
|
85
|
+
create_summary_record(target)
|
86
|
+
target_files.each do |t_file|
|
87
|
+
file_path = File.join(target, t_file)
|
88
|
+
heading1 = t_file.split('.md').first.capitalize # Each file's title
|
89
|
+
File.write(file_path, "# #{heading1}\n\n")
|
90
|
+
open(file_path, 'a') do |file|
|
91
|
+
file.puts "# #{heading1}\n\n"
|
92
|
+
file.puts build_target_notes if heading1.include? 'Notes'
|
93
|
+
end
|
94
|
+
create_summary_record(file_path.to_s) unless heading1 =~ /#{target}/i
|
95
|
+
end
|
96
|
+
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
# build_target_notes builds the content of notes file
|
101
|
+
def build_target_notes
|
102
|
+
<<~NOTES
|
103
|
+
## To Be Checked
|
104
|
+
|
105
|
+
|
106
|
+
## To Be Deleted
|
107
|
+
|
108
|
+
* Users
|
109
|
+
* user1
|
110
|
+
* user2
|
111
|
+
* Files/Directories/URL
|
112
|
+
* filepath1
|
113
|
+
* filepath1
|
114
|
+
|
115
|
+
NOTES
|
116
|
+
end
|
117
|
+
|
118
|
+
# Create summary records @see #build_targets_files
|
119
|
+
def create_summary_record(file_path)
|
120
|
+
record = File.open('SUMMARY.md', 'a+')
|
121
|
+
path = File.split file_path
|
122
|
+
title = path.last.split('.md').first.capitalize
|
123
|
+
path.delete_if {|p| p == '.'}
|
124
|
+
align = "#{' ' * path.index(path.last)}* "
|
125
|
+
file_path = "#{file_path}/#{file_path}.md" if File.directory? file_path
|
126
|
+
the_record = "#{align}[#{title}](#{file_path})"
|
127
|
+
record.puts the_record
|
128
|
+
record.close
|
129
|
+
print "\r#{the_record}".cls_upline
|
130
|
+
sleep 0.1
|
131
|
+
end
|
132
|
+
|
133
|
+
# README.md generator
|
134
|
+
def build_project_readme
|
135
|
+
readme = <<~README
|
136
|
+
# #{@project_name}
|
137
|
+
## Customer Requests and Concerns
|
138
|
+
1. No DoS Attacks
|
139
|
+
2. Automated scan should be gentle at production time
|
140
|
+
3. ABCDEFG
|
141
|
+
|
142
|
+
| Timeline | Date |
|
143
|
+
| :--- | :--- |
|
144
|
+
| Project Testing Start | 1/1/2030 |
|
145
|
+
| Project Testing End | 1/1/2030 |
|
146
|
+
|
147
|
+
## Applications progress
|
148
|
+
|
149
|
+
| Host/IP | # of issues | Progress % | Issues | Notes | misc. |
|
150
|
+
| :--- | :--- | :--- | :--- | :--- | :--- |
|
151
|
+
#{@list_of_targets.map {|host| "|#{host} | | | | | |" }.join("\n")}
|
152
|
+
|
153
|
+
### Point Of Contact
|
154
|
+
| Name | email | Mobile number | Job title/Role |
|
155
|
+
| :--- | :--- | :--- | :--- |
|
156
|
+
| Firstname Lastname | email2@email.com | 0550000000 | |
|
157
|
+
|
158
|
+
### Source IP Addresses log
|
159
|
+
This list has to be regularly update!
|
160
|
+
|
161
|
+
| Engineer 1 | Engineer 2 |
|
162
|
+
| :--- | :--- |
|
163
|
+
| x.x.x.x | y.y.y.y |
|
164
|
+
| x.x.x.x | y.y.y.y |
|
165
|
+
| x.x.x.x | y.y.y.y |
|
166
|
+
|
167
|
+
## Scope
|
168
|
+
|
169
|
+
**Approach:**
|
170
|
+
|
171
|
+
**IP ranges**
|
172
|
+
|
173
|
+
**Domains**
|
174
|
+
|
175
|
+
**Credentials**
|
176
|
+
|
177
|
+
## Clean up
|
178
|
+
| Host | URL/Files | Description |
|
179
|
+
| :--- | :--- | :--- |
|
180
|
+
| | |
|
181
|
+
README
|
182
|
+
File.write('README.md', readme)
|
183
|
+
end
|
184
|
+
|
185
|
+
# general fixes
|
186
|
+
def general_fixes
|
187
|
+
# fix for book.json
|
188
|
+
File.write('book.json', '{ }')
|
189
|
+
# Create 'files' directory, general place for project related files and scripts
|
190
|
+
Dir.mkdir 'files'
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
module HackerNote
|
2
|
+
module Utils
|
3
|
+
|
4
|
+
# fix target/project name if the target is a URL (eg. http://example.com/app1/route2/)
|
5
|
+
# @return [String]
|
6
|
+
def fix_project_naming(project)
|
7
|
+
project.gsub(/http[:|s]+\/\//, '').gsub('/', '-').gsub(/-*$/, '')
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.logo
|
11
|
+
slogan = 'The Cyber Daemons - '.reset + 'TechArch'.bold
|
12
|
+
%Q{
|
13
|
+
______
|
14
|
+
'!!""""""""""""*!!'
|
15
|
+
.u$"!' .!!"$"
|
16
|
+
*$! 'z` ($!
|
17
|
+
+$- .$$&` !$!
|
18
|
+
+$- `$$$$3 !$!
|
19
|
+
+$' !! '!$! !! !$!
|
20
|
+
+$' ($$. !$! '$$! !$!
|
21
|
+
+$' $$$$ !$! $$$$ !$!
|
22
|
+
+$' .$" !$! 3$ !$!
|
23
|
+
($! `$%` !3! .$% ($!
|
24
|
+
($(` '"$! `*$"` ."$!
|
25
|
+
`($(` '"$!.($". ."$!
|
26
|
+
`($(` !$$%. ."$!
|
27
|
+
`!$%$! !$%$!
|
28
|
+
` `
|
29
|
+
#{slogan}
|
30
|
+
}.red.bold
|
31
|
+
end
|
32
|
+
|
33
|
+
# banner
|
34
|
+
def self.banner
|
35
|
+
version = "v#{HackerNote::VERSION}".underline.reset
|
36
|
+
%Q{
|
37
|
+
______ ____ ______ ____
|
38
|
+
| | .'. .~ ~.| ..''| |`````````, ..'''' |.. |.~ ~.`````|`````|
|
39
|
+
|_________| .''```. | |..'' |______ |'''|''''' .'' | ``.. | | | |______
|
40
|
+
| | .' `. | |``.. | | `. ..' | ``.. | | | |
|
41
|
+
| |.' `.`.______.'| ``..|__________| `....'' | ``|`.______.' | |___________
|
42
|
+
#{version}
|
43
|
+
}.bold
|
44
|
+
end
|
45
|
+
|
46
|
+
# ask method for interactive session with user
|
47
|
+
def ask(question, expected_answer)
|
48
|
+
answer = ''
|
49
|
+
until answer.match?(expected_answer)
|
50
|
+
answer = Readline.readline(question, true)
|
51
|
+
end
|
52
|
+
|
53
|
+
answer
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
metadata
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: hackernote
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- KING SABRI
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-01-17 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: |-
|
14
|
+
Hacker's Note - A command-line tool creates gitbook compatible structure for pentest and read team projects.
|
15
|
+
Helps security professionals to organize their notes in a gitbook structure for PT/RT engagements.
|
16
|
+
email:
|
17
|
+
- king.sabri@gmail.com
|
18
|
+
executables:
|
19
|
+
- hackernote
|
20
|
+
extensions: []
|
21
|
+
extra_rdoc_files: []
|
22
|
+
files:
|
23
|
+
- ".gitignore"
|
24
|
+
- Gemfile
|
25
|
+
- LICENSE.txt
|
26
|
+
- README.md
|
27
|
+
- Rakefile
|
28
|
+
- bin/hackernote
|
29
|
+
- hackernote.gemspec
|
30
|
+
- lib/hackernote.rb
|
31
|
+
- lib/hackernote/extensions.rb
|
32
|
+
- lib/hackernote/git.rb
|
33
|
+
- lib/hackernote/gitbook_builder.rb
|
34
|
+
- lib/hackernote/utils.rb
|
35
|
+
- lib/hackernote/version.rb
|
36
|
+
homepage: https://github.com/TechArchSA/HackersNote
|
37
|
+
licenses:
|
38
|
+
- MIT
|
39
|
+
metadata: {}
|
40
|
+
post_install_message: "\e[1m\e[1m\e[31m\n ______\n '!!\"\"\"\"\"\"\"\"\"\"\"\"*!!'\n
|
41
|
+
\ .u$\"!' .!!\"$\"\n *$! 'z` ($!\n +$- .$$&`
|
42
|
+
\ !$!\n +$- `$$$$3 !$!\n +$' !! '!$! !! !$!\n +$'
|
43
|
+
\ ($$. !$! '$$! !$!\n +$' $$$$ !$! $$$$ !$!\n +$' .$\" !$! 3$
|
44
|
+
\ !$!\n ($! `$%` !3! .$% ($!\n ($(` '\"$! `*$\"` .\"$!\n `($(`
|
45
|
+
'\"$!.($\". .\"$!\n `($(` !$$%. .\"$!\n `!$%$! !$%$!\n `
|
46
|
+
\ `\n \e[0m\e[28mThe Cyber Daemons - \e[0m\e[1mTechArch\e[0m\n
|
47
|
+
\ \e[0m\e[0m"
|
48
|
+
rdoc_options: []
|
49
|
+
require_paths:
|
50
|
+
- lib
|
51
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
61
|
+
requirements: []
|
62
|
+
rubyforge_project:
|
63
|
+
rubygems_version: 2.6.13
|
64
|
+
signing_key:
|
65
|
+
specification_version: 4
|
66
|
+
summary: Hacker's Note - A command-line tool creates gitbook compatible structure
|
67
|
+
for pentest and read team projects.
|
68
|
+
test_files: []
|