This commit is contained in:
caret 2023-06-27 22:37:11 -05:00
parent ebeccf7026
commit 4693342cc7
10 changed files with 188 additions and 15 deletions

27
certs/test/nesica1.crt Normal file
View File

@ -0,0 +1,27 @@
Bag Attributes
localKeyID: 31 77 24 59 11 3A 84 C4 65 93 75 DE B7 EE 5A 89 6A B3 41 DA
subject=C = JP, ST = A, L = A, CN = nesica1
issuer=C = JP, ST = A, L = A, CN = nesys
-----BEGIN CERTIFICATE-----
MIIDxTCCAq2gAwIBAgIUfH7CYtnS909tjCJmn3h+9oqsLzUwDQYJKoZIhvcNAQEL
BQAwNTELMAkGA1UEBhMCSlAxCjAIBgNVBAgMAUExCjAIBgNVBAcMAUExDjAMBgNV
BAMMBW5lc3lzMB4XDTIzMDYwNTAwMDc1OVoXDTMzMDYwMjAwMDc1OVowNzELMAkG
A1UEBhMCSlAxCjAIBgNVBAgMAUExCjAIBgNVBAcMAUExEDAOBgNVBAMMB25lc2lj
YTEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDCX+/yIAFz9TpeyQxw
b3YYL+9Ngfedmxil7U3HZcpDR+2ysNtmdMTIVzQhz+ql7y3BJ+CSriEvDotuhRp1
5RFANcqf5JoolZ9m3a6BZZkQrjBZqCD7UOTExf11WKLq05N0Nr0EKoGRn4PQF04m
W/3zjpx3M53EbOAVq5bstGyClrTWItvHpzuJ3doCLotTUOKW+b6B5WPnjkPBuR9B
kMa9Ru1ZlQqxkEVxAqLdNSOLVisTASZ91ZmLhQM7klOSfMbO/6tWV2ZKgQ02Cdjt
7tEYKakGfmT21YT3q2f/2FF9TyarX9nma4RLnoNwt+GlH8bZFukr/Nkk2sf1jRZk
YecdAgMBAAGjgcowgccwHQYDVR0OBBYEFCMsf1N9KUmlPlwvFw4CBIXAuxo1MB8G
A1UdIwQYMBaAFNIBY5H/aDapjbeUecKlfXXV6ouRMA8GA1UdEwEB/wQFMAMBAf8w
dAYDVR0RBG0wa4INY2VydC5uZXN5cy5qcIIOY2VydDMubmVzeXMuanCCDWRhdGEu
bmVzeXMuanCCDnByb3h5Lm5lc3lzLmpwghFuZXN5cy50YWl0by5jby5qcIIYZmpt
MTcwOTIwemVyby5uZXNpY2EubmV0MA0GCSqGSIb3DQEBCwUAA4IBAQAXSf9Tk/i2
/Sq2mE5TiFSbhnLQB8GAn1UbiVZb6MSlrNDDuvVCk7MkYT2OnLamlbE1sdblU7/J
TIESBo4hjlwBaN61KpGRnf4NVrBh7gyCmcOHmlSAxL0+Irc0ZzwFk6Dz47MSGwYJ
QCeGWvryQdTxKpqzf04u5kOzWezoyTzxnxqw4VyxNZRXaYGfdLnzzm31jLl0Wd8d
oVyCwDmDN2lb71S5XJ47ugR+bRD3YDm0ZS+42qLvvA8FaIV/lOV1xK6So29yEz0P
HvLi/sJs0Mck7ZlG56MzwSCYHNcFTBGVVIZM2tcxWsXS/+VxtHJtbysY64eHnYog
G/7ah4CXcWtI
-----END CERTIFICATE-----

31
certs/test/nesica1.key Normal file
View File

