vault backup: 2024-12-01 23:50:59
This commit is contained in:
107
.obsidian/workspace.json
vendored
107
.obsidian/workspace.json
vendored
@@ -13,12 +13,12 @@
|
|||||||
"state": {
|
"state": {
|
||||||
"type": "markdown",
|
"type": "markdown",
|
||||||
"state": {
|
"state": {
|
||||||
"file": "Penetration Testing/Week 7/Lecture 7 - Vulnerability Scanning.md",
|
"file": "Penetration Testing/Week 11/Lecture 11 - Enumeration.md",
|
||||||
"mode": "source",
|
"mode": "source",
|
||||||
"source": false
|
"source": false
|
||||||
},
|
},
|
||||||
"icon": "lucide-file",
|
"icon": "lucide-file",
|
||||||
"title": "Lecture 7 - Vulnerability Scanning"
|
"title": "Lecture 11 - Enumeration"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -78,7 +78,8 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"direction": "horizontal",
|
"direction": "horizontal",
|
||||||
"width": 395.5
|
"width": 395.5,
|
||||||
|
"collapsed": true
|
||||||
},
|
},
|
||||||
"right": {
|
"right": {
|
||||||
"id": "ee8f6df41634f71e",
|
"id": "ee8f6df41634f71e",
|
||||||
@@ -94,7 +95,7 @@
|
|||||||
"state": {
|
"state": {
|
||||||
"type": "backlink",
|
"type": "backlink",
|
||||||
"state": {
|
"state": {
|
||||||
"file": "Penetration Testing/Week 7/Lecture 7 - Vulnerability Scanning.md",
|
"file": "Penetration Testing/Assessment/Stage 1 - RoE.md",
|
||||||
"collapseAll": false,
|
"collapseAll": false,
|
||||||
"extraContext": false,
|
"extraContext": false,
|
||||||
"sortOrder": "alphabetical",
|
"sortOrder": "alphabetical",
|
||||||
@@ -104,7 +105,7 @@
|
|||||||
"unlinkedCollapsed": true
|
"unlinkedCollapsed": true
|
||||||
},
|
},
|
||||||
"icon": "links-coming-in",
|
"icon": "links-coming-in",
|
||||||
"title": "Backlinks for Lecture 7 - Vulnerability Scanning"
|
"title": "Backlinks for Stage 1 - RoE"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -113,12 +114,12 @@
|
|||||||
"state": {
|
"state": {
|
||||||
"type": "outgoing-link",
|
"type": "outgoing-link",
|
||||||
"state": {
|
"state": {
|
||||||
"file": "Penetration Testing/Week 7/Lecture 7 - Vulnerability Scanning.md",
|
"file": "Penetration Testing/Assessment/Stage 1 - RoE.md",
|
||||||
"linksCollapsed": false,
|
"linksCollapsed": false,
|
||||||
"unlinkedCollapsed": true
|
"unlinkedCollapsed": true
|
||||||
},
|
},
|
||||||
"icon": "links-going-out",
|
"icon": "links-going-out",
|
||||||
"title": "Outgoing links from Lecture 7 - Vulnerability Scanning"
|
"title": "Outgoing links from Stage 1 - RoE"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -140,10 +141,10 @@
|
|||||||
"state": {
|
"state": {
|
||||||
"type": "outline",
|
"type": "outline",
|
||||||
"state": {
|
"state": {
|
||||||
"file": "Penetration Testing/Week 7/Lecture 7 - Vulnerability Scanning.md"
|
"file": "Penetration Testing/Assessment/Stage 1 - RoE.md"
|
||||||
},
|
},
|
||||||
"icon": "lucide-list",
|
"icon": "lucide-list",
|
||||||
"title": "Outline of Lecture 7 - Vulnerability Scanning"
|
"title": "Outline of Stage 1 - RoE"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -200,52 +201,52 @@
|
|||||||
},
|
},
|
||||||
"active": "d83bb0bbeeb86eec",
|
"active": "d83bb0bbeeb86eec",
|
||||||
"lastOpenFiles": [
|
"lastOpenFiles": [
|
||||||
"Software Project with Agile Techinques/Assignment/lu12412ehlt.tmp",
|
"Client Server Systems/Ecobuddy/paginationcontroller.php~",
|
||||||
"Data Structures/Past-Exam-Qestions.odt",
|
"Client Server Systems/Ecobuddy/Models/FacilityDataSet.php~",
|
||||||
"Data Structures/lu12412ehlq.tmp",
|
"Client Server Systems/Ecobuddy/Models/Paginator.php~",
|
||||||
|
"Client Server Systems/Ecobuddy/index.php~",
|
||||||
|
"Client Server Systems/Ecobuddy/css/my-style.css~",
|
||||||
|
"Client Server Systems/Ecobuddy/Views/template/pagination.phtml~",
|
||||||
|
"Client Server Systems/Ecobuddy/Views/template/footer.phtml~",
|
||||||
|
"Client Server Systems/Ecobuddy/Views/template/header.phtml~",
|
||||||
|
"Client Server Systems/Ecobuddy/Views/index.phtml~",
|
||||||
|
"Client Server Systems/Ecobuddy/Views/template/logoutButton.phtml~",
|
||||||
|
"Client Server Systems/Ecobuddy/postTestHandler.php~",
|
||||||
|
"Client Server Systems/Ecobuddy/images/ecoBuddy_x128.png",
|
||||||
|
"Client Server Systems/Ecobuddy/images/ecoBuddy_x128.jpg",
|
||||||
|
"Client Server Systems/Ecobuddy/images/ecoBuddy_x64.jpg",
|
||||||
|
"Client Server Systems/Ecobuddy/images/ecoBuddy_x64.png",
|
||||||
|
"Client Server Systems/Ecobuddy/images/ecoBuddy_x32.png",
|
||||||
|
"Client Server Systems/Ecobuddy/images/ecoBuddy_x32.jpg",
|
||||||
|
"Data Structures/GPT Answers to Past Paper/Question 3.md",
|
||||||
|
"Penetration Testing/Week 11/Lecture 11 - Enumeration.md",
|
||||||
|
"Data Structures/GPT Answers to Past Paper/Question 4.md",
|
||||||
|
"Data Structures/GPT Answers to Past Paper/Question 5.md",
|
||||||
|
"Data Structures/GPT Answers to Past Paper/Question 6.md",
|
||||||
|
"Data Structures/GPT Answers to Past Paper/Question 7.md",
|
||||||
|
"Data Structures/GPT Answers to Past Paper/Question 8.md",
|
||||||
|
"Data Structures/GPT Answers to Past Paper/Question 9.md",
|
||||||
|
"Data Structures/GPT Answers to Past Paper/Question 10.md",
|
||||||
|
"Data Structures/GPT Answers to Past Paper/Question 1.md",
|
||||||
|
"Data Structures/GPT Answers to Past Paper/Question 2.md",
|
||||||
|
"Data Structures/Untitled.md",
|
||||||
"Data Structures/Week 7/Week 7.md",
|
"Data Structures/Week 7/Week 7.md",
|
||||||
"Penetration Testing/Week 7/Lecture 7 - Vulnerability Scanning.md",
|
"Data Structures/GPT Answers to Past Paper.md",
|
||||||
"Penetration Testing/Week 7",
|
|
||||||
"Software Project with Agile Techinques/Assignment/Assignment 1.odt",
|
|
||||||
"Software Project with Agile Techinques/Assignment/lu12412ehh9.tmp",
|
|
||||||
"Penetration Testing/Week 6/Workshop 6.md",
|
|
||||||
"Data Structures/Week 7",
|
|
||||||
"Penetration Testing/Week 6/dns-exfil-infil/securecorp.txt",
|
|
||||||
"Penetration Testing/Week 6/dns-exfil-infil/requirements.txt",
|
|
||||||
"Penetration Testing/Week 6/dns-exfil-infil/packetySimple.py",
|
|
||||||
"Penetration Testing/Week 6/dns-exfil-infil/packetyGrabber.py",
|
|
||||||
"Penetration Testing/Week 6/dns-exfil-infil/README.md",
|
|
||||||
"Penetration Testing/Week 6/dns-exfil-infil/dns-exfil-infil/README.md",
|
|
||||||
"Pasted image 20241025143543.png",
|
|
||||||
"Pasted image 20241025141715.png",
|
|
||||||
"Pasted image 20241025141348.png",
|
|
||||||
"Software Project with Agile Techinques/Assignment/Assignment 1.md",
|
|
||||||
"AI & Data Mining/Week 6/Lecture 12 - Decision Trees (ID3).md",
|
|
||||||
"Pasted image 20241025132339.png",
|
|
||||||
"AI & Data Mining/Week 6/Lecture 11 - ID3.md",
|
|
||||||
"Pasted image 20241024132906.png",
|
|
||||||
"Pasted image 20241024132411.png",
|
|
||||||
"Client Server Systems/PHPStorm Repo/workshop6/images/new_uos_logo.jpg",
|
|
||||||
"Client Server Systems/PHPStorm Repo/workshop6/fonts/glyphicons-halflings-regular.svg",
|
|
||||||
"Penetration Testing/Week 6/Lecture 6 - Threat Modelling.md",
|
|
||||||
"Pasted image 20241024094143.png",
|
|
||||||
"Pasted image 20241024094123.png",
|
|
||||||
"AI & Data Mining/Week 5/Tutorial 9 - PRISM.md",
|
|
||||||
"AI & Data Mining/Week 5/Lecture 9 - PRISM.md",
|
|
||||||
"AI & Data Mining/Week 4/Workshop 4 - Nearest Neighbor.md",
|
|
||||||
"Networking and Security/Week 4/Workshop 4 - Routing.md",
|
|
||||||
"Penetration Testing/Week 4/Workshop 4 - Google Dorking.md",
|
|
||||||
"Penetration Testing/Week 4/Week 4 - Pre-Engagement.md",
|
|
||||||
"Penetration Testing/Week 3/Lecture 3 - Blue Team.md",
|
|
||||||
"Penetration Testing/Week 5/Lecture 5 - Reconnaisance.md",
|
|
||||||
"Data Structures/Week 5/Lecture 9 - Stacks.md",
|
"Data Structures/Week 5/Lecture 9 - Stacks.md",
|
||||||
"Client Server Systems/PHPStorm Repo/README.md",
|
"Data Structures/Week 4/Week 4 - Exceptions.md",
|
||||||
"PHPStorm/README.md",
|
"Data Structures/Week 3/Lecture 5 - Linear List.md",
|
||||||
"Software Project with Agile Techinques/Week 3/Study Skills - Class Diagrams.md",
|
"Data Structures/Week 3/Workshop 3 - ADTs.md",
|
||||||
"README.md",
|
"Career Development/Assessment.md",
|
||||||
"AI & Data Mining/Week 4/Tutorial 4 - Nearest Neighbor.md",
|
"AI & Data Mining/Week 9/Chapter 15.md",
|
||||||
"AI & Data Mining/Week 4/Lecture 7 - Nearest Neighbor.md",
|
"AI & Data Mining/Week 8/Lecture 16 - Evaluating Concept Descriptions.md",
|
||||||
"Penetration Testing/Week 3/Workshop 3 - netcat.md",
|
"Networking and Security/Week 2/Lecture 3 - IP4 and Subnetting.md",
|
||||||
|
"Networking and Security/Week 3/Workshop 3 - Subnetting.md",
|
||||||
|
"Networking and Security/Week 4/Lecture 8.md",
|
||||||
|
"Networking and Security/Week 4/Workshop 4 - Routing.md",
|
||||||
|
"Client Server Systems/Ecobuddy/images/new_uos_logo.jpg",
|
||||||
|
"Client Server Systems/Ecobuddy/fonts/glyphicons-halflings-regular.svg",
|
||||||
|
"Client Server Systems/Ecobuddy/MVCTemplate/images/new_uos_logo.jpg",
|
||||||
|
"Client Server Systems/Ecobuddy/MVCTemplate/fonts/glyphicons-halflings-regular.svg",
|
||||||
"Database Systems/Untitled.canvas",
|
"Database Systems/Untitled.canvas",
|
||||||
"Untitled 1.canvas",
|
"Untitled 1.canvas",
|
||||||
"Untitled.canvas"
|
"Untitled.canvas"
|
||||||
|
0
AI & Data Mining/Week 7/Chapter 13 - ID3.md
Normal file
0
AI & Data Mining/Week 7/Chapter 13 - ID3.md
Normal file
33
AI & Data Mining/Week 9/Chapter 15.md
Normal file
33
AI & Data Mining/Week 9/Chapter 15.md
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
1)
|
||||||
|
a) Binomial Distribution
|
||||||
|
b) Measures dispersion of probabilities with respect to a mean average value. Each possible value of S from 0 to N, the probability of observing S correct predictions given a sample of N independent examples of true accuracy P
|
||||||
|
|
||||||
|
2)
|
||||||
|
a) (150 + 180 + 420) / (150 + 180 + 420 + 30 + 50 + 50 + 40 + 50 + 30) = 0.75
|
||||||
|
|
||||||
|
# Variance of S $\sigma^2_S = N_p(1-p)$
|
||||||
|
# Std Dev of S $\sigma_S = \sqrt{N_p(1-p)}$
|
||||||
|
# Variance in F $\sigma_f = \frac{\sigma_S}{N} = \sqrt{\frac{N_p(1-p)}{N^2}} = \sqrt{\frac{p(1-p)}{N}}$
|
||||||
|
|
||||||
|
# Estimate of Predictive Accuracy $\mu_f = \frac{S}{N}$
|
||||||
|
# Successful Trials $S$
|
||||||
|
# Number of Trials $N$
|
||||||
|
|
||||||
|
|
||||||
|
750 Successes 1000 Trials
|
||||||
|
S = 750
|
||||||
|
N = 1000
|
||||||
|
$\mu_f$ = 0.75
|
||||||
|
$\sqrt{(0.75 \times 0.25)/1000} = 0.0137$
|
||||||
|
when c = 80%, (100-80)/2 = 10%, z = 1.28
|
||||||
|
|
||||||
|
$\mu_f \pm z \times \sigma_f = 0.75 \pm (1.28 \times 0.0137)$
|
||||||
|
$= 0.75 \pm 0.0175$
|
||||||
|
|
||||||
|
p lies between 73.25% and 76.75%, with 80% confidence.
|
||||||
|
|
||||||
|
3)
|
||||||
|
a)
|
||||||
|
Stratified Holdout, data split to guarantee same distribution of class values in training and test set
|
||||||
|
b)
|
||||||
|
Repeated Holdout, training and testing done several times with different splits. Overall estimate of predictive accuracy is average of predicted accuracy in different iteration
|
62
Career Development/Assessment.md
Normal file
62
Career Development/Assessment.md
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
### **1. Introduction**
|
||||||
|
|
||||||
|
- Briefly introduce the purpose of the report.
|
||||||
|
- State that you will reflect on your current soft skills, provide evidence from your technical and customer service experiences, and identify areas for development with steps for improvement.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### **2. Current Soft Skills**
|
||||||
|
|
||||||
|
- **2.1 Problem-Solving**
|
||||||
|
|
||||||
|
- Define problem-solving as the ability to identify and resolve issues effectively.
|
||||||
|
- **Evidence**: Discuss how building and deploying virtual machines and Docker applications often required troubleshooting issues such as configuration errors or failed deployments. Highlight specific examples of challenges you resolved.
|
||||||
|
- **2.2 Communication**
|
||||||
|
|
||||||
|
- Define communication as the ability to convey information clearly and effectively.
|
||||||
|
- **Evidence**: Share examples from your phone shop role, such as explaining technical details to non-technical customers, resolving complaints, or ensuring customer understanding of credit and data protection policies.
|
||||||
|
- **2.3 Time Management**
|
||||||
|
|
||||||
|
- Define time management as the ability to prioritize tasks and use time effectively.
|
||||||
|
- **Evidence**: Highlight instances where you balanced multiple responsibilities, such as meeting deployment deadlines for technical projects while managing your commitments at the phone shop.
|
||||||
|
- **2.4 Adaptability**
|
||||||
|
|
||||||
|
- Define adaptability as the ability to adjust to new challenges or environments.
|
||||||
|
- **Evidence**: Provide examples of adapting to new tools or technologies in your technical work (e.g., learning Docker or new hosting systems) or adjusting to varied customer needs and situations in your shop role.
|
||||||
|
- **2.5 Attention to Detail**
|
||||||
|
|
||||||
|
- Define attention to detail as the ability to focus on accuracy and precision.
|
||||||
|
- **Evidence**: Mention your success in configuring virtual machines and Docker containers without critical errors, as well as ensuring compliance with credit and data protection regulations in your phone shop role.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### **3. Areas for Development**
|
||||||
|
|
||||||
|
- List soft skills you feel need improvement (e.g., conflict resolution, leadership, or emotional intelligence).
|
||||||
|
- For each skill:
|
||||||
|
- Explain why you think it’s important to develop this skill.
|
||||||
|
- Outline the steps you are taking or plan to take, such as attending training, practicing in real-life situations, or seeking feedback.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### **4. Plans for Continuous Improvement**
|
||||||
|
|
||||||
|
- Discuss how the skills audit in Week 3 and the psychometric test in Week 7 will help you further assess your strengths and weaknesses.
|
||||||
|
- Mention how these tools will guide your development plan for the rest of the academic year.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### **5. Conclusion**
|
||||||
|
|
||||||
|
- Summarize your key reflections, emphasizing your strengths in problem-solving, communication, time management, adaptability, and attention to detail.
|
||||||
|
- Reaffirm your commitment to improving any identified weak areas and continuing your development throughout the year.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### **6. References (if needed)**
|
||||||
|
|
||||||
|
- List any sources, such as lecture slides or articles, that you referenced in your report.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
This structure seamlessly integrates your strengths while providing space to address growth areas and future plans.
|
BIN
Career Development/Wilkinson_George_Assessment1.odt
Normal file
BIN
Career Development/Wilkinson_George_Assessment1.odt
Normal file
Binary file not shown.
BIN
Career Development/Wilkinson_George_Assessment1.pdf
Normal file
BIN
Career Development/Wilkinson_George_Assessment1.pdf
Normal file
Binary file not shown.
1
Client Server Systems/Ecobuddy
Submodule
1
Client Server Systems/Ecobuddy
Submodule
Submodule Client Server Systems/Ecobuddy added at 00a29b9db7
76
Data Structures/GPT Answers to Past Paper/Question 1.md
Normal file
76
Data Structures/GPT Answers to Past Paper/Question 1.md
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
# Write a Java method pop() for a stack implemented using an array.
|
||||||
|
|
||||||
|
```java
|
||||||
|
public class Stack {
|
||||||
|
private int[] stackArray; // Array to hold stack elements
|
||||||
|
private int top; // Index of the top element
|
||||||
|
private int capacity; // Maximum capacity of the stack
|
||||||
|
// Constructor to initialize the stack
|
||||||
|
public Stack(int size) {
|
||||||
|
stackArray = new int[size];
|
||||||
|
capacity = size;
|
||||||
|
top = -1; // Indicates the stack is empty
|
||||||
|
}
|
||||||
|
// Method to add an element to the stack
|
||||||
|
public void push(int item) {
|
||||||
|
if (isFull()) {
|
||||||
|
throw new RuntimeException("Stack overflow");
|
||||||
|
}
|
||||||
|
stackArray[++top] = item; // Increment top and store the item
|
||||||
|
}
|
||||||
|
// Method to remove and return the top element of the stack
|
||||||
|
public int pop() {
|
||||||
|
if (isEmpty()) {
|
||||||
|
throw new RuntimeException("Stack underflow");
|
||||||
|
} return stackArray[top--]; // Return the top element and decrement top
|
||||||
|
}
|
||||||
|
// Method to check if the stack is empty
|
||||||
|
public boolean isEmpty() {
|
||||||
|
return top == -1;
|
||||||
|
}
|
||||||
|
// Method to check if the stack is full
|
||||||
|
public boolean isFull() {
|
||||||
|
return top == capacity - 1;
|
||||||
|
}
|
||||||
|
// Method to view the top element without removing it
|
||||||
|
public int peek() {
|
||||||
|
if (isEmpty()) {
|
||||||
|
throw new RuntimeException("Stack is empty");
|
||||||
|
} return stackArray[top];
|
||||||
|
}
|
||||||
|
public static void main(String[] args) {
|
||||||
|
Stack stack = new Stack(5); // Create a stack with capacity 5
|
||||||
|
// Example usage
|
||||||
|
stack.push(10);
|
||||||
|
stack.push(20);
|
||||||
|
stack.push(30);
|
||||||
|
System.out.println(stack.pop()); // Output: 30
|
||||||
|
System.out.println(stack.pop()); // Output: 20
|
||||||
|
System.out.println(stack.pop()); // Output: 10
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Explanation:
|
||||||
|
|
||||||
|
1. **Array Storage**: The stack elements are stored in an array (`stackArray`).
|
||||||
|
2. **Pointer**: The `top` variable keeps track of the current top of the stack.
|
||||||
|
3. **Pop Operation**: The `pop()` method checks if the stack is empty using the `isEmpty()` method. If not, it returns the element at the `top` index and decrements `top`.
|
||||||
|
4. **Edge Cases**:
|
||||||
|
- **Underflow**: If the stack is empty, it throws a `RuntimeException`.
|
||||||
|
- **Overflow**: The `push()` method checks for overflow before adding elements.
|
||||||
|
|
||||||
|
This ensures a robust implementation of the `pop()` operation.
|
||||||
|
|
||||||
|
- The expression `stackArray[top--]` first retrieves the value at `stackArray[top]` and then **decrements `top`** by 1.
|
||||||
|
- This uses the **post-decrement operator (`--`)**, which means:
|
||||||
|
1. The value of `top` is used to access the current top element.
|
||||||
|
2. After accessing the value, `top` is decremented.
|
||||||
|
|
||||||
|
### Why `top` Controls the Stack?
|
||||||
|
|
||||||
|
The value of `top` acts as a pointer to the last valid element in the stack. By decrementing it, you effectively "remove" the topmost element from the stack, even though the value remains in the array until overwritten by a `push()` operation.
|
||||||
|
|
||||||
|
### Conclusion:
|
||||||
|
|
||||||
|
Yes, calling `pop()` **does update `top`**, which is crucial for maintaining the stack's state. This is a standard approach for implementing a stack using an array.
|
59
Data Structures/GPT Answers to Past Paper/Question 10.md
Normal file
59
Data Structures/GPT Answers to Past Paper/Question 10.md
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
To insert a node into a **binary search tree (BST)** while keeping the tree **balanced**, we need to perform the following steps:
|
||||||
|
|
||||||
|
1. **Insert the node** in the appropriate place according to the **BST properties** (left child < parent < right child).
|
||||||
|
2. After insertion, **rebalance the tree** (if necessary) to ensure that it remains balanced. A tree is considered balanced if the height difference between the left and right subtrees of any node is at most 1 (this is the **balanced binary tree** or **AVL tree** property).
|
||||||
|
|
||||||
|
### **Given Binary Search Tree**:
|
||||||
|
```
|
||||||
|
10
|
||||||
|
/ \
|
||||||
|
5 15
|
||||||
|
/ / \
|
||||||
|
2 12 20
|
||||||
|
```
|
||||||
|
|
||||||
|
### **Step 1: Insert 4 into the BST**
|
||||||
|
|
||||||
|
We start by inserting **4** into the BST:
|
||||||
|
|
||||||
|
- 4 is less than 10, so we move to the left of 10.
|
||||||
|
- 4 is less than 5, so we move to the left of 5.
|
||||||
|
- 4 is greater than 2, so 4 will be placed as the **right child** of 2.
|
||||||
|
|
||||||
|
After insertion, the tree looks like this:
|
||||||
|
```
|
||||||
|
10
|
||||||
|
/ \
|
||||||
|
5 15
|
||||||
|
/ / \
|
||||||
|
2 12 20
|
||||||
|
\
|
||||||
|
4
|
||||||
|
```
|
||||||
|
|
||||||
|
### **Step 2: Balance the Tree (If Needed)**
|
||||||
|
|
||||||
|
At this point, the tree is not balanced. Let's check the balance factors of the nodes:
|
||||||
|
|
||||||
|
- **Node 2** has a left subtree height of 0 and a right subtree height of 1. Its balance factor is `0 - 1 = -1`, which is acceptable.
|
||||||
|
- **Node 5** has a left subtree height of 1 and a right subtree height of 1. Its balance factor is `1 - 1 = 0`, which is balanced.
|
||||||
|
- **Node 10** has a left subtree height of 2 (because of nodes 5, 2, and 4) and a right subtree height of 2 (because of nodes 15, 12, and 20). Its balance factor is `2 - 2 = 0`, which is balanced.
|
||||||
|
|
||||||
|
Since the tree is balanced at all levels, **no further rebalancing is necessary**.
|
||||||
|
|
||||||
|
### **Final Balanced Tree**:
|
||||||
|
|
||||||
|
The final tree after inserting 4 is:
|
||||||
|
```
|
||||||
|
10
|
||||||
|
/ \
|
||||||
|
5 15
|
||||||
|
/ / \
|
||||||
|
2 12 20
|
||||||
|
\
|
||||||
|
4
|
||||||
|
```
|
||||||
|
|
||||||
|
### **Conclusion**:
|
||||||
|
|
||||||
|
After inserting 4, the tree remains balanced and no rotations are needed.
|
40
Data Structures/GPT Answers to Past Paper/Question 2.md
Normal file
40
Data Structures/GPT Answers to Past Paper/Question 2.md
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
# Describe a scenario where a stack data structure would be more suitable than a Queue
|
||||||
|
|
||||||
|
A **stack data structure** is more suitable than a queue in scenarios where you need to process items in a **Last-In, First-Out (LIFO)** order
|
||||||
|
### Scenario: **Undo Operation in Text Editors**
|
||||||
|
|
||||||
|
- **Description**: In text editors, when a user types, deletes, or performs other actions, these operations are stored so they can be undone in reverse order of execution.
|
||||||
|
- **Why a Stack?**:
|
||||||
|
- The most recent action (the "last-in") is the first one that should be undone (the "first-out").
|
||||||
|
- A stack efficiently tracks these operations, allowing actions to be added to the stack as they occur and popped off when the user undoes them.
|
||||||
|
- **How It Works**:
|
||||||
|
1. User types "Hello" → each character is pushed onto the stack.
|
||||||
|
2. User presses "Undo" → the stack pops the last character added.
|
||||||
|
|
||||||
|
### Scenario: **Call Stack in Recursion**
|
||||||
|
|
||||||
|
- **Description**: When a program uses recursion, the function calls are nested, and each call must finish before the previous one can resume.
|
||||||
|
- **Why a Stack?**:
|
||||||
|
- The current function (most recent call) must finish execution (be "popped" off the stack) before the previous function call can resume.
|
||||||
|
- The stack keeps track of the state and local variables for each function call.
|
||||||
|
- **How It Works**:
|
||||||
|
1. Function `A` calls `B`, which calls `C`.
|
||||||
|
2. The stack stores the execution state of `A`, then `B`, then `C` (last-in).
|
||||||
|
3. When `C` finishes, its state is removed (first-out), resuming `B`.
|
||||||
|
|
||||||
|
### Scenario: **Browser Backtracking**
|
||||||
|
|
||||||
|
- **Description**: When navigating a web browser, the "Back" button relies on a stack to revisit the most recently visited page.
|
||||||
|
- **Why a Stack?**:
|
||||||
|
- The most recent page (last-in) should be revisited first (first-out) when the user clicks "Back".
|
||||||
|
- **How It Works**:
|
||||||
|
1. User navigates to pages: A → B → C. Each page is pushed onto the stack.
|
||||||
|
2. Clicking "Back" pops the stack, returning to page `B`, then `A`.
|
||||||
|
|
||||||
|
### Key Contrast with a Queue:
|
||||||
|
|
||||||
|
- A **queue** is more suitable when processing items in a **First-In, First-Out (FIFO)** order, such as serving customer requests or scheduling tasks.
|
||||||
|
- A stack is better when you need **reversal** or to **process the most recent element first**, such as undo operations, recursion, or browser backtracking.
|
||||||
|
|
||||||
|
Describe a scenario where a stack data structure would be more suitable than a
|
||||||
|
Queue
|
76
Data Structures/GPT Answers to Past Paper/Question 3.md
Normal file
76
Data Structures/GPT Answers to Past Paper/Question 3.md
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
# What is a binary search tree, and how does it differ from a regular binary tree?
|
||||||
|
|
||||||
|
### **Binary Search Tree (BST):**
|
||||||
|
|
||||||
|
A **Binary Search Tree (BST)** is a type of binary tree where nodes are organized based on their key values to maintain a specific order. It adheres to the following properties:
|
||||||
|
|
||||||
|
1. **Left Subtree Rule**: For any node, all values in its left subtree are less than the value of the node.
|
||||||
|
2. **Right Subtree Rule**: For any node, all values in its right subtree are greater than the value of the node.
|
||||||
|
3. **Uniqueness**: Typically, BSTs do not allow duplicate values (though this can vary depending on implementation).
|
||||||
|
|
||||||
|
These properties ensure that a **BST is sorted**, which allows for efficient searching, insertion, and deletion operations.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### **Binary Tree (General Definition):**
|
||||||
|
|
||||||
|
A **Binary Tree** is a tree data structure where each node has at most two children. It does not impose any ordering constraints on the values of the nodes.
|
||||||
|
|
||||||
|
- **Structure**: Each node can have a **left child**, a **right child**, or both (or no children).
|
||||||
|
- **No Value Order**: The values in a binary tree are not arranged in any specific order.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### **Key Differences Between Binary Tree and Binary Search Tree:**
|
||||||
|
|
||||||
|
|**Aspect**|**Binary Tree**|**Binary Search Tree**|
|
||||||
|
|---|---|---|
|
||||||
|
|**Node Value Order**|No specific order for node values.|Nodes are organized by the BST property (left < root < right).|
|
||||||
|
|**Searching Efficiency**|Searching is linear in worst case (O(n)).|Searching is efficient (O(log n)) if balanced.|
|
||||||
|
|**Insertion Rule**|Nodes can be added in any order.|Nodes are inserted based on their value to maintain the BST property.|
|
||||||
|
|**Duplicates**|Allows duplicates freely.|May or may not allow duplicates, depending on implementation.|
|
||||||
|
|**Applications**|Used for general tree structures.|Used for sorted collections or when efficient searching is required.|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### **Example:**
|
||||||
|
|
||||||
|
#### Binary Tree:
|
||||||
|
|
||||||
|
A binary tree with no ordering constraints:
|
||||||
|
```
|
||||||
|
10
|
||||||
|
/ \
|
||||||
|
20 30
|
||||||
|
/
|
||||||
|
40
|
||||||
|
```
|
||||||
|
- Node values are not in any specific order.
|
||||||
|
|
||||||
|
#### Binary Search Tree:
|
||||||
|
|
||||||
|
A binary search tree:
|
||||||
|
```
|
||||||
|
10
|
||||||
|
/ \
|
||||||
|
5 20
|
||||||
|
/ \ / \
|
||||||
|
2 7 15 25
|
||||||
|
```
|
||||||
|
|
||||||
|
- For every node:
|
||||||
|
- Left subtree values < Node value.
|
||||||
|
- Right subtree values > Node value.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### **Advantages of BST Over a General Binary Tree:**
|
||||||
|
|
||||||
|
1. **Efficient Searching**: Searching in a BST takes $O(h)$, where $h$ is the height of the tree. In a balanced BST, $h=O(logn)$.
|
||||||
|
2. **Ordered Traversal**: In-order traversal of a BST produces the nodes in sorted order.
|
||||||
|
3. **Efficient Range Queries**: BSTs can efficiently find all elements within a specific range.
|
||||||
|
|
||||||
|
### **Disadvantages of BST:**
|
||||||
|
|
||||||
|
1. If unbalanced (e.g., when nodes are inserted in sorted order), the BST can degrade to a linked list, resulting in $O(n)$ time for operations.
|
||||||
|
2. Maintaining balance (e.g., in AVL or Red-Black Trees) adds complexity.
|
90
Data Structures/GPT Answers to Past Paper/Question 4.md
Normal file
90
Data Structures/GPT Answers to Past Paper/Question 4.md
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
# What is an interface in object-oriented programming and how does it differ from a class?
|
||||||
|
|
||||||
|
### **What is an Interface in Object-Oriented Programming?**
|
||||||
|
|
||||||
|
An **interface** is a contract in object-oriented programming (OOP) that defines a set of methods (and sometimes properties) that a class must implement. It specifies _what_ a class should do, but not _how_ it should do it.
|
||||||
|
|
||||||
|
Key characteristics of an interface:
|
||||||
|
|
||||||
|
1. **Method Declaration**: An interface only contains method signatures (names, return types, and parameters) without implementation.
|
||||||
|
2. **Multiple Inheritance**: Many OOP languages, like Java, allow a class to implement multiple interfaces, enabling multiple inheritance of behavior.
|
||||||
|
3. **Abstraction**: Interfaces are entirely abstract, meaning they cannot have any concrete (implemented) methods in many languages (e.g., Java before version 8).
|
||||||
|
4. **No State**: Interfaces do not contain instance variables or state but may include constants.
|
||||||
|
|
||||||
|
#### Example in Java:
|
||||||
|
```java
|
||||||
|
// Define an interface
|
||||||
|
public interface Animal {
|
||||||
|
void eat(); // Abstract method
|
||||||
|
void sleep(); // Abstract method
|
||||||
|
}
|
||||||
|
|
||||||
|
// Class implementing the interface
|
||||||
|
public class Dog implements Animal {
|
||||||
|
@Override
|
||||||
|
public void eat() {
|
||||||
|
System.out.println("Dog is eating.");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void sleep() {
|
||||||
|
System.out.println("Dog is sleeping.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### **What is a Class?**
|
||||||
|
|
||||||
|
A **class** is a blueprint for creating objects in OOP. It defines the structure (fields or attributes) and behavior (methods) of objects. Unlike interfaces, classes can have implementations, state, and behavior.
|
||||||
|
|
||||||
|
Key characteristics of a class:
|
||||||
|
|
||||||
|
1. **State and Behavior**: Classes define fields to hold data (state) and methods to operate on that data (behavior).
|
||||||
|
2. **Concrete Methods**: Methods in a class can have concrete implementations.
|
||||||
|
3. **Inheritance**: A class can inherit from another class (single inheritance in Java) to reuse or extend functionality.
|
||||||
|
4. **Constructors**: Classes can have constructors to initialize objects.
|
||||||
|
|
||||||
|
#### Example in Java:
|
||||||
|
```java
|
||||||
|
// Define a class
|
||||||
|
public class Dog {
|
||||||
|
private String name; // Field (state)
|
||||||
|
|
||||||
|
// Constructor
|
||||||
|
public Dog(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Method (behavior)
|
||||||
|
public void bark() {
|
||||||
|
System.out.println(name + " is barking.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### **Key Differences Between an Interface and a Class**
|
||||||
|
|
||||||
|
|**Aspect**|**Interface**|**Class**|
|
||||||
|
|---|---|---|
|
||||||
|
|**Purpose**|Defines a contract for behavior.|Defines both state (fields) and behavior (methods).|
|
||||||
|
|**Implementation**|Does not provide method implementations (in most cases).|Can provide both concrete (implemented) and abstract methods.|
|
||||||
|
|**Fields/State**|Cannot contain instance variables (only constants).|Can contain fields (instance and static variables).|
|
||||||
|
|**Inheritance**|A class can implement multiple interfaces.|A class can inherit from only one superclass in languages like Java.|
|
||||||
|
|**Constructors**|Cannot have constructors.|Can have constructors to initialize objects.|
|
||||||
|
|**Abstract**|Interfaces are entirely abstract (unless extended in modern versions).|Can be abstract or concrete.|
|
||||||
|
|**Default Methods**|Starting from Java 8, interfaces can have default methods (methods with a body).|Classes always support method implementation.|
|
||||||
|
### **When to Use an Interface?**
|
||||||
|
|
||||||
|
- **Polymorphism**: When you want different classes to provide their specific implementation of the same behavior.
|
||||||
|
- **Decoupling**: To decouple code by relying on abstractions rather than concrete classes.
|
||||||
|
- **Multiple Inheritance**: When you need a class to inherit behavior from multiple sources.
|
||||||
|
|
||||||
|
### **When to Use a Class?**
|
||||||
|
|
||||||
|
- When you need to define an object with both state and behavior.
|
||||||
|
- When you need concrete implementations of methods.
|
||||||
|
- When abstraction is not required.
|
||||||
|
|
||||||
|
### **Summary:**
|
||||||
|
|
||||||
|
An **interface** defines the "what" (a contract) without defining the "how," while a **class** provides the actual implementation and can store both state and behavior.
|
34
Data Structures/GPT Answers to Past Paper/Question 5.md
Normal file
34
Data Structures/GPT Answers to Past Paper/Question 5.md
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
# Convert the infix expression A * (B + C) / D to a postfix expression
|
||||||
|
|
||||||
|
To convert the infix expression `A * (B + C) / D` into postfix notation, we use the following rules:
|
||||||
|
|
||||||
|
1. **Operator Precedence**: Parentheses have the highest precedence, followed by multiplication (`*`) and division (`/`), and then addition (`+`).
|
||||||
|
2. **Associativity**: Operators like `*` and `/` are left-associative, meaning operations are performed left to right if they have the same precedence.
|
||||||
|
3. **Conversion Rules**:
|
||||||
|
- Operands (like `A`, `B`, `C`, `D`) are output immediately.
|
||||||
|
- Operators are pushed onto a stack.
|
||||||
|
- Parentheses dictate the priority: Solve what's inside the parentheses first.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### **Step-by-Step Conversion**
|
||||||
|
|
||||||
|
#### Infix Expression: `A * (B + C) / D`
|
||||||
|
|
||||||
|
1. Start with the subexpression inside the parentheses `(B + C)`:
|
||||||
|
|
||||||
|
- Convert `B + C` to postfix: `BC+`.
|
||||||
|
2. Substitute the postfix for `(B + C)` back into the original expression:
|
||||||
|
|
||||||
|
- The expression becomes `A * BC+ / D`.
|
||||||
|
3. Process the multiplication (`*`) and division (`/`):
|
||||||
|
|
||||||
|
- `A * BC+` becomes `ABC+*`.
|
||||||
|
- `ABC+* / D` becomes `ABC+*D/`.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### **Final Postfix Expression**:
|
||||||
|
```
|
||||||
|
ABC+*D/
|
||||||
|
```
|
45
Data Structures/GPT Answers to Past Paper/Question 6.md
Normal file
45
Data Structures/GPT Answers to Past Paper/Question 6.md
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
# Evaluate the postfix expression `6 2 3 + -.`
|
||||||
|
|
||||||
|
### **Postfix Evaluation Rules**
|
||||||
|
|
||||||
|
1. Operands are pushed onto a stack.
|
||||||
|
2. Operators pop the required number of operands from the stack, perform the operation, and push the result back onto the stack.
|
||||||
|
3. Continue until the expression is fully evaluated, and the final value is the only element on the stack.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### **Step-by-Step Evaluation**
|
||||||
|
|
||||||
|
**Expression**: `6 2 3 + -`
|
||||||
|
|
||||||
|
1. **Read `6`**:
|
||||||
|
|
||||||
|
- Push `6` onto the stack.
|
||||||
|
- **Stack**: `[6]`
|
||||||
|
2. **Read `2`**:
|
||||||
|
|
||||||
|
- Push `2` onto the stack.
|
||||||
|
- **Stack**: `[6, 2]`
|
||||||
|
3. **Read `3`**:
|
||||||
|
|
||||||
|
- Push `3` onto the stack.
|
||||||
|
- **Stack**: `[6, 2, 3]`
|
||||||
|
4. **Read `+`**:
|
||||||
|
|
||||||
|
- Pop the top two operands (`3` and `2`).
|
||||||
|
- Perform `2 + 3 = 5`.
|
||||||
|
- Push the result (`5`) onto the stack.
|
||||||
|
- **Stack**: `[6, 5]`
|
||||||
|
5. **Read `-`**:
|
||||||
|
|
||||||
|
- Pop the top two operands (`5` and `6`).
|
||||||
|
- Perform `6 - 5 = 1`.
|
||||||
|
- Push the result (`1`) onto the stack.
|
||||||
|
- **Stack**: `[1]`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### **Final Result**:
|
||||||
|
|
||||||
|
The result of the postfix expression `6 2 3 + -` is **`1`**.
|
||||||
|
|
50
Data Structures/GPT Answers to Past Paper/Question 7.md
Normal file
50
Data Structures/GPT Answers to Past Paper/Question 7.md
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
# Compare and contrast a queue with a stack.
|
||||||
|
|
||||||
|
### **Comparison of Queue and Stack**
|
||||||
|
|
||||||
|
|**Aspect**|**Stack**|**Queue**|
|
||||||
|
|---|---|---|
|
||||||
|
|**Definition**|A stack is a collection of elements that follows the **Last-In, First-Out (LIFO)** principle: the last element added is the first one removed.|A queue is a collection of elements that follows the **First-In, First-Out (FIFO)** principle: the first element added is the first one removed.|
|
||||||
|
|**Primary Operations**|- **Push**: Add an element to the top of the stack. <br>- **Pop**: Remove the top element of the stack. <br>- **Peek/Top**: View the top element without removing it.|- **Enqueue**: Add an element to the back of the queue. <br>- **Dequeue**: Remove the element from the front of the queue. <br>- **Front**: View the element at the front without removing it.|
|
||||||
|
|**Order of Removal**|LIFO: Last element inserted is the first to be removed.|FIFO: First element inserted is the first to be removed.|
|
||||||
|
|**Structure**|Operates on a single end of the collection (top).|Operates on both ends: elements are added at the back and removed from the front.|
|
||||||
|
|**Real-World Analogy**|A stack of plates: the last plate added is the first one removed.|A line (queue) at a ticket counter: the first person in line is the first one served.|
|
||||||
|
|**Applications**|- Function call stack <br>- Undo operations in software <br>- Backtracking algorithms (e.g., maze solving) <br>- Expression evaluation and parsing|- Task scheduling (e.g., printer queue) <br>- Breadth-first search (BFS) in graphs <br>- Data buffers (e.g., IO buffers) <br>- Handling requests in web servers|
|
||||||
|
|**Performance**|Both `push` and `pop` are O(1)O(1)O(1) operations in most implementations.|Both `enqueue` and `dequeue` are O(1)O(1)O(1) operations in most implementations.|
|
||||||
|
|**Types/Variants**|- Simple Stack <br>- Double Stack <br>- Min/Max Stack (keeps track of min/max values)|- Simple Queue <br>- Circular Queue <br>- Priority Queue (elements removed based on priority, not order) <br>- Deque (Double-Ended Queue)|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### **Key Differences**
|
||||||
|
|
||||||
|
|**Aspect**|**Stack**|**Queue**|
|
||||||
|
|---|---|---|
|
||||||
|
|**Access Pattern**|LIFO (Last-In, First-Out)|FIFO (First-In, First-Out)|
|
||||||
|
|**Addition (Insert)**|Always at the top of the stack.|Always at the back of the queue.|
|
||||||
|
|**Removal (Delete)**|Always from the top of the stack.|Always from the front of the queue.|
|
||||||
|
|**Flexibility in Ends**|Operates only on one end (top).|Operates on both ends (front and back).|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### **Real-World Examples**
|
||||||
|
|
||||||
|
#### **Stack Examples**:
|
||||||
|
|
||||||
|
1. **Undo Feature in Text Editors**:
|
||||||
|
- When you perform actions, they are stored in a stack. Undoing removes the last action first.
|
||||||
|
2. **Browser Back Button**:
|
||||||
|
- Tracks visited pages in a stack; the last page visited is the first to be returned when you press "Back."
|
||||||
|
|
||||||
|
#### **Queue Examples**:
|
||||||
|
|
||||||
|
1. **Ticket Counter**:
|
||||||
|
- People stand in line (queue), and the first person in line is served first.
|
||||||
|
2. **Task Scheduling**:
|
||||||
|
- Jobs sent to a printer are handled in the order they are received (FIFO).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### **Summary**:
|
||||||
|
|
||||||
|
- A **stack** is suitable for tasks where the most recent action needs to be undone or processed first (**LIFO**).
|
||||||
|
- A **queue** is ideal for tasks where the first action needs to be processed first (**FIFO**).
|
91
Data Structures/GPT Answers to Past Paper/Question 8.md
Normal file
91
Data Structures/GPT Answers to Past Paper/Question 8.md
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
# Consider a min heap with these elements: [4, 5, 6, 7, 8, 9, 10]. Insert 3 into this min heap.
|
||||||
|
|
||||||
|
In a **min heap**, the root node contains the smallest element, and every parent node is less than its children. When we insert a new element into a min heap, we follow these steps:
|
||||||
|
|
||||||
|
1. **Insert the element at the end** of the heap (maintaining the complete binary tree property).
|
||||||
|
2. **Bubble up (or sift up)** the inserted element to restore the heap property by comparing it with its parent and swapping if necessary.
|
||||||
|
|
||||||
|
### Given Min Heap:
|
||||||
|
|
||||||
|
The given min heap is represented as an array:
|
||||||
|
```csharp
|
||||||
|
[4, 5, 6, 7, 8, 9, 10]
|
||||||
|
```
|
||||||
|
This corresponds to the following binary tree:
|
||||||
|
```
|
||||||
|
4
|
||||||
|
/ \
|
||||||
|
5 6
|
||||||
|
/ \ / \
|
||||||
|
7 8 9 10
|
||||||
|
```
|
||||||
|
### **Step 1: Insert 3 into the Heap**
|
||||||
|
|
||||||
|
First, insert 3 at the end of the heap:
|
||||||
|
```csharp
|
||||||
|
[4, 5, 6, 7, 8, 9, 10, 3]
|
||||||
|
```
|
||||||
|
This corresponds to the following binary tree:
|
||||||
|
```
|
||||||
|
4
|
||||||
|
/ \
|
||||||
|
5 6
|
||||||
|
/ \ / \
|
||||||
|
7 8 9 10
|
||||||
|
/
|
||||||
|
3
|
||||||
|
```
|
||||||
|
### **Step 2: Bubble Up**
|
||||||
|
|
||||||
|
Now, we need to **bubble up** the element `3` to restore the heap property. We compare `3` with its parent and swap if necessary:
|
||||||
|
|
||||||
|
- The parent of `3` is `7` (index 3). Since `3 < 7`, we swap them.
|
||||||
|
|
||||||
|
After the swap, the heap becomes:
|
||||||
|
```
|
||||||
|
4
|
||||||
|
/ \
|
||||||
|
5 6
|
||||||
|
/ \ / \
|
||||||
|
3 8 9 10
|
||||||
|
/
|
||||||
|
7
|
||||||
|
```
|
||||||
|
|
||||||
|
Now, we continue the bubbling up process:
|
||||||
|
|
||||||
|
- The parent of `3` is `5` (index 1). Since `3 < 5`, we swap them.
|
||||||
|
|
||||||
|
After the swap, the heap becomes:
|
||||||
|
```
|
||||||
|
4
|
||||||
|
/ \
|
||||||
|
3 6
|
||||||
|
/ \ / \
|
||||||
|
5 8 9 10
|
||||||
|
/
|
||||||
|
7
|
||||||
|
```
|
||||||
|
|
||||||
|
Finally, we compare `3` with its parent `4` (index 0):
|
||||||
|
|
||||||
|
- Since `3 < 4`, we swap them.
|
||||||
|
|
||||||
|
After the swap, the heap becomes:
|
||||||
|
|
||||||
|
```
|
||||||
|
3
|
||||||
|
/ \
|
||||||
|
4 6
|
||||||
|
/ \ / \
|
||||||
|
5 8 9 10
|
||||||
|
/
|
||||||
|
7
|
||||||
|
```
|
||||||
|
|
||||||
|
### **Final Array Representation**:
|
||||||
|
|
||||||
|
The final min heap as an array is:
|
||||||
|
```csharp
|
||||||
|
[3, 4, 6, 5, 8, 9, 10, 7]
|
||||||
|
```
|
52
Data Structures/GPT Answers to Past Paper/Question 9.md
Normal file
52
Data Structures/GPT Answers to Past Paper/Question 9.md
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
# Create an adjacency matrix for the following weighted undirected graph.
|
||||||
|
```
|
||||||
|
A-3-B
|
||||||
|
| |
|
||||||
|
2 1
|
||||||
|
| |
|
||||||
|
C-4-D
|
||||||
|
```
|
||||||
|
|
||||||
|
To create an **adjacency matrix** for the given **weighted undirected graph**, we need to follow these steps:
|
||||||
|
|
||||||
|
1. **Identify the nodes**: We have 4 nodes: `A`, `B`, `C`, and `D`.
|
||||||
|
2. **Create a matrix**: The matrix will be 4x4, where rows and columns represent the nodes, and the elements in the matrix represent the weights of the edges between nodes. If there's no edge between two nodes, the matrix will have a value of `0` (or infinity, depending on the context, but we'll use `0` here).
|
||||||
|
3. **Place the edge weights in the matrix**: Since the graph is undirected, the matrix will be symmetric, meaning if there's an edge from node `A` to node `B`, the matrix entry at `[A][B]` and `[B][A]` will have the same value.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### **Graph Details**:
|
||||||
|
|
||||||
|
- **A -3- B**: There is an edge between A and B with weight 3.
|
||||||
|
- **A -2- C**: There is an edge between A and C with weight 2.
|
||||||
|
- **B -1- D**: There is an edge between B and D with weight 1.
|
||||||
|
- **C -4- D**: There is an edge between C and D with weight 4.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### **Adjacency Matrix**
|
||||||
|
|
||||||
|
Let's map the nodes to indices:
|
||||||
|
|
||||||
|
- `A` = 0
|
||||||
|
- `B` = 1
|
||||||
|
- `C` = 2
|
||||||
|
- `D` = 3
|
||||||
|
|
||||||
|
#### Matrix:
|
||||||
|
|
||||||
|
| | A | B | C | D |
|
||||||
|
| --- | --- | --- | --- | --- |
|
||||||
|
| A | 0 | 3 | 2 | 0 |
|
||||||
|
| B | 3 | 0 | 0 | 1 |
|
||||||
|
| C | 2 | 0 | 0 | 4 |
|
||||||
|
| D | 0 | 1 | 4 | 0 |
|
||||||
|
|
||||||
|
### **Explanation**:
|
||||||
|
|
||||||
|
- `A-B` has a weight of 3, so `matrix[0][1] = 3` and `matrix[1][0] = 3` (since the graph is undirected).
|
||||||
|
- `A-C` has a weight of 2, so `matrix[0][2] = 2` and `matrix[2][0] = 2`.
|
||||||
|
- `B-D` has a weight of 1, so `matrix[1][3] = 1` and `matrix[3][1] = 1`.
|
||||||
|
- `C-D` has a weight of 4, so `matrix[2][3] = 4` and `matrix[3][2] = 4`.
|
||||||
|
|
||||||
|
This adjacency matrix accurately represents the weighted undirected graph.
|
@@ -0,0 +1 @@
|
|||||||
|
,boris,boris-ThinkPad-T480,01.12.2024 23:42,file:///home/boris/.config/libreoffice/4;
|
BIN
Networking and Security/Assignment 1 - 00677611.odt
Normal file
BIN
Networking and Security/Assignment 1 - 00677611.odt
Normal file
Binary file not shown.
@@ -20,3 +20,11 @@
|
|||||||
- A and B have large address ranges.
|
- A and B have large address ranges.
|
||||||
- Either need multiple network numbers, or use subnets to pretend you have multiple network numbers
|
- Either need multiple network numbers, or use subnets to pretend you have multiple network numbers
|
||||||
- One LAN per building, big network likely to be split into smaller networks. (Subnets)
|
- One LAN per building, big network likely to be split into smaller networks. (Subnets)
|
||||||
|
|
||||||
|
|
||||||
|
255.0.0.0
|
||||||
|
/8
|
||||||
|
16.0.0.0
|
||||||
|
255.255.0.0
|
||||||
|
/16
|
||||||
|
255.255.255.0
|
BIN
Networking and Security/Week 8/Basic_Troubleshooting.pkt
Normal file
BIN
Networking and Security/Week 8/Basic_Troubleshooting.pkt
Normal file
Binary file not shown.
@@ -0,0 +1 @@
|
|||||||
|
,boris,boris-ThinkPad-T480,01.11.2024 14:15,file:///home/boris/.config/libreoffice/4;
|
Binary file not shown.
Binary file not shown.
21
Penetration Testing/Assessment/Stage 1 - RoE.md
Normal file
21
Penetration Testing/Assessment/Stage 1 - RoE.md
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
- “Scope” - describe what you intend to do and what you are aiming to find
|
||||||
|
- “Permission to test” - outline why you believe this is a legal and ethical thing for you to
|
||||||
|
do in this assignment (or describe if you have to do it in a particular way in order to make
|
||||||
|
sure you stay legal and ethical even if this will limit the amount of information that you
|
||||||
|
are able to find
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
| Action No | Scope: Summary of Intention | Permission to Test: Outline of Legal and Ethical Justification | Allow/Reject |
|
||||||
|
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
|
||||||
|
| 1 | I would use WHOIS / Recon-NG to find website registrar identities and the ASN of the company. This would provide me with a list of identities, and their emails, that may have access to infrastructure, or elevated permissions. | I believe this is legal as WHOIS is a public database of registrar information. No information found through WHOIS is sensitive, and has been published by the company, rather than found - no ethical issues with WHOIS | |
|
||||||
|
| 2 | I would use dig or nslookup to find IPs of webservers and mailservers, TXT records, CNAME recs, etordc. This would provide vital information about the company's infrastructure and layout of their webserver. | I believe this is legal as dig / nslookup does not access the server, but rather uses public DNS information from ex. Cloudflare. Since this information is registered voluntarily by the company, and anybody can find it from simply loading the webpage or through a DNS request, I see no ethical issues with the use of dig / nslookup. | |
|
||||||
|
| 3 | I would use Google Dorking to find any pages that may contain useful information. Finding information like meeting minutes, mailing lists, etc. could contain sensitive information - I should exercise caution with information found. This likely will find a lot of information I could use to further the investigation. | I believe this is legal, as all information found through Google Dorking is provided through a public index of information on a search engine for anybody to find; there is no contact with the company therefore no Computer Misuse. If sensitive data is found, as long as PII is protected and stored anonymised and encrypted, there should be no ethical issues with information found. | |
|
||||||
|
| 4 | I would use theHarvester to find email addresses of employees or users. theHarvester could also find IP addresses owned or rented by the company not found when using dig / nslookup. | I believe this is legal since the information gathered from theHarvester is gathered from interacting with public search engine indexes. No information gathered from theHarvester is sensitive, since it is information used in the public domain - therefore should be ethical. | |
|
||||||
|
| 5 | I would use BGPView and HE's BGP Toolkit to verify IP addresses are within the scope of the company's ASN, found in the WHOIS lookup. This would provide me with the address range rented or owned by the company, potentially revealing useful information about clients | I believe this is legal, since ASNs are announced in the public space, along with address ranges. There is no interaction with the company or it's servers. No sensitive information is revealed directly from knowing address ranges or AS number, which should make this ethical. | |
|
||||||
|
| 6 | I would use Shodan to obtain insight into IPs within scope. This could give detailed results regarding connected devices that may be public-facing, however this may be unlikely. | I believe this is legal, since Shodan is a crawler and can only find devices that have been (intentional or not) configured to be public-facing, since Shodan is exclusively a tool to find devices using an obscurity model for their security. I see no ethical issues by using Shodan outside of mishandling of PII if sensitive information is found by using it. | |
|
||||||
|
| 7 | I *could* use Intelx / Phonebook.cz and HaveIBeenPwnd to find breaches employees have been involved in. This could provide information on login details, or even just provide information on employees that otherwise would be unknown. For example, in these leaks, information like a person's car, home address, accounts registered with their email, and much more can be found. | I believe this is legal, since the sources are public information, regardless of how they are obtained by the breacher since they are on clearweb and indexed publicly. The only legal issue related to obtaining this data is redistribution, and as long as PII is protected, there is no law that limits possession of data found in breaches. However, it's usage heavily effects the ethicality of obtaining this data; it's usage in most ways when unauthorised is at worst illegal, and at best immoral. Realistically in this scope it is best used as a tool to gain information on employees, rather than obtain credentials or sensitive personal information. | |
|
||||||
|
| 8 | I would use robots.txt to find pages the company may not want indexed, not being found by Google Dorking. This may provide information on where to start looking, but may also not be useful. | I believe this is legal, as the robots.txt file has been chosen to be given to the user from the webserver. It is not hidden or even accidentally advertised. Since the company has voluntarily made the file public, there are no ethical issues regarding using this information. | |
|
||||||
|
| 9 | I would use the Google Hacking Database to find any potential exploits in services used on the webserver. This could provide information on potential entrypoints that could be found in later stages. | I believe this is legal, as GHDB is a collection of known exploits and vulnerabilities, no interaction is made directly or indirectly with the company, only knowledge of their services is required, which is public information. I believe this is ethical as these exploits are public knowledge, and any vulnerabilities found should be protected against by the company. | |
|
||||||
|
| 10 | I could use social media pages after information about employees have been found. This could be turn out with invaluable knowledge about employee habits, aiding the social engineering aspect | I believe this is legal, as there are no laws protecting people from searching others on social media - it is all voluntarily published publicly forever. I believe this is ethical, as no sensitive information should be published anywhere on social media, all information should be inconsequential individually, more used to build upon other methods included in RoE. | |
|
||||||
|
| 11 | | | |
|
46
Penetration Testing/Week 11/Lecture 11 - Enumeration.md
Normal file
46
Penetration Testing/Week 11/Lecture 11 - Enumeration.md
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
Collection of detailed information about a target system, ex OS, infra
|
||||||
|
After compromising, attackers perform enumeration to learn more about host, ex. location on lan, functionality (hostname, interfaces, routes, services.).
|
||||||
|
Gathering info ex. usernames, machine names, share names, directory names, os details, network infra, printer names, webserver details, etc.
|
||||||
|
Key component of ethical hacking and pentesting.
|
||||||
|
|
||||||
|
# Enumerating Windows System
|
||||||
|
|
||||||
|
- ipconfig - list interfaces, gateways, if mac addresses, ip addresses
|
||||||
|
- /all - list additional info about if
|
||||||
|
- /displaydns - show dns cache
|
||||||
|
- arp -a - display arp cache
|
||||||
|
- netstat -ano - list all connections on a specified port
|
||||||
|
- route print - display routing table
|
||||||
|
- net start / net stop - start / stop running service
|
||||||
|
- netsh - firewall rules
|
||||||
|
- netsh firewall set opmode disable - turn off firewall
|
||||||
|
- tasklist - enumerate all services running on host
|
||||||
|
|
||||||
|
# Enumerating Linux System
|
||||||
|
|
||||||
|
- ifconfig - similar to ipconfig, more explanatory
|
||||||
|
- pwd - print working directory
|
||||||
|
- ls - list items in directory
|
||||||
|
- find - find items
|
||||||
|
- who/last - displays currently logged in users
|
||||||
|
- whoami - displays information about current user
|
||||||
|
- uname - display kernel info
|
||||||
|
- touch - create empty file
|
||||||
|
- cat /etc/passwd - enumerate local users
|
||||||
|
- cat /etc/host - show hosts file
|
||||||
|
- cat /etc/group - enumerate all local groups
|
||||||
|
- cat /etc/resolv.conf - locate name servers on local machine
|
||||||
|
|
||||||
|
# Enumerating with Meterpreter
|
||||||
|
|
||||||
|
- sysinfo - gets info such as OS and name
|
||||||
|
- route - view / modify routing table
|
||||||
|
- ps - list processes
|
||||||
|
- getuid - get current uid
|
||||||
|
- getpid - get current process id
|
||||||
|
- cd - change directory
|
||||||
|
- cat - read and stdout contents of file
|
||||||
|
- ls - list items in directory
|
||||||
|
- enumdesktops - list all accessible desktops
|
||||||
|
- screenshot - grab screenshot of meterpreter desktop
|
||||||
|
- idletime - checks how long target has been idle
|
@@ -0,0 +1,37 @@
|
|||||||
|
# Classes of Vulnerabilities
|
||||||
|
|
||||||
|
- Design: Weaknesses in Software Specifications
|
||||||
|
- Implementation: Technical security bugs found in code
|
||||||
|
- Operational: Improper config and deployment of system in environment
|
||||||
|
|
||||||
|
Operational Vulnerability is likely the worst
|
||||||
|
|
||||||
|
# Types of Vulnerabilities
|
||||||
|
|
||||||
|
- Local Vulnerability: attacker requires local access to trigger the vulnerability - using a malicious piece of code attacker could escalate access privileges.
|
||||||
|
- Remote Vulnerability: attacker has no prior access to system - executing a malicious piece of code over the network could give attacker access.
|
||||||
|
|
||||||
|
# Quantification of Vulnerabilities
|
||||||
|
|
||||||
|
CVSS: Common Vulnerability Scoring System
|
||||||
|
- Uses principle characteristics of a vulnerability to produce a numerical score reflecting severity. Can be translated into qualitative representation (low->critical) to help organisations assess and prioritise vulnerability management processes
|
||||||
|
- https://www.first.org/cvss
|
||||||
|
|
||||||
|
# Attack Patterns
|
||||||
|
|
||||||
|
CAPEC: Common Attack Pattern Enumeration and Classification
|
||||||
|
- Catalogue of common attack patterns that helps users understand how adversaries exploit weaknesses in applications and other capabilities.
|
||||||
|
- https://capac.mitre.org/
|
||||||
|
|
||||||
|
# Search for Vulnerabilities
|
||||||
|
|
||||||
|
- https://cvedetails.com
|
||||||
|
|
||||||
|
# Vulnerability Scanning
|
||||||
|
|
||||||
|
- Process of using automated tools to discover and identify vulnerabilities in a network
|
||||||
|
- Range from simple scripts to commercial software engines that scan for thousands of vulnerabilities
|
||||||
|
- Can generate alot of traffic, and may result in denial of service on many devices.
|
||||||
|
|
||||||
|
## Nessus
|
||||||
|
|
||||||
|
@@ -0,0 +1,12 @@
|
|||||||
|
## Cogent Frankfurt -> remote.salford.ac.uk
|
||||||
|
Cogent [AS174](https://bgp.he.net/AS174)
|
||||||
|
Arelion [AS1299](https://bgp.he.net/AS1299)
|
||||||
|
JISC (Salford Edge) [AS786](https://bgp.he.net/AS786)
|
||||||
|
remote.salford.ac.uk (Announced by JISC) [AS786](https://bgp.he.net/AS786)
|
||||||
|
|
||||||
|
## Hetzner -> remote.salford.ac.uk
|
||||||
|
Hetzner [AS24940](https://bgp.he.net/AS24940)
|
||||||
|
core-backbone [AS201011](https://bgp.he.net/AS201011)
|
||||||
|
LINX London [AS3491](https://bgp.he.net/AS3491)
|
||||||
|
JISC (Salford Edge) [AS786](https://bgp.he.net/AS786)
|
||||||
|
remote.salford.ac.uk (Announced by JISC) [AS786](https://bgp.he.net/AS786)
|
18
Penetration Testing/docker-compose.yml
Normal file
18
Penetration Testing/docker-compose.yml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
services:
|
||||||
|
|
||||||
|
nessus:
|
||||||
|
image: tenable/nessus:10.7.2-ubuntu
|
||||||
|
restart: unless-stopped
|
||||||
|
container_name: nessus
|
||||||
|
volumes:
|
||||||
|
- /etc/localtime:/etc/localtime:ro
|
||||||
|
- ./nessus/etc/:/opt/nessus/etc/nessus/:rw
|
||||||
|
- ./nessus/var/:/opt/nessus/var/nessus/:rw
|
||||||
|
environment:
|
||||||
|
UID: 1000
|
||||||
|
GID: 1000
|
||||||
|
USERNAME: boris
|
||||||
|
PASSWORD: boris1!
|
||||||
|
ACTIVATION_CODE: BRUZ-CSTS-CGAX-VJYB-LZAD
|
||||||
|
ports:
|
||||||
|
- 8834:8834
|
BIN
Penetration Testing/nessus/etc/nessus-fetch.db
Normal file
BIN
Penetration Testing/nessus/etc/nessus-fetch.db
Normal file
Binary file not shown.
191
Penetration Testing/nessus/etc/nessusd.conf.imported
Normal file
191
Penetration Testing/nessus/etc/nessusd.conf.imported
Normal file
@@ -0,0 +1,191 @@
|
|||||||
|
#
|
||||||
|
# Configuration file of the Nessus Security Scanner
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
# Any line starting with a '#' is a comment and will be
|
||||||
|
# ignored by the Nessus Scanner
|
||||||
|
|
||||||
|
|
||||||
|
# Automatic plugins updates - if enabled and Nessus is registered, then
|
||||||
|
# fetch the newest plugins from plugins.nessus.org automatically. Disable
|
||||||
|
# if the scanner is on an isolated network not able to reach the Internet.
|
||||||
|
auto_update = yes
|
||||||
|
|
||||||
|
# Number of hours to wait between two updates
|
||||||
|
auto_update_delay = 24
|
||||||
|
|
||||||
|
# Maximum number of simultaneous hosts tested :
|
||||||
|
max_hosts = 100
|
||||||
|
global.max_hosts = 1499
|
||||||
|
|
||||||
|
# Maximum number of simultaneous checks against each host tested :
|
||||||
|
max_checks = 5
|
||||||
|
|
||||||
|
# Log file :
|
||||||
|
logfile = /opt/nessus/var/nessus/logs/nessusd.messages
|
||||||
|
|
||||||
|
# The maximum number of log files kept on disk.
|
||||||
|
# If the number exceeds the value, the oldest log file will be deleted.
|
||||||
|
logfile_max_files = 100
|
||||||
|
|
||||||
|
# Specifies the type of log file rotation applied to the Nessus Log File.
|
||||||
|
# Can be 'size' or 'time'
|
||||||
|
logfile_rot = size
|
||||||
|
|
||||||
|
# Specifies the maximum size of the log file in megabytes (MB).
|
||||||
|
# If file size exceeds the maximum size, a new log file will be created.
|
||||||
|
# This only applies if logfile_rot is set to 'size'
|
||||||
|
logfile_max_size = 512
|
||||||
|
|
||||||
|
# Specifies how many days between log rotations.
|
||||||
|
# Every time this amount of time has elapsed, since the service started, a new log file will be created.
|
||||||
|
# This only applies if logfile_rot is set to 'time'
|
||||||
|
logfile_rotation_time = 1
|
||||||
|
|
||||||
|
# Web Server (user interface) log file :
|
||||||
|
www_logfile = /opt/nessus/var/nessus/logs/www_server.log
|
||||||
|
|
||||||
|
# Shall we log every details of the attack ? (disk intensive)
|
||||||
|
log_whole_attack = no
|
||||||
|
|
||||||
|
# Dump file for debugging/errors output
|
||||||
|
dumpfile = /opt/nessus/var/nessus/logs/nessusd.dump
|
||||||
|
|
||||||
|
# The maximum number of dump files kept on disk.
|
||||||
|
# If the number exceeds the value, the oldest dump file will be deleted.
|
||||||
|
dumpfile_max_files = 100
|
||||||
|
|
||||||
|
# Specifies the type of log file rotation applied to the Nessus Dump File.
|
||||||
|
# Can be 'size' or 'time'
|
||||||
|
dumpfile_rot = size
|
||||||
|
|
||||||
|
# Specifies the maximum size of the dump file in megabytes (MB).
|
||||||
|
# If file size exceeds the maximum size, a new dump file will be created.
|
||||||
|
# This only applies if dumpfile_rot is set to 'size'
|
||||||
|
dumpfile_max_size = 512
|
||||||
|
|
||||||
|
# Specifies how many days between dump file rotations.
|
||||||
|
# Every time this amount of time has elapsed, since the service started, a new dump file will be created.
|
||||||
|
# This only applies if dumpfile_rot is set to 'time'
|
||||||
|
dumpfile_rotation_time = 1
|
||||||
|
|
||||||
|
# Rules file :
|
||||||
|
rules = /opt/nessus/etc/nessus/nessusd.rules
|
||||||
|
|
||||||
|
# CGI paths to check for. Supports colon delimited list
|
||||||
|
# e.g., cgi-bin:/cgi-aws:/
|
||||||
|
cgi_path = /cgi-bin:/scripts
|
||||||
|
|
||||||
|
# Range of the ports the port scanners will scan :
|
||||||
|
# 'default' means that Nessus will scan ports found in its
|
||||||
|
# services file, 'all' will scan 1-65535 or can specify
|
||||||
|
# commad-delmited ports or ranges of ports.
|
||||||
|
port_range = default
|
||||||
|
|
||||||
|
# Allow post scan editing (this can be defined in the policy) :
|
||||||
|
allow_post_scan_editing = yes
|
||||||
|
|
||||||
|
# Read timeout for the sockets of the tests :
|
||||||
|
checks_read_timeout = 5
|
||||||
|
# Ports against which two plugins should not be run simultaneously :
|
||||||
|
# non_simult_ports = Services/www, 139, Services/finger
|
||||||
|
non_simult_ports = 139, 445, 3389
|
||||||
|
# Maximum lifetime of a plugin's activity (in seconds) :
|
||||||
|
plugins_timeout = 320
|
||||||
|
|
||||||
|
|
||||||
|
# Safe checks rely on banner grabbing :
|
||||||
|
safe_checks = yes
|
||||||
|
|
||||||
|
|
||||||
|
# Automatically activate the plugins that are depended on
|
||||||
|
# If disabled, not all plugins may run despite being selected
|
||||||
|
# in a scan policy.
|
||||||
|
auto_enable_dependencies = yes
|
||||||
|
|
||||||
|
|
||||||
|
# If enabled, the list of plugin dependencies and their output
|
||||||
|
# are not included in the report.
|
||||||
|
silent_dependencies = yes
|
||||||
|
# Save the knowledge base on disk :
|
||||||
|
# Can admin users upload plugins?
|
||||||
|
plugin_upload = yes
|
||||||
|
|
||||||
|
|
||||||
|
# If this option is set, Nessus will not scan a network incrementally
|
||||||
|
# (10.0.0.1, then 10.0.0.2, 10.0.0.3 and so on..) but will attempt to
|
||||||
|
# slice the workload throughout the whole network (ie: it will scan
|
||||||
|
# 10.0.0.1, then 10.0.0.127, then 10.0.0.2, then 10.0.0.128 and so on...
|
||||||
|
slice_network_addresses = no
|
||||||
|
|
||||||
|
# IPv4 address to listen for incoming connections :
|
||||||
|
listen_address = 0.0.0.0
|
||||||
|
|
||||||
|
# Source IPs to use when running on a multi-homed host. If multiple
|
||||||
|
# IPs are provided, Nessus will cycle through them whenever it performs
|
||||||
|
# a new connection
|
||||||
|
#source_ip = 192.168.0.1,192.168.0.2
|
||||||
|
|
||||||
|
# Port for the Nessus Web Server to listen to (new XMLRPC protocol) :
|
||||||
|
xmlrpc_listen_port = 8834
|
||||||
|
|
||||||
|
# XMLRPC Idle Session Timeout (in min) :
|
||||||
|
xmlrpc_idle_session_timeout = 30
|
||||||
|
|
||||||
|
# Make sure compatible SSL ciphers are available when connecting to port
|
||||||
|
# 8834. Supports general OpenSSL designations as listed at
|
||||||
|
# http://www.openssl.org/docs/apps/ciphers.html.
|
||||||
|
#ssl_cipher_list = compatible
|
||||||
|
|
||||||
|
# Minimum TLS version for the web server :
|
||||||
|
ssl_mode = tls_1_2
|
||||||
|
|
||||||
|
# Disable the new XMLRPC (Web Server) interface :
|
||||||
|
disable_xmlrpc = no
|
||||||
|
|
||||||
|
# Should consider all the NASL scripts as being signed ? (unsafe if set to 'yes')
|
||||||
|
nasl_no_signature_check = no
|
||||||
|
|
||||||
|
# nasl engine output (in nessusd.dump) : none or normal
|
||||||
|
nasl_log_type = normal
|
||||||
|
|
||||||
|
# Network performance settings (These settings should not be changed unless you
|
||||||
|
# are absolutely sure you know what they do and how it may impact scan activity!)
|
||||||
|
|
||||||
|
# If set to non-zero, this defines the maximum number of scans which may take place in parallel :
|
||||||
|
global.max_scans = 0
|
||||||
|
|
||||||
|
# If set to non-zero, this defines the maximum of (web) users who can connect in parallel :
|
||||||
|
global.max_web_users = 1024
|
||||||
|
|
||||||
|
# Maximum of simulteanous TCP sessions between all scans :
|
||||||
|
#global.max_simult_tcp_sessions = 2000
|
||||||
|
# Maximum of simulteanous TCP sessions per scan :
|
||||||
|
#max_simult_tcp_sessions = 200
|
||||||
|
# Maximum of simulteanous TCP sessions per scanned host :
|
||||||
|
#host.max_simult_tcp_sessions = 20
|
||||||
|
|
||||||
|
# Reduce the number of TCP session in parallel when the network appears to be congested :
|
||||||
|
reduce_connections_on_congestion = no
|
||||||
|
# Stop scanning a host which seems to have been disconnected during the scan :
|
||||||
|
stop_scan_on_disconnect = no
|
||||||
|
# Kill a paused scan after how many minutes (0 for no timeout)
|
||||||
|
#paused_scan_timeout = 240
|
||||||
|
|
||||||
|
# Anonymously report crashes to Tenable. We encourage this to be
|
||||||
|
# enabled in order to better debug issues and provide the highest
|
||||||
|
# quality software possible. ** No personal or system identifying
|
||||||
|
# information is sent. **
|
||||||
|
report_crashes = yes
|
||||||
|
|
||||||
|
# Memory usage
|
||||||
|
# You can choose between a lower memory usage ('low') but possibly lower performances
|
||||||
|
# or a higher memory usage ('high') and better performance. If you use Nessus on a
|
||||||
|
# dedicated system, put 'high' here. Otherwise, put 'low'.
|
||||||
|
# Note that putting 'low' will increase the disk usage
|
||||||
|
qdb_mem_usage = low
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# EOF
|
BIN
Penetration Testing/nessus/etc/nessusd.db
Normal file
BIN
Penetration Testing/nessus/etc/nessusd.db
Normal file
Binary file not shown.
28
Penetration Testing/nessus/var/CA/cakey.pem
Normal file
28
Penetration Testing/nessus/var/CA/cakey.pem
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
-----BEGIN PRIVATE KEY-----
|
||||||
|
MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDMQq+dp3bZHTi0
|
||||||
|
pxlKj4etnFHz3TL8E6nL1XjW/5zpG9dKCIXtQ0lLgcrgvw+mFvTU/3XJKx4rXidB
|
||||||
|
bKZMMcyVe/JRlETD+y/UyGYNS3+ETnHxt4A/bQELW64Hq8OhlDqk8ZaGwY1j6njP
|
||||||
|
OO+poVA+UIsnkFo8F/COMFZeDMSQTK2NAole5La8iVRWO+6FF/Q1+ZEAq38ZAHiA
|
||||||
|
rdkYGTSxgeLkaKDACf5iVJIU0yAiezVXeTc8CwhOKeuP1kVOdGJeOHpV8uWx113n
|
||||||
|
yLyzqnOm2LIPM9HHja5OFHMl8ChaBP1u+pEow7/4rnKs3j1Ytc9AjdSbp+UQwsk2
|
||||||
|
e4FB6Z/hAgMBAAECggEAA/oYaT1ldvy2qe3G9EivH5Y3kkPwRjAr0igp3iXD7FX6
|
||||||
|
bxqTYPc6ahnw1UdjCpzPz4XZyTzprXZ71S5EXp9pmE99fFEitZ4iZEYylnet1+mf
|
||||||
|
FlG4UYPRzWLPlJ6nhHHaYnPBtoX2NsfN6lr1b5wQb+Ypj2+kEh91M4+FXvdorFaI
|
||||||
|
8kuk4LViK2FSc+TlD0yAfH5M9rHE5rmq6ylJhIhdLjTDJ3imOuACnMAXbRt4ePLr
|
||||||
|
E0bMllOCLwwk1N6h5DRmPOdeVUAXbtAurgqyplwc0MPW2ZnpZ3j1/5KVCJjwKXvP
|
||||||
|
EQJer21W9yfjW6uQAui8DH12PVYE5H0WVJdB6bGXsQKBgQDqKh1IA5RNIBlWTvGF
|
||||||
|
UeS4wiAY1hfZRJxPGCTrpoaG7dTCaoBbNXoggTCMAh8lbUyE+JaAk8RXDTmMkuo9
|
||||||
|
4zorCJf3J0mLI5GRhs9Rj0YaNJofwAHMt8jFV0egBL7PYJnPTSv//9WFDs+wHtzN
|
||||||
|
6FhPqq/27j9a9y7gPbUglw7E0wKBgQDfTrbgLrj2swJ7xziQe+o/Q/FAl/jYSdgy
|
||||||
|
EdKfPDrcmMDqqUtw+NvOeq4FB7BzzWE9+WS/Qlaj5pdRJFo4musUkLC3OJuS83dB
|
||||||
|
GUZSDV4YRF6/w2f8wkEA7qiXGy38MzR/0t97IbP4NLu/buyiTbUuSVNJdGDeqaHK
|
||||||
|
I8qwujOn+wKBgQDOBReWEHAeGyuvn+0m2xJc647JyzNYWOEdRaTWH8EkXYNfOcyM
|
||||||
|
ctRsXL2VsRguGafFJeFkZp3L6TrEz01//bdjvT/Wl55A6J5eZzloDKIk1Dr1zDzJ
|
||||||
|
HLlrxoqh4wrt8ZPhq4gWx8PYOVvJHJ4wG0f3b7k5jAv5wJhhemktrzmzOQKBgQCs
|
||||||
|
cwpRWGOoyJdLZY9uLPO6hcqimnom9egKyq7AH/BI+YJJ9hF3ngeJjj4jTkvbMik9
|
||||||
|
hgJinWVxT5tdo1g1TJXsnMyLwiCKvJBE6rLenMokrXAKYWpFzPIMOUJi5y99C0Io
|
||||||
|
0H2bhmyIapju/keqE56urxutpz1D1vZFt5xJHJLVzwKBgQCOTlmnXcivqBMoItyy
|
||||||
|
kksyXlXjIOJk6NDAthKCuYG5nBVczmzJSx+/Z5C6VjV2oqvYCQL9HK8ThBgapRXC
|
||||||
|
4IWL39M5PcyXrJq+8TBLtKn7Orq92J6Jt45GYNs8hw+vEAUV72wxsIPkJkoYqVlN
|
||||||
|
EijnnvuHcHJMWJb10IWX+m2hAA==
|
||||||
|
-----END PRIVATE KEY-----
|
28
Penetration Testing/nessus/var/CA/serverkey.pem
Normal file
28
Penetration Testing/nessus/var/CA/serverkey.pem
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
-----BEGIN PRIVATE KEY-----
|
||||||
|
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDoFSb23jHqXyzA
|
||||||
|
jmmedP4unwmea1MyWKOn9ylnSJT+yMPhgHIxr9bgGr9aS2uZRtbn/YbLI0+eg9w3
|
||||||
|
KDTeIhi8cETKnMNPL3EaXqntmNoDLeweTq8vayCqKRofTFCoSeRbvEQ2LdF79k8M
|
||||||
|
6BfWcTqN3ZR7vdAkm7kJVVa0AExJ7fXn/kGA876vQpWut5gAvWKi9Xa7w61cgO/X
|
||||||
|
LCAAS4ptl+81Y7FJuDFaERJBe/lPYox+SrQObSxLyafWhOpEOZFy7yE06Xu5WA68
|
||||||
|
V28oxpTWPAEfcs0R2On1fKpLSHpS7EpsDSm08h8Dzpgg7JKp9VMoKufKJuhlOIDV
|
||||||
|
OFpBCt8NAgMBAAECggEAMySGI5yvT0CN8hjv+XU6ljeBvSFVgiC6X8c9nn8GJmdD
|
||||||
|
kyvk/kILjfMW++Tm3y4XKaRa0eUEJKBWJOl9TP4iiVQMNMH64DZKLE90DuHCGTVD
|
||||||
|
dSJNxJtM5XKNSRxeIde2tOh196J9KV4L6YIzzpPBHYYYtHQNrCOM0Ru3MY9nQFr+
|
||||||
|
hzqc2Sn+UmXVc6ABbVyOGEPR0Xq1BNuio1t1K+F1+gZ8oAsBIuPLN0RStUDMocyt
|
||||||
|
UyIE32Q89fHxo8II9vM4dxlSbeye1zOfTHqeklEWprYn8J2FCUqL7ekOHmapKP6b
|
||||||
|
XaJJua4BEZE0AFTEOu2ezI299PdZMB0vsnp+LwTMgQKBgQD3MDiU1hEvA/fWT3dx
|
||||||
|
AdG0PphRtQAq3pjxU85aKhJZDygHFxaQhcwbFe3CFQprX0H8fRyS/hOjehfgncf1
|
||||||
|
EIprR4ZhHx5/mTa30IxTfYBsZwQ2xcjkS3LK02c68xXx1I/aeg6Fvg8l6rKAbN0g
|
||||||
|
qab3wgUMJuNtdsLi3uAaLB12MQKBgQDwWxR7tkkiJoVaRansQ0XPaz46mAB6hdX+
|
||||||
|
UXvBhfvmCswbMg4Ak56xa+NSjnEqoDr0Vms2ju4Ad4YJoPkkjGrqAGjUYIr67Fyk
|
||||||
|
Ydm7L+gWEuLe+EAydzTJOXb2mqgHhleJ20anuRAXIjdT1qXk8Ubqup7rAu0CeX8D
|
||||||
|
5KaWfL/TnQKBgG6g+0HJiMlE+l/FEwzVppgHx74RxvBozYR8YIdD+xA201BRCf1G
|
||||||
|
lHGu38kUB6TEblDlYat74SgyFYumsf5BF+Ipkb/X4Jt04+Nih9s5+QcLF/y3ilB6
|
||||||
|
X/bcpH/imXixDGzYYbWDuV3b62XE0zayFxMdl4q3wOOV2mUVILE1+z2RAoGBAKF2
|
||||||
|
7im1aSfR7N+Z0O7wumL+zk0ac6fbZMh2AMcetPvy4O6cD5//iynxKkL5gbh671/Y
|
||||||
|
9ikul2Ak6xxo0TXmRqRwJfwV5wdt5UZgnZ4MLsM1aMcUyjucrQ9I1UwQ1TRI4WGw
|
||||||
|
tqRRxCdmSvi9R7CnDVb+i2ehDYsOB2+cGPUbVNpZAoGADq0RxXhlL1fNisaXeKbl
|
||||||
|
AY0N+tZkerdiQB86uDHUJNStrpaNWfbDdLTvjatOiS+7iRanY09UgF/lYJDslo9x
|
||||||
|
Ouxc4XmiMxR8gsVdBbax1ge6GLBmCpvZxkQo3lZ0+tftiNqQJr1LM2LlHFeOudxa
|
||||||
|
EGM21HBZ+cwAaoS4C7cXgt0=
|
||||||
|
-----END PRIVATE KEY-----
|
259453
Penetration Testing/nessus/var/logs/nessusd.dump
Normal file
259453
Penetration Testing/nessus/var/logs/nessusd.dump
Normal file
File diff suppressed because it is too large
Load Diff
1021788
Penetration Testing/nessus/var/logs/nessusd.messages
Normal file
1021788
Penetration Testing/nessus/var/logs/nessusd.messages
Normal file
File diff suppressed because it is too large
Load Diff
1
Penetration Testing/nessus/var/nessus-service.pid
Normal file
1
Penetration Testing/nessus/var/nessus-service.pid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
19033
|
1
Penetration Testing/nessus/var/nessus-service.version
Normal file
1
Penetration Testing/nessus/var/nessus-service.version
Normal file
@@ -0,0 +1 @@
|
|||||||
|
19.8.2
|
1
Penetration Testing/nessus/var/nessusd.pid
Normal file
1
Penetration Testing/nessus/var/nessusd.pid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
19226
|
1
Penetration Testing/nessus/var/uuid
Normal file
1
Penetration Testing/nessus/var/uuid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
695249bd-906e-86ff-fad0-96061ebf06a0d3d9a156edb27a23
|
@@ -102,3 +102,5 @@ Send Invoice to CSW (+Refurbs)
|
|||||||
### Actions
|
### Actions
|
||||||
|
|
||||||
Process Transaction
|
Process Transaction
|
||||||
|
|
||||||
|
manager processes req -> creatres purchase order
|
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user