Forwarded from UNDERCODE HACKING
Using Google Dorks For Hacking.pdf
1 MB
β β β Uππ»βΊπ«Δπ¬πβ β β β
π¦PROXY PARSER PHP BY UNDERCODE :
<?php<font></font>
<font></font>
$link = 'https://free-proxy-list.net/';<font></font>
<font></font>
$agent = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36';<font></font>
<font></font>
$ch = curl_init($link);<font></font>
curl_setopt($ch, CURLOPT_USERAGENT, $agent);<font></font>
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);<font></font>
$response_data = curl_exec($ch);<font></font>
if (curl_errno($ch) > 0) {<font></font>
die('ΠΡΠΈΠ±ΠΊΠ° curl: ' . curl_error($ch));<font></font>
}<font></font>
curl_close($ch);<font></font>
<font></font>
preg_match_all('#<td>[0-9.]{5,}[0-9]{2,}</td>#', $response_data, $rawlist);<font></font>
<font></font>
$cleanedList = str_replace('</td><td>', ':', $rawlist[0]);<font></font>
$cleanedList = str_replace('<td>', '', $cleanedList);<font></font>
$cleanedList = str_replace('</td>', '', $cleanedList);<font></font>
<font></font>
foreach ($cleanedList as $key => $value) {<font></font>
echo $value . PHP_EOL;<font></font>
}
> Run like this:
php proxy_parser.php
A list of xy proxies will be received
π¦you can uploaded to your github
ENJOYβ€οΈππ»
@UndercodeTesting
@UndercodeSecurity
@UndercodeHacking
β β β Uππ»βΊπ«Δπ¬πβ β β β
π¦PROXY PARSER PHP BY UNDERCODE :
<?php<font></font>
<font></font>
$link = 'https://free-proxy-list.net/';<font></font>
<font></font>
$agent = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36';<font></font>
<font></font>
$ch = curl_init($link);<font></font>
curl_setopt($ch, CURLOPT_USERAGENT, $agent);<font></font>
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);<font></font>
$response_data = curl_exec($ch);<font></font>
if (curl_errno($ch) > 0) {<font></font>
die('ΠΡΠΈΠ±ΠΊΠ° curl: ' . curl_error($ch));<font></font>
}<font></font>
curl_close($ch);<font></font>
<font></font>
preg_match_all('#<td>[0-9.]{5,}[0-9]{2,}</td>#', $response_data, $rawlist);<font></font>
<font></font>
$cleanedList = str_replace('</td><td>', ':', $rawlist[0]);<font></font>
$cleanedList = str_replace('<td>', '', $cleanedList);<font></font>
$cleanedList = str_replace('</td>', '', $cleanedList);<font></font>
<font></font>
foreach ($cleanedList as $key => $value) {<font></font>
echo $value . PHP_EOL;<font></font>
}
> Run like this:
php proxy_parser.php
A list of xy proxies will be received
π¦you can uploaded to your github
ENJOYβ€οΈππ»
@UndercodeTesting
@UndercodeSecurity
@UndercodeHacking
β β β Uππ»βΊπ«Δπ¬πβ β β β
free-proxy-list.net
Free Proxy List - Just Checked Proxy List
Here are the latest 300 free proxies that are just checked and added into our proxy list. The proxy list is updated every 10 minutes to keep fresh.
β β β Uππ»βΊπ«Δπ¬πβ β β β
π¦SOME VERIFIED BINS :
> β Bin For HBO Now Premium
Bin : 650180xxxxxxxxxx
CVV/Date: RND
IP : USA πΊπΈ
Zip Code : 10080
> β | x3 Multifunctional Bins For FuboTV, Tidal, FlixOle try more sites too
BIN: 406032xxxxxxxxxx
BIN: 406068xxxxxxxxxx
DATE: Rnd
TESTED ON:
Tidal (Any plan)
FlixOlΓ©
IP USA πΊπΈ
Zip Code: 10080
> β Bin Amazon AWS
Bin: 531260008116xxxx > β
Bin: 531260009066xxxx > this fail
Bin: 531260505223xxxx > β
Data: 04/23
Status: Works & Tested
IP: United States
π¦Only Checked by Us
E N J O Y & USE FOR LEARN
β β β Uππ»βΊπ«Δπ¬πβ β β β
π¦SOME VERIFIED BINS :
> β Bin For HBO Now Premium
Bin : 650180xxxxxxxxxx
CVV/Date: RND
IP : USA πΊπΈ
Zip Code : 10080
> β | x3 Multifunctional Bins For FuboTV, Tidal, FlixOle try more sites too
BIN: 406032xxxxxxxxxx
BIN: 406068xxxxxxxxxx
DATE: Rnd
TESTED ON:
Tidal (Any plan)
FlixOlΓ©
IP USA πΊπΈ
Zip Code: 10080
> β Bin Amazon AWS
Bin: 531260008116xxxx > β
Bin: 531260009066xxxx > this fail
Bin: 531260505223xxxx > β
Data: 04/23
Status: Works & Tested
IP: United States
π¦Only Checked by Us
E N J O Y & USE FOR LEARN
β β β Uππ»βΊπ«Δπ¬πβ β β β
β β β Uππ»βΊπ«Δπ¬πβ β β β
π¦SOME TERMS FOR BEGINERS
1οΈβ£Packing
It is to use a special algorithm to change the encoding of the exe executable program or the DLL dynamic link library file (for example, to achieve compression and encryption) to reduce the file size and encrypt the program encoding, and even avoid the intention of anti-virus software. At present, the more commonly used shells are UPX, ASPack, PePack, PECompact, UPack, Immune 007 and so on. Another important function of the packer is to prevent the software from being cracked.
2οΈβ£Flower instruction
It is just a few assembly instructions to make some jumps in the assembly statement, so that the anti-virus software cannot normally judge the structure of the virus file. To put it simply, "Antivirus software searches for viruses in order from head to toe. If we reverse the head and feet of the virus, the antivirus software will not find the virus.
3οΈβ£Router is
a device used to access the Internet. In the past, a broadband cable was used to directly connect to a computer and enter the password to access the Internet. Why do computers need to be connected to a router now? Because the mobile phone needs to connect to the wifi of the router to access the Internet, the broadband cable is connected to the router, and the computer has no broadband cable, so you can only connect to the router.
4οΈβ£The port needs
to be on the network. Knowing the ip address of a computer is just equivalent to knowing its residential address. To communicate with it, we also need to know which ports it opens. For example, when we go to a hospital, we need to register to 1 You must go to window No. 2 for pricing, and window No. 3 to get medicine. Then the communication with the computer is the same. To access example.com, you have to contact the port 80 of the example.com server, and ftp To log in to the space and transfer files, we have to connect to port 21 of the server again. Therefore, the port is a data transmission channel for receiving certain data and then sending it to the corresponding reply. After the computer processes the data, Then send the corresponding reply to the other party through the port.
5οΈβ£ip address
computer on the Internet have a lot in order to enable them to recognize each other, each host on the Internet is assigned only a 32-bit address, which is called ip address, also called Internet address, the ip address It consists of 4 numerical parts, each of which can take a value of 0-255, and each ip address has 256x256-1=65535 ports.
@UndercodeTesting
@UndercodeSecurity
@UndercodeHacking
β β β Uππ»βΊπ«Δπ¬πβ β β β
π¦SOME TERMS FOR BEGINERS
1οΈβ£Packing
It is to use a special algorithm to change the encoding of the exe executable program or the DLL dynamic link library file (for example, to achieve compression and encryption) to reduce the file size and encrypt the program encoding, and even avoid the intention of anti-virus software. At present, the more commonly used shells are UPX, ASPack, PePack, PECompact, UPack, Immune 007 and so on. Another important function of the packer is to prevent the software from being cracked.
2οΈβ£Flower instruction
It is just a few assembly instructions to make some jumps in the assembly statement, so that the anti-virus software cannot normally judge the structure of the virus file. To put it simply, "Antivirus software searches for viruses in order from head to toe. If we reverse the head and feet of the virus, the antivirus software will not find the virus.
3οΈβ£Router is
a device used to access the Internet. In the past, a broadband cable was used to directly connect to a computer and enter the password to access the Internet. Why do computers need to be connected to a router now? Because the mobile phone needs to connect to the wifi of the router to access the Internet, the broadband cable is connected to the router, and the computer has no broadband cable, so you can only connect to the router.
4οΈβ£The port needs
to be on the network. Knowing the ip address of a computer is just equivalent to knowing its residential address. To communicate with it, we also need to know which ports it opens. For example, when we go to a hospital, we need to register to 1 You must go to window No. 2 for pricing, and window No. 3 to get medicine. Then the communication with the computer is the same. To access example.com, you have to contact the port 80 of the example.com server, and ftp To log in to the space and transfer files, we have to connect to port 21 of the server again. Therefore, the port is a data transmission channel for receiving certain data and then sending it to the corresponding reply. After the computer processes the data, Then send the corresponding reply to the other party through the port.
5οΈβ£ip address
computer on the Internet have a lot in order to enable them to recognize each other, each host on the Internet is assigned only a 32-bit address, which is called ip address, also called Internet address, the ip address It consists of 4 numerical parts, each of which can take a value of 0-255, and each ip address has 256x256-1=65535 ports.
@UndercodeTesting
@UndercodeSecurity
@UndercodeHacking
β β β Uππ»βΊπ«Δπ¬πβ β β β
β β β Uππ»βΊπ«Δπ¬πβ β β β
π¦ A decade of lurking "hacker mercenaries" appeared, eyeing European law firms
#News
> This year, following the exposure of the Dark Basin hacker hire organization, Kaspersky discovered Deceptikons, the second hacker hire organization.
> The Russian cybersecurity company Kaspersky stated in a webinar that it discovered a new hacker hire organization that has been active for nearly a decade.
According to Kaspersky Malware Analyst Vicente Diaz, Kaspersky named this organization "Deceptikons". It launched attacks against the four major law firms and financial technology companies in the industry to steal confidential corporate data, mainly in Europe. Occasionally appear in Middle Eastern countries such as Israel, Jordan and Egypt.
The organization's most recent attack was a spear phishing campaign in 2019. A series of European law firms were recruited. In this campaign, the organization deployed malicious PowerShell scripts on target enterprise hosts.
π¦0day vulnerability has not been exploited
> The Russian security company mentioned in a written report in the webinar, βThe development of the attack technology is still immature. As far as we know, 0day has not been used to carry out attacks.β
> As far as the hacker organizationβs infrastructure and malware are concerned, βsmart but not advancedβ, the biggest advantage to infected hosts is persistence.
>Observing most of its attacks, we can find that they have similar patterns, starting with spear-phishing emails, which carry modified malicious LINK (shortcut) files.
>If the victim downloads or interacts with the email (such as clicking on it), this shortcut file will automatically download and run the PowerShell backdoor Trojan.
>Kaspersky will release some more comprehensive technical reports on the organization's activities in the next few weeks.
#News
@UndercodeTesting
@UndercodeSecurity
@UndercodeHacking
β β β Uππ»βΊπ«Δπ¬πβ β β β
π¦ A decade of lurking "hacker mercenaries" appeared, eyeing European law firms
#News
> This year, following the exposure of the Dark Basin hacker hire organization, Kaspersky discovered Deceptikons, the second hacker hire organization.
> The Russian cybersecurity company Kaspersky stated in a webinar that it discovered a new hacker hire organization that has been active for nearly a decade.
According to Kaspersky Malware Analyst Vicente Diaz, Kaspersky named this organization "Deceptikons". It launched attacks against the four major law firms and financial technology companies in the industry to steal confidential corporate data, mainly in Europe. Occasionally appear in Middle Eastern countries such as Israel, Jordan and Egypt.
The organization's most recent attack was a spear phishing campaign in 2019. A series of European law firms were recruited. In this campaign, the organization deployed malicious PowerShell scripts on target enterprise hosts.
π¦0day vulnerability has not been exploited
> The Russian security company mentioned in a written report in the webinar, βThe development of the attack technology is still immature. As far as we know, 0day has not been used to carry out attacks.β
> As far as the hacker organizationβs infrastructure and malware are concerned, βsmart but not advancedβ, the biggest advantage to infected hosts is persistence.
>Observing most of its attacks, we can find that they have similar patterns, starting with spear-phishing emails, which carry modified malicious LINK (shortcut) files.
>If the victim downloads or interacts with the email (such as clicking on it), this shortcut file will automatically download and run the PowerShell backdoor Trojan.
>Kaspersky will release some more comprehensive technical reports on the organization's activities in the next few weeks.
#News
@UndercodeTesting
@UndercodeSecurity
@UndercodeHacking
β β β Uππ»βΊπ«Δπ¬πβ β β β
β β β Uππ»βΊπ«Δπ¬πβ β β β
π¦ALL POPULAR WAYS- PASSWORD #CRACKING
1. Record the screen
In order to prevent keyloggers from using the mouse and pictures to enter the password, hackers can take a screenshot of the userβs screen through a Trojan horse program and record the position of the mouse click. By recording the mouse position and comparing the screenshot, the method can be cracked. User password.
2. Multiple monitoring of the keyboard
If the userβs password is more complex, it is difficult to use brute force to crack it. At this time, hackers often install Trojan horse viruses for the user, design a "keylogger" program, record and monitor the userβs keyboard operations, and then record them in various ways The userβs keyboard content is sent to the hacker, so that the hacker can crack the userβs password by analyzing the userβs keyboard information.
3. Phishing and fraudulent website fraud
"Phishing" attacks use deceptive emails and fake website login sites to carry out fraudulent activities. The victim often reveals his sensitive information (such as username, password, account number, PIN code or credit card details), phishing Mainly by sending e-mails to lure users to log on to fake online banking and online securities websites, defrauding user account passwords to commit theft.
4. Brute force cracking
The most basic of password cracking technology is brute force cracking, also called password cracking. Xiaofeng calls it the most mindless operation. If the hacker knows the account number in advance, such as mail account, QQ user account, online banking account, birthday, etc., and the userβs password is set very simple, for example, with a simple combination of numbers, the hacker can quickly crack it using brute force cracking tools Come out the password. Therefore, the user should try to make the password setting more complicated.
5. Use a sniffer to obtain
On the local area network, if a hacker wants to quickly obtain a large number of accounts (including user names and passwords), the most effective method is to use the Sniffer program. Sniffer, Chinese translated as sniffer, is a very threatening passive attack tool. Using this tool, you can monitor the status of the network, the data flow, and the information transmitted on the network. When the information is transmitted on the network in the form of plain text, the data packets transmitted on the network can be stolen by means of network monitoring. Set the network interface to monitor mode, and then you can intercept the continuous information transmitted on the Internet. Any data packets directly transmitted via HTTP, FTP, POP, SMTP, TELNET protocols will be monitored by the Sniffer program.
6. Implant a Trojan horse for remote control
Use the remote control Trojan to monitor all operations of the user's local computer, and any keyboard and mouse operations of the user will be intercepted by remote hackers.
7. Bad habits of using passwords
Although some employees set a long password, they write the password on paper. Some use their own name or birthday as the password, and some use commonly used words as the password. These bad habits will lead to The password can be easily cracked.
8. Analyze and reason through social engineering
If a user uses multiple systems, hackers can first crack the user password of the simpler system, and then use the cracked password to calculate the user password of other systems. For example, many users use the same password for all systems.
9. Use tools to crack
For some locally saved passwords with asterisks, you can use a tool like Password Reminder to crack. Drag and drop the magnifying glass in Password Reminder onto the asterisks to crack the password.
π¦ALL POPULAR WAYS- PASSWORD #CRACKING
1. Record the screen
In order to prevent keyloggers from using the mouse and pictures to enter the password, hackers can take a screenshot of the userβs screen through a Trojan horse program and record the position of the mouse click. By recording the mouse position and comparing the screenshot, the method can be cracked. User password.
2. Multiple monitoring of the keyboard
If the userβs password is more complex, it is difficult to use brute force to crack it. At this time, hackers often install Trojan horse viruses for the user, design a "keylogger" program, record and monitor the userβs keyboard operations, and then record them in various ways The userβs keyboard content is sent to the hacker, so that the hacker can crack the userβs password by analyzing the userβs keyboard information.
3. Phishing and fraudulent website fraud
"Phishing" attacks use deceptive emails and fake website login sites to carry out fraudulent activities. The victim often reveals his sensitive information (such as username, password, account number, PIN code or credit card details), phishing Mainly by sending e-mails to lure users to log on to fake online banking and online securities websites, defrauding user account passwords to commit theft.
4. Brute force cracking
The most basic of password cracking technology is brute force cracking, also called password cracking. Xiaofeng calls it the most mindless operation. If the hacker knows the account number in advance, such as mail account, QQ user account, online banking account, birthday, etc., and the userβs password is set very simple, for example, with a simple combination of numbers, the hacker can quickly crack it using brute force cracking tools Come out the password. Therefore, the user should try to make the password setting more complicated.
5. Use a sniffer to obtain
On the local area network, if a hacker wants to quickly obtain a large number of accounts (including user names and passwords), the most effective method is to use the Sniffer program. Sniffer, Chinese translated as sniffer, is a very threatening passive attack tool. Using this tool, you can monitor the status of the network, the data flow, and the information transmitted on the network. When the information is transmitted on the network in the form of plain text, the data packets transmitted on the network can be stolen by means of network monitoring. Set the network interface to monitor mode, and then you can intercept the continuous information transmitted on the Internet. Any data packets directly transmitted via HTTP, FTP, POP, SMTP, TELNET protocols will be monitored by the Sniffer program.
6. Implant a Trojan horse for remote control
Use the remote control Trojan to monitor all operations of the user's local computer, and any keyboard and mouse operations of the user will be intercepted by remote hackers.
7. Bad habits of using passwords
Although some employees set a long password, they write the password on paper. Some use their own name or birthday as the password, and some use commonly used words as the password. These bad habits will lead to The password can be easily cracked.
8. Analyze and reason through social engineering
If a user uses multiple systems, hackers can first crack the user password of the simpler system, and then use the cracked password to calculate the user password of other systems. For example, many users use the same password for all systems.
9. Use tools to crack
For some locally saved passwords with asterisks, you can use a tool like Password Reminder to crack. Drag and drop the magnifying glass in Password Reminder onto the asterisks to crack the password.
10. Study human psychology and conduct cryptographic psychology
Many well-known hackers do not use cutting-edge technology to crack passwords, but only use password psychology. They start from the user's psychology, analyze the user's information and analyze the user's psychology, so as to crack the password faster. In fact, there are many ways to obtain information. If you have a good grasp of password psychology, you can quickly crack and obtain user information.
enjoyβ€οΈππ»
@UndercodeTesting
@UndercodeSecurity
@UndercodeHacking
β β β Uππ»βΊπ«Δπ¬πβ β β β
Many well-known hackers do not use cutting-edge technology to crack passwords, but only use password psychology. They start from the user's psychology, analyze the user's information and analyze the user's psychology, so as to crack the password faster. In fact, there are many ways to obtain information. If you have a good grasp of password psychology, you can quickly crack and obtain user information.
enjoyβ€οΈππ»
@UndercodeTesting
@UndercodeSecurity
@UndercodeHacking
β β β Uππ»βΊπ«Δπ¬πβ β β β
Forwarded from Backup Legal Mega
mega.nz
1.42 GB folder on MEGA
457 files and 12 subfolders
Forwarded from Backup Legal Mega
mega.nz
File folder on MEGA
π¦Termux tutorials - commands :
check recently termux 2 pdfs +
1) How To Install Package in Termux
pkg install <package name>
2)How To search Package
pkg search <query>
3)How To Upgrade Package
pkg upgrade
4) Uninstall
pkg uninstall <pkg name>
5) Install Mosquitto MQTT Broker
After Installation, Run Termux app. Then at the prompt type
pkg install mosquitto mosquitto
6) Install Node-Red
Prompt type :
apt update
apt upgrade
apt install coreutils nano nodejs
npm i -g --unsafe-perm node-red
node-red Then you can point a browser to localhost:1880
7) Install C language
pkg install clang
8) Install Python
pkg install python
9) Install NodeJS
pkg install nodejs
10) Install Go programming language
apt install golang
11) Install PHP language
apt install php
12) How To use SSH
pkg install dropbear
pkg install openssh
13)Find IP address
ifconfig
14) Install nano Editor
pkg install nano
15) Install Git GitHub tool
apt install git
16) Control Raspberry Pi
If you have a headless Pi, then you can Control and use Raspberry Pi via SSH using Termux. How to setup truly headless RPi β How To Use Raspberry pi in a truely headless mode
17) Install Apache2
apt update
apt upgrade
apt install apache2
Remember Apache directory is this /data/data/com.termux/files/usr/share/apache2/default-site/htdocs/
For example I have read.txt if you want to move this read.txt to Apache directory then I use this command
mv read.txt /data/data/com.termux/files/usr/share/apache2/default-site/htdocs/
To start apache2 server in Termux type this command :
apachectl
Now open browser and type localhost:8080/read.txt
enjoyβ€οΈππ»
@UndercodeTesting
@UndercodeSecurity
@UndercodeHacking
β β β Uππ»βΊπ«Δπ¬πβ β β β
check recently termux 2 pdfs +
1) How To Install Package in Termux
pkg install <package name>
2)How To search Package
pkg search <query>
3)How To Upgrade Package
pkg upgrade
4) Uninstall
pkg uninstall <pkg name>
5) Install Mosquitto MQTT Broker
After Installation, Run Termux app. Then at the prompt type
pkg install mosquitto mosquitto
6) Install Node-Red
Prompt type :
apt update
apt upgrade
apt install coreutils nano nodejs
npm i -g --unsafe-perm node-red
node-red Then you can point a browser to localhost:1880
7) Install C language
pkg install clang
8) Install Python
pkg install python
9) Install NodeJS
pkg install nodejs
10) Install Go programming language
apt install golang
11) Install PHP language
apt install php
12) How To use SSH
pkg install dropbear
pkg install openssh
13)Find IP address
ifconfig
14) Install nano Editor
pkg install nano
15) Install Git GitHub tool
apt install git
16) Control Raspberry Pi
If you have a headless Pi, then you can Control and use Raspberry Pi via SSH using Termux. How to setup truly headless RPi β How To Use Raspberry pi in a truely headless mode
17) Install Apache2
apt update
apt upgrade
apt install apache2
Remember Apache directory is this /data/data/com.termux/files/usr/share/apache2/default-site/htdocs/
For example I have read.txt if you want to move this read.txt to Apache directory then I use this command
mv read.txt /data/data/com.termux/files/usr/share/apache2/default-site/htdocs/
To start apache2 server in Termux type this command :
apachectl
Now open browser and type localhost:8080/read.txt
enjoyβ€οΈππ»
@UndercodeTesting
@UndercodeSecurity
@UndercodeHacking
β β β Uππ»βΊπ«Δπ¬πβ β β β
Forwarded from Backup Legal Mega
π¦Packt - TypeScript for JavaScript Developers
#expert - course (4 rating stars )
https://mega.nz/folder/EuB13STS#EZnpuPmLdqpZzLvgBHuCqg
#expert - course (4 rating stars )
https://mega.nz/folder/EuB13STS#EZnpuPmLdqpZzLvgBHuCqg
mega.nz
522.15 MB folder on MEGA
33 files and 7 subfolders
Scripting Metasploit to exploit a group of hosts..pdf
1.2 MB
Scripting Metasploit to exploit a group of hosts / servers ...
β β β Uππ»βΊπ«Δπ¬πβ β β β
π¦How to install secure, robust Mosquitto MQTT broker on AWS Ubuntu ?
πΈπ½π π π°π»π»πΈπ π°π πΈπΎπ½ & π π π½ :
1) Install Mosquitto
Log into the AWS Ubuntu Instance.
1οΈβ£$ sudo apt-get update
> Install iboth the mosquitto broker and the publish / subscribe clients.
2οΈβ£$ sudo apt-get install mosquitto mosquitto-clients
Example for subscribe:
3οΈβ£$ mosquittosub -h localhost -t mychanel
Example for publish:
4οΈβ£$ mosquittopub -h localhost -t mychanel "Hello World"
2) Enable Remote Access
5οΈβ£To publish or subscribe using this broker from a remote machine, we need first open port 1883 in the security group setting. Using the AWS console, go to the security group and open port 1883 to everyone.
The default config file may permit connections from localhost only. The default conf file is can be opened
6οΈβ£$ sudo vim /etc/mosquitto/conf.d/default.conf
The file should contain line following enable remote usage
listener 1883
Note that this port is currently unsecured, so if you donβt want to permit remote access:
listener 1883 localhost
Everytime you edit the conf file, you will have to restart the service for the settings to take effect.
$ sudo systemctl restart mosquitto
3) Robust MQTT
If MQTT broker crashed sometimes, disabling the real time communication. So we added a script that checked the state of the process and restarted Mosquitto in case it was down.
7οΈβ£
8οΈβ£This can script can be saved in a file say βmosquittorestart.shβ.
This file needs to be made an executable and then put in a cron job that runs every 5 minutes. The cron should be set as root.
9οΈβ£$ chmod +x mosquittorestart.sh
π$ sudo -i
1οΈβ£1οΈβ£$ crontab -e
Add the following statement
@UndercodeTesting
@UndercodeSecurity
@UndercodeHacking
β β β Uππ»βΊπ«Δπ¬πβ β β β
π¦How to install secure, robust Mosquitto MQTT broker on AWS Ubuntu ?
πΈπ½π π π°π»π»πΈπ π°π πΈπΎπ½ & π π π½ :
1) Install Mosquitto
Log into the AWS Ubuntu Instance.
1οΈβ£$ sudo apt-get update
> Install iboth the mosquitto broker and the publish / subscribe clients.
2οΈβ£$ sudo apt-get install mosquitto mosquitto-clients
Example for subscribe:
3οΈβ£$ mosquittosub -h localhost -t mychanel
Example for publish:
4οΈβ£$ mosquittopub -h localhost -t mychanel "Hello World"
2) Enable Remote Access
5οΈβ£To publish or subscribe using this broker from a remote machine, we need first open port 1883 in the security group setting. Using the AWS console, go to the security group and open port 1883 to everyone.
The default config file may permit connections from localhost only. The default conf file is can be opened
6οΈβ£$ sudo vim /etc/mosquitto/conf.d/default.conf
The file should contain line following enable remote usage
listener 1883
Note that this port is currently unsecured, so if you donβt want to permit remote access:
listener 1883 localhost
Everytime you edit the conf file, you will have to restart the service for the settings to take effect.
$ sudo systemctl restart mosquitto
3) Robust MQTT
If MQTT broker crashed sometimes, disabling the real time communication. So we added a script that checked the state of the process and restarted Mosquitto in case it was down.
7οΈβ£
if "ps -aux | grep /usr/sbin/mosquitto | wc -l" == "1"
then
echo "mosquitto wasnt running so attempting restart" >> /home/ubuntu/cron.log
systemctl restart mosquitto
exit 0
fi
echo "$SERVICE is currently running" >> /home/ubuntu/cron.log
exit 0
8οΈβ£This can script can be saved in a file say βmosquittorestart.shβ.
This file needs to be made an executable and then put in a cron job that runs every 5 minutes. The cron should be set as root.
9οΈβ£$ chmod +x mosquittorestart.sh
π$ sudo -i
1οΈβ£1οΈβ£$ crontab -e
Add the following statement
* * * * /home/ubuntu/mosquitto_restart.shenjoyβ€οΈππ»
@UndercodeTesting
@UndercodeSecurity
@UndercodeHacking
β β β Uππ»βΊπ«Δπ¬πβ β β β
β β β Uππ»βΊπ«Δπ¬πβ β β β
π¦Complete Conf file for reference It uses password protection, runs a MQTT on port 1883, for ubuntu-kali-
> MQTTS on port 1884, websockets on port 3033, and WSS on port 8083. Do not forget the open these ports in the security group.
allowanonymous false
passwordfile /etc/mosquitto/passwd
listener 1883
listener 1884
certfile /etc/letsencrypt/live/mqtt.example.io/cert.pem
cafile /etc/letsencrypt/live/mqtt.example.io/chain.pem
keyfile /etc/letsencrypt/live/mqtt.example.io/privkey.pem
listener 3033
protocol websockets
listener 8083
protocol websockets
certfile /etc/letsencrypt/live/mqtt.example.io/cert.pem
cafile /etc/letsencrypt/live/mqtt.example.io/chain.pem
keyfile /etc/letsencrypt/live/mqtt.example.io/privkey.pem
enjoyβ€οΈππ»
wiki source
β β β Uππ»βΊπ«Δπ¬πβ β β β
π¦Complete Conf file for reference It uses password protection, runs a MQTT on port 1883, for ubuntu-kali-
> MQTTS on port 1884, websockets on port 3033, and WSS on port 8083. Do not forget the open these ports in the security group.
allowanonymous false
passwordfile /etc/mosquitto/passwd
listener 1883
listener 1884
certfile /etc/letsencrypt/live/mqtt.example.io/cert.pem
cafile /etc/letsencrypt/live/mqtt.example.io/chain.pem
keyfile /etc/letsencrypt/live/mqtt.example.io/privkey.pem
listener 3033
protocol websockets
listener 8083
protocol websockets
certfile /etc/letsencrypt/live/mqtt.example.io/cert.pem
cafile /etc/letsencrypt/live/mqtt.example.io/chain.pem
keyfile /etc/letsencrypt/live/mqtt.example.io/privkey.pem
enjoyβ€οΈππ»
wiki source
β β β Uππ»βΊπ«Δπ¬πβ β β β