@ -0,0 +1,31 @@
Bag Attributes
localKeyID: 31 77 24 59 11 3A 84 C4 65 93 75 DE B7 EE 5A 89 6A B3 41 DA
Key Attributes: <No Attributes>
-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDCX+/yIAFz9Tpe
yQxwb3YYL+9Ngfedmxil7U3HZcpDR+2ysNtmdMTIVzQhz+ql7y3BJ+CSriEvDotu
hRp15RFANcqf5JoolZ9m3a6BZZkQrjBZqCD7UOTExf11WKLq05N0Nr0EKoGRn4PQ
F04mW/3zjpx3M53EbOAVq5bstGyClrTWItvHpzuJ3doCLotTUOKW+b6B5WPnjkPB
uR9BkMa9Ru1ZlQqxkEVxAqLdNSOLVisTASZ91ZmLhQM7klOSfMbO/6tWV2ZKgQ02
Cdjt7tEYKakGfmT21YT3q2f/2FF9TyarX9nma4RLnoNwt+GlH8bZFukr/Nkk2sf1
jRZkYecdAgMBAAECggEAFW7Tu/yYfGtVg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bzs9Lk/+zKwE5RlwDpFzXzSXXHnWZeEyOb6ENyOnUpwT5gRyJFKidD1h
gtEx0PWclBbrf84Tz1GRurVmb+FuRe5la+aLb5Otdudnc+mggNGFoAOZMU8mQtoQ
s/bVTFKdN0+vYR18OTu3nGQg
-----END PRIVATE KEY-----

BIN
certs/test/nesica1.pfx Normal file

Binary file not shown.

25
certs/test/nesys.crt Normal file
View File

@ -0,0 +1,25 @@
Bag Attributes
localKeyID: 95 50 8D 60 5A CE 2B CF 64 99 FD DC 17 8C 56 AC 12 73 70 FF
subject=C = JP, ST = A, L = A, CN = nesys
issuer=C = JP, ST = A, L = A, CN = Taito Arcade Machine CA
-----BEGIN CERTIFICATE-----
MIIDXTCCAkWgAwIBAgIUZvUOPy2SRMCgA7kLN+3K5pj6PUswDQYJKoZIhvcNAQEL
BQAwRzELMAkGA1UEBhMCSlAxCjAIBgNVBAgMAUExCjAIBgNVBAcMAUExIDAeBgNV
BAMMF1RhaXRvIEFyY2FkZSBNYWNoaW5lIENBMB4XDTIzMDYwNTAwMDc1OFoXDTMz
MDYwMjAwMDc1OFowNTELMAkGA1UEBhMCSlAxCjAIBgNVBAgMAUExCjAIBgNVBAcM
AUExDjAMBgNVBAMMBW5lc3lzMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC
AQEAyPW5EMLI0fxhkgW5NgL37C/pqG1Dq5lUR/vZeqAzOyi6WkZfq4CYIdQapnrB
J/Q0agnBWHZc9xORoLI0bGCwL3ipTc5rimO6626OCytGuyTJO5vAmDDbENNKavAl
y4mzVNCDHdY3Pt9GuF7yM8IhluOWWEbqTy/m+X4WI6NupXQWTw6Z+SAYywBzbOfq
qwiexb7R7DDTkP903tNLa+TNNA9N13Fjg0jqS9c+L0EcNVh2WwtkGIcDFfI656sI
Mu16mUmnZrOonAjryDDrjmMIYjAlhpI4XElonZxuoq0IRQVMrWOBJVkt7LMz2X/w
5NNm+1Pfxz6MXLv5dQ23Uo8jpQIDAQABo1MwUTAdBgNVHQ4EFgQU0gFjkf9oNqmN
t5R5wqV9ddXqi5EwHwYDVR0jBBgwFoAUdlf7M4BI/ELlCwTbk84NocX26+cwDwYD
VR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAnkR/ZX3zDQaOZRCxaBJ8
dMdAWVW7gKfUUUFn9icRAs8g2NnxhLAQ1Wj9Xet80OflqusUIz1kfbrdHDn2kQrV
2dwYTOaLou7xGK3VWZDdfsQ5jDd2bdW2EPU1UsN9/4okUBu19aUEoezgbL3tZbDr
XdIDu/e3XVRgCA2dMXaoh2ue/kJ6OcN58Jkf5pmgCCAvCFogvGZsK7VP+fGNovas
5Z5z/gZFb5QcHFM5r4U9k+XpHp8a3uhnXJk8KCiPY977TxLmlEARDmvvTMLmPhxX
rfDJOZglAMaR94wS5zyyWMxNNZImgsrwf6Jm+7iI3bJNPQxJOxB+9gRDSw/TYRr/
sA==
-----END CERTIFICATE-----

31
certs/test/nesys.key Normal file
View File

