Skip to content

Commit 7fc565e

Browse files
KINGSABRIgitbook-bot
authored andcommitted
GitBook: [master] 11 pages and one asset modified
1 parent da4411c commit 7fc565e

File tree

12 files changed

+65
-35
lines changed

12 files changed

+65
-35
lines changed

.gitbook/assets/bhr-cover.png

1.04 MB
Loading

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ description: ruby for pentesters
88
_**Rubyfu, where Ruby goes evil!**_
99
![Twitter Follow](https://img.shields.io/twitter/follow/Rubyfu.svg?style=social&label=Follow&style=plastic)
1010

11+
## Introduction
12+
1113
This book is a great collection of ideas, tricks, and skills that could be useful for Hackers. It's a unique extraction reference, summarizes a lot of research and experience in order to achieve your **w00t** in the shortest and smartest way. Rubyfu is where you'll find plug-n-hack code. Rubyfu is a book to use not only to read, it's where ruby goes evil.
1214

1315
### Who should read this book?
@@ -46,3 +48,40 @@ Module 0x6 explores forensic capabilities with Rubyfu. Whoever you are: redteam,
4648

4749
![](https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png)
4850

51+
## Black Hat Ruby **— Offensive Ruby programming book for hackers & pentesters**
52+
53+
Black Hat Ruby is the commercial edition of Rubyfu. The book contains many new topics and solving a lot of real-world challenges with detailed explanations targeting professionals.
54+
55+
![Black Hat Ruby cover](.gitbook/assets/bhr-cover.png)
56+
57+
{% hint style="success" %}
58+
You can purchase [**Black Hat Ruby on Amazon**](https://www.amazon.com/dp/B08JHSF6GT)\*\*\*\*
59+
{% endhint %}
60+
61+
The primary goal of Black Hat Ruby book is to provide you with a vast angle of using Ruby as an information security professional in an offensive manner. The book meant to help you with weaponizing Ruby language in various offensive scenarios whether you are testing web applications, networks, systems, or exploit development to carve your ideas into working and achieving code.
62+
63+
Another intended goal of the book is to route you to the code that achieves your goal in the shortest time. This book is aimed at security researchers, security consultants, penetration testers, red teamers, or any professional who is interested in writing offensive Code.
64+
65+
In this book, you will learn:
66+
67+
* Hacker's day to day string manipulation, conversion, and extraction.
68+
* Compiling ruby to exe, parsing, and files such as XML, JSON, HTML, and binary.
69+
* Manipulating files stamps, creating malicious Shortcut, Excel & PDF files.
70+
* Generating the most common hashes for various platforms.
71+
* Using ruby to execute system commands.
72+
* Tactical code for red teaming activities, such as lateral movements via WinRM, WMI and creating malicious OLE and malicious Excel files for spear phishing.
73+
* Importing Windows system internal for execute shellcode, dll injection.
74+
* Introduction to the network Socket operations in Ruby and creating a remote shell.
75+
* Malicious use for network services such as HTTP, SSH, DNS, FTP, TFTP for exploitation and data exfiltration.
76+
* Packet manipulation and building network packet from the ground up to for ARP spoofing, rogue wireless access point \(AP\), SNMP spoofing and parsing captured pcap files.
77+
* Introduction about dealing with services and creating covert C2 for data exfiltration.
78+
* Automating the hunting of XSS and blind-XSS. • Exploiting Web socket and WSDL services and its APIs.
79+
* Using Slack as a C2
80+
* Understanding and creating advanced Burp Suite scanner extensions \(active and passive\) and manipulate the Burp user interface in detail.
81+
* Step by step basic buffer overflow exploit development using ruby.
82+
* Porting your stand-alone exploit to Metasploit and creating Auxiliary, Exploit and Post modules.
83+
84+
Happy Hacking!
85+
86+
87+

contributors/README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22

33
![](../.gitbook/assets/ruby_loves_us.jpg)
44

5-
**Big love to those people who support this book by any meaning.**
6-
7-
8-
5+
**Big love to those people who support this book by any meaning.**
96

107
## Founder
118

module-0x1-or-basic-ruby-kung-fu/README.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ We can't stop being jealous of Metasploit console \(msfconsole\), where we take
4444

4545
The Readline module provides an interface for GNU Readline. This module defines a number of methods to facilitate completion and accesses input history from the Ruby interpreter.
4646

47-
{% code-tabs %}
48-
{% code-tabs-item title="console-basic1.rb" %}
47+
{% code title="console-basic1.rb" %}
4948
```ruby
5049
#!/usr/bin/env ruby
5150
# KING SABRI | @KINGSABRI
@@ -70,15 +69,13 @@ while line = Readline.readline('-> ', true)
7069
break if line =~ /^quit.*/i or line =~ /^exit.*/i
7170
end
7271
```
73-
{% endcode-tabs-item %}
74-
{% endcode-tabs %}
72+
{% endcode %}
7573

7674
Now run it and try out the tab completion!
7775

7876
Well, the main idea for tab completion is to make things easier, not just "press tab". Here is a simple thought...
7977

80-
{% code-tabs %}
81-
{% code-tabs-item title="console-basic2.rb" %}
78+
{% code title="console-basic2.rb" %}
8279
```ruby
8380
require 'readline'
8481

@@ -115,8 +112,7 @@ while line = Readline.readline('-> ', true) # Start console with character -> a
115112
break if line =~ /^quit.*/i or line =~ /^exit.*/i
116113
end
117114
```
118-
{% endcode-tabs-item %}
119-
{% endcode-tabs %}
115+
{% endcode %}
120116

121117
Things can go much farther, like _msfconsole_, maybe?
122118

module-0x3-or-network-kung-fu/network-scanning/nessus.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,14 @@ end
2929
Output:
3030

3131
```text
32-
172.17.1.96 MS08-067: Microsoft Windows Server Service Crafted RPC Request Handling Remote Code Execution (958644) (ECLIPSEDWING) (uncredentialed check)
33-
172.17.1.96 MS17-010: Security Update for Microsoft Windows SMB Server (4013389) (ETERNALBLUE) (ETERNALCHAMPION) (ETERNALROMANCE) (ETERNALSYNERGY) (WannaCry) (EternalRocks) (Petya) (uncredentialed check)
34-
172.17.1.96 MS09-001: Microsoft Windows SMB Vulnerabilities Remote Code Execution (958687) (uncredentialed check)
35-
172.17.1.93 MS08-067: Microsoft Windows Server Service Crafted RPC Request Handling Remote Code Execution (958644) (ECLIPSEDWING) (uncredentialed check)
36-
172.17.1.93 MS17-010: Security Update for Microsoft Windows SMB Server (4013389) (ETERNALBLUE) (ETERNALCHAMPION) (ETERNALROMANCE) (ETERNALSYNERGY) (WannaCry) (EternalRocks) (Petya) (uncredentialed check)
37-
172.17.1.93 MS12-020: Vulnerabilities in Remote Desktop Could Allow Remote Code Execution (2671387) (uncredentialed check)
38-
172.17.1.50 Microsoft RDP RCE (CVE-2019-0708) (BlueKeep) (uncredentialed check)
32+
172.17.1.96 MS08-067: Microsoft Windows Server Service Crafted RPC Request Handling Remote Code Execution (958644) (ECLIPSEDWING) (uncredentialed check)
33+
172.17.1.96 MS17-010: Security Update for Microsoft Windows SMB Server (4013389) (ETERNALBLUE) (ETERNALCHAMPION) (ETERNALROMANCE) (ETERNALSYNERGY) (WannaCry) (EternalRocks) (Petya) (uncredentialed check)
34+
172.17.1.96 MS09-001: Microsoft Windows SMB Vulnerabilities Remote Code Execution (958687) (uncredentialed check)
35+
172.17.1.93 MS08-067: Microsoft Windows Server Service Crafted RPC Request Handling Remote Code Execution (958644) (ECLIPSEDWING) (uncredentialed check)
36+
172.17.1.93 MS17-010: Security Update for Microsoft Windows SMB Server (4013389) (ETERNALBLUE) (ETERNALCHAMPION) (ETERNALROMANCE) (ETERNALSYNERGY) (WannaCry) (EternalRocks) (Petya) (uncredentialed check)
37+
172.17.1.93 MS12-020: Vulnerabilities in Remote Desktop Could Allow Remote Code Execution (2671387) (uncredentialed check)
38+
172.17.1.50 Microsoft RDP RCE (CVE-2019-0708) (BlueKeep) (uncredentialed check)
3939
```
4040

4141
Read more on [GitHub](https://github.com/mephux/ruby-nessus).
42+

module-0x3-or-network-kung-fu/packet-manipulation/arp-spoofing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ We have 3 machines in this scenario as shown below.
1616
Here the list of IP and MAC addresses of each of theme in the following table
1717

1818
| Host/Info | IP Address | MAC Address |
19-
| --- | :---: | :---: |
19+
| :--- | :---: | :---: |
2020
| Attacker | 192.168.0.100 | 3C:77:E6:68:66:E9 |
2121
| Victim | 192.168.0.21 | 00:0C:29:38:1D:61 |
2222
| Router | 192.168.0.1 | 00:50:7F:E6:96:20 |

module-0x3-or-network-kung-fu/packet-manipulation/dns-spooging.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,10 @@ end
280280

281281
[https://github.com/SilverFoxx/Spoofa/blob/master/spoofa](https://github.com/SilverFoxx/Spoofa/blob/master/spoofa)
282282

283-
Sources - The code has been modified and fixed
283+
Sources - The code has been modified and fixed
284284

285285
| Bit | Flag | Description | Reference |
286-
| :---: | --- | --- | --- |
286+
| :---: | :--- | :--- | :--- |
287287
| bit 5 | AA | Authoritative Answer | \[RFC1035\] |
288288
| bit 6 | TC | Truncated Response | \[RFC1035\] |
289289
| bit 7 | RD | Recursion Desired | \[RFC1035\] |

module-0x4-or-web-kung-fu/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ end
4545

4646
#### Simple Shortened URL extractor
4747

48-
{% code-tabs %}
49-
{% code-tabs-item title="urlextractor.rb" %}
48+
{% code title="urlextractor.rb" %}
5049
```ruby
5150
#!/usr/bin/env ruby
5251
require 'net/http'
@@ -61,8 +60,7 @@ loop do
6160
end
6261
end
6362
```
64-
{% endcode-tabs-item %}
65-
{% endcode-tabs %}
63+
{% endcode %}
6664

6765
Run it
6866

module-0x4-or-web-kung-fu/extending-burp-suite.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010

1111
Import the Burp Suite Extender Core API `IBurpExtender`
1212

13-
{% code-tabs %}
14-
{% code-tabs-item title="alert.rb" %}
13+
{% code title="alert.rb" %}
1514
```ruby
1615
require 'java'
1716
java_import 'burp.IBurpExtender'
@@ -25,8 +24,7 @@ class BurpExtender
2524
end
2625
end
2726
```
28-
{% endcode-tabs-item %}
29-
{% endcode-tabs %}
27+
{% endcode %}
3028

3129
Load the plugin alert.rb
3230
![](../.gitbook/assets/webfu__burp-ext1.png)

module-0x4-or-web-kung-fu/ldap-injection.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
## Special Blind LDAP Injection (without "*")
1+
# LDAP injection
22

33
The is a very basic script that will retrieve the password of a user in a Blind LDAP Injection case by bruteforcing all characters one by one.
44

5-
65
```ruby
76
#!/usr/bin/env ruby
87
require 'net/http'
@@ -20,3 +19,4 @@ flag = ''
2019
end
2120
end
2221
```
22+

module-0x5-or-exploitation-kung-fu/metasm.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ asm> pop eax
4949

5050
Note: it is possible to do exactly the same thing with a metasploit embedded tool: [`nasm_shell`](https://github.com/rapid7/metasploit-framework/blob/master/tools/exploit/nasm_shell.rb).
5151

52-
```
52+
```text
5353
$ /opt/metasploit/tools/exploit/nasm_shell.rb
5454
nasm > jmp esp
5555
00000000 FFE4 jmp esp
5656
```
57+

references.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@
6060
* Haiti - A CLI tool and library to identify the hash type of a given hash \[ [link](https://github.com/noraj/haiti) \]
6161
* ctf-party - A library to enhance and speed up script/exploit writing for CTF players \[ [link](https://github.com/noraj/ctf-party) \]
6262
* itdis - A small tool that allows you to check if a list of domains you have been provided is in the scope of your pentest or not. \[ [link](https://gitlab.com/noraj/itdis) \]
63-
* nvd_feed_api - A simple ruby API/library for managing NVD CVE feeds. The API will help you to download and manage NVD Data Feeds, search for CVEs, build your vulnerability assessment platform or vulnerability database. \[ [link](https://gitlab.com/noraj/nvd_api) \]
63+
* nvd\_feed\_api - A simple ruby API/library for managing NVD CVE feeds. The API will help you to download and manage NVD Data Feeds, search for CVEs, build your vulnerability assessment platform or vulnerability database. \[ [link](https://gitlab.com/noraj/nvd_api) \]
6464
* VBSmin - VBScript minifier CLI tool and library \[ [link](https://github.com/noraj/vbsmin) \]
6565
* Fingerprinter - CMS/LMS/Library etc Versions Fingerprinter \[ [link](https://github.com/erwanlr/Fingerprinter) \]
6666
* API-fuzzer - API Fuzzer which allows to fuzz request attributes using common pentesting techniques and lists vulnerabilities \[ [link](https://github.com/Fuzzapi/API-fuzzer) \]
67-
* oxml_xxe - Tool for embedding XXE/XML exploits into different filetypes (docx/xlsx, odt/ods, svg, xml, etc.) \[ [link](https://github.com/BuffaloWill/oxml_xxe) \]
67+
* oxml\_xxe - Tool for embedding XXE/XML exploits into different filetypes \(docx/xlsx, odt/ods, svg, xml, etc.\) \[ [link](https://github.com/BuffaloWill/oxml_xxe) \]
6868
* SSRF Proxy - Facilitates tunneling HTTP communications through servers vulnerable to SSRF \[ [link](https://github.com/bcoles/ssrf_proxy) \]
6969
* XXEinjector - Tool for automatic exploitation of XXE vulnerability using direct and different out of band methods \[ [link](https://github.com/enjoiz/XXEinjector) \]
7070
* envizon - Network visualization & vulnerability management/reporting \[ [link](https://github.com/evait-security/envizon) \]

0 commit comments

Comments
 (0)