Skip to content

Instantly share code, notes, and snippets.

View rucko24's full-sized avatar
🤘
Dandole

0x52 rucko24

🤘
Dandole
View GitHub Profile
@DrSensor
DrSensor / esptool.md
Created November 18, 2018 22:00
ESP Troubleshooting 101
$ esptool.py chip_id
esptool.py v2.5.1
Found 1 serial ports
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
MAC: 84:f3:eb:0b:dd:53
@nielsutrecht
nielsutrecht / RsaExample.java
Created December 28, 2016 14:13
Example of RSA generation, sign, verify, encryption, decryption and keystores in Java
import javax.crypto.Cipher;
import java.io.InputStream;
import java.security.*;
import java.util.Base64;
import static java.nio.charset.StandardCharsets.UTF_8;
public class RsaExample {
public static KeyPair generateKeyPair() throws Exception {
KeyPairGenerator generator = KeyPairGenerator.getInstance("RSA");
@Spring3
Spring3 / gist:42629b7ab7ab2f557d89
Last active October 28, 2021 04:16
Solve google recaptcha using 2captcha API and Selenium WebDriver
//client = HttpClient
//captchaUserId = user id from http://2captcha.com
private String solveCaptcha(WebDriver driver) throws Exception{
WebElement captchaChallenge = driver.findElement(By.id("recaptcha_challenge_image"));
if (captchaChallenge != null){
String imageURL = captchaChallenge.getAttribute("src");
InputStream in = new BufferedInputStream(new URL(imageURL).openStream());
ByteArrayOutputStream baos = new ByteArrayOutputStream();
for (int i; (i = in.read()) != -1;){
@alessandroleite
alessandroleite / cert.java
Last active March 2, 2024 00:41
Generate a self signed X509 certificate with Bouncy Castle
//Generate a self signed X509 certificate with Bouncy Castle.
// StringBuilder sb = new StringBuilder();
//
// for (int i = 0; i < pub.length; ++i)
// {
// sb.append(Integer.toHexString(0x0100 + (pub[i] & 0x00FF)).substring(1));
// }
//
// System.out.println(sb);
// sb.setLength(0);
@christianroman
christianroman / test.py
Created May 30, 2013 16:02
Bypass Captcha using 10 lines of code with Python, OpenCV & Tesseract OCR engine
import cv2.cv as cv
import tesseract
gray = cv.LoadImage('captcha.jpeg', cv.CV_LOAD_IMAGE_GRAYSCALE)
cv.Threshold(gray, gray, 231, 255, cv.CV_THRESH_BINARY)
api = tesseract.TessBaseAPI()
api.Init(".","eng",tesseract.OEM_DEFAULT)
api.SetVariable("tessedit_char_whitelist", "0123456789abcdefghijklmnopqrstuvwxyz")
api.SetPageSegMode(tesseract.PSM_SINGLE_WORD)
tesseract.SetCvImage(gray,api)
print api.GetUTF8Text()