@ -0,0 +1,31 @@
Bag Attributes
localKeyID: 95 50 8D 60 5A CE 2B CF 64 99 FD DC 17 8C 56 AC 12 73 70 FF
Key Attributes: <No Attributes>
-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDI9bkQwsjR/GGS
Bbk2AvfsL+mobUOrmVRH+9l6oDM7KLpaRl+rgJgh1BqmesEn9DRqCcFYdlz3E5Gg
sjRsYLAveKlNzmuKY7rrbo4LK0a7JMk7m8CYMNsQ00pq8CXLibNU0IMd1jc+30a4
XvIzwiGW45ZYRupPL+b5fhYjo26ldBZPDpn5IBjLAHNs5+qrCJ7FvtHsMNOQ/3Te
00tr5M00D03XcWODSOpL1z4vQRw1WHZbC2QYhwMV8jrnqwgy7XqZSadms6icCOvI
MOuOYwhiMCWGkjhcSWidnG6irQhFBUytY4ElWS3sszPZf/Dk02b7U9/HPoxcu/l1
DbdSjyOlAgMBAAECggEAA1FvV1QBndn72gqtj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XqwIpYBPOHLVQHoEhDLdOiTvM0vElFnLq0Hq7wmuVSiiVbKSlsEZbQHRZlaChp
32YDqVxUYGEj5XnpBiCq3DTLru7Wr8r0njvKiBMNLOPPbtHukHnJFZL3gDTo96Ey
js/euYOMeKilOMkIURCKhw4P
-----END PRIVATE KEY-----

BIN
certs/test/nesys.pfx Normal file

Binary file not shown.

25
certs/test/root.crt Normal file
View File

@ -0,0 +1,25 @@
Bag Attributes
localKeyID: 96 20 7D 93 C7 3E C0 5A 55 61 3E 4E 0C 2D E7 44 35 87 5B 03
subject=C = JP, ST = A, L = A, CN = Taito Arcade Machine CA
issuer=C = JP, ST = A, L = A, CN = Taito Arcade Machine CA
-----BEGIN CERTIFICATE-----
MIIDbzCCAlegAwIBAgIUacZ68WtsoozH9w1+jlpguBVIh5gwDQYJKoZIhvcNAQEL
BQAwRzELMAkGA1UEBhMCSlAxCjAIBgNVBAgMAUExCjAIBgNVBAcMAUExIDAeBgNV
BAMMF1RhaXRvIEFyY2FkZSBNYWNoaW5lIENBMB4XDTIzMDYwNTAwMDc1OFoXDTMz
MDYwMjAwMDc1OFowRzELMAkGA1UEBhMCSlAxCjAIBgNVBAgMAUExCjAIBgNVBAcM
AUExIDAeBgNVBAMMF1RhaXRvIEFyY2FkZSBNYWNoaW5lIENBMIIBIjANBgkqhkiG
9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoUvkzIO4WLknQUWA2z7/ZqrnwjRxKow27PHm
e6K6jTDcgEzKVljXCJV6TNWdlhU/jWoxqYmrQZJA8YGrUW3x9yUZB8WSusNfIU4m
5sLtTDTW7ivJbbOpSDernFBmemVnn9KGWuggp6LlH8Q+RzYEPWRszKNxC2lYNDKw
nLVRUIr8bKqVvzRDf+qk4lAV7WAJQW4SYzluOvf9ftSP54MwCexRIImnL9D/3OBi
4qxJrravaJdBWphd2r9WLUgOwTLN2f6p9NpTIbG+oOHsy/myW1cQw3i9mQM9jdK1
rSzlgbqP5EmK6EN5aMhEy531d7zZBE1WDEx58dqArchVTmjo1QIDAQABo1MwUTAd
BgNVHQ4EFgQUdlf7M4BI/ELlCwTbk84NocX26+cwHwYDVR0jBBgwFoAUdlf7M4BI
/ELlCwTbk84NocX26+cwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOC
AQEANnk5Tdl3+LM5KZEHub6zig/i5U+Hl9cCbkqPyX5yZNsKuUYg/Sc+5+neuhfx
agvoIFMwbpv5OmyNFuTKtzaBx/VWymANYM9+vaV1so8XqtCeHYKu2Skq3oV58LSX
h1tZPwtnGoVJgeG5d5fltWgb26K7e1W0VZlgZPKiwWM/nMRPQW1tfB6l6Yd6bCL8
My4PKHDPIva86YHM1CDJAnAv52ZSG46aOulUT0RUNJXDrF2+mEgjJ7vxQSRyvUTt
UWF2S+v9CemYfR+ghvtr3hAo9rNtlkBvW+tvCA3lPbc1U8DJwAOGQ0a/keaEegk+
9dmTRoOYNN6kJBpgg+WCjswWbA==
-----END CERTIFICATE-----

31
certs/test/root.key Normal file
View File

