mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-05-29 11:04:46 -07:00
uz801: Update installer usb backdoor trigger code
This commit is contained in:
@@ -53,13 +53,30 @@ async fn run_install(admin_ip: String) -> Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub async fn activate_usb_debug(admin_ip: &str) -> Result<()> {
|
pub async fn activate_usb_debug(admin_ip: &str) -> Result<()> {
|
||||||
let url = format!("http://{}/usbdebug.html", admin_ip);
|
let url = format!("http://{}/ajax", admin_ip);
|
||||||
let client = reqwest::Client::new();
|
let referer = format!("http://{}/usbdebug.html", admin_ip);
|
||||||
let response = client.get(&url).send().await?;
|
let origin = format!("http://{}", admin_ip);
|
||||||
|
|
||||||
if !response.status().is_success() {
|
let _handle = tokio::spawn(async move {
|
||||||
anyhow::bail!("Failed to activate USB debug: HTTP {}", response.status());
|
let client = reqwest::Client::builder()
|
||||||
}
|
.timeout(Duration::from_secs(5))
|
||||||
|
.build()
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
let _response = client
|
||||||
|
.post(&url)
|
||||||
|
.header("Accept", "application/json, text/javascript, */*; q=0.01")
|
||||||
|
.header("Accept-Encoding", "gzip, deflate")
|
||||||
|
.header("Referer", &referer)
|
||||||
|
.header("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8")
|
||||||
|
.header("X-Requested-With", "XMLHttpRequest")
|
||||||
|
.header("Origin", &origin)
|
||||||
|
.header("Connection", "keep-alive")
|
||||||
|
.body(r#"{"funcNo":2001}"#)
|
||||||
|
.send()
|
||||||
|
.await;
|
||||||
|
// Ignore any errors - the device will reboot and connection will be lost
|
||||||
|
});
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user