X33fcon-2023-Empowering-Security-GenerativeAI-Fundamentals-Applications
X33fcon-2023-Empowering-Security-GenerativeAI-Fundamentals-Applications
Generative AI
Fundamentals and
Applications of GPT models
@Cyb3rWard0g
AI Cybersecurity Enthusiast
Created by Midjourney
“Researcher wearing a scientist coat looking at the city
through a window at night cyberpunk style --ar 16:9 --v 5.1”
@Cyb3rWard0g
https://msrc-blog.microsoft.com/2022/09/07/curious-innovative-creative-community-driven-meet-cyb3rward0g-roberto-rodriquez/
• Fundamentals
• GPT Models
• Demos
Fundamentals
Created by Midjourney
“Two security researchers one woman one man as professors
explaining mathematics in a big blackboard with a lot of
mathematic formulas at night cyberpunk style --ar 16:9 --v 5.1”
ARTIFICIAL
INPUT OUTPUT
INTELLIGENCE
The ability to process information
and make decisions or take actions
to achieve a desired outcome
Artificial Intelligence
Artificial Intelligence In 1956, the Dartmouth Summer Research Project on
1950’s
Artificial Intelligence (DSRPAI) Conference marked the
birth of the field of AI (New Hampshire).
Bias
w2
Forward Propagation
Backpropagation
How does each weight contribute to the overall loss?
(+) Gradient
w w
Loss w
w
Actual
Value
(-) Gradient Predicted
Value Loss
w
Weight w
w w
Loss is Minimized
Learning Happens
Forward Propagation
Backpropagation
How does each weight contribute to the overall loss?
Actual
Value
Loss
Learning Happens
Forward Propagation
“Learned weights / parameters capture the knowledge and
patterns learned by the neural network during training”
h0 h1
Recurrence Recurrence
Relation Relation
https://www.youtube.com/watch?v=ySEx_Bqxvvo&list=PLtBw6njQRU-rwp5__7C0oIVt26ZgjG9NI&index=3
Internal Internal
State State
Recurrent
h0 h1
Cell
H Recurrence Recurrence
Relation Relation
https://www.youtube.com/watch?v=ySEx_Bqxvvo&list=PLtBw6njQRU-rwp5__7C0oIVt26ZgjG9NI&index=3
Many to One One to Many Many to Many
Sentiment Classification Text Generation Text Translation
https://www.youtube.com/watch?v=ySEx_Bqxvvo&list=PLtBw6njQRU-rwp5__7C0oIVt26ZgjG9NI&index=3
The dog is Fixed Length El perro es
brown
Encoder Vector Decoder marrón
https://arxiv.org/abs/1406.1078
The dog is The dog is brown
Tokenizer
brown
Input Tokens
Token Embeddings
The dog is Fixed Length El perro es
brown
Encoder Vector Decoder marrón
El perro es marrón
h1 h2 h3 h4
Input
Sentence
Embedding
word word word word
embedding embedding embedding embedding
H
Decoder
Encoder
https://arxiv.org/abs/1706.03762
Encoder
h1 h2 h3
Embeddings
P0 P1 P2 P3
http://jalammar.github.io/illustrated-transformer/
Self-Attention
https://ai.googleblog.com/2017/08/transformer-novel-neural-network.html
[[0.9, 0.5, 0.3, 0.7],
[0.4,
[[0.9,
0.6,0.5,
0.2,0.3,
0.1],
0.7],
[0.8,
[0.4,
0.2,
[[0.9,
0.6,
0.7,
0.5,
0.2,
0.4],
0.3,
0.1],
0.7],
[0.2,
[0.8,
0.3,
[0.4,
0.2,
[[0.9,
0.1,
0.6,
0.7,
0.6]]
0.5,
0.2,
0.4],
0.3,
0.1],
0.7],
[0.2,
[0.8,
0.3,
[0.4,
0.2,
[[0.9,
0.1,
0.6,
0.7,
0.6]]
0.5,
0.2,
0.4],
0.3,
0.1],
0.7],
[0.2,
[0.8,
0.3,
[0.4,
0.2,
0.1,
0.6,
0.7,
0.6]]
0.2,
0.4],
0.1],
[0.2,
[0.8,
0.3,0.2,
0.1,0.7,
0.6]]
0.4],
[0.2, 0.3, 0.1, 0.6]]
https://learn.deeplearning.ai/chatgpt-prompt-eng/lesson/1/introduction
GPT Models
Created by Midjourney
“Two security researchers one woman one man as professors
explaining mathematics in a big blackboard with a lot of
mathematic formulas at night cyberpunk style --ar 16:9 --v 5.1”
Input Layer Hidden Layers Output Layer
https://learn.microsoft.com/en-us/semantic-kernel/prompt-engineering/llm-models#what-is-a-baseline-comparison-rubric-for-llm-ais
https://platform.openai.com/docs/models/gpt-4
https://platform.openai.com/docs/models/gpt-4
https://arxiv.org/abs/1706.03762
Prompt
https://www.midjourney.com/
Sit Down
Foundation Model
Come Stay
https://www.midjourney.com/
Rescue Dog
Special Training
Service Dog
Foundation Model
Police Dog
https://www.midjourney.com/
Traditional ML
Prompt-Based ML
Prompt Predict
Created by Midjourney
“Two security researchers one woman one man as professors
explaining mathematics in a big blackboard with a lot of
mathematic formulas at night cyberpunk style --ar 16:9 --v 5.1”
https://github.com/Cyb3rWard0g/GPT-Security-Adventures
https://thedfirreport.com/2022/03/21/phosphorus-automates-initial-access-using-proxyshell/
https://github.com/pinecone-io/examples/blob/master/generation/langchain/handbook/05-langchain-retrieval-augmentation.ipynb
Answer
Query Query
ATT&CK
Python Client Embedding
Context LLM
ATT&CK Database
Retriever
Relevant
Documents
Document
Tokenizing
Embedding
Vector Database
ATT&CK Groups
Agents use an LLM to determine which actions to take and in what order. An action can either be using
a tool and observing its output or returning to the user.
2108.07258.pdf (arxiv.org)
https://www.youtube.com/watch?v=QDX-1M5Nj7s&t=5s
https://www.youtube.com/watch?v=hfIUstzHs9A
https://www.youtube.com/watch?v=FE88OOUBonQ&t=129s
Tensor2Tensor Intro - Colaboratory (google.com)
Thank you