@ -0,0 +1,31 @@
Bag Attributes
localKeyID: 96 20 7D 93 C7 3E C0 5A 55 61 3E 4E 0C 2D E7 44 35 87 5B 03
Key Attributes: <No Attributes>
-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQChS+TMg7hYuSdB
RYDbPv9mqufCNHEqjDbs8eZ7orqNMNyATMpWWNcIlXpM1Z2WFT+NajGpiatBkkDx
gatRbfH3JRkHxZK6w18hTibmwu1MNNbuK8lts6lIN6ucUGZ6ZWef0oZa6CCnouUf
xD5HNgQ9ZGzMo3ELaVg0MrCctVFQivxsqpW/NEN/6qTiUBXtYAlBbhJjOW469/1+
1I/ngzAJ7FEgiacv0P/c4GLirEmutq9ol0FamF3av1YtSA7BMs3Z/qn02lMhsb6g
4ezL+bJbVxDDeL2ZAz2N0rWtLOWBuo/kSYroQ3loyETLnfV3vNkETVYMTHnx2oCt
yFVOaOjVAgMBAAECggE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DkmYFJ4m54rxdaRms
vjORG6ncxxucQbX+A5vgFUUXzRhB0qQre0pmLBJb2TZWyldN5botq9LEWVLS4NLg
y3l0SY1Sl7Ax0ZH+uZVb9E/BSIytkcp6AbcGgIRvAISHO7bGiUORO8BBFkHmxuYG
xbK01G+eU/ZsrBbpjeDrehHY
-----END PRIVATE KEY-----

BIN
certs/test/root.pfx Normal file

Binary file not shown.

View File

@ -1,5 +1,3 @@
//! Restart PC and see if installed certs work
//! get rid of HTTP cert issue in access logs
#![allow(unused_variables)] #![allow(unused_variables)]
#![allow(non_snake_case)] #![allow(non_snake_case)]
#![allow(dead_code)] #![allow(dead_code)]
@ -26,6 +24,7 @@ use md5::{Digest, Md5};
#[post("/basicinfo")] #[post("/basicinfo")]
async fn basicinfo() -> HttpResponse { async fn basicinfo() -> HttpResponse {
println!("/basicinfo\nNot fully implemented!");
/* /*
let pem = "-----BEGIN PUBLIC KEY----- let pem = "-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy63nybDg2d0l5Em5RTsx MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy63nybDg2d0l5Em5RTsx
@ -62,49 +61,51 @@ async fn basicinfo() -> HttpResponse {
#[macro_export] #[macro_export]
macro_rules! resp { macro_rules! resp {
($str:expr) => { ($str:expr) => {
HttpResponse::Ok().append_header(ContentType(mime::TEXT_PLAIN)).body($str) //HttpResponse::Ok().append_header(ContentType(mime::TEXT_HTML)).body($str)
//HttpResponse::Ok().append_header(ContentType::octet_stream()).body($str) HttpResponse::Ok().append_header(ContentType::octet_stream()).body($str)
}; };
} }
#[get("/alive/{id}/Alive.txt")] #[get("/alive/{id}/Alive.txt")]
async fn alive(id: web::Path<String>, req: actix_web::HttpRequest) -> HttpResponse { async fn alive(id: web::Path<String>, req: actix_web::HttpRequest) -> HttpResponse {
println!("---");
println!("Method: {:?}", req.method());
println!("Host: {:?}", req.head().uri.host());
println!("Path: {:?}", req.path());
println!("/alive/{}/Alive.txt", id); println!("/alive/{}/Alive.txt", id);
resp!("") resp!("")
} }
#[get("/alive/i.php")] #[get("/alive/i.php")]
async fn alive_i() -> HttpResponse { async fn alive_i() -> HttpResponse {
println!("/alive/i.php");
resp!("REMOTE ADDRESS:10.3.0.53\nSERVER NAME:LLSIFAC\nSERVER ADDR:10.3.0.53") resp!("REMOTE ADDRESS:10.3.0.53\nSERVER NAME:LLSIFAC\nSERVER ADDR:10.3.0.53")
} }
#[post("/service/card/incomALL.php")] #[post("/service/card/incomALL.php")]
async fn incomALL() -> HttpResponse { async fn incomALL() -> HttpResponse {
println!("/service/card/incomALL.php");
resp!("1+1") resp!("1+1")
} }
#[post("/service/respone/respone.php")] #[post("/service/respone/respone.php")]
async fn respone() -> HttpResponse { async fn respone() -> HttpResponse {
println!("____________________________");
println!("/service/respone/respone.php");
resp!("1") resp!("1")
} }
#[get("/server/FireAlert.php")] #[get("/server/FireAlert.php")]
async fn fire_alert() -> HttpResponse { async fn fire_alert() -> HttpResponse {
println!("/server/FireAlert.php");
resp!("OK") resp!("OK")
} }
#[get("/server/cursel.php")] #[get("/server/cursel.php")]
async fn cursel() -> HttpResponse { async fn cursel() -> HttpResponse {
println!("/server/cursel.php");
resp!("1\n") resp!("1\n")
} }
#[get("/server/gameinfo.php")] #[get("/server/gameinfo.php")]
async fn gameinfo() -> HttpResponse { async fn gameinfo() -> HttpResponse {
println!("/server/gameinfo.php");
resp!("0\n3\n301000,test1\n302000,test2\n303000,test3\n") resp!("0\n3\n301000,test1\n302000,test2\n303000,test3\n")
} }
#[post("/game/info")] #[post("/game/info")]
@ -121,6 +122,7 @@ async fn game_info() -> HttpResponse {
Aes128CfbEnc::new(key.into(), iv.into()).encrypt(&mut ciphertext); Aes128CfbEnc::new(key.into(), iv.into()).encrypt(&mut ciphertext);
//println!("{:?}", String::from_utf8_lossy(&ciphertext)); //println!("{:?}", String::from_utf8_lossy(&ciphertext));
println!("/game/info");
HttpResponse::Ok().append_header(ContentType::octet_stream()).body(ciphertext) HttpResponse::Ok().append_header(ContentType::octet_stream()).body(ciphertext)
} }
@ -135,16 +137,16 @@ pub struct Certify {
#[get("/server/certify.php")] #[get("/server/certify.php")]
async fn certify(data: web::Query<Certify>, req: HttpRequest) -> HttpResponse { async fn certify(data: web::Query<Certify>, req: HttpRequest) -> HttpResponse {
println!("Certify!"); println!("/server/certify.php");
dbg!(&data); dbg!(&data);
let mut hasher = Md5::new(); let mut hasher = Md5::new();
let gid_bytes = "303801".as_bytes(); // LL game nesys id let gid_bytes = "303801".as_bytes(); // LL game nesys id
hasher.update(gid_bytes); hasher.update(gid_bytes);
let hash_result = hasher.finalize(); let hash_result = hasher.finalize();
let mut ticket = String::new();
for byte in hash_result { for byte in hash_result {
print!("{:x?}", &byte); ticket.push_str(&format!("{:x?}", &byte));
} }
println!("");
let res = format!( let res = format!(
"host=http://10.3.0.53 "host=http://10.3.0.53
no=1337 no=1337
@ -156,6 +158,7 @@ x-img=http://10.3.0.53/test.png
x-ranking=http://10.3.0.53/ranking/ranking.php x-ranking=http://10.3.0.53/ranking/ranking.php
ticket=9251859b560b33b031516d05c2ef3c28" ticket=9251859b560b33b031516d05c2ef3c28"
); );
println!("Response:\n{}", &res);
resp!(res) resp!(res)
} }
@ -178,8 +181,8 @@ fn load_rustls_config() -> rustls::ServerConfig {
let config = ServerConfig::builder().with_safe_defaults().with_no_client_auth(); let config = ServerConfig::builder().with_safe_defaults().with_no_client_auth();
// load TLS key/cert files // load TLS key/cert files
let cert_file = &mut BufReader::new(File::open("./certs/nesica1.crt").expect("Certificate not found!")); let cert_file = &mut BufReader::new(File::open("./certs/test/nesica1.crt").expect("Certificate not found!"));
let key_file = &mut BufReader::new(File::open("./certs/nesica1.key").expect("Key not found!")); let key_file = &mut BufReader::new(File::open("./certs/test/nesica1.key").expect("Key not found!"));
// convert files to key/cert objects // convert files to key/cert objects
let cert_chain = certs(cert_file).unwrap().into_iter().map(Certificate).collect(); let cert_chain = certs(cert_file).unwrap().into_iter().map(Certificate).collect();
@ -196,7 +199,7 @@ fn load_rustls_config() -> rustls::ServerConfig {
#[actix_web::main] #[actix_web::main]
async fn main() -> std::io::Result<()> { async fn main() -> std::io::Result<()> {
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info")); //env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));
let config = load_rustls_config(); let config = load_rustls_config();
info!("Certificates loaded."); info!("Certificates loaded.");
println!("Started!"); println!("Started!");